iamarnold
iamarnold

Reputation: 725

Polidea's iOS Class Guard successful, but can't tell the difference

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

Answers (2)

snail-x
snail-x

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 appin 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_projectshould be successful.

Upvotes: 0

Nathan Arthur
Nathan Arthur

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 the otool utility if you need to check for the Objective-C symbols after stripping.

otool will show unneeded information, but it can be filtered using grep and awk to only show symbols:

otool -o /path/to/your/binary | grep 'name 0x' | awk '{print $3}' | sort | uniq

Upvotes: 1

Related Questions