mirror of
https://github.com/j-hc/revanced-magisk-module.git
synced 2025-05-28 04:20:23 +02:00
use shell expansion
This commit is contained in:
parent
d818d142e7
commit
4a4d1b2ba9
@ -1,9 +1,10 @@
|
||||
# shellcheck disable=SC2148,SC2086,SC2115
|
||||
ui_print ""
|
||||
am force-stop __PKGNAME
|
||||
grep __PKGNAME /proc/mounts | while read -r line; do
|
||||
ui_print "* Un-mount"
|
||||
echo "$line" | cut -d" " -f2 | xargs -r umount -l
|
||||
line=${line#*' '}
|
||||
line=${line%%' '*}
|
||||
umount -l ${line%%\\*} # trims \040(deleted)
|
||||
done
|
||||
|
||||
if [ $ARCH = "arm" ]; then
|
||||
@ -19,7 +20,12 @@ else
|
||||
fi
|
||||
set_perm_recursive $MODPATH/bin 0 0 0755 0777
|
||||
|
||||
BASEPATH=$(pm path __PKGNAME | grep base | cut -d: -f2)
|
||||
basepath() {
|
||||
basepath=$(pm path __PKGNAME | grep base)
|
||||
echo ${basepath#*:}
|
||||
}
|
||||
|
||||
BASEPATH=$(basepath)
|
||||
if [ -n "$BASEPATH" ] && cmpr $BASEPATH $MODPATH/stock.apk; then
|
||||
ui_print "* Installed __PKGNAME and module stock.apk are identical"
|
||||
ui_print "* Skipping stock APK installation"
|
||||
@ -30,7 +36,7 @@ else
|
||||
ui_print "ERROR: APK installation failed!"
|
||||
abort "${op}"
|
||||
fi
|
||||
BASEPATH=$(pm path __PKGNAME | grep base | cut -d: -f2)
|
||||
BASEPATH=$(basepath)
|
||||
fi
|
||||
|
||||
ui_print "* Patching __PKGNAME (v__MDVRSN) on the fly"
|
||||
|
@ -1,4 +1,6 @@
|
||||
#!/system/bin/sh
|
||||
grep __PKGNAME /proc/mounts | while read -r line; do
|
||||
echo "$line" | cut -d" " -f2 | xargs -r umount -l
|
||||
line=${line#*' '}
|
||||
line=${line%%' '*}
|
||||
umount -l ${line%%\\*}
|
||||
done
|
||||
|
@ -4,7 +4,8 @@ MODDIR=${0%/*}
|
||||
until [ "$(getprop sys.boot_completed)" = 1 ]; do
|
||||
sleep 1
|
||||
done
|
||||
BASEPATH=$(pm path __PKGNAME | grep base | cut -d: -f2)
|
||||
BASEPATH=$(pm path __PKGNAME | grep base)
|
||||
BASEPATH=${BASEPATH#*:}
|
||||
if [ "$BASEPATH" ]; then
|
||||
chcon u:object_r:apk_data_file:s0 $MODDIR/base.apk
|
||||
mount -o bind $MODDIR/base.apk $BASEPATH
|
||||
|
Loading…
x
Reference in New Issue
Block a user