-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__UIApplication_canOpenURL__.js
37 lines (35 loc) · 1.72 KB
/
__UIApplication_canOpenURL__.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Auto-generated by Frida. Please modify to match the signature of -[UIApplication canOpenURL:].
* This stub is currently auto-generated from manpages when available.
*
* For full API reference, see: http://www.frida.re/docs/javascript-api/
*/
{
/**
* Called synchronously when about to call -[UIApplication canOpenURL:].
*
* @this {object} - Object allowing you to store state for use in onLeave.
* @param {function} log - Call this function with a string to be presented to the user.
* @param {array} args - Function arguments represented as an array of NativePointer objects.
* For example use Memory.readUtf8String(args[0]) if the first argument is a pointer to a C string encoded as UTF-8.
* It is also possible to modify arguments by assigning a NativePointer object to an element of this array.
* @param {object} state - Object allowing you to keep state across function calls.
* Only one JavaScript function will execute at a time, so do not worry about race-conditions.
* However, do not use this to store function arguments across onEnter/onLeave, but instead
* use "this" which is an object for keeping state local to an invocation.
*/
onEnter: function (log, args, state) {
var url = ObjC.Object(args[2]).toString(); // NSString
log("-[UIApplication canOpenURL:" + url + " ]");
if (url.indexOf("cydia") >= 0) {
log("Jailbreak detection => Trying to use Cydia URL Schema: "+url);
this.jailbreakCall = true;
}
},
onLeave: function (log, retval, state) {
if(this.jailbreakCall) {
retval.replace(0x00);
log("Jailbreak detection bypassed!");
}
}
}