User Tools

Site Tools


howto:fridahooklibrary

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:fridahooklibrary [2017/11/06 22:59]
czokie [PrettyWoman]
howto:fridahooklibrary [2017/11/12 09:45] (current)
czokie [Tweak.js]
Line 34: Line 34:
  
 ===== PrettyWoman.sh ===== ===== PrettyWoman.sh =====
-<code shell PrettyWoman.sh>+<code bash PrettyWoman.sh>
 #!/bin/bash #!/bin/bash
  
Line 203: Line 203:
 jsfunction,DJIUpgradeNotifyViewModel,notifyHidden,-,1,[*] Upgrade Notification DISABLLED,[*] Upgrade Notification already disabled,0 jsfunction,DJIUpgradeNotifyViewModel,notifyHidden,-,1,[*] Upgrade Notification DISABLLED,[*] Upgrade Notification already disabled,0
 jsfunctioniffcc,DJIProductManager,currentProductCode,+,13,[*] Changed product code to MAVIC,,1 jsfunctioniffcc,DJIProductManager,currentProductCode,+,13,[*] Changed product code to MAVIC,,1
 +jsfunction,DJILImitDBUpdateLogic,needUpdateType,-,0,[*] Removing NFZ DB Update Message,,0
 </code> </code>
- 
 ===== Tweak.js ===== ===== Tweak.js =====
  
Line 443: Line 443:
     }     }
   });   });
-} 
-</code> 
-====== Hooks ====== 
-===== DJITermsNotificationController - shouldShowTerms ===== 
  
-<code javascript DJITermsNotificationController.shouldShowTerms.js> +  // 
-'use strict'; +  // DJILImitDBUpdateLogic needUpdateType jsfunction 
-if (ObjC.available) {+  //
  
-  var DJITermsNotificationController = ObjC.classes.DJITermsNotificationController; +  var DJILImitDBUpdateLogic = ObjC.classes.DJILImitDBUpdateLogic
- +  var needUpdateType DJILImitDBUpdateLogic['needUpdateType']; 
-  var shouldShowTerms DJITermsNotificationController['shouldShowTerms']; +  var needUpdateTypeImpl needUpdateType.implementation; 
-  var shouldShowTermsImpl shouldShowTerms.implementation; +  needUpdateType.implementation = ObjC.implement(needUpdateType, function (handle, selector) { 
-  shouldShowTerms.implementation = ObjC.implement(shouldShowTerms, function (handle, selector) { +    var originalResult = needUpdateTypeImpl(handle, selector); 
-    var originalResult = shouldShowTermsImpl(handle, selector); +    if ( originalResult != 0 ) { 
-    console.log('Original says:', originalResult, 'we say: 0');+      if ( 00 == 0 || DJILImitDBUpdateLogicneedUpdateTypeSeenReplace == 0 ) { 
 +        console.log("[*] Removing NFZ DB Update Message"); 
 +        DJILImitDBUpdateLogicneedUpdateTypeSeenReplace = 1; 
 +      } 
 +    } else { 
 +      if ( 00 == 0 || DJILImitDBUpdateLogicneedUpdateTypeSeenHit == ) { 
 +        console.log(""); 
 +        DJILImitDBUpdateLogicneedUpdateTypeSeenHit = 1; 
 +      } 
 +    }
     return 0;     return 0;
-  }); 
-} 
-</code> 
-===== DJIAppSettings - sdr_force_fcc ===== 
-<code javascript DJIAppSettings.sdr_force_fcc.js> 
-if (ObjC.available) { 
-  var DJIAppSettings = ObjC.classes.DJIAppSettings; 
-   
-  var sdr_force_fcc = DJIAppSettings['- sdr_force_fcc']; 
-  var sdr_force_fccImpl = sdr_force_fcc.implementation; 
-  sdr_force_fcc.implementation = ObjC.implement(sdr_force_fcc, function (handle, selector) { 
-    var originalResult = sdr_force_fccImpl(handle, selector); 
-    console.log('DJIAppSettings:sdr_force_fcc  Original says:', originalResult, 'we say: 1'); 
-    return 1; 
   });   });
 } }
 </code> </code>
  
