获得"可调试" androidManifest从code值? [英] Getting "debuggable" value of androidManifest from code?
本文介绍了获得"可调试" androidManifest从code值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经写在Log.java的顶部由机器人提供的包装。我的等级会添加一些其他的应用程序级功能的日志。
I've written a wrapper on top of Log.java that is provided by android. My Class will add some other application level features in Logs.
现在的事情是,我要检查从C可调试是否设置为真或假在AndroidManifest.xml文件中$ C $。
Now the things is that i want to check from the code whether "debuggable" is set to 'true' or 'false' in androidManifest.xml file.
我能做到吗?如果是的话,怎么办?
Can i do that? If yes, how?
感谢所有提前。
推荐答案
使用 PackageManager
来获得 ApplicationInfo
对象您的应用程序,并检查标志
字段 FLAG_DEBUGGABLE
。
Use PackageManager
to get an ApplicationInfo
object on your application, and check the flags
field for FLAG_DEBUGGABLE
.
boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
这篇关于获得"可调试" androidManifest从code值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文