Cylent Security

Cylent Security

Disabling the iOS Watchdog Timer

iOS has a feature that will kill your app if it hangs on startup. If you run this script first it will prevent Watchdog from killing your app. This will allow your app to take as long as it needs to start when loading intensive Frida scripts.

Command: frida -U -n SpringBoard -l disable_watchdog.js

var method = ObjC.classes.FBApplicationProcessWatchdogPolicy['- watchdogPolicyForProcess:eventContext:'];
 
Interceptor.attach(method.implementation, {
    onLeave: function(retval) {
        // Print the original policy pointer just for confirmation
        console.log(`[*] Watchdog Policy requested. Original: ${retval}`);
 
        // Force it to NULL (No Policy = No Watchdog)
        retval.replace(ptr("0x0"));
 
        console.log("[+] Policy killed. Watchdog disabled for this launch.");
    }
});