-===== canUseIllegalChannels ===== 
-<code javascript DJIAppSettings.canUseIllegalChannels.js> 
-if (ObjC.available) { 
-  var DJIAppSettings = ObjC.classes.DJIAppSettings; 
-   
-  var canUseIllegalChannels = DJIAppSettings['- canUseIllegalChannels']; 
-  var canUseIllegalChannelsImpl = canUseIllegalChannels.implementation; 
-  canUseIllegalChannels.implementation = ObjC.implement(canUseIllegalChannels, function (handle, selector) { 
-    var originalResult = canUseIllegalChannelsImpl(handle, selector); 
-    console.log('DJIAppSettings:canUseIllegalChannels  Original says:', originalResult, 'we say: 1'); 
-    return 1; 
-  }); 
-   
-  var DJIRadioLogic = ObjC.classes.DJIRadioLogic; 
-   
-  var canUseIllegalChannels = DJIRadioLogic['- canUseIllegalChannels']; 
-  var canUseIllegalChannelsImpl = canUseIllegalChannels.implementation; 
-  canUseIllegalChannels.implementation = ObjC.implement(canUseIllegalChannels, function (handle, selector) { 
-    var originalResult = canUseIllegalChannelsImpl(handle, selector); 
-    console.log('DJIRadioLogic:canUseIllegalChannels  Original says:', originalResult, 'we say: 1'); 
-    return 1; 
-  }); 
-} 
-</code> 
- 
-===== AFSecurityPolicy - setSSLPinningMode ===== 
-<code javascript AFSecurityPolicy.setSSLPinningMode.js> 
-if (ObjC.available) { 
-  
-  var AFSecurityPolicy = ObjC.classes.AFSecurityPolicy; 
-  
-  var setSSLPinningMode = AFSecurityPolicy['- setSSLPinningMode:']; 
-  var setSSLPinningModeImpl = setSSLPinningMode.implementation; 
-  setSSLPinningMode.implementation = ObjC.implement(setSSLPinningMode, function (handle, selector, originalResult) { 
-    setSSLPinningModeImpl(handle, selector, 0); 
-    console.log('AFSecurityPolicy:setSSLPinningMode. Changing from: ', originalResult, 'to: 0'); 
-  }); 
-} 
-</code> 
- 
-===== DJIAccountManager - checkIsAdminUser ===== 
-<code javascript DJIAccountManager.checkIsAdminUser.js> 
-//Set Admin mode in Flight Records 
-var DJIAccountManager = ObjC.classes.DJIAccountManager; 
-var checkIsAdminUser = DJIAccountManager['- checkIsAdminUser']; 
-var checkIsAdminUserImpl = checkIsAdminUser.implementation; 
-checkIsAdminUser.implementation = ObjC.implement(checkIsAdminUser, function (handle, selector) { 
-     var originalResult = checkIsAdminUserImpl(handle, selector); 
-     console.log('[*] Setting user to Admin for Flight Records'); 
-     return 1; 
-}); 
-</code> 
- 
-===== DJIUpgradeNotifyViewModel - notifyHidden ===== 
-<code javascript DJIUpgradeNotifyViewModel.notifyHidden.js> 
-//Bypass upgrade notification on splash screen 
-var DJIUpgradeNotifyViewModel = ObjC.classes.DJIUpgradeNotifyViewModel; 
-var notifyHidden = DJIUpgradeNotifyViewModel['- notifyHidden']; 
-var notifyHiddenImpl = notifyHidden.implementation; 
-notifyHidden.implementation = ObjC.implement(notifyHidden, function (handle, selector) { 
-     var originalResult = notifyHiddenImpl(handle, selector); 
-     console.log('[*] Disabling Upgrade Notification'); 
-     return 1; 
-}); 
-</code> 
- 
-===== DJIAppSettings - sdr_force_fcc ===== 
-<code javascript DJIAppSettings.sdr_force_fcc.js> 
-//Force FCC Mode 
-var shown=0; 
-var fcc_enabled; 
- 
-var DJIAppSettings = ObjC.classes.DJIAppSettings; 
-var sdr_force_fcc = DJIAppSettings['- sdr_force_fcc']; 
-var sdr_force_fccImpl = sdr_force_fcc.implementation; 
-sdr_force_fcc.implementation = ObjC.implement(sdr_force_fcc, function (handle, selector) { 
-var originalResult = sdr_force_fccImpl(handle, selector); 
-     console.log('[*] Setting Forced FCC Mode'); 
-     fcc_enabled = 1; 
-     return 1; 
-}); 
- 
-//Fake Mavic for P4 FCC 
-var DJIProductManager = ObjC.classes.DJIProductManager; 
-var currentProductCode = DJIProductManager['+ currentProductCode']; 
-var currentProductCodeImpl = currentProductCode.implementation; 
-currentProductCode.implementation = ObjC.implement(currentProductCode, function (handle, selector) { 
-     var originalResult = currentProductCodeImpl(handle, selector); 
-     if(shown==0) { 
-          console.log('[*] Faking product code for FCC'); 
-          shown=1; 
-     } 
-     if(fcc_enabled==0) 
-         return 13; //mavic 
-     else 
-         return originalResult 
-}); 
-</code> 
- 
-===== DJIAppForceUpdateManager - hasChecked ===== 
-<code javascript DJIAppForceUpdateManager.hasChecked.js> 
-//Bypass DJI Go 4 new app version check 
-var DJIAppForceUpdateManager = ObjC.classes.DJIAppForceUpdateManager; 
-var hasChecked = DJIAppForceUpdateManager['- hasChecked']; 
-var hasCheckedImpl = hasChecked.implementation; 
-hasChecked.implementation = ObjC.implement(hasChecked, function (handle, selector) { 
-     var originalResult = hasCheckedImpl(handle, selector); 
-     console.log("[*] Disabling App Upgrade Check"); 
-     return 1; 
-}); 
-</code> 
- 
-===== DJIAppSettings - canUseIllegalChannels ===== 
-<code javascript DJIAppForceUpdateManager.hasChecked.js> 
-//Enable Illegal Channels (32 Channels) 
-if (ObjC.available) { 
-     var DJIAppSettings = ObjC.classes.DJIAppSettings; 
-     var canUseIllegalChannels = DJIAppSettings['- canUseIllegalChannels']; 
-     var canUseIllegalChannelsImpl = canUseIllegalChannels.implementation; 
-     canUseIllegalChannels.implementation = ObjC.implement(canUseIllegalChannels, function (handle, selector) { 
-          var originalResult = canUseIllegalChannelsImpl(handle, selector); 
-          console.log('[*] Enabling Illegal Channels (32 Channels)'); 
-          return 1; 
-     }); 
-     var DJIRadioLogic = ObjC.classes.DJIRadioLogic; 
-     var canUseIllegalChannels = DJIRadioLogic['- canUseIllegalChannels']; 
-     var canUseIllegalChannelsImpl = canUseIllegalChannels.implementation; 
-     canUseIllegalChannels.implementation = ObjC.implement(canUseIllegalChannels, function (handle, selector) { 
-          var originalResult = canUseIllegalChannelsImpl(handle, selector); 
-          console.log('[*] Enabling Illegal Channels (32 Channels)'); 
-          return 1; 
-  }); 
-} 
-</code> 
howto/fridahooklibrary.1510009146.txt.gz · Last modified: 2017/11/06 22:59 by czokie