您的位置:首页 > 移动开发 > IOS开发

iOS中llvm-Obfuscation的配置

2016-01-23 15:37 711 查看
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文件,
<string>com.apple.compilers.clang</string> 改为 <string>com.apple.compilers.obfuscator</string>
<string>Clang LLVM 1.0 Compiler Xcode Plug-in</string> 改为 <string>Obfuscator Xcode Plug-in</string>

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

然后输入命令
$ 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)



更改other c flags或者c++:



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

投资自己,让自己升值!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: