diff --git a/lite-script_only/UpdateTargetList.sh b/lite-script_only/UpdateTargetList.sh index 883e024..88784a4 100644 --- a/lite-script_only/UpdateTargetList.sh +++ b/lite-script_only/UpdateTargetList.sh @@ -26,7 +26,7 @@ echo " Staring script..." echo " " # Create or overwrite the target.txt file -su -c > /data/adb/tricky_store/target.txt +> /data/adb/tricky_store/target.txt echo " Adding apps to target.txt..." echo " " diff --git a/module/action.sh b/module/action.sh index 72fbccb..a147298 100644 --- a/module/action.sh +++ b/module/action.sh @@ -3,7 +3,9 @@ echo "**********************************************" echo "- Staring script..." echo " " -sh "$MODDIR"/common/UpdateTargetList.sh || true +sh "$MODDIR"/common/UpdateTargetList.sh echo "**********************************************" -echo "\(__All set!__)/" \ No newline at end of file +echo "\(__All set!__)/" +echo "Exiting in 3 seconds..." +sleep 3 \ No newline at end of file diff --git a/module/common/UpdateTargetList.sh b/module/common/UpdateTargetList.sh index fff5742..d557c0a 100644 --- a/module/common/UpdateTargetList.sh +++ b/module/common/UpdateTargetList.sh @@ -10,14 +10,14 @@ MODDIR="/data/adb/tricky_store/target_list_config" echo "- Checking config files..." echo " " if [ ! -f "$MODDIR/EXCLUDE" ]; then - echo "! Exclude list is missing!" + echo "! Exclude list is missing, please reinstall module" exit 1 else echo "- Exclude config file found." echo " " fi if [ ! -f "$MODDIR/ADDITION" ]; then - echo "! Addition list is missing" + echo "! Addition list is missing, please reinstall module" exit 1 else echo "- Addition config file found." @@ -31,7 +31,7 @@ ADDITIONS=$(grep -vE '^#|^$' "$MODDIR/ADDITION") # Create or overwrite the target.txt file echo "- Overwritting target.txt" echo " " -su -c > /data/adb/tricky_store/target.txt +> /data/adb/tricky_store/target.txt # Add all non-system apps to the target file and remove exclusions echo "- Adding apps into /data/adb/tricky_store/target.txt" diff --git a/module/customize.sh b/module/customize.sh index 6982ae6..3994d10 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -23,7 +23,7 @@ if [ -d /data/adb/modules/tricky_store ]; then echo "- Tricky store module installed" else echo "! Tricky store module is not installed" - exit 1 + abort " " fi key_check() { @@ -62,9 +62,20 @@ if [ ! -d "$CONFIG_DIR" ]; then mkdir -p "$CONFIG_DIR" mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE" mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION" -else - rm -f "$COMPATH/EXCLUDE" - rm -f "$COMPATH/ADDITION" +elif [ -d "$CONFIG_DIR" ]; then + if [ ! -f "$CONFIG_DIR/EXCLUDE"]; then + mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE" + rm -f "$COMPATH/ADDITION" + elif [ ! -f "$CONFIG_DIR/ADDITION"]; then + mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION" + rm -f "$COMPATH/EXCLUDE" + elif [ ! -f "$CONFIG_DIR/EXCLUDE" ] && [ ! -f "$CONFIG_DIR/ADDITION" ]; then + mv "$COMPATH/EXCLUDE" "$CONFIG_DIR/EXCLUDE" + mv "$COMPATH/ADDITION" "$CONFIG_DIR/ADDITION" + else + rm -f "$COMPATH/EXCLUDE" + rm -f "$COMPATH/ADDITION" + fi fi if [ ! -f "/data/adb/modules/$MODNAME/system.prop" ]; then diff --git a/module/service.sh b/module/service.sh index f73c0aa..f44f5c1 100644 --- a/module/service.sh +++ b/module/service.sh @@ -2,6 +2,11 @@ MODDIR=${0%/*} COMPATH="$MODDIR/common" TS="/data/adb/modules/tricky_store" +if [ ! -f "$COMPATH/ninstalled" ] || [ ! -f "$COMPATH/disabled" ] || [ ! -f "$COMPATH/normal" ]; then + sed -i 's/^description=.*/description=Module is corrupted, please reinstall module./' "$MODDIR/module.prop" + abort +fi + if [ ! -d "$TS" ]; then cat "$COMPATH/ninstalled" > "$MODDIR/module.prop" elif [ -f "$TS/disable" ]; then