From 1f3c1e960aa15fb845125c42b62e8f3ed5564a0a Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Mon, 18 Nov 2024 18:56:07 +0800 Subject: [PATCH] Migrate boot hash to /data/adb prevent ksu/apatch overwrite --- module/install_func.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/install_func.sh b/module/install_func.sh index fb639ad..8aa740c 100644 --- a/module/install_func.sh +++ b/module/install_func.sh @@ -69,18 +69,20 @@ find_config() { } migrate_old_boot_hash() { - if [ ! -f "$ORG_DIR/boot_hash" ]; then - mv "$COMPATH/boot_hash" "$MODPATH/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" else rm -f "$COMPATH/boot_hash" - mv "$ORG_DIR/boot_hash" "$MODPATH/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" >> "$MODPATH/boot_hash" + echo -e "\n$hash_value" >> "/data/adb/boot_hash" fi fi }