在手机管家类软件中,需要解析apk软件包,可以使用如下代码片段:
PackageManager packageManager = getPackageManager(); String path = "Your apk‘s filepath "; PackageInfo packageInfo = PM.getPackageArchiveInfo(path, 1); if(info != null) { info.applicationInfo.sourceDir = path; info.applicationInfo.publicSouceDir = path; String appName = info.applicationInfo.loadLabel(PM).toString(); }