Skip to content

Commit

Permalink
Allow webview debugging in dev mode + XIP (#1806)
Browse files Browse the repository at this point in the history
* Enable webview debugging on android in dev mode

* allow XIP for local connections

* change to Buildconfig.DEBUG
  • Loading branch information
EtDu authored Oct 14, 2020
1 parent 7adf92b commit 1ce4036
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<application
android:name=".MainApplication"
android:debuggable="${isDebug}"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
Expand Down
3 changes: 3 additions & 0 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import io.metamask.nativeModules.PreventScreenshotPackage;
import android.webkit.WebView;

import androidx.multidex.MultiDexApplication;

Expand Down Expand Up @@ -54,6 +55,8 @@ public ReactNativeHost getReactNativeHost() {
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG)
{ WebView.setWebContentsDebuggingEnabled(true); }
SoLoader.init(this, /* native exopackage */ false);

initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/xml/react_native_config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">xip.io</domain>
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
Expand Down

0 comments on commit 1ce4036

Please sign in to comment.