ksud: Support remove files in customize.sh by REMOVE variables.

e.g:

REMOVE="
/system/app/YouTube
/system/app/Bloatware
"
This commit is contained in:
tiann
2023-03-27 15:04:28 +08:00
parent 14b2afe78d
commit dcbbbab11e

View File

@@ -271,6 +271,12 @@ mktouch() {
chmod 644 $1 chmod 644 $1
} }
mark_remove() {
mkdir -p ${1%/*} 2>/dev/null
mknod $1 c 0 0
chmod 644 $1
}
request_size_check() { request_size_check() {
reqSizeM=`du -ms "$1" | cut -f1` reqSizeM=`du -ms "$1" | cut -f1`
} }
@@ -387,6 +393,12 @@ install_module() {
mktouch $MODPATH$TARGET/.replace mktouch $MODPATH$TARGET/.replace
done done
# Handle remove files
for TARGET in $REMOVE; do
ui_print "- Remove target: $TARGET"
mark_remove $MODPATH$TARGET
done
if $BOOTMODE; then if $BOOTMODE; then
mktouch $NVBASE/modules/$MODID/update mktouch $NVBASE/modules/$MODID/update
rm -rf $NVBASE/modules/$MODID/remove 2>/dev/null rm -rf $NVBASE/modules/$MODID/remove 2>/dev/null