Update customize.sh
This commit is contained in:
parent
0c99946300
commit
a0886bd47b
1 changed files with 22 additions and 14 deletions
|
|
@ -4,9 +4,10 @@
|
|||
# Abort TWRP installation with error message when user tries to install this module in TWRP
|
||||
|
||||
if [ $BOOTMODE = false ]; then
|
||||
ui_print "ERROR: Installing through TWRP Not supported"
|
||||
ui_print "ERROR: Intsall this module via Magisk Manager"
|
||||
abort "ERROR: Aborting installation !!"
|
||||
ui_print "ERROR: TWRP based recovery detected"
|
||||
ui_print "ERROR: This module can't be installed through recovery mode"
|
||||
ui_print "ERROR: Please reboot to Android and install with Magisk/KernelSU !"
|
||||
abort "ERROR: Aborting..."
|
||||
fi
|
||||
|
||||
|
||||
|
|
@ -29,8 +30,9 @@ rm -rf $MODPATH/youtube
|
|||
|
||||
if ! dumpsys package $PKGNAME | grep path > /dev/null 2>&1
|
||||
then
|
||||
ui_print "ERROR : $APPNAME app is not installed"
|
||||
abort "INFO : Aborting installation !!"
|
||||
ui_print "ERROR : $APPNAME app can't be installed"
|
||||
ui_print "INFO : Try install $APPNAME app manually !"
|
||||
abort "ERROR : Aborting..."
|
||||
fi
|
||||
|
||||
|
||||
|
|
@ -40,11 +42,11 @@ VANCEDXAPPVER=$(grep version= module.prop | sed 's/version=v//')
|
|||
if [ "$STOCKAPPVER" != "$VANCEDXAPPVER" ]
|
||||
then
|
||||
ui_print "INFO : Installed $APPNAME version : $STOCKAPPVER"
|
||||
ui_print "- $APPNAME Vanced+ version : $VANCEDXAPPVER"
|
||||
ui_print "ERROR : Installed app version mismatch with module !"
|
||||
ui_print "ERROR : Uninstall current installed stock YT app or"
|
||||
ui_print "ERROR : Get Vanced+ module that match with current installed YT App version !"
|
||||
abort "INFO : Aborting installation !!"
|
||||
ui_print "INFO : YouTube Vanced+ version : $VANCEDXAPPVER"
|
||||
ui_print "ERROR : Installed app version are mismatch with Vanced+ !"
|
||||
ui_print "INFO : Uninstall current installed $APPNAME app or"
|
||||
ui_print "INFO : Find Vanced+ module that match with current installed $APPNAME app version !"
|
||||
abort "INFO : Aborting..."
|
||||
fi
|
||||
|
||||
ui_print "INFO : Unmounting previous mounts"
|
||||
|
|
@ -54,16 +56,22 @@ do
|
|||
echo "$LINE" | grep "$PKGNAME" | cut -d " " -f 2 | sed "s/apk.*/apk/" | xargs -r umount -l
|
||||
done
|
||||
|
||||
ui_print "INFO : Moving files and setting permissions"
|
||||
ui_print "INFO : Moving files"
|
||||
mkdir -p "$MODPATH/app"
|
||||
rm $MODPATH/app/"$APPNAME"*
|
||||
mv $MODPATH/*.apk $MODPATH/app/"$APPNAME"VancedX-"$VANCEDXAPPVER".apk
|
||||
mv $MODPATH/*.apk $MODPATH/app/vancedx-"$VANCEDXAPPVER".apk
|
||||
STOCKAPK=$(pm path $PKGNAME | grep base | cut -d ":" -f2)
|
||||
VANCEDXAPK=$MODPATH/app/"$APPNAME"VancedX-"$VANCEDXAPPVER".apk
|
||||
VANCEDXAPK=$MODPATH/app/vancedx-"$VANCEDXAPPVER".apk
|
||||
ui_print "INFO : set permissions"
|
||||
chmod 644 "$VANCEDXAPK"
|
||||
chown system:system "$VANCEDXAPK"
|
||||
chcon u:object_r:apk_data_file:s0 "$VANCEDXAPK"
|
||||
ui_print "INFO : Mounting YouTube Vanced+ to YouTube app..."
|
||||
mount -o bind "$VANCEDXAPK" "$STOCKAPK"
|
||||
ui_print "INFO : Force closing current YouTube app..."
|
||||
am force-stop "$PKGNAME"
|
||||
|
||||
ui_print "INFO : YouTube Vanced+ Installed !!"
|
||||
ui_print "INFO : YouTube Vanced+ Installed !"
|
||||
ui_print "TIPS : To prevent update from Play Store, use zygisk-detach module !"
|
||||
ui_print "TIPS : GitHub : https://github.com/j-hc/zygisk-detach"
|
||||
ui_print "TIPS : or try disable update for $APPNAME on Play Store."
|
||||
|
|
|
|||
Loading…
Reference in a new issue