我可以在手机上获取已安装应用程序的 APK 文件吗

编程入门 行业动态 更新时间:2024-10-26 08:26:47
本文介绍了我可以在手机上获取已安装应用程序的 APK 文件吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试开发用于备份文件的应用程序.我需要像 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 01:19:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/928099.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:机上   在手   应用程序   文件   APK

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!