diff --git a/.yarn/cache/react-native-webview-npm-13.12.2-69b4f76f62-d84b2e2e75.zip b/.yarn/cache/react-native-webview-npm-13.12.2-69b4f76f62-d84b2e2e75.zip new file mode 100644 index 00000000000..63a7550c192 Binary files /dev/null and b/.yarn/cache/react-native-webview-npm-13.12.2-69b4f76f62-d84b2e2e75.zip differ diff --git a/.yarn/cache/react-native-webview-npm-13.6.3-481fd1ecaf-3bfe952153.zip b/.yarn/cache/react-native-webview-npm-13.6.3-481fd1ecaf-3bfe952153.zip deleted file mode 100644 index af7ef815c32..00000000000 Binary files a/.yarn/cache/react-native-webview-npm-13.6.3-481fd1ecaf-3bfe952153.zip and /dev/null differ diff --git a/packages/mobile/android/app/src/debug/java/com/standardnotes/ReactNativeFlipper.java b/packages/mobile/android/app/src/debug/java/com/standardnotes/ReactNativeFlipper.java deleted file mode 100644 index e6dd050f70a..00000000000 --- a/packages/mobile/android/app/src/debug/java/com/standardnotes/ReactNativeFlipper.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - *
This source code is licensed under the MIT license found in the LICENSE file in the root - * directory of this source tree. - */ -package com.standardnotes; -import android.content.Context; -import com.facebook.flipper.android.AndroidFlipperClient; -import com.facebook.flipper.android.utils.FlipperUtils; -import com.facebook.flipper.core.FlipperClient; -import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; -import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; -import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; -import com.facebook.flipper.plugins.inspector.DescriptorMapping; -import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; -import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; -import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; -import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; -import com.facebook.react.ReactInstanceEventListener; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.modules.network.NetworkingModule; -import okhttp3.OkHttpClient; - -/** - * Class responsible of loading Flipper inside your React Native application. This is the debug - * flavor of it. Here you can add your own plugins and customize the Flipper setup. - */ -public class ReactNativeFlipper { - public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { - if (FlipperUtils.shouldEnableFlipper(context)) { - final FlipperClient client = AndroidFlipperClient.getInstance(context); - client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); - client.addPlugin(new DatabasesFlipperPlugin(context)); - client.addPlugin(new SharedPreferencesFlipperPlugin(context)); - client.addPlugin(CrashReporterPlugin.getInstance()); - NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); - NetworkingModule.setCustomClientBuilder( - new NetworkingModule.CustomClientBuilder() { - @Override - public void apply(OkHttpClient.Builder builder) { - builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); - } - }); - client.addPlugin(networkFlipperPlugin); - client.start(); - // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized - // Hence we run if after all native modules have been initialized - ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); - if (reactContext == null) { - reactInstanceManager.addReactInstanceEventListener( - new ReactInstanceEventListener() { - @Override - public void onReactContextInitialized(ReactContext reactContext) { - reactInstanceManager.removeReactInstanceEventListener(this); - reactContext.runOnNativeModulesQueueThread( - new Runnable() { - @Override - public void run() { - client.addPlugin(new FrescoFlipperPlugin()); - } - }); - } - }); - } else { - client.addPlugin(new FrescoFlipperPlugin()); - } - } - } -} \ No newline at end of file diff --git a/packages/mobile/android/app/src/main/java/com/standardnotes/CustomWebViewManager.java b/packages/mobile/android/app/src/main/java/com/standardnotes/CustomWebViewManager.java index 00aacb7c6f3..b7d54d70227 100644 --- a/packages/mobile/android/app/src/main/java/com/standardnotes/CustomWebViewManager.java +++ b/packages/mobile/android/app/src/main/java/com/standardnotes/CustomWebViewManager.java @@ -6,10 +6,11 @@ import com.facebook.react.uimanager.ThemedReactContext; import android.view.inputmethod.InputConnectionWrapper; import com.facebook.react.module.annotations.ReactModule; +import com.reactnativecommunity.webview.RNCWebViewWrapper; + import android.view.KeyEvent; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; -import android.webkit.WebView; @ReactModule(name = CustomWebViewManager.REACT_CLASS) public class CustomWebViewManager extends RNCWebViewManager { @@ -60,7 +61,7 @@ public boolean deleteSurroundingText(int beforeLength, int afterLength) { } @Override - public RNCWebView createViewInstance(ThemedReactContext reactContext) { + public RNCWebViewWrapper createViewInstance(ThemedReactContext reactContext) { return super.createViewInstance(reactContext, new CustomWebView(reactContext)); } @@ -69,7 +70,6 @@ public String getName() { return REACT_CLASS; } - @Override protected void addEventEmitters(ThemedReactContext reactContext, RNCWebView view) { view.setWebViewClient(new CustomWebViewClient()); } diff --git a/packages/mobile/android/app/src/main/java/com/standardnotes/MainApplication.java b/packages/mobile/android/app/src/main/java/com/standardnotes/MainApplication.java index 48c9f84a512..5b47b28fa1b 100644 --- a/packages/mobile/android/app/src/main/java/com/standardnotes/MainApplication.java +++ b/packages/mobile/android/app/src/main/java/com/standardnotes/MainApplication.java @@ -84,7 +84,6 @@ public void onCreate() { // If you opted-in for the New Architecture, we load the native entry point for this app. DefaultNewArchitectureEntryPoint.load(); } - ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); try { /* diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 3c762061189..f81f51e01d3 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -65,7 +65,7 @@ "react-native-privacy-snapshot": "standardnotes/react-native-privacy-snapshot#653e904c90fc6f2b578da59138f2bfe5d7f942fe", "react-native-share": "^9.4.1", "react-native-version-info": "^1.1.1", - "react-native-webview": "13.6.3", + "react-native-webview": "13.12.2", "typescript": "*" }, "engines": { diff --git a/yarn.lock b/yarn.lock index 935f007fb1e..c57f3a6e26b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7905,7 +7905,7 @@ __metadata: react-native-share: ^9.4.1 react-native-store-review: ^0.4.1 react-native-version-info: ^1.1.1 - react-native-webview: 13.6.3 + react-native-webview: 13.12.2 typescript: "*" languageName: unknown linkType: soft @@ -14589,13 +14589,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:2.0.0, escape-string-regexp@npm:^2.0.0": - version: 2.0.0 - resolution: "escape-string-regexp@npm:2.0.0" - checksum: 9f8a2d5743677c16e85c810e3024d54f0c8dea6424fad3c79ef6666e81dd0846f7437f5e729dfcdac8981bc9e5294c39b4580814d114076b8d36318f46ae4395 - languageName: node - linkType: hard - "escape-string-regexp@npm:5.0.0, escape-string-regexp@npm:^5.0.0": version: 5.0.0 resolution: "escape-string-regexp@npm:5.0.0" @@ -14610,6 +14603,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:^2.0.0": + version: 2.0.0 + resolution: "escape-string-regexp@npm:2.0.0" + checksum: 9f8a2d5743677c16e85c810e3024d54f0c8dea6424fad3c79ef6666e81dd0846f7437f5e729dfcdac8981bc9e5294c39b4580814d114076b8d36318f46ae4395 + languageName: node + linkType: hard + "escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -23809,16 +23809,16 @@ __metadata: languageName: node linkType: hard -"react-native-webview@npm:13.6.3": - version: 13.6.3 - resolution: "react-native-webview@npm:13.6.3" +"react-native-webview@npm:13.12.2": + version: 13.12.2 + resolution: "react-native-webview@npm:13.12.2" dependencies: - escape-string-regexp: 2.0.0 + escape-string-regexp: ^4.0.0 invariant: 2.2.4 peerDependencies: react: "*" react-native: "*" - checksum: 3bfe952153ba25ced17b2783f686c26cdfd7d9de0ad3a99b953fc616f1b87624172cc39ebeec3b7c213b781d709a3ae5ea0313b4dce5cb0bbdafcf6a478d64f4 + checksum: d84b2e2e75dc484eb40f8e285607b9686693f2d31e95802e2b358dc0820bcc294b438a77174eba157c31d95675c962c61c94885629af999416ad1355e9618fe0 languageName: node linkType: hard