How can I detect whether an Android APK has debugg

2019-02-05 04:22发布

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.

3条回答
地球回转人心会变
2楼-- · 2019-02-05 04:59

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)
查看更多
来,给爷笑一个
3楼-- · 2019-02-05 05:04

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.

查看更多
唯我独甜
4楼-- · 2019-02-05 05:24

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.
查看更多
登录 后发表回答