Search code examples
iphoneobjective-cios6jailbreak

retrieve app's author - jailbreak iOS 6


How can I retrieve an app's author (or developer or publisher, etc) on a jailbroken iOS 6.x device? In iOS 4.x and 5.x, there was an author member in the SBApplication class. But in iOS 6.1 I now get an NSUnknownKeyException when requesting the author. A quick look at SBApplication.h from a iOS 6 class dump online didn't show anything promising (except signerIdentity, but that's something else). Is there any easy way to get this, without digging around in any Info.plist files?

Update: The Info.plist files actually don't contain this information either. The iTunesMetadata.plist file on the other hand does, but System/Cydia apps don't have this file.


Solution

  • I haven't yet jailbroken my iOS 6 device or run class-dump on all the iOS 6 frameworks, so I can't tell you if there's another private API to do exactly what you used to be able to do.

    Your suggestion about inspecting the contents of app folders (e.g. /var/mobile/Applications/*/*.app/) and reading the iTunesMetadata.plist files sounds reasonable. Reading each app's Info.plist would also give you the CFBundleIdentifier, which would normally at least contain the publisher's domain name (e.g. com.mycompany.MyAppName).

    For apps that don't come from the app store (and don't have iTunesMetadata.plist), you could try another technique (in addition to reading Info.plist):

    Cydia packages are maintained with dpkg utilities. You can list all installed packages with the command dpkg -l. You can invoke this command either with

    system("dpkg -l >> /tmp/output.log 2>&1");
    

    piping the output into a temporary file, or with NSTask. NSTask is part of OS X APIs, and is not in the iOS public APIs. But, if you add the NSTask.h header to your project yourself, you can certainly use it as a private API in a non-App Store app, to run a command and capture output programmatically.

    At the command line, running dpkg -l would give you:

    ii  libhide                                        2.1                                            Library to hide icons. If you are a developer wanting to use this library, code samples included in /usr/lib
    ii  libxml2-lib                                    2.6.32-3                                       represents the library for libxml2
    ii  lsof                                           33-4                                           shows what files programs have open
    ii  lzma                                           4.32.7-4                                       slower, but better, compression algorithm
    ii  make                                           3.81-2                                         dependency-based build environments
    ii  mobilesubstrate                                0.9.3999.1                                     powerful code insertion platform
    ri  ncurses                                        5.7-12                                         feature-complete terminal library
    ii  network-cmds                                   307.0.1-6                                      arp, ifconfig, netstat, route, traceroute
    

    so, your app could parse that output, to read package names from the second column.

    Then, you could use the apt-cache show command to get the information from the package's DEBIAN/control file, which would have something like this:

    iPhone-3G:~ root# apt-cache show sqlite3
    Package: sqlite3
    Version: 3.5.9-12
    Architecture: iphoneos-arm
    Maintainer: Jay Freeman (saurik) <saurik at saurik dot com>
    Installed-Size: 348
    Pre-Depends: dpkg (>= 1.14.25-8)
    Depends: sqlite3-lib
    Replaces: sqlite3 (<= 3.5.9-11)
    Filename: debs/sqlite3_3.5.9-12_iphoneos-arm.deb
    Size: 71928
    MD5sum: 6d47c112692ac00af61bd84e3847aa42
    Section: Data_Storage
    Priority: standard
    Description: embedded database used by iPhoneOS
    Name: SQLite 3.x
    Tag: purpose::library, role::developer
    

    I know this is more work than just using author from SBApplication, but maybe it's good enough? Hopefully, some one else will chime in with another answer ...