fix error

This commit is contained in:
QiuChenly
2024-04-07 02:37:54 +08:00
parent 5787f265c1
commit e1c1466eca
8 changed files with 23 additions and 19 deletions

View File

@@ -104,14 +104,14 @@ fi
if [[ ! -e "../tool/insert_dylib" ]]; then
echo "⚠️ 确保上级tool目录中存在insert_dylib" && exit 1
fi
if [[ ! -e "../tool/Rel_QiuChenly.dylib" ]]; then
echo "⚠️ 确保上级tool目录中存在Rel_QiuChenly.dylib" && exit 1
if [[ ! -e "../tool/91QiuChenly.dylib" ]]; then
echo "⚠️ 确保上级tool目录中存在91QiuChenly.dylib" && exit 1
fi
chmod +x "../tool/insert_dylib"
sudo cp -f "../tool/Rel_QiuChenly.dylib" "/Applications/Surge.app/Contents/Frameworks/Rel_QiuChenly.dylib" || exit 1
sudo cp -f "../tool/91QiuChenly.dylib" "/Applications/Surge.app/Contents/Frameworks/91QiuChenly.dylib" || exit 1
sudo cp -f "/Applications/Surge.app/Contents/Frameworks/Bugsnag.framework/Versions/A/Bugsnag" "/Applications/Surge.app/Contents/Frameworks/Bugsnag.framework/Versions/A/Bugsnag_backup" || exit 1
sudo ../tool/insert_dylib "/Applications/Surge.app/Contents/Frameworks/Rel_QiuChenly.dylib" "/Applications/Surge.app/Contents/Frameworks/Bugsnag.framework/Versions/A/Bugsnag_backup" "/Applications/Surge.app/Contents/Frameworks/Bugsnag.framework/Versions/A/Bugsnag" || exit 1
sudo ../tool/insert_dylib "/Applications/Surge.app/Contents/Frameworks/91QiuChenly.dylib" "/Applications/Surge.app/Contents/Frameworks/Bugsnag.framework/Versions/A/Bugsnag_backup" "/Applications/Surge.app/Contents/Frameworks/Bugsnag.framework/Versions/A/Bugsnag" || exit 1
cd "${SCRIPT_DIR}/.." || exit 1
sudo bash ./tool/surgeAgent.sh

20
main.py
View File

@@ -199,16 +199,14 @@ def main():
subprocess.run(sh, shell=True)
sh = (
f"sudo {current.parent}/tool/optool install -p '{current.parent}/tool/Rel_QiuChenly.dylib' -t '{dest}'"
f"sudo {current.parent}/tool/optool install -p '{current.parent}/tool/91QiuChenly.dylib' -t '{dest}'"
if useOptool is not None
else f"sudo {current.parent}/tool/insert_dylib '{current.parent}/tool/Rel_QiuChenly.dylib' '{backup}' '{dest}'"
else f"sudo {current.parent}/tool/insert_dylib '{current.parent}/tool/91QiuChenly.dylib' '{backup}' '{dest}'"
)
if need_copy_to_app_dir:
source_dylib = f"{current.parent}/tool/Rel_QiuChenly.dylib"
destination_dylib = (
f"'{app_base_locate}{bridge_file}Rel_QiuChenly.dylib'"
)
source_dylib = f"{current.parent}/tool/91QiuChenly.dylib"
destination_dylib = f"'{app_base_locate}{bridge_file}91QiuChenly.dylib'"
subprocess.run(f"cp {source_dylib} {destination_dylib}", shell=True)
# shutil.copy(source_dylib, destination_dylib)
insert_command = rf"sudo cp '{dest}' /tmp/app && sudo {current.parent}/tool/optool install -p {destination_dylib} -t /tmp/app --resign && sudo cp /tmp/app '{dest}'"
@@ -253,10 +251,16 @@ def main():
if isinstance(tccutil, list):
for service in tccutil:
# print(f"处理 tccutil reset {service}")
subprocess.run(f"tccutil reset {service} {local_app['CFBundleIdentifier']}", shell=True)
subprocess.run(
f"tccutil reset {service} {local_app['CFBundleIdentifier']}",
shell=True,
)
else:
# print("处理 tccutil reset All")
subprocess.run(f"tccutil reset All {local_app['CFBundleIdentifier']}", shell=True)
subprocess.run(
f"tccutil reset All {local_app['CFBundleIdentifier']}",
shell=True,
)
print("App处理完成。")
except KeyboardInterrupt:

