Created
March 29, 2023 19:52
-
-
Save devpwn/a2ef62cee6811a42c59a5886cc2f623b to your computer and use it in GitHub Desktop.
Watch Dog iOS bypass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dontTerminate = | |
[ | |
'br.com.john.doe.app' | |
]; | |
const FBSProcessTerminationRequest = ObjC.classes.FBSProcessTerminationRequest; | |
const terminateReq = FBSProcessTerminationRequest['+ requestForProcess:withLabel:'] | |
var oldImpl = terminateReq.implementation; | |
terminateReq.implementation = ObjC.implement(terminateReq, function (handle, selector, process, label) { | |
const lbl = new ObjC.Object(label); | |
console.log('Reason: ' + lbl); | |
if (lbl == 'watchdog provision violated') | |
{ | |
const proc = new ObjC.Object(process); | |
const bid = proc.$ivars._bundleIdentifier.toString() | |
var didMatch = false; | |
for (var i =0; i<dontTerminate.length;i++) | |
{ | |
if (bid == dontTerminate[i]) | |
{ | |
didMatch = true; | |
} | |
} | |
if (didMatch) | |
{ | |
console.log('They\'re trying to terminate us: ' + bid) | |
} | |
else { | |
return oldImpl(handle, selector, process, label); | |
} | |
} | |
else { | |
return oldImpl(handle, selector, process, label); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment