如何在不安装 Android APK 的情况下检测其清单中的 debuggable 设置为 true 或 false?

发布于 2024-12-17 01:02:47 字数 86 浏览 1 评论 0原文

正如标题所述,我希望能够在计算机上查找 APK 是否将可调试设置为 true 或 false,而无需将其安装在设备上,运行它并查看它是否显示在 DDMS 中。

As the title says, I'd like to be able to find whether an APK has debuggable set to true or false on a computer without having to install it on the device, run it and see whether it shows up in DDMS or not.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

极致的悲 2024-12-24 01:02:47

这是“一旦你知道怎么做就很容易”的事情之一 - 使用 aapt 工具检查清单。

aapt dump xmltree YourApp.apk AndroidManifest.xml | grep debuggable

该命令将为您提供 AndroidManifest.xml 文件的编译形式的转储 - 输出将类似于

答:android:debuggable(0x0101000f)=(类型0x12)0x0

(命令提示符的实际输出)在该示例中,0x0 表示 false。

This is one of those "easy once you know how" things - Use the aapt tool to inspect the manifest.

aapt dump xmltree YourApp.apk AndroidManifest.xml | grep debuggable

That command will give you a dump of the compiled form of the AndroidManifest.xml file- the output will look something like

A: android:debuggable(0x0101000f)=(type 0x12)0x0

(Actual output from my command prompt) in that example, the 0x0 indicates false.

指尖上的星空 2024-12-24 01:02:47

显然 aapt 可以做到这一点:

aapt l -a app.apk | grep debuggable

将返回:

A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff (means debuggable is true)

A: android:debuggable(0x0101000f)=(type 0x12)0x0 (means debuggable is false)

Apparently aapt can do it:

aapt l -a app.apk | grep debuggable

will return either:

A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff (means debuggable is true)

or

A: android:debuggable(0x0101000f)=(type 0x12)0x0 (means debuggable is false)
何处潇湘 2024-12-24 01:02:47

对于窗口用户可以使用以下命令:

aapt l -a <apk with path> | findstr debuggable

将返回:

A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
-> this means debuggable is true.

A: android:debuggable(0x0101000f)=(type 0x12)0x0
-> this means debuggable is false.

For window user can use following command:

aapt l -a <apk with path> | findstr debuggable

will return either:

A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
-> this means debuggable is true.

or

A: android:debuggable(0x0101000f)=(type 0x12)0x0
-> this means debuggable is false.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文