daily pastebin goal
2%
SHARE
TWEET

Untitled

a guest May 16th, 2018 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // com.brando.dClean
  2. // written by brando88
  3. // miniscule app to remove 'dynamic-text.dat,' currently supporting only fw 1.1.3/4
  4.  
  5. include("iuikit/iuikit.js");
  6.  
  7. var window = new UIWindow( UIHardware.fullScreenApplicationContentRect );
  8. window.setHidden( false );
  9. window.orderFront();
  10. window.makeKey();
  11. window.backgroundColor = [ 1 , 1 , 1 , 1 ];
  12.  
  13. var mainView = new IUIBackgroundStriped();
  14. window.setContentView( mainView );
  15.  
  16. var navigationBar = new IUINavigationBar( [ 0 , 0 , mainView.bounds[2] , 43 ] , 'blue' );
  17. mainView.addSubview( navigationBar );
  18.  
  19. var navigationTitle = new IUISetBarTitle( 'dClean' , [ 0 , 0 , 0 , 1 ] );
  20. mainView.addSubview( navigationTitle );
  21.  
  22. /*
  23. function myDevice(){
  24.   var temp = '/tmp/temp.plist'
  25.   FileManager.copy("/System/Library/CoreServices/SystemVersion.plist",temp)
  26.   var data = new Data()
  27.   data.loadFromFile(temp)
  28.   var plist = data.asString()
  29.   FileManager.remove(temp)
  30.   var m = plist.match(/<key>ProductVersion<\/key>\s*<string>(1.1.3)<\/string>/ || /<key>ProductVersion<\/key>\s*<string>(1.1.4)<\/string>/)
  31.   if (!m){
  32.     var dPath = 'mobile'
  33.   } else {
  34.     var dPath = 'root'
  35.   }
  36. }
  37. */
  38.  
  39. var dPath = 'mobile'
  40.  
  41. var deleteFile = new UIAlertSheet();
  42. deleteFile.setBodyText( "Delete: dynamic-text.dat?" );
  43. deleteFile.addButtonWithTitle("OK","");
  44. deleteFile.addButtonWithTitle("Cancel","");
  45. deleteFile.setDefaultButton(1);
  46.  
  47. var datDeleted = new UIAlertSheet();
  48. datDeleted.setBodyText( "Done." );
  49. datDeleted.addButtonWithTitle("OK","");
  50.  
  51. var noFile = new UIAlertSheet();
  52. noFile.setBodyText( "File already deleted." );
  53. noFile.addButtonWithTitle("OK","");
  54.  
  55. datDeleted.onButtonClicked = function( button ) {
  56.     datDeleted.dismiss( true );
  57.     terminate();
  58. }
  59.  
  60. deleteFile.onButtonClicked = function( button ) {
  61.     if ( button == 1 ) {
  62.         // executeShellCommand( 'cd /private/var/' + dPath + '/Library/Keyboard; rm dynamic-text.dat' );
  63.         FileManager.remove( "/private/var/" + dPath + "/Library/Keyboard/dynamic-text.dat" );
  64.         deleteFile.dismiss( true );
  65.         datDeleted.popupAlertAnimated( true );
  66.     } else {
  67.         deleteFile.dismiss( true );
  68.         terminate();
  69.     }
  70. }
  71.  
  72. noFile.onButtonClicked = function( button ) {
  73.     noFile.dismiss( true );
  74.     terminate();
  75. }
  76.  
  77. if ( FileManager.fileExists( "/private/var/" + dPath + "/Library/Keyboard/dynamic-text.dat" ) ) {
  78.     deleteFile.popupAlertAnimated( true );
  79. } else {
  80.     noFile.popupAlertAnimated( true );
  81. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top