To check the debuggable flag, you can use this code:
boolean isDebuggable = ( 0 != ( getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE ) );
Kotlin:
val isDebuggable = 0 != applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE
For more information, please see Securing Android LVL Applications.
Alternatively, if you're using Gradle correctly, you can check if BuildConfig.DEBUG
is true or false.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…