|
|
@@ -5,6 +5,7 @@ import path from 'path'
|
|
|
import util from 'util'
|
|
|
import Vorpal from 'vorpal'
|
|
|
import { spawn, execSync } from 'child_process'
|
|
|
+import { setTimeout } from 'timers/promises'
|
|
|
|
|
|
const filePath = url.fileURLToPath(import.meta.url)
|
|
|
const __dirname = path.dirname(filePath)
|
|
|
@@ -201,7 +202,7 @@ class Tracer {
|
|
|
}
|
|
|
|
|
|
_onSessionDetached(reason) {
|
|
|
- Log.w(`[PID ${this.pid}] onSessionDetached(reason='${reason}')`)
|
|
|
+ Log.i(`[PID ${this.pid}] onSessionDetached(reason='${reason}')`)
|
|
|
const i = tracers.findIndex((tracer) => tracer.pid === this.pid)
|
|
|
if (i !== -1) {
|
|
|
tracers.splice(i, 1)
|
|
|
@@ -223,7 +224,7 @@ vorpal.sigint(function () {
|
|
|
stop()
|
|
|
})
|
|
|
|
|
|
-vorpal.command('clear [app]').action(function (args, callback) {
|
|
|
+vorpal.command('clear [app]').action(async function (args, callback) {
|
|
|
try {
|
|
|
const app = args.app
|
|
|
if ('sms' === app) {
|
|
|
@@ -236,6 +237,7 @@ vorpal.command('clear [app]').action(function (args, callback) {
|
|
|
execSync('adb shell pm clear com.google.android.gsf')
|
|
|
} else if ('all' === app) {
|
|
|
execSync('adb shell pm clear com.google.android.apps.messaging')
|
|
|
+ await setTimeout(1000)
|
|
|
execSync('adb shell pm clear com.google.android.gms')
|
|
|
pushFile('../gson.dex', '/sdcard/Android/data/com.google.android.gms/')
|
|
|
pushFile('../gson.dex', '/sdcard/Android/data/com.google.android.apps.messaging/')
|