Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // com.brando.dClean
- // written by brando88
- // miniscule app to remove 'dynamic-text.dat,' currently supporting only fw 1.1.3/4
- include("iuikit/iuikit.js");
- var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
- window.setHidden( false );
- window.orderFront();
- window.makeKey();
- window.backgroundColor = [ 1 , 1 , 1 , 1 ];
- var mainView = new IUIBackgroundStriped();
- window.setContentView( mainView );
- var navigationBar = new IUINavigationBar( [ 0 , 0 , mainView.bounds[2] , 43 ] , 'blue' );
- mainView.addSubview( navigationBar );
- var navigationTitle = new IUISetBarTitle( 'dClean' , [ 0 , 0 , 0 , 1 ] );
- mainView.addSubview( navigationTitle );
- /*
- function myDevice(){
- var temp = '/tmp/temp.plist'
- FileManager.copy("/System/Library/CoreServices/SystemVersion.plist",temp)
- var data = new Data()
- data.loadFromFile(temp)
- var plist = data.asString()
- FileManager.remove(temp)
- var m = plist.match(/<key>ProductVersion<\/key>\s*<string>(1.1.3)<\/string>/ || /<key>ProductVersion<\/key>\s*<string>(1.1.4)<\/string>/)
- if (!m){
- var dPath = 'mobile'
- } else {
- var dPath = 'root'
- }
- }
- */
- var dPath = 'mobile'
- var deleteFile = new UIAlertSheet();
- deleteFile.setBodyText( "Delete: dynamic-text.dat?" );
- deleteFile.addButtonWithTitle("OK","");
- deleteFile.addButtonWithTitle("Cancel","");
- deleteFile.setDefaultButton(1);
- var datDeleted = new UIAlertSheet();
- datDeleted.setBodyText( "Done." );
- datDeleted.addButtonWithTitle("OK","");
- var noFile = new UIAlertSheet();
- noFile.setBodyText( "File already deleted." );
- noFile.addButtonWithTitle("OK","");
- datDeleted.onButtonClicked = function( button ) {
- datDeleted.dismiss( true );
- terminate();
- }
- deleteFile.onButtonClicked = function( button ) {
- if ( button == 1 ) {
- // executeShellCommand( 'cd /private/var/' + dPath + '/Library/Keyboard; rm dynamic-text.dat' );
- FileManager.remove( "/private/var/" + dPath + "/Library/Keyboard/dynamic-text.dat" );
- deleteFile.dismiss( true );
- datDeleted.popupAlertAnimated( true );
- } else {
- deleteFile.dismiss( true );
- terminate();
- }
- }
- noFile.onButtonClicked = function( button ) {
- noFile.dismiss( true );
- terminate();
- }
- if ( FileManager.fileExists( "/private/var/" + dPath + "/Library/Keyboard/dynamic-text.dat" ) ) {
- deleteFile.popupAlertAnimated( true );
- } else {
- noFile.popupAlertAnimated( true );
- }
Add Comment
Please, Sign In to add comment