View File

@@ -182,10 +182,10 @@ def main
backup = Shellwords.escape(backup)
dest = Shellwords.escape(dest)
sh = "sudo #{current}/tool/insert_dylib #{current}/tool/Rel_QiuChenly.dylib #{backup} #{dest}"
sh = "sudo #{current}/tool/insert_dylib #{current}/tool/91QiuChenly.dylib #{backup} #{dest}"
unless needCopy2AppDir.nil?
system "sudo cp #{current}/tool/Rel_QiuChenly.dylib #{Shellwords.escape(appBaseLocate + bridgeFile)}Rel_QiuChenly.dylib"
sh = "sudo #{current}/tool/insert_dylib #{Shellwords.escape(appBaseLocate + bridgeFile)}Rel_QiuChenly.dylib #{backup} #{dest}"
system "sudo cp #{current}/tool/91QiuChenly.dylib #{Shellwords.escape(appBaseLocate + bridgeFile)}91QiuChenly.dylib"
sh = "sudo #{current}/tool/insert_dylib #{Shellwords.escape(appBaseLocate + bridgeFile)}91QiuChenly.dylib #{backup} #{dest}"
end
# puts sh
system sh

BIN
tool/91QiuChenly.dylib Executable file

Binary file not shown.

Binary file not shown.

View File

@@ -1,2 +1,2 @@
chmod +x tool/optool
tool/optool install -p /Applications/Setapp.app/Contents/Frameworks/Rel_QiuChenly.dylib -t /Applications/Setapp.app/Contents/Library/LaunchServices/Setapp.app/Contents/MacOS/SetappAgent --resign
tool/optool install -p /Applications/Setapp.app/Contents/Frameworks/91QiuChenly.dylib -t /Applications/Setapp.app/Contents/Library/LaunchServices/Setapp.app/Contents/MacOS/SetappAgent --resign

View File

@@ -9,7 +9,7 @@ main='/Applications/Autodesk/AutoCAD 2024/AutoCAD 2024.app/Contents/MacOS/AutoCA
sudo cp "$main" "$main.bak"
# 签名主程序
sudo $BASE_PATH/insert_dylib $BASE_PATH/Rel_QiuChenly.dylib "$main.bak" "$main"
sudo $BASE_PATH/insert_dylib $BASE_PATH/91QiuChenly.dylib "$main.bak" "$main"
# 修改通过服务器认证文件
helper='/Library/Application Support/Autodesk/AdskLicensing/13.3.0.9688/AdskLicensingAgent/AdskLicensingAgent.app/Contents/PlugIns/libadlmint.dylib'

View File

@@ -11,8 +11,8 @@ fi
# 把.bak覆盖原文件
sudo cp "$main.bak" "$main"
inject="$BASE_PATH/Rel_QiuChenly.dylib"
inject="/Users/qiuchenly/Library/Developer/Xcode/DerivedData/InjectLib-fyoxoytblilggjegbdnyoruvteuz/Build/Products/Debug/Rel_QiuChenly.dylib"
inject="$BASE_PATH/91QiuChenly.dylib"
inject="/Users/qiuchenly/Library/Developer/Xcode/DerivedData/InjectLib-fyoxoytblilggjegbdnyoruvteuz/Build/Products/Debug/91QiuChenly.dylib"
# 签名主程序
sudo "$BASE_PATH/insert_dylib" "$inject" "$main.bak" "$main"