How to parse Info.plist file from ipa

I want to write a program to get application details like. application name, version, package ID, from ipa. However, this file is not a simple text file, it is encoded in some way and my program cannot parse it.

Is there a way to decode this file?

UPDATE

To clarify the matter, I am writing a python program to get application information from the ipa files that I exported from Xcode.

+4


source to share


5 answers


For those who don't have Apple developer logins, here are two answers from the accepted answer link (you need to log in to see it):



  • use PlistBuddy

    • /usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" yourBinaryOrXmlPlist.plist

  • There are many other ways to parse plist binaries as well. For example, I am using Python, and there is a library called biplist that is exactly used to read and write binary plist files and supports both Python 2 and 3. Also, "plistlib" in Python 3.4 supports binary manipulation with new APIs. interfaces.
+3


source


My Python version: https://gist.github.com/noamtm/a8ddb994df41583b64f8

In my research, the tricky bit was parsing a binary plist as python PlistLib can't read it:



from Foundation import NSData, NSPropertyListSerialization 
# Use PyObjC, pre-installed in Apple Python dist.
def parse_plist(info_plist_string):
  data = NSData.dataWithBytes_length_(info_plist_string, len(info_plist_string))
  return NSPropertyListSerialization.propertyListWithData_options_format_error_(data, 0, None, None)

      

+1


source


It's easy if you have a MacBook.
Then follow this recommendation: http://osxdaily.com/2011/04/07/extract-and-explore-an-ios-app-in-mac-os-x/

  1. Rename from file.ipa -> file.zip
  2. Unpack the .zip file
  3. Go to the "Payload" folder
  4. Right Click Application File -> Show Package Contents
  5. .See Info.plist
+1


source


Got a response from the Apple Developer Forum:

PlistBuddy is what you are looking for:

/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" yourBinaryOrXmlPlist.plist

0


source


Double clicking on the list will open from Xcode.

0


source







All Articles