0

I am currently using nm -ufm to get the list of imports in a library file. However, for objective-c symbols, I only seem to be getting the imported class definitions. For example, a part of the imported symbols in libGoogleAdMobAds.a are:

libGoogleAdMobAds.a(GADIdentifierUtilities.o) (for architecture i386):
         (undefined) weak external _CC_MD5
         (undefined) external _CFBundleGetInfoDictionary
         (undefined) external _CFBundleGetMainBundle
         (undefined) external _CFDictionaryGetValue
         (undefined) external _NSSearchPathForDirectoriesInDomains
         (undefined) external _OBJC_CLASS_$_GADNumberUtilities
         (undefined) external _OBJC_CLASS_$_NSArray
         (undefined) external _OBJC_CLASS_$_NSBundle
         (undefined) external _OBJC_CLASS_$_NSData
         (undefined) external _OBJC_CLASS_$_NSDictionary
         (undefined) external _OBJC_CLASS_$_NSMutableDictionary
         (undefined) external _OBJC_CLASS_$_NSMutableString
         (undefined) external _OBJC_CLASS_$_NSNumber
         (undefined) external _OBJC_CLASS_$_NSObject
         (undefined) external _OBJC_CLASS_$_NSPropertyListSerialization
         (undefined) external _OBJC_CLASS_$_NSString
         (undefined) external _OBJC_CLASS_$_NSURL
         (undefined) external _OBJC_CLASS_$_NSUserDefaults
         (undefined) external _OBJC_CLASS_$_UIApplication
         (undefined) external _OBJC_CLASS_$_UIDevice
         (undefined) external _OBJC_CLASS_$_UIScreen
         (undefined) external _OBJC_EHTYPE_$_NSException
         (undefined) external _OBJC_METACLASS_$_NSObject
         (undefined) external __Unwind_Resume_or_Rethrow
         (undefined) external ___CFConstantStringClassReference
         (undefined) external ___objc_personality_v0
         (undefined) external __objc_empty_cache
         (undefined) external __objc_empty_vtable
         (undefined) external _kCFBundleVersionKey
         (undefined) external _kGADParameterApplicationName
         (undefined) external _kGADParameterAudioOutput
         (undefined) external _kGADParameterBaseSdkVersion
         (undefined) external _kGADParameterCapabilitiesBookstore
         (undefined) external _kGADParameterDeviceID
         (undefined) external _kGADParameterDeviceModel
         (undefined) external _kGADParameterDeviceSubmodel
         (undefined) external _kGADParameterIPadCompatibilityMode
         (undefined) external _kGADParameterITunesMetadata
         (undefined) external _kGADParameterJailbroken
         (undefined) external _kGADParameterLocale
         (undefined) external _kGADParameterScreenDensity
         (undefined) external _kGADParameterScreenHeight
         (undefined) external _kGADParameterScreenOrientation
         (undefined) external _kGADParameterScreenWidth
         (undefined) external _objc_begin_catch
         (undefined) external _objc_end_catch
         (undefined) external _objc_enumerationMutation
         (undefined) external _objc_msgSend
         (undefined) external _objc_msgSendSuper2
         (undefined) external _objc_msgSend_fpret
         (undefined) external _objc_msgSend_stret
         (undefined) external _strlen
         (undefined) external _uname

Which lists a bunch of objective-c classes, but I would like to know exactly which methods are being called.

I am not very knowledgeable in the implementation details of objective-c method calls (pardon me, I meant "message passing"), but since I'm also seeing an imported _objc_msgSend, does this mean that calls are resolved at runtime by name, using some kind of reflection?

Regardless, is it possible to get a list of the actual methods used by a library?

Note: it should be possible, because Apple can. I'm investigating a rejection I had for an iOS app for using the uniqueIdentifier method of UIDevice, but doing a simple grep as suggested here is way too vague, as the string can be anything, including a string resource inside the file, and I would like to corroborate the information I got with grep with a more substantial report, like the one from nm.

Community
  • 1
  • 1
Panda Pajama
  • 1,283
  • 2
  • 13
  • 31
  • 1
    try `otool -v -s __TEXT __objc_methname libGoogleAdMobAds.a` – Kevin Jul 30 '13 at 03:25
  • @Kevin well that is much closer. That shows me the names of the methods called, but doesn't show for which classes each name is used. This is however, enough for my purposes. – Panda Pajama Jul 30 '13 at 05:53

0 Answers0