如何获得没有root用户访问权限的已安装应用的APK? [英] How do I get the APK of an installed app without root access?

查看:90
本文介绍了如何获得没有root用户访问权限的已安装应用的APK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试提取没有root权限的已安装Android应用的APK文件.

I'm trying to extract the APK file of an installed Android app WITHOUT root permissions.

我认为这是不可能的,因为非系统应用程序的所有APK文件都位于/data/app中,并且访问此文件夹需要root权限.然后,我发现Google Play商店中有很多应用程序似乎都可以访问APK文件,即使在没有根目录的设备上也是如此.

I thought that this was impossible, because all APK files for non-system-apps are located in /data/app, and accessing this folder requires root permission. Then I found that there are numerous apps in the Google Play store that seem to have access to the APK files even on non-rooted devices.

有人可以告诉我这怎么可能吗?没有备份应用程序可以无根备份APK文件吗?

Can someone tell me how this is possible? Aren't there backup apps which backup the APK files without root?

推荐答案

在没有root许可的情况下可以访问/data/app.该目录的权限为rwxrwx--x.对目录具有执行权限意味着您可以访问它,但是缺少读取权限意味着您无法获取其内容列表-因此,要访问该目录,您必须知道将要访问的文件的名称. Android的软件包管理器会告诉您给定软件包的已存储apk的名称.

Accessing /data/app is possible without root permission; the permissions on that directory are rwxrwx--x. Execute permission on a directory means you can access it, however lack of read permission means you cannot obtain a listing of its contents -- so in order to access it you must know the name of the file that you will be accessing. Android's package manager will tell you the name of the stored apk for a given package.

要从命令行执行此操作,请使用adb shell pm list packages获取已安装软件包的列表并找到所需的软件包.

To do this from the command line, use adb shell pm list packages to get the list of installed packages and find the desired package.

使用包名称,我们可以使用adb shell pm path your-package-name获取APK的实际文件名和位置.

With the package name, we can get the actual file name and location of the APK using adb shell pm path your-package-name.

知道完整目录后,我们终于可以使用adb pull full/directory/of/the.apk

And knowing the full directory, we can finally pull the adb using adb pull full/directory/of/the.apk

使用@tarn指出在棒棒糖下apk路径为/data/app/your-package-name-1/base.apk

Credit to @tarn for pointing out that under Lollipop, the apk path will be /data/app/your-package-name-1/base.apk

这篇关于如何获得没有root用户访问权限的已安装应用的APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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