Skip to content

Commit

Permalink
session installer
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Apr 13, 2023
1 parent ade7b45 commit b0b2ae7
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,30 @@ else
mmm_exec() { true; }
fi

install_phonesky()
{
pm_install() {
which sed >/dev/null 2>&1
if [ $? -eq 0 ]; then
sessionRaw=$(pm install-create --dont-kill "$1")
if [ $? -eq 0 ]; then
session=$(echo "$sessionRaw" | sed -E 's/.*\[(.*)\].*/\1/g')
if [ $? -eq 0 ]; then
pm install-write "$session" "$1"
if [ $? -eq 0 ]; then
pm install-commit "$session"
return $?
else
pm install-abandon "$session"
fi
fi
fi
fi
pm install --dont-kill "$1" "$2"
return $?
}

install_phonesky() {
mmm_exec showLoading
pm install --dont-kill "$MODPATH/system/priv-app/Phonesky/Phonesky.apk"
pm_install "" "$MODPATH/system/priv-app/Phonesky/Phonesky.apk"
pm grant com.android.vending android.permission.FAKE_PACKAGE_SIGNATURE 2>/dev/null
mmm_exec hideLoading
}
Expand All @@ -20,7 +40,8 @@ if $BOOTMODE; then

ui_print "- Installing microG GmsCore"
mmm_exec showLoading
pm install --dont-kill -g "$MODPATH/system/priv-app/GmsCore/GmsCore.apk"
pm_install "-g" "$MODPATH/system/priv-app/GmsCore/GmsCore.apk"
pm grant com.google.android.gms android.permission.FAKE_PACKAGE_SIGNATURE 2>/dev/null
mmm_exec hideLoading

if [ -f /data/adb/Phonesky.apk ]; then
Expand Down

0 comments on commit b0b2ae7

Please sign in to comment.