Reputation: 725
I'm developing a static library and used Polidea's iOS Class Guard to obfuscate my static library. I followed the steps to download obfuscate_project in my project's root path, changed the required names inside, and finally run bash obfuscate_project in my terminal. I got a message saying that my build succeeded, but I couldn't find my symbols.h file. I also noticed that a build folder was generated. My question is, did obfuscation actually happen? If so, how do I check? Is the obfuscated project inside my build folder?
Upvotes: 0
Views: 641
Reputation: 1
Hey,don't know you have fixed this issue or not.I just met the same problem as yours today,and I found the cause accidentally ,all that because DerivedData file,this file expected to locate at /Users/'username'/Library/Developer/Xcode/DerivedData
by default,but in my project the DerivedData file is located at the root path of the project,and all my projects are the same. I guess this codewhile read app
in obfuscate_project 78 line is looking for app in DerivedData file through the default path,obviously it won't be found,so other code after this line isn't executed.
Follow these steps to change DerivedData file path: Xcode->Preferences->Locations, select 'Derived Data' option 'Default',and choose 'Unique' in 'Advanced',then delete DerivedData file in project finder,compile project,now run bash obfuscate_project
should be successful.
Upvotes: 0
Reputation: 1182
The documentation for PPiOS-Rename (a fork of iOS Class Guard) explains how to do it:
To verify that your app has been obfuscated, use the
nm
utility, which is included in the Xcode Developer Tools. Run:nm path/to/your/binary | less
This will show the symbols from your app. If you do this with an unobfuscated build, you will see the orginal symbols. If you do this with an obfuscated build, you will see obfuscated symbols.
Note that
nm
will not work properly after stripping symbols from your binary. You can use theotool
utility if you need to check for the Objective-C symbols after stripping.
otool
will show unneeded information, but it can be filtered usinggrep
andawk
to only show symbols:otool -o /path/to/your/binary | grep 'name 0x' | awk '{print $3}' | sort | uniq
Upvotes: 1