Skip to content

Commit

Permalink
build: android fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardo2016x committed Oct 25, 2024
1 parent a1076d5 commit f80da1f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
56 changes: 56 additions & 0 deletions apps/mobile/patches/react-native-webview+13.10.5.patch
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,29 @@ index 07f73fd..7a410d7 100644
private PermissionAwareActivity getPermissionAwareActivity() {
Activity activity = this.mWebView.getThemedReactContext().getCurrentActivity();
if (activity == null) {
diff --git a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java
index 6664b6f..0435296 100644
--- a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java
+++ b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java
@@ -68,6 +68,7 @@ public class RNCWebView extends WebView implements LifecycleEventListener {
private OnScrollDispatchHelper mOnScrollDispatchHelper;
protected boolean hasScrollEvent = false;
protected boolean nestedScrollEnabled = false;
+ protected boolean disableJsPromptLike = false;
protected ProgressChangedFilter progressChangedFilter;

/**
@@ -102,6 +103,10 @@ public class RNCWebView extends WebView implements LifecycleEventListener {
this.nestedScrollEnabled = nestedScrollEnabled;
}

+ public void setDisableJsPromptLike(boolean val) {
+ this.disableJsPromptLike = val;
+ }
+
@Override
public void onHostResume() {
// do nothing
diff --git a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java
index d59e19c..ebbeaa2 100644
--- a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java
Expand Down Expand Up @@ -366,6 +389,39 @@ index d59e19c..ebbeaa2 100644
}

@Override
diff --git a/node_modules/react-native-webview/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java b/node_modules/react-native-webview/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java
index 5bae4aa..47caeb2 100644
--- a/node_modules/react-native-webview/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java
+++ b/node_modules/react-native-webview/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java
@@ -331,6 +331,12 @@ public class RNCWebViewManager extends ViewGroupManager<RNCWebViewWrapper>
mRNCWebViewManagerImpl.setWebviewDebuggingEnabled(view, value);
}

+ @Override
+ @ReactProp(name = "disableJsPromptLike")
+ public void setDisableJsPromptLike(RNCWebViewWrapper view, boolean value) {
+ mRNCWebViewManagerImpl.setDisableJsPromptLike(view, value);
+ }
+
/* iOS PROPS - no implemented here */
@Override
public void setAllowingReadAccessToURL(RNCWebViewWrapper view, @Nullable String value) {}
diff --git a/node_modules/react-native-webview/android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.java b/node_modules/react-native-webview/android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.java
index 709117a..9ffbae5 100644
--- a/node_modules/react-native-webview/android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.java
+++ b/node_modules/react-native-webview/android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.java
@@ -268,6 +268,11 @@ public class RNCWebViewManager extends ViewGroupManager<RNCWebViewWrapper> {
mRNCWebViewManagerImpl.setWebviewDebuggingEnabled(view, value);
}

+ @ReactProp(name = "disableJsPromptLike")
+ public void setDisableJsPromptLike(RNCWebViewWrapper view, boolean value) {
+ mRNCWebViewManagerImpl.setDisableJsPromptLike(view, value);
+ }
+
@ReactProp(name = "userAgent")
public void setUserAgent(RNCWebViewWrapper view, @Nullable String value) {
mRNCWebViewManagerImpl.setUserAgent(view, value);
diff --git a/node_modules/react-native-webview/apple/RNCWebView.mm b/node_modules/react-native-webview/apple/RNCWebView.mm
index 1ae84c8..229c4b0 100644
--- a/node_modules/react-native-webview/apple/RNCWebView.mm
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/scripts/create-patch.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# ./node_modules/.bin/patch-package @isudaji/react-native-install-apk --exclude 'build|xcodeproj|package.json'
./node_modules/.bin/patch-package react-native-webview --exclude 'build|xcodeproj|package.json' --include 'lib\/.*\.d\.ts|android\/.*\/(RNCWebChromeClient|RNCWebViewClient)\.java|apple\/(RNCWebViewImpl|RNCWebView)\.m'
./node_modules/.bin/patch-package react-native-webview --exclude 'build|xcodeproj|package.json' --include 'lib\/.*\.d\.ts|android\/.*\/(RNCWebChromeClient|RNCWebViewClient|RNCWebViewManager|RNCWebView)\.java|apple\/(RNCWebViewImpl|RNCWebView)\.m'
./node_modules/.bin/patch-package @debank/common
./node_modules/.bin/patch-package react-native-fs --exclude 'android\/build' --include 'android'
./node_modules/.bin/patch-package react-native-mmkv --exclude 'android\/.cxx|build|xcodeproj|package.json'
Expand Down

0 comments on commit f80da1f

Please sign in to comment.