Temporary disable verification when hiding app

For some reason, Google Play Protect randomly blocks our self-signed
repackaged Magisk Manager APKs. Since we are root, the sky is our
limit, so yeah, disable package verification temporarily when installing
patched APKs, LOLz

Close #1979
This commit is contained in:
topjohnwu 2019-10-24 12:23:03 -04:00
parent 0b87108174
commit 9d948f2c2b
2 changed files with 11 additions and 1 deletions

View File

@ -103,7 +103,7 @@ object PatchAPK {
// Install the application // Install the application
repack.setReadable(true, false) repack.setReadable(true, false)
if (!Shell.su("pm install $repack").exec().isSuccess) if (!Shell.su("force_pm_install $repack").exec().isSuccess)
return false return false
Config.suManager = pkg Config.suManager = pkg

View File

@ -109,3 +109,13 @@ EOF
touch hosts/auto_mount touch hosts/auto_mount
cd / cd /
} }
force_pm_install() {
local APK=$1
local VERIFY=`settings get global package_verifier_enable`
[ "$VERIFY" -eq 1 ] && settings set global package_verifier_enable 0
pm install -r $APK
local res=$?
[ "$VERIFY" -eq 1 ] && settings set global package_verifier_enable 1
return $res
}