From 5e6b53e0dadbd7f2b4a44d79156ee1f050a19df3 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Sat, 21 Sep 2024 23:59:15 +0800 Subject: [PATCH] AppMigration: put suManager after installation --- .../com/topjohnwu/magisk/core/tasks/AppMigration.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/core/src/main/java/com/topjohnwu/magisk/core/tasks/AppMigration.kt b/app/core/src/main/java/com/topjohnwu/magisk/core/tasks/AppMigration.kt index fec34f203..28e53e222 100644 --- a/app/core/src/main/java/com/topjohnwu/magisk/core/tasks/AppMigration.kt +++ b/app/core/src/main/java/com/topjohnwu/magisk/core/tasks/AppMigration.kt @@ -191,11 +191,12 @@ object AppMigration { // Install and auto launch app val session = APKInstall.startSession(activity, pkg, onFailure) { + Config.suManager = pkg + Shell.cmd("touch $AppApkPath").exec() launchApp(activity, pkg) } - Config.suManager = pkg - val cmd = "touch $AppApkPath; adb_pm_install $repack $pkg" + val cmd = "adb_pm_install $repack $pkg" if (Shell.cmd(cmd).exec().isSuccess) return true try { @@ -240,11 +241,12 @@ object AppMigration { } val apk = StubApk.current(activity) val session = APKInstall.startSession(activity, APP_PACKAGE_NAME, onFailure) { + Config.suManager = "" + Shell.cmd("touch $AppApkPath").exec() launchApp(activity, APP_PACKAGE_NAME) dialog.dismiss() } - Config.suManager = "" - val cmd = "touch $AppApkPath; adb_pm_install $apk $APP_PACKAGE_NAME" + val cmd = "adb_pm_install $apk $APP_PACKAGE_NAME" if (Shell.cmd(cmd).await().isSuccess) return val success = withContext(Dispatchers.IO) { try {