判断是否为debug包:
private static int sIsDebugMode = -1;
public static boolean isDebugMode(Context context) {
if (sIsDebugMode == -1) {
boolean isDebug = context.getApplicationInfo() != null
&& (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
sIsDebugMode = isDebug ? 1 : 0;
}
return sIsDebugMode == 1;
}