From 6aa0e4cf286f175f7ffba5b8f5f96fc8865f8f2a Mon Sep 17 00:00:00 2001 From: ice <44568304+icepony@users.noreply.github.com> Date: Thu, 11 Apr 2024 13:30:06 +0800 Subject: [PATCH] manager: Use AM instead of Monkey to start the app. (#1614) Using Monkey will unlock the rotation, and possibly more unintended behavior. link: [ADB shell monkey command changing device orientation lock](https://stackoverflow.com/q/56684778) --- .../app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt index 4338c39c..d90e8068 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt @@ -366,11 +366,11 @@ fun launchApp(packageName: String) { val shell = getRootShell() val result = - shell.newJob().add("monkey -p $packageName -c android.intent.category.LAUNCHER 1").exec() + shell.newJob().add("cmd package resolve-activity --brief $packageName | tail -n 1 | xargs cmd activity start-activity -n").exec() Log.i(TAG, "launch $packageName result: $result") } fun restartApp(packageName: String) { forceStopApp(packageName) launchApp(packageName) -} \ No newline at end of file +}