Skip to content

Commit 3f6e78b

Browse files
authored
Fixes critical installation failures observed on APatch and KernelSU, and cleans up redundant files.
### Changes included: 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. 4. **Removed Redundant Boot Scripts:** - Deleted `service.sh` and `post-fs-data.sh`. - These scripts contained legacy logic that is no longer required for this fork and caused confusion. **Status:** Tested and verified working on APatch and Magisk (Fresh Install & Upgrade scenarios).
1 parent ef88196 commit 3f6e78b

3 files changed

Lines changed: 19 additions & 44 deletions

File tree

module/customize.sh

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
#!/system/bin/sh
1+
#!/system/bin/sh
2+
# customize.sh - Safe Installer
23

3-
MODPATH=${0%/*}
4-
MODULE_NAME=targetedfix
5-
MODULE_PATH=/data/adb/modules/$MODULE_NAME
6-
UPDATE_PATH=/data/adb/modules_update/$MODULE_NAME
4+
# 1. Setup Variables
5+
# CRITICAL: Do NOT define MODPATH manually. Trust the Manager.
6+
MODID=targetedfix
7+
LIVE_PATH="/data/adb/modules/$MODID"
78

8-
ui_print "-> Installing $MODULE_NAME..."
9+
ui_print "- Installing TargetedFix..."
910

10-
# If old install exists = update/reinstall
11-
if [ -d "$MODULE_PATH/config" ]; then
12-
ui_print "-> Backing up user configs..."
13-
mkdir -p "$UPDATE_PATH/config"
14-
15-
for f in "$MODULE_PATH/config/"*; do
16-
[ -s "$f" ] && cp -af "$f" "$UPDATE_PATH/config/"
17-
done 2>/dev/null
11+
# 2. CONFIG RESTORATION
12+
# Check if config folder exists AND is not empty
13+
if [ -d "$LIVE_PATH/config" ] && [ "$(ls -A "$LIVE_PATH/config")" ]; then
14+
ui_print "- Preserving user config..."
15+
16+
# A. Delete the default 'config' folder
17+
rm -rf "$MODPATH/config"
18+
19+
# B. Copy the user's clean config folder
20+
cp -af "$LIVE_PATH/config" "$MODPATH/"
1821
fi
1922

20-
ui_print "-> $MODULE_NAME installation done!"
21-
ui_print "-> Thanks for using this module.🙂"
22-
23-
exit 0
23+
ui_print "- Installation Done!"
24+
ui_print "- Thanks for using this module.🙂"

module/post-fs-data.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

module/service.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)