1
mirror of https://github.com/topjohnwu/Magisk synced 2024-11-13 20:54:12 +01:00

Do not run pm install on main thread

This commit is contained in:
topjohnwu 2021-02-23 04:09:13 -08:00
parent 5ac0e64edb
commit a1096b5bf0

View File

@ -160,7 +160,9 @@ object HideAPK {
fun restore(activity: Activity) {
val apk = DynAPK.current(activity)
APKInstall.registerInstallReceiver(activity, WaitPackageReceiver(APPLICATION_ID, activity))
if (!Shell.su("adb_pm_install $apk").exec().isSuccess)
APKInstall.installHideResult(activity, apk)
Shell.su("adb_pm_install $apk").submit {
if (!it.isSuccess)
APKInstall.installHideResult(activity, apk)
}
}
}