-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathpost-fs-data.sh
More file actions
35 lines (29 loc) · 1.45 KB
/
post-fs-data.sh
File metadata and controls
35 lines (29 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/system/bin/sh
MODPATH="${0%/*}"
MODNAME="${MODPATH##*/}"
MAGISKTMP="$(magisk --path)" || MAGISKTMP=/sbin
if [ "$(magisk -V)" -lt 26302 ] || { [ -x /data/adb/ksud ] && [ "$(/data/adb/ksud -V)" -lt 10818 ]; }; then
touch "$MODPATH/disable"
fi
# Using util_functions.sh
[ -f "$MODPATH/util_functions.sh" ] && . "$MODPATH/util_functions.sh" || abort "! util_functions.sh not found!"
# Cleanup and replacements (avoiding duplicates with service.sh)
for prop in $(getprop | grep -E "lineage|aosp_|eng.|dev-keys|test-keys|userdebug" | cut -d ":" -f 1 | tr -d '[]'); do
replace_value_resetprop "$prop" "lineageos." ""
replace_value_resetprop "$prop" "lineage_" ""
replace_value_resetprop "$prop" "aosp_" ""
replace_value_resetprop "$prop" "eng." ""
replace_value_resetprop "$prop" "dev-keys" "release-keys"
replace_value_resetprop "$prop" "test-keys" "release-keys"
replace_value_resetprop "$prop" "userdebug" "user"
done
# Process prefixes (optimized to avoid redundant checks)
for prefix in system vendor system_ext product oem odm vendor_dlkm odm_dlkm bootimage; do
# Check and reset properties only once per prefix
check_resetprop "ro.${prefix}.build.tags" release-keys
check_resetprop "ro.${prefix}.build.type" user
# Replace values in all relevant properties
for prop in ro.${prefix}.build.description ro.${prefix}.build.fingerprint ro.product.${prefix}.name; do
replace_value_resetprop "$prop" "aosp_" ""
done
done