xiongzhu 1 年間 前
コミット
af87532996
2 ファイル変更18 行追加15 行削除
  1. 9 8
      scripts/phone.js
  2. 9 7
      scripts/system_server.js

+ 9 - 8
scripts/phone.js

@@ -168,14 +168,15 @@ setImmediate(() => {
 
         // log(readConfig('serial_no'))
         let config = readConfig()
-
-        new Interaction().start(23946, (msg) => {
-            log(`received message: ${JSON.stringify(msg)}`)
-            if (msg.action === 'saveConfig') {
-                config = msg.data
-                saveConfig(config)
-            }
-        })
+        setTimeout(() => {
+            new Interaction().start(23946, (msg) => {
+                log(`received message: ${JSON.stringify(msg)}`)
+                if (msg.action === 'saveConfig') {
+                    config = msg.data
+                    saveConfig(config)
+                }
+            })
+        }, 10000)
 
         const PhoneInterfaceManager = Java.use('com.android.phone.PhoneInterfaceManager')
         PhoneInterfaceManager.getImeiForSlot.overload('int', 'java.lang.String', 'java.lang.String').implementation =

+ 9 - 7
scripts/system_server.js

@@ -174,13 +174,15 @@ setImmediate(() => {
 
         // saveConfig({ a: 1 })
         let config = readConfig()
-        new Interaction().start(23947, (msg) => {
-            log(`received message: ${JSON.stringify(msg)}`)
-            if (msg.action === 'saveConfig') {
-                config = msg.data
-                saveConfig(config)
-            }
-        })
+        setTimeout(() => {
+            new Interaction().start(23947, (msg) => {
+                log(`received message: ${JSON.stringify(msg)}`)
+                if (msg.action === 'saveConfig') {
+                    config = msg.data
+                    saveConfig(config)
+                }
+            })
+        }, 10000)
 
         const DeviceIdentifiersPolicy = Java.use(
             'com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy'