Skip to content

Commit

Permalink
Temporary disable verification when hiding app
Browse files Browse the repository at this point in the history
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 topjohnwu#1979
  • Loading branch information
topjohnwu committed Oct 24, 2019
1 parent 0b87108 commit 9d948f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ object PatchAPK {

// Install the application
repack.setReadable(true, false)
if (!Shell.su("pm install $repack").exec().isSuccess)
if (!Shell.su("force_pm_install $repack").exec().isSuccess)
return false

Config.suManager = pkg
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/raw/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,13 @@ EOF
touch hosts/auto_mount
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
}

0 comments on commit 9d948f2

Please sign in to comment.