xiongzhu 10 mēneši atpakaļ
vecāks
revīzija
c021cde275
1 mainītis faili ar 65 papildinājumiem un 0 dzēšanām
  1. 65 0
      scripts/cell.js

+ 65 - 0
scripts/cell.js

@@ -0,0 +1,65 @@
+function trace(tag) {
+    Log.e((tag || '') + Java.use('android.util.Log').getStackTraceString(Java.use('java.lang.Throwable').$new()))
+}
+
+class Log {
+    static TAG = '[Cell]'
+    static Debug = true
+    static format(...msg) {
+        let m = []
+        for (let i = 0; i < msg.length; i++) {
+            if (typeof msg[i] === 'object') {
+                m.push(msg[i] + '')
+            } else {
+                m.push(msg[i])
+            }
+        }
+        m = m.join(' ')
+        return m
+    }
+    static i(...msg) {
+        if (!this.Debug) return
+        console.log(`\x1b[30m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+    static w(...msg) {
+        console.log(`\x1b[33m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+    static e(...msg) {
+        console.log(`\x1b[31m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+    static s(...msg) {
+        console.log(`\x1b[32m${this.TAG} ${this.format(...msg)}\x1b[0m`)
+    }
+}
+
+Java.perform(function () {
+    const classLoaders = Java.enumerateClassLoadersSync()
+    for (let i of classLoaders) {
+        if (i.toString().includes('TeleService.apk')) {
+            Java.classFactory.loader = i
+            break
+        }
+    }
+    const PhoneInterfaceManager = Java.use('com.android.phone.PhoneInterfaceManager')
+    PhoneInterfaceManager.getAllCellInfo.overload('java.lang.String', 'java.lang.String').implementation = function (
+        arg1,
+        arg2
+    ) {
+        Log.i(`getAllCellInfo(${arg1}, ${arg2})`)
+        return this.getAllCellInfo(arg1, arg2)
+    }
+
+    PhoneInterfaceManager.getCallState.overload().implementation = function () {
+        Log.i(`getCallState()`)
+        return this.getCallState()
+    }
+    PhoneInterfaceManager.getCallStateForSubscription.overload(
+        'int',
+        'java.lang.String',
+        'java.lang.String'
+    ).implementation = function (arg1, arg2, arg3) {
+        Log.i(`getCallStateForSubscription(${arg1}, ${arg2}, ${arg3})`)
+        return this.getCallStateForSubscription(arg1, arg2, arg3)
+    }
+
+})