- 查看可用证书
security find-identity -v -p codesigning
localhost:~ zhangheng$ security find-identity -v -p codesigning
1) 15BD477C29A3E624XXXXXXXXXXXXXXXXXXX "iPhone Developer: 恒 张 (Q262893UMK)"
1 valid identities found
- 从embedded.mobileprovision文件里提取entitlements权限文件
#在embedded.mobileprovision文件目录
localhost:Desktop zhangheng$ security cms -D -i embedded.mobileprovision > temp.plist
localhost:Desktop zhangheng$ /usr/libexec/Plistbuddy -x -c'Print:Entitlements' temp.plist > entitlements.plist
localhost:Desktop zhangheng$
3.对app进行签名
codesign -fs 15BD477C29A3E624XXXXXXXXXXXXXXXXXXX --entitlements entitlements.plist jiuwen-lawyer
- 对动态库进行签名
codesign -fs 15BD477C29A3E624XXXXXXXXXXXXXXXXXXX xxx.dylib
localhost:jiuwen-lawyer.app zhangheng$ security find-identity -v -p codesigning
1) 15BD477C29A3E624XXXXXXXXXXXXXXXXXXX "Apple Development: 恒 张 (Q262893UMK)"
2) 15BD477C29A3E624XXXXXXXXXXXXXXXXXXX "iPhone Developer: 恒 张 (Q262893UMK)"
2 valid identities found
localhost:jiuwen-lawyer.app zhangheng$ codesign -fs 15BD477C29A3E624XXXXXXXXXXXXXXXXXXX CydiaSubstrate
CydiaSubstrate: replacing existing signature
localhost:jiuwen-lawyer.app zhangheng$ codesign -fs 15BD477C29A3E624XXXXXXXXXXXXXXXXXXX tweakjiuwen.dylib
tweakjiuwen.dylib: replacing existing signature
localhost:jiuwen-lawyer.app zhangheng$
- insert_dylib
- 下载链接
https://github.com/Tyilo/insert_dylib
- 生成执行文件copy到
/usr/local/bin
目录下- 更改动态库的加载路径
install_name_tool -change 旧地址 新地址 Mach-O文件
- 常用的环境变量
3.1@executable_path
代表执行文件所在的目录
3.2@loader_path
代表动态库所在的目录
localhost:就问 zhangheng$ cd jiuwen-lawyer.app/
localhost:jiuwen-lawyer.app zhangheng$ insert_dylib @executable_path/tweakjiuwen.dylib jiuwen-lawyer --all-yes --weak jiuwen-lawyer
jiuwen-lawyer already exists. Overwrite it? [y/n] y
LC_CODE_SIGNATURE load command found. Remove it? [y/n] y
Added LC_LOAD_WEAK_DYLIB to jiuwen-lawyer
localhost:jiuwen-lawyer.app zhangheng$ install_name_tool -change /Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate @loader_path/CydiaSubstrate tweakjiuwen.dylib
localhost:jiuwen-lawyer.app zhangheng$
网友评论