add debug build checks #137

Merged
akinwale merged 1 commit from debug-check into master 2018-05-20 00:37:01 +02:00
2 changed files with 6 additions and 4 deletions

View file

@ -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);

View file

@ -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;