我有一个应用程序二进制文件,我想知道它是针对 iOS 5.x、6.x 还是 7.0 SDK 编译的。有可能解决这个问题吗?
最佳答案
提取 IPA 并使用 MachOView打开二进制文件 (Payload/appname.app/appname)。在左侧打开 Load Commands -> LC_VERSION_MIN_IPHONEOS
右边应该有四个字段。
来自 iPhone SDK 中的 usr/include/mach-o/loader.h,
/*
* The version_min_command contains the min OS version on which this
* binary was built to run.
*/
struct version_min_command {
uint32_t cmd; /* LC_VERSION_MIN_MACOSX or
LC_VERSION_MIN_IPHONEOS */
uint32_t cmdsize; /* sizeof(struct min_version_command) */
uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
};
此处的“版本”字段指定应用所需的最低 iOS 版本。 “保留”字段指定编译应用程序所针对的 SDK。使用上述结构解码SDK版本。
关于iOS - 是否可以判断应用程序二进制文件是针对哪个 Base SDK 编译的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19934426/