diff --git a/README.md b/README.md index 70b907b..e0da97d 100755 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ A **KSU WebUI** to configure tricky store target.txt ## Description - Automated script to update tricky store target list. - System app excluded by default +- This module is **not** a part of Tricky Store module, DO NOT report to Tricky Store if you encounter any issue. - This is **not** a necessary module for root hide but for those who lazy to do it manually ## Requirements diff --git a/changelog.md b/changelog.md index ba7aa1f..10c00b4 100755 --- a/changelog.md +++ b/changelog.md @@ -3,11 +3,19 @@ A **KSU WebUI** to configure tricky store target.txt Requirement: Tricky Store module installed +This module is not a part of Tricky Store, DO NOT report to Tricky Store if you encounter any issue. + GitHub release: [Tricky Addon: Update Target List](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/latest) Telegram channel: [KOW's Little World](https://t.me/kowchannel) ## Changelog +### v2.6-beta.2 +- Due to extensive code refactoring, you might encounter unexpected bugs in this version, feedback in [Telegram](https://t.me/kowchannel) or [create issue](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/issues) if you found any issue. +- This module now invisible, use shortcut on Tricky Store module. To uninstall module, scroll down to the botttom of WebUI and press Uninstall WebUI. +- Compatiple with Tricky Store 1.2.0. Tested on Magisk Alpha 28001, Apatch Next 11010, KernelSU 11895. +- Fixed some UI bug. + ### v2.6-beta.1 - Check in [release notes](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/releases/tag/v2.6-beta.1). diff --git a/module/action.sh b/module/action.sh index c93e6a0..0b379a1 100644 --- a/module/action.sh +++ b/module/action.sh @@ -1,4 +1,8 @@ -MODPATH="${0%/*}" +########################################### +## This file is NOT a part of Tricky Store +########################################### + +MODPATH="/data/adb/modules/.TA_utl" COMPATH="$MODPATH/common" SCRIPT_DIR="/data/adb/tricky_store" diff --git a/module/common/get_WebUI.sh b/module/common/get_WebUI.sh index 642e9fa..b9cfcb5 100644 --- a/module/common/get_WebUI.sh +++ b/module/common/get_WebUI.sh @@ -1,6 +1,5 @@ URL="https://github.com/5ec1cff/KsuWebUIStandalone/releases/download/v1.0/KsuWebUI-1.0-34-release.apk" APK_DIR="$COMPATH" -LOG_FILE="$COMPATH/webuiError.log" find_busybox check_wget diff --git a/module/common/temp/remove b/module/common/temp/remove new file mode 100644 index 0000000..e69de29 diff --git a/module/common/temp/service.sh b/module/common/temp/service.sh new file mode 100644 index 0000000..f1b1805 --- /dev/null +++ b/module/common/temp/service.sh @@ -0,0 +1,3 @@ +MODPATH=${0%/*} + +rm -rf "$MODPATH" \ No newline at end of file diff --git a/module/uninstall.sh b/module/common/temp/uninstall.sh similarity index 56% rename from module/uninstall.sh rename to module/common/temp/uninstall.sh index 210309d..30ca28f 100644 --- a/module/uninstall.sh +++ b/module/common/temp/uninstall.sh @@ -1,4 +1,5 @@ MODPATH=${0%/*} +TS="/data/adb/modules/tricky_store" SCRIPT_DIR="/data/adb/tricky_store" # Enable back TSupport-A auto update @@ -7,7 +8,15 @@ if [ -f "/storage/emulated/0/stop-tspa-auto-target" ]; then fi # Remove residue and restore aosp keybox. +rm -rf "/data/adb/modules/.TA_utl" rm -rf "$SCRIPT_DIR/target_list_config" rm -f "$SCRIPT_DIR/UpdateTargetList.sh" rm -f "/data/adb/boot_hash" -xxd -r -p "$MODPATH/common/.default" | base64 -d > "$SCRIPT_DIR/keybox.xml" +if [ -d "$TS" ]; then + if [ -f "$MODPATH/action.sh" ]; then + rm -f "$TS/action.sh" + else + rm -rf "$TS/webroot" + fi +fi +xxd -r -p "$MODPATH/.default" | base64 -d > "$SCRIPT_DIR/keybox.xml" diff --git a/module/customize.sh b/module/customize.sh index 70ca8a7..5e8fef2 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -4,8 +4,7 @@ COMPATH="$MODPATH/common" TS="/data/adb/modules/tricky_store" SCRIPT_DIR="/data/adb/tricky_store" CONFIG_DIR="$SCRIPT_DIR/target_list_config" -MODID=`grep_prop id $TMPDIR/module.prop` -ORG_DIR="/data/adb/modules/$MODID" +NEW_MODID=.TA_utl kb="$COMPATH/.default" ui_print " "; diff --git a/module/install_func.sh b/module/install_func.sh index da8fc65..e54a086 100644 --- a/module/install_func.sh +++ b/module/install_func.sh @@ -5,14 +5,18 @@ initialize() { if [ -f "$CONFIG_DIR/skipwebui" ]; then rm -f "$CONFIG_DIR/skipwebui" fi - cp "$MODPATH/module.prop" "$COMPATH/module.prop.orig" + if [ -d "/data/adb/modules/$NEW_MODID" ]; then + rm -rf "/data/adb/modules/$NEW_MODID" + fi + cp "$MODPATH/module.prop" "$COMPATH/temp/module.prop" + cp "$COMPATH/.default" "$COMPATH/temp/.default" mv "$COMPATH/UpdateTargetList.sh" "$SCRIPT_DIR/UpdateTargetList.sh" - sed -i "s|\"set-path\"|\"/data/adb/modules/$MODID/common/\"|" "$MODPATH/webroot/index.js" || { + sed -i "s|\"set-path\"|\"/data/adb/modules/$NEW_MODID/common/\"|" "$MODPATH/webroot/index.js" || { ui_print "! Failed to set path" abort } - sed -i "s|\"set-id\"|\"$MODID\"|" "$COMPATH/util_func.sh" || { + sed -i "s|\"set-id\"|\"$NEW_MODID\"|" "$COMPATH/util_func.sh" || { ui_print "! Failed to set id" abort } @@ -77,19 +81,8 @@ find_config() { migrate_old_boot_hash() { if [ ! -f "/data/adb/boot_hash" ]; then - if [ -f "$ORG_DIR/boot_hash" ]; then - mv "$ORG_DIR/boot_hash" "/data/adb/boot_hash" - fi - mv "$COMPATH/boot_hash" "/data/adb/boot_hash" + mv "$COMPATH/boot_hash" "/data/adb/boot_hash" else rm -f "$COMPATH/boot_hash" fi - - # Migrate from old version setup - if [ -f "$ORG_DIR/system.prop" ]; then - hash_value=$(sed -n 's/^ro.boot.vbmeta.digest=//p' "$ORG_DIR/system.prop") - if [ -n "$hash_value" ]; then - echo -e "\n$hash_value" >> "/data/adb/boot_hash" - fi - fi } \ No newline at end of file diff --git a/module/module.prop b/module/module.prop index 07a0512..fdedd96 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,6 +1,6 @@ id=TA_utl name=Tricky Addon - Update Target List -version=v2.6-beta.1 +version=v2.6-beta.2 versionCode=250 author=KOWX712 description=A WebUI to conifgure tricky store target.txt diff --git a/module/service.sh b/module/service.sh index 034eec0..96eb500 100644 --- a/module/service.sh +++ b/module/service.sh @@ -1,6 +1,5 @@ MODPATH=${0%/*} -OUTPUT_APP="$MODPATH/common/applist" -OUTPUT_SKIP="$MODPATH/common/skiplist" +HIDE_DIR="/data/adb/modules/.TA_utl" TS="/data/adb/modules/tricky_store" SCRIPT_DIR="/data/adb/tricky_store" TSPA="/data/adb/modules/tsupport-advance" @@ -19,23 +18,32 @@ elif [ ! -d "$TSPA" ] && [ -f "/storage/emulated/0/stop-tspa-auto-target" ]; the rm -f "/storage/emulated/0/stop-tspa-auto-target" fi -if [ ! -f "$MODPATH/common/module.prop.orig" ]; then - sed -i 's/^description=.*/description=Module is corrupted, please reinstall module./' "$MODPATH/module.prop" - touch "$MODPATH/disable" - exit 1 +rm -f "$MODPATH/module.prop" +if [ ! -d "$HIDE_DIR" ]; then + mv "$MODPATH" "$HIDE_DIR" fi +MODPATH="$HIDE_DIR" +OUTPUT_APP="$MODPATH/common/applist" +OUTPUT_SKIP="$MODPATH/common/skiplist" if [ ! -d "$TS" ]; then - sed -i 's/^description=.*/description=Tricky store is not installed/' "$MODPATH/module.prop" - touch "$MODPATH/disable" + cp -rf "$MODPATH/common/temp/" "/data/adb/modules/TA_utl/" + rm -rf "$MODPATH" + exit 1 elif [ -f "$TS/disable" ]; then - sed -i 's/^description=.*/description=Tricky store is disabled/' "$MODPATH/module.prop" - touch "$MODPATH/disable" -elif [ ! -f "$SCRIPT_DIR/UpdateTargetList.sh" ]; then - sed -i 's/^description=.*/description=Script missing, please install module again/' "$MODPATH/module.prop" - touch "$MODPATH/disable" + exit 1 else - cat "$MODPATH/common/module.prop.orig" > "$MODPATH/module.prop" + if [ -f "$MODPATH/action.sh" ]; then + if [ -f "$TS/action.sh" ]; then + rm -f "$TS/action.sh" + fi + ln -s "$MODPATH/action.sh" "$TS/action.sh" + else + if [ ! -d "$TS/webroot" ]; then + rm -rf "$TS/webroot" + fi + ln -s "$MODPATH/webroot" "$TS/webroot" + fi until [ "$(getprop sys.boot_completed)" = "1" ]; do sleep 1 done diff --git a/module/webroot/index.html b/module/webroot/index.html index 5c1e2ee..ccb5341 100644 --- a/module/webroot/index.html +++ b/module/webroot/index.html @@ -11,7 +11,7 @@