【问题标题】:Get android manifest <application> debuggable property value获取android manifest <application> 可调试属性值
【发布时间】:2021-07-03 05:09:08
【问题描述】:

检查清单中的 android 可调试属性是否为真。

&lt;application android:allowBackup="true" android:debuggable="true" &gt;

如何以编程方式获取可调试的属性值?

【问题讨论】:

  • 应该类似于boolean debuggable = (context.getApplicationInfo().flags &amp; ApplicationInfo.FLAG_DEBUGGABLE) == ApplicationInfo.FLAG_DEBUGGABLE;。
  • 谢谢@MikeM。你的答案是正确的!

标签: java android android-manifest


【解决方案1】:

您使用此检查 DEBUGGABLE 是真还是假

(getContext().getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0 

【讨论】:

  • 通过反编译应用程序并手动更改清单(〜添加可调试行)然后重建apk来测试这个东西,我仍然能够检查应用程序是否可调试。
【解决方案2】:

this.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-19
    • 2014-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-10
    相关资源
    最近更新 更多