Skip to content

Commit

Permalink
$APKPATH gets set via the app when using Magisk so only set for KSU/A…
Browse files Browse the repository at this point in the history
…Patch
  • Loading branch information
skittles9823 committed Jul 7, 2024
1 parent 6b9fa97 commit 8de6168
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions quickswitch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ID="quickswitch"
# Mod Directory
MODDIR=${0%/*}

KSU=true # removed during install if false
KSU=true # removed during install if false
APATCH=true # removed during install if false

if [ "$KSU" ]; then
Expand Down Expand Up @@ -147,7 +147,7 @@ setvars() {
if [ -n "$KSU" ] || [ -n "$APATCH" ]; then
STEPDIRPREFIX=$MODDIR
else
STEPDIRPREFIX=$MODDIR/system
STEPDIRPREFIX=$MODDIR/system
fi
SUFFIX="/overlay/QuickSwitchOverlay"
if [ "$API" -ge 29 ]; then
Expand Down Expand Up @@ -225,7 +225,7 @@ reset_provider() {
rm -rf $STEPDIR/QuickSwitchOverlay.apk
fi
rm -rf $MODDIR/system
if [ "$KSU" ] || [ "$APATCH" ] ; then
if [ "$KSU" ] || [ "$APATCH" ]; then
[ -d $MODDIR/product ] && rm -rf $MODDIR/product
[ -d $MODDIR/vendor ] && rm -rf $MODDIR/vendor
fi
Expand All @@ -247,7 +247,9 @@ switch_providers() {

echo "\nThe overlay will be copied to $STEPDIR..."

APKPATH=$(pm path $1 | sed "s|package:||")
if [ "$KSU" ] || [ "$APATCH" ]; then
APKPATH=$(pm path $1 | sed "s|package:||")
fi

# Create needed dirs
while [ ! -d "$STEPDIR" ]; do
Expand Down Expand Up @@ -309,8 +311,8 @@ $permissions
mkdir ${MODDIR}/compiled
aapt2 compile -v --dir ${OVERLAYDIR}/overlay/ -o ${MODDIR}/compiled && \
aapt2 link -o ${MODDIR}/unsigned.apk -I /system/framework/framework-res.apk \
--manifest ${OVERLAYDIR}/AndroidManifest.xml ${MODDIR}/compiled/* \
&>$MODDIR/logs/aapt2.log
--manifest ${OVERLAYDIR}/AndroidManifest.xml ${MODDIR}/compiled/* \
&>$MODDIR/logs/aapt2.log
rm -rf ${MODDIR}/compiled

if [ -s ${MODDIR}/unsigned.apk ]; then
Expand Down

0 comments on commit 8de6168

Please sign in to comment.