iOS中llvm-Obfuscation的配置

llvm-obfuscator3.6.1的下载地址: https://github.com/obfuscator-llvm/obfuscator/tree/llvm-3.6.1

也可以执行命令来下载

$ git clone -b llvm-3.6.1 https://github.com/obfuscator-llvm/obfuscator.git
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE:String=Release ../obfuscator/
$ make -j5
首先我的Xcode版本是6.3.2

1.Xcode6.3版本,obfuscator-llvm-3.6.1版本



2.执行命令

$ cd /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/              

进入Xcode6.3版本的该目录

如果是两个版本的Xcode,需要在Xcode.app时候确定选择Xcode6.3的版本,你可以通过ls来查看,我这边的命令是 Xcode\ 2.app 



到Xcode6.3的plug-ins目录下

输入命令

$ sudo cp -r Clang\ LLVM\ 1.0.xcplugin/ Obfuscator.xcplugin

$ sudo cp -r Clang\ LLVM\ 1.0.xcplugin/Obfuscator.xcplugin

$ cd Obfuscator.xcplugin/Contents/

$ sudo plutil -convert xml1 Info.plist

$ sudo vim Info.plist


编辑Info.plist文件,

com.apple.compilers.clang 改为 com.apple.compilers.obfuscator

Clang LLVM 1.0 Compiler Xcode Plug-in 改为 Obfuscator Xcode Plug-in 


以防万一,可以选择重新打开一次看看刚才的是否修改成功。




然后输入命令

$ sudo plutil -convert binary1 Info.plist

$ cd Resources/

$ sudo mv Clang\ LLVM\ 1.0.xcspec Obfuscator.xcspec

$ sudo vim Obfuscator.xcspec


编辑Obfuscator.xcspec文件

Identifier = "com.apple.compilers.llvm.clang.1_0"; 改为 Identifier = “com.apple.compilers.llvm.obfuscator.3_6_1”;

Name = "Apple LLVM 6.1"; 改为 Name = "Obfuscator 3.6.1”;

Description = "Apple LLVM 6.1 compiler"; 改为 Description = "Obfuscator 3.6.1”;

Vendor = Apple; 改为 Vendor = HEIG-VD;

Version = "5.0"; 改为 Version = “3.6.1”;

ExecPath = "clang"; 改为 ExecPath = “/path/to/obfuscator_bin/clang”;


此处clang路径为obfuscator3.6.1中clang的路径





然后输入命令

$ cd English.lproj/

$ sudo mv Apple\ LLVM\ 6.1.strings "Obfuscator 3.6.1.strings”  

$ sudo vim Obfuscator\ 3.6.1.strings 


编辑strings文件

"Name" = "Apple LLVM 5.0"; -> "Name" = "Obfuscator 3.6.1”;

"Description" = "Apple LLVM 5.0 Compiler"; -> "Description" = "Obfuscator 3.6.1”;

"Version" = "5.0"; -> "Version" = “3.6.1";

"Vendor" = "Apple"; -> "Vendor" = “HEIG-VD";


然后可以通过设置来完成效果:(选择Obfuscator3.6.1)

iOS中llvm-Obfuscation的配置_第1张图片

更改other c flags或者c++:

Xcode build settings



译自:https://github.com/obfuscator-llvm/obfuscator/wiki/Installation


投资自己,让自己升值!!!


你可能感兴趣的:(iOS中llvm-Obfuscation的配置)