3

ジェイルブレイクされた iOS 6.x デバイスでアプリの作成者 (または開発者や発行者など) を取得するにはどうすればよいですか? iOS 4.x および 5.x では、クラスauthorにメンバーがありました。SBApplicationしかし、iOS 6.1 ではNSUnknownKeyException、作成者をリクエストすると が表示されるようになりました。オンラインの iOS 6 クラス ダンプから SBApplication.h をざっと見ても、有望なものは何も示されませんでした (ただしsignerIdentity、それは別のことです)。ファイルを掘り下げずに、これを取得する簡単な方法はありInfo.plistますか?

更新:Info.plistファイルには実際にはこの情報も含まれていません。一方iTunesMetadata.plist、ファイルにはありますが、System/Cydia アプリにはこのファイルがありません。

4

1 に答える 1

1

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 ...

于 2013-02-06T21:52:19.277 に答える