Use uid 2000 to install patched apk

This commit is contained in:
vvb2060 2020-08-15 10:58:30 +08:00 committed by John Wu
parent ddd513110f
commit a4c1ddd9f2
2 changed files with 11 additions and 2 deletions

View File

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

View File

@ -85,6 +85,16 @@ EOF
cd /
}
adb_pm_install() {
local tmp=/data/local/tmp/patched.apk
cp -f "$1" $tmp
chmod 644 $tmp
su 2000 -c pm install $tmp
local res=$?
rm -f $tmp
return $res
}
check_boot_ramdisk() {
# Create boolean ISAB
[ -z $SLOT ] && ISAB=false || ISAB=true