Skip to content

Commit bd2c5d7

Browse files
committed
fix(propclean): preserve running ROM's own properties from hexpatch
hexpatch_deleteprop was wiping all properties matching fingerprint substrings (e.g. "crdroid"), including ro.crdroid.build.version which crDroid needs for its About screen and OTA updater. Auto-detect the running ROM by checking for ro.<fingerprint>* props before wiping. Also adds --debug flag to package.sh for unstripped debug builds.
1 parent 3882264 commit bd2c5d7

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

package.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# Package TA_enhanced module ZIP
3-
# Usage: ./package.sh [--no-build] [--webui] [--no-bump] [--clean] [output_dir]
3+
# Usage: ./package.sh [--no-build] [--debug] [--webui] [--no-bump] [--clean] [output_dir]
44
#
55
# Single entry point for producing a release:
66
# 1. Cross-compiles ta-enhanced for both ABIs (via rust/build.sh)
@@ -16,11 +16,13 @@ DO_BUILD=true
1616
DO_WEBUI=false
1717
DO_BUMP=true
1818
DO_CLEAN=false
19+
BUILD_PROFILE=release
1920
OUT_DIR=""
2021

2122
while [ $# -gt 0 ]; do
2223
case "$1" in
2324
--no-build) DO_BUILD=false ;;
25+
--debug) BUILD_PROFILE=debug ;;
2426
--webui) DO_WEBUI=true ;;
2527
--no-bump) DO_BUMP=false ;;
2628
--clean) DO_CLEAN=true ;;
@@ -69,7 +71,7 @@ fi
6971
if [ "$DO_BUILD" = true ]; then
7072
echo ""
7173
echo "=== Cross-compiling Rust binary ==="
72-
bash "$REPO_DIR/rust/build.sh" release
74+
bash "$REPO_DIR/rust/build.sh" "$BUILD_PROFILE"
7375
fi
7476

7577
if [ "$DO_WEBUI" = true ]; then

propclean.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,22 @@ _PROP_FAIL_COUNT=0
1212

1313
_log "INFO" "Property cleanup starting"
1414

15+
# Snapshot all props once — used for own-ROM detection below
16+
_all_props=$(getprop)
17+
1518
FINGERPRINT_FILE="$MODPATH/common/rom-fingerprints.txt"
1619
if [ -f "$FINGERPRINT_FILE" ]; then
1720
fingerprints=""
1821
while IFS= read -r line; do
1922
case "$line" in \#*|"") continue ;; esac
23+
# Don't wipe props belonging to the running ROM — breaks version display, OTA, etc.
24+
if echo "$_all_props" | grep -qi "^\[ro\.${line}"; then
25+
_log "INFO" "Preserving own ROM props: $line"
26+
continue
27+
fi
2028
fingerprints="$fingerprints $line"
2129
done < "$FINGERPRINT_FILE"
2230
if [ -n "$fingerprints" ]; then
23-
# word splitting intentional — each fingerprint is a separate argument
2431
# shellcheck disable=SC2086
2532
hexpatch_deleteprop $fingerprints
2633
fi

0 commit comments

Comments
 (0)