Skip to content

(hook)绕过 Surge 安全机制!模拟许可证检查和其他授权功能,激活。

Notifications You must be signed in to change notification settings

melonDiary/surge_pxx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

101 Commits
 
 
 
 
 
 
 
 

Repository files navigation


截图内容 只是介绍!不是最终版本




终端执行 克隆 Theos 仓库
git clone --recursive https://github.com/theos/theos.git

将 Theos 的路径添加到环境变量中:
方法一:
终端执行 直接添加到 ~/theos

export THEOS=~/theos
export PATH=$THEOS/bin:$PATH

终端执行 重新 加载配置:
source ~/.zshrc

另一种方法:
终端执行 打开配置文件 .zshrc
nano ~/.zshrc

# Theos 配置  // theos文件夹 的本地路径
export THEOS=/Users/pxx917144686/theos     

之后;contron + X 是退出编辑; 按‘y’ 保存编辑退出!

终端执行 重新 加载配置:
source ~/.zshrc

Preview


👉 如果 theos 报错:ld: warning: -multiply_defined is obsolete
theos报错 解释
报错 ld: warning: -multiply_defined is obsolete
解释 为什么会出现这个问题?
原因 新版本的 Apple 链接器 (ld64) 不再推荐使用 -multiply_defined;Theos 为了兼容旧版本 iOS,才默认加入该选项。
解决 在文件 theos/makefiles/targets/_common/darwin_tail.mk 打开文件,搜索找到并删除 -multiply_defined suppress

👉 如果 make 报错:found architecture 'x86_64', required architecture(我保留了 静态引用 OpenSSL 库 其实可以去除 )
make报错 解释
报错 warning: ignoring file '/usr/local/Cellar/openssl@3/3.4.0/lib/libcrypto.3.dylib': found architecture 'x86_64', required architecture 'arm64e'
解释 英特尔的Mac x86_64 不匹配架构 OpenSSL 库。
检查 Mac 架构检查:
- 在终端执行 uname -m
- 输出 x86_64 表示 Intel Mac
- 输出 arm64 表示 Apple Silicon Mac
解决(Intel x86_64 方法) 避免耽误时间精力!网络指导可能产生误导,把 Intel (x86_64) 的方法误导为适用于 arm64 的方法。使用 Intel Mac 编译 iOS 插件时,目标架构应为 arm64arm64e
步骤一:下载 OpenSSL 官方源代码 - 在终端执行:git clone https://github.com/openssl/openssl.git
- 进入目录:cd openssl
步骤二:设置环境变量 - 执行:export PLATFORM="iPhoneOS"
- 执行:export SDK=$(xcrun --sdk iphoneos --show-sdk-path)
- 执行:export CC="$(xcrun --sdk iphoneos -f clang)"
设置支持多个架构 - 执行:export ARCHS="arm64 arm64e"
- 执行:export CFLAGS="-arch arm64 -arch arm64e -isysroot $SDK -miphoneos-version-min=14.0"
- 执行:export LDFLAGS="-arch arm64 -arch arm64e -isysroot $SDK"
配置 OpenSSL 编译 执行:./Configure ios64-cross no-shared no-dso no-hw no-engine --prefix=$(PWD)/../openssl-ios
步骤三:编译 OpenSSL - 清理缓存:make clean
- 编译 OpenSSL:make
- 安装 OpenSSL 到指定目录:make install
验证编译结果 在终端执行:
- lipo -info ../openssl-ios/lib/libcrypto.a
- lipo -info ../openssl-ios/lib/libssl.a
成功的输出应显示:arm64 arm64e

About

(hook)绕过 Surge 安全机制!模拟许可证检查和其他授权功能,激活。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Logos 98.2%
  • Makefile 1.8%