我可以在手机上获取已安装应用程序的 APK 文件吗 [英] Can I get APK file on phone of the installed applications

查看:30
本文介绍了我可以在手机上获取已安装应用程序的 APK 文件吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发用于备份文件的应用程序.我需要像 Astro 管理器那样提取已安装应用程序的 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.

推荐答案

它们存储在 /data/app/ 中,但除非您的手机已 root,否则您将看不到任何内容.

They are stored in /data/app/ but unless your phone is rooted you won't see anything there.

系统 apk 存储在 /system/app

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