An IPA file is a ZIP file, so the first thing you need to do is extract this file.
After unzip IPA file, we will get a folder named Payload
, and a file with extension app
will be stored in folder Payload
,
maybe this app named is xxxx.app, and info.plist
we can located in this app xxxx.app, the path related to folder Payload should be Payload/xxxx.app/info.plist.
// parse info.plist
File plistFile = new File(plistFilePath);
NSDictionary rootDict = null;
try {
rootDict = (NSDictionary) PropertyListParser.parse(plistFile);
// get bundle id
NSString parameter = (NSString) rootDict.objectForKey("CFBundleIdentifier");
ipaInfo.put("CFBundleIdentifier", parameter.toString());
// get application name
parameter = (NSString) rootDict.objectForKey("CFBundleName");
ipaInfo.put("CFBundleName", parameter.toString());
// get version
parameter = (NSString) rootDict.objectForKey("CFBundleVersion");
ipaInfo.put("CFBundleVersion", parameter.toString());
// get bundle display name
parameter = (NSString) rootDict.objectForKey("CFBundleDisplayName");
ipaInfo.put("CFBundleDisplayName", parameter.toString());
// get ios mini. version
parameter = (NSString) rootDict.objectForKey("MinimumOSVersion");
ipaInfo.put("MinimumOSVersion", parameter.toString());
} catch (Exception e) {
e.printStackTrace();
}