From 5cb50ca9615b92f141cbd6defaf4ed9dfcb88028 Mon Sep 17 00:00:00 2001 From: marlkiller Date: Sat, 7 Sep 2024 20:38:13 +0800 Subject: [PATCH] fix: script fixes #28 (cherry picked from commit 796502f6e7b987c653f9cb478c8d2644cc5b3bf2) --- script/all_in_one.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/script/all_in_one.sh b/script/all_in_one.sh index db6de10..0767868 100644 --- a/script/all_in_one.sh +++ b/script/all_in_one.sh @@ -26,10 +26,18 @@ check_dylib_exist() { return 1 } + +# If SIP is on, re-sign the app and fix the helper file (if the app has a helper); refer to `forklift_hack.sh`; function resign_app() { - sudo codesign --remove-signature "$1" >/dev/null 2>&1 - sudo xattr -cr "$1" >/dev/null 2>&1 - sudo codesign -f -s - --timestamp=none --all-architectures --deep "$1" >/dev/null 2>&1 + sudo xattr -cr "$1" + echo -e "${GREEN}🔍 Checking code signature before re-signing${NC}" + sudo codesign -d -r- "$1" + + echo -e "${GREEN}🔏 Re-signing ${app_name}...${NC}" + sudo codesign -f -s - --all-architectures --deep "$1" + + echo -e "${GREEN}🔍 Checking code signature after re-signing${NC}" + sudo codesign -d -r- "$1" } BUILT_PRODUCTS_DIR="${current_path}/../release" @@ -64,7 +72,7 @@ printf "${RED}⛔️ Checking the insert_dylib quarantine status...${NC}\n" xattr "${insert_dylib}" "${insert_dylib}" --weak --all-yes "@rpath/${prefix}${dylib_name}.dylib" "$app_executable_backup_path" "$app_executable_path" -printf "${GREEN}✅ [${app_name}] - dylib_dobby_hook Injection completed successfully.${NC}\n" resign_app "/Applications/${app_name}.app" -printf "${GREEN}✅ [${app_name}] - Resigned successfully.${NC}\n" +printf "${GREEN}🔧 [${app_name}] - Resigned.${NC}\n" +printf "${GREEN}✅ [${app_name}] - dylib_dobby_hook Injection completed successfully.${NC}\n"