From 2839744ce1f3b3e53d61b4da32b4f0b4f6faff98 Mon Sep 17 00:00:00 2001 From: shoey63 Date: Thu, 15 Jan 2026 10:05:23 +0800 Subject: [PATCH 1/3] Delete module/post-fs-data.sh - Deleted `post-fs-data.sh`. - This script contains broken "backup/restore" logic that failed because the `modules_update` directory is cleared before boot. - As per the README, legacy script-based prop fixes have been removed in this fork, rendering these empty/broken scripts unnecessary. --- module/post-fs-data.sh | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 module/post-fs-data.sh diff --git a/module/post-fs-data.sh b/module/post-fs-data.sh deleted file mode 100644 index 9c2980256..000000000 --- a/module/post-fs-data.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/system/bin/sh -# Early boot restore - -MODULE_NAME=targetedfix -MODULE_PATH=/data/adb/modules/$MODULE_NAME -UPDATE_PATH=/data/adb/modules_update/$MODULE_NAME - -mkdir -p "$MODULE_PATH/config" - -# Restore from backup if available -for f in "$UPDATE_PATH/config/"*; do - [ -s "$f" ] && cp -af "$f" "$MODULE_PATH/config/" -done 2>/dev/null \ No newline at end of file From 64f33e82211032085351cff154020f9fc311b05f Mon Sep 17 00:00:00 2001 From: shoey63 Date: Thu, 15 Jan 2026 10:06:32 +0800 Subject: [PATCH 2/3] Delete module/service.sh - Deleted `service.sh`. - This script contains broken "backup/restore" logic that failed because the `modules_update` directory is cleared before boot. - As per the README, legacy script-based prop fixes have been removed in this fork, rendering these empty/broken scripts unnecessary. --- module/service.sh | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 module/service.sh diff --git a/module/service.sh b/module/service.sh deleted file mode 100644 index fdb803263..000000000 --- a/module/service.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/system/bin/sh -# Late boot restore fallback - -MODULE_NAME=targetedfix -MODULE_PATH=/data/adb/modules/$MODULE_NAME -UPDATE_PATH=/data/adb/modules_update/$MODULE_NAME - -sleep 5 -mkdir -p "$MODULE_PATH/config" - -for f in "$UPDATE_PATH/config/"*; do - [ -s "$f" ] && cp -af "$f" "$MODULE_PATH/config/" -done 2>/dev/null \ No newline at end of file From 81f6f79b5624793b0a2e89b0c13e7fafc86b4296 Mon Sep 17 00:00:00 2001 From: shoey63 Date: Thu, 15 Jan 2026 10:17:53 +0800 Subject: [PATCH 3/3] Update customize.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. **Fixed `customize.sh` Logic & Pathing:** - Removed the manual `MODPATH` definition (which incorrectly resolved to `sh` on APatch) and manual directory creation. - The script now relies on the module manager's native extraction and `$MODPATH` variable, ensuring cross-manager compatibility and preventing the "empty folder" bug. 2. **Fixed Script Encoding (BOM & CRLF):** - `customize.sh` contained a UTF-8 Byte Order Mark (BOM) and Windows (CRLF) line endings. - This caused the kernel to fail reading the shebang (`#!/system/bin/sh`), resulting in "not found" errors during execution. The file has been converted to standard Unix format (LF) without BOM. - *Proof of error:* `curl -sL "..." | cat -v` showed `M-oM-;M-?#!/system/bin/sh`. 3. **Improved Config Persistence:** - Implemented a robust "Wipe & Replace" strategy for user configs. - If a user backup is detected (and is not empty), the default `config` folder—extracted automatically by the manager—is deleted (`rm -rf`) and replaced with the user's files. --- module/customize.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index 48b4b6223..89ea550ca 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -1,23 +1,24 @@ -#!/system/bin/sh +#!/system/bin/sh +# customize.sh - Safe Installer -MODPATH=${0%/*} -MODULE_NAME=targetedfix -MODULE_PATH=/data/adb/modules/$MODULE_NAME -UPDATE_PATH=/data/adb/modules_update/$MODULE_NAME +# 1. Setup Variables +# CRITICAL: Do NOT define MODPATH manually. Trust the Manager. +MODID=targetedfix +LIVE_PATH="/data/adb/modules/$MODID" -ui_print "-> Installing $MODULE_NAME..." +ui_print "- Installing TargetedFix..." -# If old install exists = update/reinstall -if [ -d "$MODULE_PATH/config" ]; then - ui_print "-> Backing up user configs..." - mkdir -p "$UPDATE_PATH/config" - - for f in "$MODULE_PATH/config/"*; do - [ -s "$f" ] && cp -af "$f" "$UPDATE_PATH/config/" - done 2>/dev/null +# 2. CONFIG RESTORATION +# Check if config folder exists AND is not empty +if [ -d "$LIVE_PATH/config" ] && [ "$(ls -A "$LIVE_PATH/config")" ]; then + ui_print "- Preserving user config..." + + # A. Delete the default 'config' folder + rm -rf "$MODPATH/config" + + # B. Copy the user's clean config folder + cp -af "$LIVE_PATH/config" "$MODPATH/" fi -ui_print "-> $MODULE_NAME installation done!" -ui_print "-> Thanks for using this module.🙂" - -exit 0 \ No newline at end of file +ui_print "- Installation Done!" +ui_print "- Thanks for using this module.🙂"