Get APK basic info in Android

Source: Internet
Author: User

A packagemanager can get all the packet node information:
1, base class for all nodes: Packageiteminfo;
2,packageinfo:package's comprehensive information, consistent with all information in the Androidmanifest.xml;
3,applicationinfo: Associated application-specific information, consistent with the application node in the manifest;
4,activityinfo: Information associated with activity or receiver, consistent with the nodes in the list;
5,serviceinfo: The information associated with the service, consistent with the service node in the list;
6,providerinfo: Preservation of contentprovider information;
7,resolveinfo: Consistent with the intent node in the manifest, it can be used to obtain the component information on the intent layer.

Two get basic information about the apps installed on your phone:
1, obtained PackageInfo:pm.getInstalledPackages (packagemanager.get_uninstalled_packages);
2, Get package name: Packageinfo.packagename;
3, get version number: Packageinfo.versioncode;
4, obtain ApplicationInfo:packageInfo.applicationInfo;
5, get APK installation path: Applicationinfo.publicsourcedir;

Three get the APK signature file:
After obtaining the APK path, the ZipFile and ZipEntry APIs are available to get the APK's three signature files, and the names of the three files are: Meta-inf/manifest. MF, Meta-inf/cert. SF and Meta-inf/cert. Rsa.

Get APK basic info in Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.