Commit 9d948f2c authored by topjohnwu's avatar topjohnwu

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
parent 0b871081
...@@ -103,7 +103,7 @@ object PatchAPK { ...@@ -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
......
...@@ -109,3 +109,13 @@ EOF ...@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment