如何以编程方式获取 apk 文件名和路径? [英] How can i get the apk file name and path programmatically?

查看:19
本文介绍了如何以编程方式获取 apk 文件名和路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我已经知道目标 apk 的包名,我想获取程序的确切文件名.例如,如果我知道我的 apk 的包名称,即 com.packagename,我如何获得该包的确切路径和文件名?顺便说一句,我不想​​只获得我的 apk 位置,我想要我应用的任何包名称的位置.SystemTuner pro 能够做到这一点,所以我知道这是可能的,只是不确定如何.

I want to get the exact file name of a program if I already know the package name of the target apk. For instance, if I know the package name of my apk, which is com.packagename, how can I get the exact path and file name of that package? Btw, i don't want to get just MY apk location, i want the location of any package name i apply. SystemTuner pro is able to do this so i know it is possible, just not sure how.

谢谢各位!

推荐答案

PackageManager.getPackageInfo() 返回关于包的信息,PackageInfo.applicationInfo 字段包含有关应用程序的必填信息.

PackageManager.getPackageInfo() returns information about the package, and PackageInfo.applicationInfo field has required information about the application.

这篇关于如何以编程方式获取 apk 文件名和路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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