我可以得到安装的应用程序的手机APK文件 [英] Can I get APK file on phone of the installed applications
本文介绍了我可以得到安装的应用程序的手机APK文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图发展用于备份文件的应用程序。我需要提取安装的应用程序的APK文件,例如天文管理者做的。
I am trying to develop a application for backing up the files. I need to extract the APK files of installed applications like the Astro manager does.
如果有谁知道如何提取,请给我的解决方案。
If anyone know how to extract please give me the solution.
推荐答案
它们存储在 /数据/应用/
,但除非你的手机是植根你不会看到任何那里。
They are stored in /data/app/
but unless your phone is rooted you won't see anything there.
系统的apk都存储在 /系统/应用程序
System apk's are stored at /system/app
获取准确的apk路径的一种更好的方式:
A better way of getting the exact apk path :
PackageManager pm = getPackageManager();
List<PackageInfo> pkginfolist = pm.getInstalledPackages(PackageManager.GET_ACTIVITIES);
List<ApplicationInfo> appinfoList = pm.getInstalledApplications(0);
for (int x = 0; x < pkginfolist .size(); x++) {
PackageInfo pkginfo = pkginfolist.get(x);
pkg_path[x] = appinfoList.get(x).publicSourceDir;
}
这篇关于我可以得到安装的应用程序的手机APK文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文