This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
howto:fridahooklibrary [2017/10/19 20:29] czokie [DJIAppSettings - sdr_force_fcc] |
howto:fridahooklibrary [2017/10/24 06:05] jezzab [DJIAppSettings - canUseIllegalChannels] |
||
---|---|---|---|
Line 8: | Line 8: | ||
Our work at the moment is focussed on IOS. As a general rule of thumb, we should where possible use the " | Our work at the moment is focussed on IOS. As a general rule of thumb, we should where possible use the " | ||
+ | ===== Configuration ===== | ||
+ | The config below can be used for stand-alone hooks, allowing you to open DJI GO 4 from springboard. | ||
+ | <code java FridaGadget.config> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
===== Template hook ===== | ===== Template hook ===== | ||
Line 15: | Line 27: | ||
We'll dig into this more later when/if we need to access parameter data etc. | We'll dig into this more later when/if we need to access parameter data etc. | ||
- | |||
- | So. For now, our template hook is | ||
====== Hooks ====== | ====== Hooks ====== | ||
Line 22: | Line 32: | ||
<code javascript DJITermsNotificationController.shouldShowTerms.js> | <code javascript DJITermsNotificationController.shouldShowTerms.js> | ||
+ | 'use strict'; | ||
if (ObjC.available) { | if (ObjC.available) { | ||
+ | |||
var DJITermsNotificationController = ObjC.classes.DJITermsNotificationController; | var DJITermsNotificationController = ObjC.classes.DJITermsNotificationController; | ||
- | | + | |
var shouldShowTerms = DJITermsNotificationController[' | var shouldShowTerms = DJITermsNotificationController[' | ||
var shouldShowTermsImpl = shouldShowTerms.implementation; | var shouldShowTermsImpl = shouldShowTerms.implementation; | ||
shouldShowTerms.implementation = ObjC.implement(shouldShowTerms, | shouldShowTerms.implementation = ObjC.implement(shouldShowTerms, | ||
var originalResult = shouldShowTermsImpl(handle, | var originalResult = shouldShowTermsImpl(handle, | ||
- | console.log(' | + | console.log(' |
- | return | + | return |
}); | }); | ||
} | } | ||
</ | </ | ||
- | |||
===== DJIAppSettings - sdr_force_fcc ===== | ===== DJIAppSettings - sdr_force_fcc ===== | ||
<code javascript DJIAppSettings.sdr_force_fcc.js> | <code javascript DJIAppSettings.sdr_force_fcc.js> | ||
Line 73: | Line 84: | ||
}); | }); | ||
} | } | ||
+ | </ | ||
+ | ===== AFSecurityPolicy - setSSLPinningMode ===== | ||
+ | <code javascript AFSecurityPolicy.setSSLPinningMode.js> | ||
+ | if (ObjC.available) { | ||
+ | |||
+ | var AFSecurityPolicy = ObjC.classes.AFSecurityPolicy; | ||
+ | |||
+ | var setSSLPinningMode = AFSecurityPolicy[' | ||
+ | var setSSLPinningModeImpl = setSSLPinningMode.implementation; | ||
+ | setSSLPinningMode.implementation = ObjC.implement(setSSLPinningMode, | ||
+ | setSSLPinningModeImpl(handle, | ||
+ | console.log(' | ||
+ | }); | ||
+ | } | ||
+ | </ | ||
+ | ===== DJIAccountManager - checkIsAdminUser ===== | ||
+ | <code javascript DJIAccountManager.checkIsAdminUser.js> | ||
+ | //Set Admin mode in Flight Records | ||
+ | var DJIAccountManager = ObjC.classes.DJIAccountManager; | ||
+ | var checkIsAdminUser = DJIAccountManager[' | ||
+ | var checkIsAdminUserImpl = checkIsAdminUser.implementation; | ||
+ | checkIsAdminUser.implementation = ObjC.implement(checkIsAdminUser, | ||
+ | var originalResult = checkIsAdminUserImpl(handle, | ||
+ | | ||
+ | | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | ===== DJIUpgradeNotifyViewModel - notifyHidden ===== | ||
+ | <code javascript DJIUpgradeNotifyViewModel.notifyHidden.js> | ||
+ | //Bypass upgrade notification on splash screen | ||
+ | var DJIUpgradeNotifyViewModel = ObjC.classes.DJIUpgradeNotifyViewModel; | ||
+ | var notifyHidden = DJIUpgradeNotifyViewModel[' | ||
+ | var notifyHiddenImpl = notifyHidden.implementation; | ||
+ | notifyHidden.implementation = ObjC.implement(notifyHidden, | ||
+ | var originalResult = notifyHiddenImpl(handle, | ||
+ | | ||
+ | | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | ===== 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[' | ||
+ | var sdr_force_fccImpl = sdr_force_fcc.implementation; | ||
+ | sdr_force_fcc.implementation = ObjC.implement(sdr_force_fcc, | ||
+ | var originalResult = sdr_force_fccImpl(handle, | ||
+ | | ||
+ | | ||
+ | | ||
+ | }); | ||
+ | |||
+ | //Fake Mavic for P4 FCC | ||
+ | var DJIProductManager = ObjC.classes.DJIProductManager; | ||
+ | var currentProductCode = DJIProductManager[' | ||
+ | var currentProductCodeImpl = currentProductCode.implementation; | ||
+ | currentProductCode.implementation = ObjC.implement(currentProductCode, | ||
+ | var originalResult = currentProductCodeImpl(handle, | ||
+ | | ||
+ | { | ||
+ | console.log(' | ||
+ | shown=1; | ||
+ | } | ||
+ | | ||
+ | | ||
+ | else | ||
+ | | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | ===== DJIAppForceUpdateManager - hasChecked ===== | ||
+ | <code javascript DJIAppForceUpdateManager.hasChecked.js> | ||
+ | //Bypass DJI Go 4 new app version check | ||
+ | var DJIAppForceUpdateManager = ObjC.classes.DJIAppForceUpdateManager; | ||
+ | var hasChecked = DJIAppForceUpdateManager[' | ||
+ | var hasCheckedImpl = hasChecked.implementation; | ||
+ | hasChecked.implementation = ObjC.implement(hasChecked, | ||
+ | var originalResult = hasCheckedImpl(handle, | ||
+ | | ||
+ | | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | ===== DJIAppSettings - canUseIllegalChannels ===== | ||
+ | <code javascript DJIAppForceUpdateManager.hasChecked.js> | ||
+ | //Enable Illegal Channels (32 Channels) | ||
+ | if (ObjC.available) { | ||
+ | var DJIAppSettings = ObjC.classes.DJIAppSettings; | ||
+ | var canUseIllegalChannels = DJIAppSettings[' | ||
+ | var canUseIllegalChannelsImpl = canUseIllegalChannels.implementation; | ||
+ | | ||
+ | var originalResult = canUseIllegalChannelsImpl(handle, | ||
+ | console.log(' | ||
+ | return 1; | ||
+ | }); | ||
+ | var DJIRadioLogic = ObjC.classes.DJIRadioLogic; | ||
+ | var canUseIllegalChannels = DJIRadioLogic[' | ||
+ | var canUseIllegalChannelsImpl = canUseIllegalChannels.implementation; | ||
+ | | ||
+ | var originalResult = canUseIllegalChannelsImpl(handle, | ||
+ | console.log(' | ||
+ | return 1; | ||
+ | }); | ||
+ | } | ||
</ | </ |