Reputation: 1349
Is it possible to get any information about the package or the application from the apk file without installing it in the Android environment?
Upvotes: 22
Views: 49474
Reputation: 5624
Check out this method from the PackageManager class:
public PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags)
Retrieve overall information about an application package defined in a package archive file
Might be helpful for you ;)
Upvotes: 23
Reputation: 1007369
unzipping and converting AndroidManifest.xml from binary form isn't the best way (IMHO)
You act like you have an option. You don't, if all you have is the APK. The only solution, if all you have is the APK file, is based on what Sam pointed out.
Of course, you can publish your metadata in a separate file alongside your APK, wherever you are getting your APK from (e.g., Web server).
Upvotes: 2
Reputation: 2709
An apk file is really just a zip archive with a different name. Rename x.apk to x.zip, where x is the name of the file, and you will be able to open it with any zip tool. It really depends on what information you're after as to whether you can find it in the apk file. I can say that you can access the AndroidManifest.xml file in which key information about the access rights of the app etc is stored in a fairly readable form, provided you know what you're looking for. What do you want to find? If you're looking for a readme or something then you almost certainly won't find it in there.
Upvotes: 8