0

我目前正在使用nm -ufm获取库文件中的导入列表。但是,对于objective-c 符号,我似乎只得到了导入的类定义。例如,其中一部分导入的符号libGoogleAdMobAds.a是:

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

其中列出了一堆objective-c类,但我想确切地知道正在调用哪些方法。

我对objective-c方法调用的实现细节不是很了解(请原谅我,我的意思是“消息传递”),但由于我也看到了一个导入的_objc_msgSend,这是否意味着调用在运行时通过名称解析,使用某种反思?

无论如何,是否可以获得库使用的实际方法的列表?

注意:应该是可以的,因为苹果可以。我正在调查一个 iOS 应用程序因使用 的uniqueIdentifier方法而被拒绝,但是按照这里建议的方式UIDevice做一个简单的方法太模糊了,因为字符串可以是任何东西,包括文件中的字符串资源,我想用一份更实质性的报告来证实我得到的信息,比如来自.grepgrepnm

4

0 回答 0