Created
July 31, 2016 09:03
-
-
Save KimuraTakaumi/2f2cb634ad49b11d36d62a64d42ad841 to your computer and use it in GitHub Desktop.
AARファイルからアプリのBuildConfigのDEBUGを読み込む
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean isDebug(Context context){ | |
try { | |
Class<?> clazz = Class.forName(context.getPackageName() + ".BuildConfig"); | |
Field field = clazz.getField("DEBUG"); | |
return (Boolean) field.get(null); | |
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { | |
e.printStackTrace(); | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment