我试图提取一个安装的Android应用程序的APK文件没有根权限。

我认为这是不可能的,因为所有非系统应用程序的APK文件都位于/data/app中,访问这个文件夹需要root权限。然后我发现谷歌Play商店中有许多应用程序似乎可以在非根设备上访问APK文件。

谁能告诉我这是怎么回事?难道没有备份程序可以备份APK文件吗?


当前回答

在Nougat(7.0) Android版本上运行adb shell pm list packages来列出设备上安装的包。 然后执行adb shell pm path your-package-name命令显示apk的路径。 使用adb复制包到下载adb shell cp /data/app/com.test-1/base.apk /storage/emulated/0/Download。 然后通过运行adb pull /storage/emulated/0/Download/base.apk将apk从Downloads拉到你的机器。

其他回答

通过免费和开源的Ghost Commander应用程序可以获得已安装应用程序的APK文件,该应用程序可在F-Droid和Play Store上使用。

在幽灵指挥官应用程序中,进入应用程序,然后简单地长按列表中的应用程序并选择复制。.apk文件将在其他文件面板中可用;你可以把它放在任何你想要的地方。

请注意,由于Ghost Commander是一个双面板的文件管理器,你首先必须使用另一个面板并在那里打开一个文件夹(这是我们想要复制apk文件的地方)。然后,转到另一个面板,选择应用程序。

(如果你没有看到“应用程序”,首先点击箭头,选择主页。)

链接:

https://f-droid.org/packages/com.ghostsq.commander/ https://sourceforge.net/projects/ghostcommander/ https://play.google.com/store/apps/details?id=com.ghostsq.commander

检查已安装的apk的列表(下面的命令还列出了安装的路径和包名)。 Adb shell PM列表包 使用adb拉/package_path/包名/path_in_pc (包路径和包名可以从上面的命令1中获取。)

Android将一个序列号附加到包名以产生最终的APK文件名(这可能与Android OS版本不同)。在非root设备上执行以下命令:

获取所需包的APK文件的完整路径名。 Adb shell PM路径com.example.someapp 这将输出为:package:/data/app/com.example.someapp-2.apk。 将APK文件从Android设备拉到开发框中。 Adb pull /data/app/com.example.someapp-2.apk

成功拉出APK后,APK的位置将在你pc/笔记本电脑上的../sdk/platform-tools/base.apk。

当你安装了Eclipse for Android开发时:

Use your device as debugging device. On your phone: Settings > Applications > Development and enable USB debugging, see http://developer.android.com/tools/device.html In Eclipse, open DDMS-window: Window > Open Perspective > Other... > DDMS, see http://developer.android.com/tools/debugging/ddms.html If you can't see your device try (re)installing USB-Driver for your device In middle pane select tab "File Explorer" and go to system > app Now you can select one or more files and then click the "Pull a file from the device" icon at the top (right to the tabs) Select target folder - tada!

在Nougat(7.0) Android版本上运行adb shell pm list packages来列出设备上安装的包。 然后执行adb shell pm path your-package-name命令显示apk的路径。 使用adb复制包到下载adb shell cp /data/app/com.test-1/base.apk /storage/emulated/0/Download。 然后通过运行adb pull /storage/emulated/0/Download/base.apk将apk从Downloads拉到你的机器。