Polidea / ios-class-guard

Simple Objective-C obfuscator for Mach-O executables.
http://www.polidea.com
1.64k stars 240 forks source link

Undefined symbol error #30

Open EricFowlerHTC opened 9 years ago

EricFowlerHTC commented 9 years ago

I am just getting started. Using the basic script tweaked slightly, I am getting this (after successfully building a million files).

Can anyone help with this?

Thanks

▸ Analyzing FOOLike.m

⌦ Undefined symbols for architecture arm64

Symbol: _OBJCCLASS$_c6r Referenced from: objc-class-ref in FOOFacebookFriendsConnector.o

⌦ ld: symbol(s) not found for architecture arm64

⌦ clang: error: linker command failed with exit code 1 (use -v to see invocation)

⌦ Undefined symbols for architecture armv7

Symbol: _OBJCCLASS$_c6r Referenced from: objc-class-ref in FOOFacebookFriendsConnector.o

⌦ ld: symbol(s) not found for architecture armv7

⌦ clang: error: linker command failed with exit code 1 (use -v to see invocation)

\ BUILD FAILED **

marcinkiewiczblazej commented 9 years ago

Could you check what symbol hides under "c6r" in generated symbols header? If it's a symbol from external library you can add it manually to ignored symbols list.

EricFowlerHTC commented 9 years ago

Cool. Can I exclude the whole library?

Edit ... Eh, I see the doc page. Never mind.

-F '!UnresolvedClassName'

marcinkiewiczblazej commented 9 years ago

If it's using class prefix you can add option -F '!PREFIX*'.

EricFowlerHTC commented 9 years ago

Floundering forward .... I fixed all the KVO issues I could find, and now when I run it I get an exception, with this report:

*\ Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<g3z 0x17697f50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dataSourceType.'

g3z points at one of my nibs: it's a table view class in one of my storyboards.

I could live without obscuring my table views.

What is the shortcut here?

BTW, is it appropriate to use this forum to request support? It looks like mostly bug reporting.

Eric

marcinkiewiczblazej commented 9 years ago

Try -X option. This should also obfuscate your XIBs and storyboards.

EricFowlerHTC commented 9 years ago

I am now getting a crash:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FOOClipProgressBar 0x16e3f890> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key a9z.'

The line that is choking is:

My file looks like this:

Obfuscate project

ios-class-guard \ --sdk-root "$SDKDIR" \ -O symbols.h \ -F '!FB' \ -F '!FOOView' \ -F '!FooClipPickerHeader_' \ -F '!FOOEClipBar' \ -i 'FOOClipProgressBar' \ -i 'status' \ -i '_fflineBlock' \ -i 'ignoreNetworkError' \ -i 'loaded' \ -i '_umberOfSelectedClips' \ -i 'theme' \ -i '_electedClipsLabel' \ -i '_uration*Label' \ build/$CONFIGURATION-$OBFUSCATION_SDK/$TARGET.app/$TARGET

Notice I am excluding FOOClipProgressBar.

So it looks as though that nib references something that has been obfuscated, or vice-versa. When I open the nib, I see a view that has certain outputs and a9z is one of them. I have methodically added every property and UIAction target possessed by this class on the RHS of -i or -F expressions in the obfuscation script but that has not worked.

What am I doing wrong?

How can I exclude my nibs/xibs?

Eric

EricFowlerHTC commented 9 years ago

Eh, just noticed this was already answered ... sorry about the spam.