From 1a6e3bf21433a5318da9d6099879a174ddeb5e49 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 19 May 2018 23:35:43 +0100 Subject: [PATCH] add debug build checks --- src/main/java/io/lbry/browser/MainActivity.java | 2 +- .../java/io/lbry/browser/reactmodules/MixpanelModule.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/lbry/browser/MainActivity.java b/src/main/java/io/lbry/browser/MainActivity.java index f64308a3..c9684213 100644 --- a/src/main/java/io/lbry/browser/MainActivity.java +++ b/src/main/java/io/lbry/browser/MainActivity.java @@ -100,7 +100,7 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand switch (requestCode) { case STORAGE_PERMISSION_REQ_CODE: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - if (!Settings.canDrawOverlays(this)) { + if (BuildConfig.DEBUG && !Settings.canDrawOverlays(this)) { Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName())); startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE); diff --git a/src/main/java/io/lbry/browser/reactmodules/MixpanelModule.java b/src/main/java/io/lbry/browser/reactmodules/MixpanelModule.java index 65977ece..33d9d8e9 100644 --- a/src/main/java/io/lbry/browser/reactmodules/MixpanelModule.java +++ b/src/main/java/io/lbry/browser/reactmodules/MixpanelModule.java @@ -9,6 +9,8 @@ import com.facebook.react.bridge.ReadableMap; import com.mixpanel.android.mpmetrics.MixpanelAPI; +import io.lbry.browser.BuildConfig; + import java.util.HashMap; import java.util.Map; import org.json.JSONObject; @@ -16,9 +18,9 @@ import org.json.JSONException; public class MixpanelModule extends ReactContextBaseJavaModule { - // TODO: Detect dev / debug and release mode and update value accordingly - private static final String MIXPANEL_TOKEN = "93b81fb957cb0ddcd3198c10853a6a95"; // Production - //private static final String MIXPANEL_TOKEN = "bc1630b8be64c5dfaa4700b3a62969f3"; // Dev Testing + private static final String MIXPANEL_TOKEN = BuildConfig.DEBUG ? + "bc1630b8be64c5dfaa4700b3a62969f3" /* Dev Testing */ : + "93b81fb957cb0ddcd3198c10853a6a95"; /* Production */ private Context context;