Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find source of class symbols in binary

I have an interesting problem. I'm getting crash logs referencing a class called NRURLProtocol in my app (specifically in the file NRURLProtocol.m), that according to the crash log exists in my app and not in an iOS framework for instance. However, there is no NRURLProtocol class in my project nor any NRURLProtocol.m file. A search online via Google or StackOverflow turns up literally 0 references to this class.

If I run the following command on my binary:

otool -o binary | grep NR

I find various classes with the NR prefix, including NRURLProtocol. However, when I use the same otool command on all static libraries that my binary links with, I find nothing. I find no file called NRURLProtocol.m on my drive.

I'm at a bit of a loss as to how to track this down. Not only does this class exist in my binary, but it's being loaded as a URL Protocol by something. So it would seem that some 3rd party library I'm using includes it, even though otool finds nothing.

Here's a full list of classes with the NR prefix that appear in my binary:

NRASIRequestTracker
NRASISupport
NRErrorData
NRLogger
NRNonARCMethods
NRSecureUDID
NRStats
NRStatsEngine
NRSupportability
NRTransactionData
NRURLProtocol
NRNSURLSupport

Here are all of the 3rd party static libraries I'm linking to:

Facebook SDK
HockeyApp SDK
ZipKit
Mixberry SDK (though not actually using it anywhere, currently disabled)
Flurry SDK
Google AdMob SDK
HelpShift SDK
UrbanAirship SDK
libBass (audio library, doesn't contain Objective-C code)
EX2Kit (my own toolkit library, which doesn't contain this code)

Does anyone have any clue where these classes are coming from, or what other commands I can try?

like image 202
Ben Baron Avatar asked Oct 16 '13 19:10

Ben Baron


1 Answers

Found it! Somehow I missed the fact that we use NewRelic's SDK as well. Which should have been obvious given the NR prefix. otool quickly showed that the offending classes are there.

like image 111
Ben Baron Avatar answered Sep 30 '22 10:09

Ben Baron