-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtcallback.js
25 lines (22 loc) · 926 Bytes
/
btcallback.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
var cbManager = ObjC.classes.CBCentralManager["- scanForPeripheralsWithServices:options:"];
var applicationBackground = ObjC.classes.UIApplication["- _applicationDidEnterBackground"];
var applicationForeground = ObjC.classes.UIApplication["- _sendWillEnterForegroundCallbacks"];
Interceptor.attach(cbManager.implementation, {
onEnter: function (args) {
console.log("\n\n" + Date());
var message = ObjC.Object(args[2]);
console.log("[CBCentralManager scanForPeripheralsWithServices:@\"" + message.toString().trim() + "\"]");
}
});
Interceptor.attach(applicationBackground.implementation, {
onEnter: function (args) {
console.log("\n\n" + Date());
console.log("Entered background");
}
})
Interceptor.attach(applicationForeground.implementation, {
onEnter: function (args) {
console.log("\n\n" + Date());
console.log("Entered foreground");
}
});