react-native-webview-bootpay 13.13.423 → 13.13.431

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,88 +12,4 @@
12
12
  android:resource="@xml/file_provider_paths" />
13
13
  </provider>
14
14
  </application>
15
-
16
- <!-- android 11 모든 앱 접근 권한 사용 (Google Play 가이드라인 참고 - 2021-02-19 기준 못찾았음) -->
17
- <!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />-->
18
- <!-- android 11 Package Visibility 설정 (compileSdkVersion, targetSdkVersion 30 이상 설정시 필수) -->
19
- <!-- 2021-02-19 -->
20
- <queries>
21
- <!-- 다날[신한, BC(페이북), 국민, 현대, 삼성, 하나, 롯데, 농협, 우리, 씨티, 페이코, 삼성페이, 카카오페이, 뱅크페이, SSG페이, 스마일페이, 엘페이] -->
22
- <!-- KCP [페이코, 현대, BC(페이북), 롯데, 국민, 농협, 삼성, 신한, 우리, 하나, 씨티] -->
23
- <!-- 이니시스 [카카오페이, 네이버페이, 신한, 하나, 현대, 삼성, 국민, BC(페이북), 농협, 롯데, 씨티, 페이코, 엘페이, SSG페이, 차이, 토스, 삼성페이] -->
24
- <!-- 나이스페이 [신한, 국민, 삼성, BC(페이북), 롯데, 현대, 하나 농협, 씨티, 우리] -->
25
- <!-- 토스페이먼츠 [현대, 신한, 페이북, 국민, 삼성, 롯데, 농협, 우리] -->
26
- <!-- 이지페이 [현대, 하나, 국민, 롯데, 삼성, BC(페이북) 신한, 하나, 농협, 씨티, 우리, 페이코] -->
27
- <!-- 티페이 [BC(페이북), 국민, 하나, 삼성, 신한, 현대, 롯데, 농협, 씨티, 우리] -->
28
- <!-- 페이레터 [BC(페이북), 국민, 하나, 삼성, 신한, 현대. 롯데, 농협, 씨티, ] -->
29
- <!-- 월컴페이먼츠 [카카오스, 엘페이, 현대, BC(페이북), 국민, 삼성, 신한, 롯데, 농협, 하나, 씨티, 하나, 우리] -->
30
-
31
- <!-- 간편결제 -->
32
- <package android:name="com.nhnent.payapp" /> <!-- 페이코 -->
33
- <package android:name="com.lottemembers.android" /> <!-- LPAY -->
34
- <package android:name="com.ssg.serviceapp.android.egiftcertificate" /> <!-- SSG 페이 -->
35
- <package android:name="com.inicis.kpay" /> <!-- 이니시스 KPAY -->
36
- <package android:name="com.tmoney.tmpay" /> <!-- 티머니페이 -->
37
- <package android:name="viva.republica.toss" /> <!-- 토스페이 -->
38
- <package android:name="com.kakao.talk" /> <!-- 카카오페이 -->
39
- <package android:name="com.mysmilepay.app" /> <!-- 스마일 페이 -->
40
- <package android:name="com.lotte.lpay" /> <!-- 엘페이 -->
41
- <package android:name="finance.chai.app" /> <!-- 차이 -->
42
- <package android:name="com.nhn.android.search" /> <!-- 네이버 -->
43
-
44
- <!-- 앱카드 -->
45
- <package android:name="kvp.jjy.MispAndroid320" /> <!-- BC 페이북 -->
46
- <package android:name="com.kbcard.kbkookmincard" /> <!-- 국민카드 -->
47
- <package android:name="com.kbcard.cxh.appcard" /> <!-- 국민카드 -->
48
- <package android:name="com.kbstar.liivbank" /> <!-- 국민 리브 -->
49
- <package android:name="com.kbstar.reboot" /> <!-- 국민 new 리브 -->
50
- <package android:name="com.kbstar.kbbank" /> <!-- KB 스타뱅킹 -->
51
-
52
- <package android:name="com.samsung.android.spay" /> <!-- 삼성페이 -->
53
- <package android:name="com.samsung.android.spaylite" /> <!-- 삼성페이 미니 -->
54
- <package android:name="com.lge.lgpay" /> <!-- 엘지페이 -->
55
- <package android:name="com.hanaskcard.paycla" /> <!-- 하나카드 -->
56
- <package android:name="kr.co.hanamembers.hmscustomer" /> <!-- 하나카드(멤버스결제) -->
57
- <package android:name="com.lcacApp" /> <!-- 롯데카드 -->
58
- <package android:name="kr.co.samsungcard.mpocket" /> <!-- 삼성카드 -->
59
- <package android:name="com.shcard.smartpay" /> <!-- 신한카드-->
60
- <package android:name="com.shinhan.smartcaremgr" /> <!-- 신한 쏠-->
61
- <package android:name="com.shinhancard.smartshinhan" /> <!-- 신한카드 (ARS/일반결제/Smart결제) -->
62
- <package android:name="com.hyundaicard.appcard" /> <!-- 현대카드 -->
63
- <package android:name="nh.smart.nhallonepay" /> <!-- 농협카드 -->
64
- <package android:name="com.wooricard.wpay" /> <!-- 우리카드 -->
65
- <package android:name="com.wooricard.smartapp" /> <!-- 우리 WON 카드 -->
66
- <package android:name="com.wooribank.smart.npib" /> <!-- 우리 WON 뱅킹 -->
67
- <package android:name="kr.co.citibank.citimobile" /> <!-- 씨티카드 -->
68
- <package android:name="com.mobiletoong.travelwallet" /> <!-- 트레블월렛 -->
69
-
70
-
71
-
72
- <!-- 계좌이체 -->
73
- <package android:name="com.kftc.bankpay.android" /> <!-- 뱅크페이 -->
74
- <package android:name="com.kbankwith.smartbank" /> <!-- 케이뱅크 -->
75
- <package android:name="com.knb.psb" /> <!-- BNK 경남은행 모바일뱅킹 -->
76
- <package android:name="kr.co.kfcc.mobilebank" /> <!-- MG 새마을금고 -->
77
- <package android:name="com.nh.cashcardapp" /> <!-- NH앱캐시 -->
78
-
79
- <!-- 공인인증(신용카드) -->
80
- <package android:name="com.hanaskcard.rocomo.potal" /> <!-- 하나카드 -->
81
- <package android:name="com.lumensoft.touchenappfree" /> <!-- 현대카드 -->
82
-
83
-
84
- <!-- 보안앱 -->
85
- <package android:name="com.TouchEn.mVaccine.webs" /> <!-- 신한, 씨티 -->
86
- <package android:name="kr.co.shiftworks.vguardweb" /> <!-- 삼성 -->
87
- <package android:name="com.ahnlab.v3mobileplus" /> <!-- 하나, 농협, 우리, 국민 리브 -->
88
-
89
- <!-- 휴대폰 결제 -->
90
- <package android:name="com.kt.ktauth" /> <!-- KT 본인인증 -->
91
- <package android:name="kr.danal.app.damoum" /> <!-- 다모음 -->
92
- <package android:name="uplus.membership" /> <!-- U+ 멤버스 -->
93
- <package android:name="com.sktelecom.tauth" /> <!--PASS-->
94
- <package android:name="com.lguplus.smartotp" /> <!--PASS-->
95
-
96
- <!--해외결제-->
97
- <package android:name="com.eg.android.AlipayGphone" />
98
- </queries>
99
15
  </manifest>
@@ -10,88 +10,4 @@
10
10
  android:resource="@xml/file_provider_paths" />
11
11
  </provider>
12
12
  </application>
13
-
14
- <!-- android 11 모든 앱 접근 권한 사용 (Google Play 가이드라인 참고 - 2021-02-19 기준 못찾았음) -->
15
- <!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />-->
16
- <!-- android 11 Package Visibility 설정 (compileSdkVersion, targetSdkVersion 30 이상 설정시 필수) -->
17
- <!-- 2021-02-19 -->
18
- <queries>
19
- <!-- 다날[신한, BC(페이북), 국민, 현대, 삼성, 하나, 롯데, 농협, 우리, 씨티, 페이코, 삼성페이, 카카오페이, 뱅크페이, SSG페이, 스마일페이, 엘페이] -->
20
- <!-- KCP [페이코, 현대, BC(페이북), 롯데, 국민, 농협, 삼성, 신한, 우리, 하나, 씨티] -->
21
- <!-- 이니시스 [카카오페이, 네이버페이, 신한, 하나, 현대, 삼성, 국민, BC(페이북), 농협, 롯데, 씨티, 페이코, 엘페이, SSG페이, 차이, 토스, 삼성페이] -->
22
- <!-- 나이스페이 [신한, 국민, 삼성, BC(페이북), 롯데, 현대, 하나 농협, 씨티, 우리] -->
23
- <!-- 토스페이먼츠 [현대, 신한, 페이북, 국민, 삼성, 롯데, 농협, 우리] -->
24
- <!-- 이지페이 [현대, 하나, 국민, 롯데, 삼성, BC(페이북) 신한, 하나, 농협, 씨티, 우리, 페이코] -->
25
- <!-- 티페이 [BC(페이북), 국민, 하나, 삼성, 신한, 현대, 롯데, 농협, 씨티, 우리] -->
26
- <!-- 페이레터 [BC(페이북), 국민, 하나, 삼성, 신한, 현대. 롯데, 농협, 씨티, ] -->
27
- <!-- 월컴페이먼츠 [카카오스, 엘페이, 현대, BC(페이북), 국민, 삼성, 신한, 롯데, 농협, 하나, 씨티, 하나, 우리] -->
28
-
29
- <!-- 간편결제 -->
30
- <package android:name="com.nhnent.payapp" /> <!-- 페이코 -->
31
- <package android:name="com.lottemembers.android" /> <!-- LPAY -->
32
- <package android:name="com.ssg.serviceapp.android.egiftcertificate" /> <!-- SSG 페이 -->
33
- <package android:name="com.inicis.kpay" /> <!-- 이니시스 KPAY -->
34
- <package android:name="com.tmoney.tmpay" /> <!-- 티머니페이 -->
35
- <package android:name="viva.republica.toss" /> <!-- 토스페이 -->
36
- <package android:name="com.kakao.talk" /> <!-- 카카오페이 -->
37
- <package android:name="com.mysmilepay.app" /> <!-- 스마일 페이 -->
38
- <package android:name="com.lotte.lpay" /> <!-- 엘페이 -->
39
- <package android:name="finance.chai.app" /> <!-- 차이 -->
40
- <package android:name="com.nhn.android.search" /> <!-- 네이버 -->
41
-
42
- <!-- 앱카드 -->
43
- <package android:name="kvp.jjy.MispAndroid320" /> <!-- BC 페이북 -->
44
- <package android:name="com.kbcard.kbkookmincard" /> <!-- 국민카드 -->
45
- <package android:name="com.kbcard.cxh.appcard" /> <!-- 국민카드 -->
46
- <package android:name="com.kbstar.liivbank" /> <!-- 국민 리브 -->
47
- <package android:name="com.kbstar.reboot" /> <!-- 국민 new 리브 -->
48
- <package android:name="com.kbstar.kbbank" /> <!-- KB 스타뱅킹 -->
49
-
50
- <package android:name="com.samsung.android.spay" /> <!-- 삼성페이 -->
51
- <package android:name="com.samsung.android.spaylite" /> <!-- 삼성페이 미니 -->
52
- <package android:name="com.lge.lgpay" /> <!-- 엘지페이 -->
53
- <package android:name="com.hanaskcard.paycla" /> <!-- 하나카드 -->
54
- <package android:name="kr.co.hanamembers.hmscustomer" /> <!-- 하나카드(멤버스결제) -->
55
- <package android:name="com.lcacApp" /> <!-- 롯데카드 -->
56
- <package android:name="kr.co.samsungcard.mpocket" /> <!-- 삼성카드 -->
57
- <package android:name="com.shcard.smartpay" /> <!-- 신한카드-->
58
- <package android:name="com.shinhan.smartcaremgr" /> <!-- 신한 쏠-->
59
- <package android:name="com.shinhancard.smartshinhan" /> <!-- 신한카드 (ARS/일반결제/Smart결제) -->
60
- <package android:name="com.hyundaicard.appcard" /> <!-- 현대카드 -->
61
- <package android:name="nh.smart.nhallonepay" /> <!-- 농협카드 -->
62
- <package android:name="com.wooricard.wpay" /> <!-- 우리카드 -->
63
- <package android:name="com.wooricard.smartapp" /> <!-- 우리 WON 카드 -->
64
- <package android:name="com.wooribank.smart.npib" /> <!-- 우리 WON 뱅킹 -->
65
- <package android:name="kr.co.citibank.citimobile" /> <!-- 씨티카드 -->
66
- <package android:name="com.mobiletoong.travelwallet" /> <!-- 트레블월렛 -->
67
-
68
-
69
-
70
- <!-- 계좌이체 -->
71
- <package android:name="com.kftc.bankpay.android" /> <!-- 뱅크페이 -->
72
- <package android:name="com.kbankwith.smartbank" /> <!-- 케이뱅크 -->
73
- <package android:name="com.knb.psb" /> <!-- BNK 경남은행 모바일뱅킹 -->
74
- <package android:name="kr.co.kfcc.mobilebank" /> <!-- MG 새마을금고 -->
75
- <package android:name="com.nh.cashcardapp" /> <!-- NH앱캐시 -->
76
-
77
- <!-- 공인인증(신용카드) -->
78
- <package android:name="com.hanaskcard.rocomo.potal" /> <!-- 하나카드 -->
79
- <package android:name="com.lumensoft.touchenappfree" /> <!-- 현대카드 -->
80
-
81
-
82
- <!-- 보안앱 -->
83
- <package android:name="com.TouchEn.mVaccine.webs" /> <!-- 신한, 씨티 -->
84
- <package android:name="kr.co.shiftworks.vguardweb" /> <!-- 삼성 -->
85
- <package android:name="com.ahnlab.v3mobileplus" /> <!-- 하나, 농협, 우리, 국민 리브 -->
86
-
87
- <!-- 휴대폰 결제 -->
88
- <package android:name="com.kt.ktauth" /> <!-- KT 본인인증 -->
89
- <package android:name="kr.danal.app.damoum" /> <!-- 다모음 -->
90
- <package android:name="uplus.membership" /> <!-- U+ 멤버스 -->
91
- <package android:name="com.sktelecom.tauth" /> <!--PASS-->
92
- <package android:name="com.lguplus.smartotp" /> <!--PASS-->
93
-
94
- <!--해외결제-->
95
- <package android:name="com.eg.android.AlipayGphone" />
96
- </queries>
97
13
  </manifest>
@@ -3,63 +3,38 @@ package kr.co.bootpay.webview;
3
3
  import android.Manifest;
4
4
  import android.annotation.TargetApi;
5
5
  import android.app.Activity;
6
- import android.app.AlertDialog;
7
6
  import android.content.pm.PackageManager;
8
7
  import android.net.Uri;
9
- import android.net.http.SslError;
10
8
  import android.os.Build;
11
9
  import android.os.Message;
12
10
  import android.view.Gravity;
13
- import android.view.KeyEvent;
14
11
  import android.view.View;
15
12
  import android.view.ViewGroup;
16
- import android.view.WindowManager;
17
-
18
13
  import android.webkit.ConsoleMessage;
19
14
  import android.webkit.GeolocationPermissions;
20
15
  import android.webkit.PermissionRequest;
21
- import android.webkit.SslErrorHandler;
22
16
  import android.webkit.ValueCallback;
23
17
  import android.webkit.WebChromeClient;
24
18
  import android.webkit.WebView;
25
19
  import android.webkit.WebViewClient;
26
20
  import android.widget.FrameLayout;
27
-
28
- import android.content.Intent;
29
- import android.annotation.SuppressLint;
30
- import android.net.http.SslError;
31
21
 
32
22
  import androidx.annotation.RequiresApi;
33
23
  import androidx.core.content.ContextCompat;
34
24
 
35
25
  import com.facebook.react.bridge.Arguments;
36
26
  import com.facebook.react.bridge.LifecycleEventListener;
37
- import com.facebook.react.bridge.ReactNoCrashSoftException;
38
27
  import com.facebook.react.bridge.WritableMap;
39
28
  import com.facebook.react.common.build.ReactBuildConfig;
40
29
  import com.facebook.react.modules.core.PermissionAwareActivity;
41
30
  import com.facebook.react.modules.core.PermissionListener;
42
31
  import com.facebook.react.uimanager.UIManagerHelper;
43
- import com.facebook.react.uimanager.ThemedReactContext;
44
- import com.facebook.react.uimanager.UIManagerModule;
45
-
46
-
47
32
  import kr.co.bootpay.webview.events.TopLoadingProgressEvent;
48
33
  import kr.co.bootpay.webview.events.TopOpenWindowEvent;
49
34
 
50
35
  import java.util.ArrayList;
51
36
  import java.util.Collections;
52
37
  import java.util.List;
53
- import android.util.Log;
54
-
55
- import android.app.Dialog;
56
- import android.content.Context;
57
- import android.content.Intent;
58
- import android.widget.Toast;
59
-
60
- import org.json.JSONException;
61
- import org.json.JSONObject;
62
- import android.content.DialogInterface;
63
38
 
64
39
  public class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
65
40
  protected static final FrameLayout.LayoutParams FULLSCREEN_LAYOUT_PARAMS = new FrameLayout.LayoutParams(
@@ -104,162 +79,41 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
104
79
  protected BPCWebView.ProgressChangedFilter progressChangedFilter = null;
105
80
  protected boolean mAllowsProtectedMedia = false;
106
81
 
107
- protected boolean mHasOnOpenWindowEvent = false;
82
+ protected boolean mHasOnOpenWindowEvent = false;
108
83
 
109
84
  public BPCWebChromeClient(BPCWebView webView) {
110
85
  this.mWebView = webView;
111
86
  }
112
-
113
87
 
114
- boolean isPopupWebView = false;
115
88
  @Override
116
89
  public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
117
90
 
118
- ThemedReactContext reactContext = (ThemedReactContext) view.getContext();
119
- final BPCWebView newWebView = new BPCWebView(reactContext);
91
+ final WebView newWebView = new WebView(view.getContext());
120
92
 
121
- BPCWebChromeClient client = new BPCWebChromeClient(newWebView);
122
- client.setProgressChangedFilter(progressChangedFilter);
123
- newWebView.setWebChromeClient(client);
93
+ if(mHasOnOpenWindowEvent) {
94
+ newWebView.setWebViewClient(new WebViewClient(){
95
+ @Override
96
+ public boolean shouldOverrideUrlLoading (WebView subview, String url) {
97
+ WritableMap event = Arguments.createMap();
98
+ event.putString("targetUrl", url);
124
99
 
125
- Log.d("BPCWebChromeClient", "onCreateWindow");
126
- isPopupWebView = true;
100
+ ((BPCWebView) view).dispatchEvent(
101
+ view,
102
+ new TopOpenWindowEvent(BPCWebViewWrapper.getReactTagFromWebView(view), event)
103
+ );
127
104
 
128
- setWebSettingCopy(view, newWebView);
129
-
130
-
131
- newWebView.setWebViewClient(new WebViewClient(){
132
- @Override
133
- public boolean shouldOverrideUrlLoading (WebView subview, String url) {
134
-
135
- Log.d("bootpay url", url);
136
-
137
- // return true;
138
- if(BootpayUrlHelper.shouldOverrideUrlLoading(view, url)) {
139
105
  return true;
140
106
  }
141
- // return shouldOverrideUrlLoadingRN(view, url);
142
- WritableMap event = Arguments.createMap();
143
- event.putString("targetUrl", url);
144
-
145
- ((BPCWebView) view).dispatchEvent(
146
- view,
147
- new TopOpenWindowEvent(view.getId(), event)
148
- );
149
-
150
- return false;
107
+ });
151
108
  }
152
- });
153
-
154
- Dialog popupDialog = new Dialog(view.getContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
155
- popupDialog.setContentView(newWebView);
156
- ViewGroup.LayoutParams params = popupDialog.getWindow().getAttributes();
157
- params.width = ViewGroup.LayoutParams.MATCH_PARENT;
158
- params.height = ViewGroup.LayoutParams.MATCH_PARENT;
159
- popupDialog.getWindow().setAttributes((WindowManager.LayoutParams) params);
160
- popupDialog.setOnDismissListener(dialog -> {
161
- onCloseWindow(view); //rn에선 딱히 동작하지 않음
162
- });
163
- newWebView.setDialog(popupDialog);
164
- popupDialog.show();
165
-
166
109
 
167
110
  final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
168
111
  transport.setWebView(newWebView);
169
112
  resultMsg.sendToTarget();
170
113
 
171
- // 🔹 팝업을 위한 FrameLayout을 React Native UI 트리에 추가
172
- // Activity activity = reactContext.getCurrentActivity();
173
- // if (activity != null) {
174
- // activity.runOnUiThread(() -> {
175
- // FrameLayout popupContainer = new FrameLayout(activity);
176
- // popupContainer.setLayoutParams(new FrameLayout.LayoutParams(
177
- // ViewGroup.LayoutParams.MATCH_PARENT,
178
- // ViewGroup.LayoutParams.MATCH_PARENT
179
- // ));
180
- // popupContainer.addView(newWebView);
181
- // ((ViewGroup) activity.findViewById(android.R.id.content)).addView(popupContainer);
182
- // });
183
- // } else {
184
- // Log.e("BPCWebChromeClient", "Activity is null, cannot add popup WebView.");
185
- // }
186
-
187
-
188
114
  return true;
189
115
  }
190
116
 
191
-
192
- @Override
193
- public void onCloseWindow(WebView window) {
194
- super.onCloseWindow(window);
195
- ((BPCWebView) window).dissmissDialog();
196
-
197
- Log.d("BPCWebChromeClient", "onCloseWindow");
198
-
199
- isPopupWebView = false;
200
- // if(mainView != null) {
201
- // mainView.removeView(window);
202
- // }
203
- // window.setVisibility(View.GONE);
204
- }
205
-
206
-
207
-
208
-
209
- void setWebSettingCopy(WebView view, WebView newWebView) {
210
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
211
- newWebView.getSettings().setMediaPlaybackRequiresUserGesture( view.getSettings().getMediaPlaybackRequiresUserGesture() );
212
- }
213
-
214
- newWebView.getSettings().setBuiltInZoomControls(view.getSettings().getBuiltInZoomControls());
215
- newWebView.getSettings().setDisplayZoomControls(view.getSettings().getDisplayZoomControls());
216
- newWebView.getSettings().setAllowFileAccess(view.getSettings().getAllowFileAccess());
217
- newWebView.getSettings().setAllowContentAccess(view.getSettings().getAllowContentAccess());
218
- newWebView.getSettings().setLoadWithOverviewMode(view.getSettings().getLoadWithOverviewMode());
219
- // newWebView.getSettings().setEnableSmoothTransition(view.getSettings().);
220
- newWebView.getSettings().setSaveFormData(view.getSettings().getSaveFormData());
221
- newWebView.getSettings().setSavePassword(view.getSettings().getSavePassword());
222
- newWebView.getSettings().setTextZoom(view.getSettings().getTextZoom());
223
-
224
- newWebView.getSettings().setUseWideViewPort(view.getSettings().getUseWideViewPort());
225
- newWebView.getSettings().setSupportMultipleWindows(true);
226
- newWebView.getSettings().setLayoutAlgorithm(view.getSettings().getLayoutAlgorithm());
227
- newWebView.getSettings().setStandardFontFamily(view.getSettings().getStandardFontFamily());
228
- newWebView.getSettings().setFixedFontFamily(view.getSettings().getFixedFontFamily());
229
- newWebView.getSettings().setSansSerifFontFamily(view.getSettings().getSansSerifFontFamily());
230
- newWebView.getSettings().setSerifFontFamily(view.getSettings().getSerifFontFamily());
231
- newWebView.getSettings().setCursiveFontFamily(view.getSettings().getCursiveFontFamily());
232
- newWebView.getSettings().setFantasyFontFamily(view.getSettings().getFantasyFontFamily());
233
- newWebView.getSettings().setMinimumFontSize(view.getSettings().getMinimumFontSize());
234
- newWebView.getSettings().setMinimumLogicalFontSize(view.getSettings().getMinimumLogicalFontSize());
235
- newWebView.getSettings().setDefaultFontSize(view.getSettings().getDefaultFontSize());
236
- newWebView.getSettings().setDefaultFixedFontSize(view.getSettings().getDefaultFixedFontSize());
237
- newWebView.getSettings().setLoadsImagesAutomatically(view.getSettings().getLoadsImagesAutomatically());
238
- newWebView.getSettings().setBlockNetworkImage(view.getSettings().getBlockNetworkImage());
239
- newWebView.getSettings().setJavaScriptEnabled(view.getSettings().getJavaScriptEnabled());
240
- newWebView.getSettings().setDatabaseEnabled(view.getSettings().getDatabaseEnabled());
241
- newWebView.getSettings().setDomStorageEnabled(view.getSettings().getDomStorageEnabled());
242
-
243
- newWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(view.getSettings().getJavaScriptCanOpenWindowsAutomatically());
244
- newWebView.getSettings().setDefaultTextEncodingName(view.getSettings().getDefaultTextEncodingName());
245
- newWebView.getSettings().setUserAgentString(view.getSettings().getUserAgentString());
246
- newWebView.getSettings().setCacheMode(view.getSettings().getCacheMode());
247
-
248
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
249
- newWebView.getSettings().setMixedContentMode(view.getSettings().getMixedContentMode());
250
- }
251
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
252
- newWebView.getSettings().setSafeBrowsingEnabled(view.getSettings().getSafeBrowsingEnabled());
253
- }
254
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
255
- newWebView.getSettings().setForceDark(view.getSettings().getForceDark());
256
- }
257
-
258
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
259
- newWebView.getSettings().setDisabledActionModeMenuItems(view.getSettings().getDisabledActionModeMenuItems());
260
- }
261
- }
262
-
263
117
  @Override
264
118
  public boolean onConsoleMessage(ConsoleMessage message) {
265
119
  if (ReactBuildConfig.DEBUG) {
@@ -276,19 +130,6 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
276
130
  if (progressChangedFilter.isWaitingForCommandLoadUrl()) {
277
131
  return;
278
132
  }
279
-
280
- if(isPopupWebView) {
281
- return;
282
- }
283
-
284
- Log.e("BPCWebChromeClient", "" + isPopupWebView);
285
- // if(this.mWebView == null || this.mWebView.getThemedReactContext() == null) return;
286
- // UIManagerModule uiManager = (this.mWebView.getThemedReactContext()).getNativeModule(UIManagerModule.class);
287
- // if (uiManager == null) {
288
- // Log.e("BPCWebChromeClient", "UIManagerModule is null, skipping event dispatch.");
289
- // return;
290
- // }
291
-
292
133
  int reactTag = BPCWebViewWrapper.getReactTagFromWebView(webView);
293
134
  WritableMap event = Arguments.createMap();
294
135
  event.putDouble("target", reactTag);
@@ -298,8 +139,7 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
298
139
  event.putBoolean("canGoForward", webView.canGoForward());
299
140
  event.putDouble("progress", (float) newProgress / 100);
300
141
 
301
- UIManagerHelper.getEventDispatcherForReactTag(this.mWebView.getThemedReactContext(), reactTag).dispatchEvent(new TopLoadingProgressEvent(reactTag, event));
302
-
142
+ UIManagerHelper.getEventDispatcherForReactTag(this.mWebView.getThemedReactContext(), reactTag).dispatchEvent(new TopLoadingProgressEvent(reactTag, event));
303
143
  }
304
144
 
305
145
  @Override
@@ -1,7 +1,5 @@
1
1
  package kr.co.bootpay.webview;
2
2
 
3
- import android.app.Dialog;
4
-
5
3
  import android.annotation.SuppressLint;
6
4
  import android.graphics.Rect;
7
5
  import android.net.Uri;
@@ -55,28 +53,12 @@ public class BPCWebView extends WebView implements LifecycleEventListener {
55
53
  String injectedJS;
56
54
  protected @Nullable
57
55
  String injectedJSBeforeContentLoaded;
58
-
56
+ protected static final String JAVASCRIPT_INTERFACE = "ReactNativeWebView";
59
57
  protected @Nullable
60
58
  BPCWebViewBridge fallbackBridge;
61
59
  protected @Nullable
62
60
  WebViewCompat.WebMessageListener bridgeListener = null;
63
61
 
64
- /** bootpay added start ***/
65
- protected static final String JAVASCRIPT_INTERFACE = "BootpayRNWebView";
66
-
67
- // protected static final String JAVASCRIPT_INTERFACE = "ReactNativeWebView";
68
-
69
- Dialog dialog; //popup dialog
70
- public void setDialog(Dialog dialog) {
71
- this.dialog = dialog;
72
- }
73
-
74
- public void dissmissDialog() {
75
- if(this.dialog != null) this.dialog.dismiss();
76
- this.dialog = null;
77
- }
78
- /** bootpay added end ***/
79
-
80
62
  /**
81
63
  * android.webkit.WebChromeClient fundamentally does not support JS injection into frames other
82
64
  * than the main frame, so these two properties are mostly here just for parity with iOS & macOS.
@@ -291,12 +273,6 @@ public class BPCWebView extends WebView implements LifecycleEventListener {
291
273
  addJavascriptInterface(fallbackBridge, JAVASCRIPT_INTERFACE);
292
274
  }
293
275
  }
294
-
295
- // if (fallbackBridge == null) {
296
- // fallbackBridge = new BPCWebViewBridge(webView);
297
- // addJavascriptInterface(fallbackBridge, JAVASCRIPT_INTERFACE);
298
- // }
299
-
300
276
  injectJavascriptObject();
301
277
  }
302
278
 
@@ -36,12 +36,6 @@ import android.webkit.CookieSyncManager;
36
36
 
37
37
  import java.util.concurrent.atomic.AtomicReference;
38
38
 
39
- import android.app.AlertDialog;
40
- import android.content.DialogInterface;
41
- import android.content.Intent;
42
- import android.widget.Toast;
43
- import android.util.Log;
44
-
45
39
  public class BPCWebViewClient extends WebViewClient {
46
40
  private static String TAG = "BPCWebViewClient";
47
41
  protected static final int SHOULD_OVERRIDE_URL_LOADING_TIMEOUT = 250;
@@ -102,18 +96,6 @@ public class BPCWebViewClient extends WebViewClient {
102
96
 
103
97
  @Override
104
98
  public boolean shouldOverrideUrlLoading(WebView view, String url) {
105
-
106
- // Log.i("bootpay url", url);
107
- if(BootpayUrlHelper.shouldOverrideUrlLoading(view, url)) {
108
- return true;
109
- }
110
- // return false;
111
- return shouldOverrideUrlLoadingRN(view, url);
112
- }
113
-
114
-
115
-
116
- public boolean shouldOverrideUrlLoadingRN(WebView view, String url) {
117
99
  final BPCWebView BPCWebView = (BPCWebView) view;
118
100
  final boolean isJsDebugging = BPCWebView.getReactApplicationContext().getJavaScriptContextHolder().get() == 0;
119
101
 
@@ -236,36 +218,6 @@ public class BPCWebViewClient extends WebViewClient {
236
218
  );
237
219
  }
238
220
 
239
- void alertSSLError(WebView view, SslErrorHandler handler, SslError error) {
240
- // for SSLErrorHandler
241
- AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext());
242
- builder.setTitle("SSL Connection Error");
243
- builder.setMessage("Your device's Android version is outdated and may not securely connect to our service. To continue using the app securely, please update your device's operating system. If you choose to proceed without updating, it may expose you to security vulnerabilities.");
244
- builder.setPositiveButton("Update", new DialogInterface.OnClickListener() {
245
- @Override
246
- public void onClick(DialogInterface dialog, int which) {
247
- // Redirect the user to the system update settings
248
-
249
-
250
- Intent intent = new Intent("android.settings.SYSTEM_UPDATE_SETTINGS");
251
- if (intent.resolveActivity(view.getContext().getPackageManager()) != null) {
252
- view.getContext().startActivity(intent);
253
- } else {
254
- // If the device does not support system update settings intent
255
- Toast.makeText(view.getContext(), "System update option not available. Please check your device settings manually.", Toast.LENGTH_LONG).show();
256
- }
257
- }
258
- });
259
- builder.setNeutralButton("Cancel", new DialogInterface.OnClickListener() {
260
- @Override
261
- public void onClick(DialogInterface dialog, int which) {
262
- handler.cancel();
263
- }
264
- });
265
- AlertDialog dialog = builder.create();
266
- dialog.show();
267
- }
268
-
269
221
  @Override
270
222
  public void onReceivedError(
271
223
  WebView webView,
@@ -12,7 +12,7 @@
12
12
 
13
13
  using namespace facebook::react;
14
14
 
15
- auto stringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string value) {
15
+ auto bootpayStringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string value) {
16
16
  if (value == "click") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Click;
17
17
  if (value == "formsubmit") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Formsubmit;
18
18
  if (value == "backforward") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Backforward;
@@ -21,7 +21,7 @@ auto stringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string value) {
21
21
  return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Other;
22
22
  }
23
23
 
24
- auto stringToOnLoadingStartNavigationTypeEnum(std::string value) {
24
+ auto bootpayStringToOnLoadingStartNavigationTypeEnum(std::string value) {
25
25
  if (value == "click") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Click;
26
26
  if (value == "formsubmit") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Formsubmit;
27
27
  if (value == "backforward") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Backforward;
@@ -30,7 +30,7 @@ auto stringToOnLoadingStartNavigationTypeEnum(std::string value) {
30
30
  return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Other;
31
31
  }
32
32
 
33
- auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
33
+ auto bootpayStringToOnLoadingFinishNavigationTypeEnum(std::string value) {
34
34
  if (value == "click") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Click;
35
35
  if (value == "formsubmit") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Formsubmit;
36
36
  if (value == "backforward") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Backforward;
@@ -81,7 +81,7 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
81
81
  .url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
82
82
  .lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
83
83
  .title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
84
- .navigationType = stringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
84
+ .navigationType = bootpayStringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
85
85
  .canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
86
86
  .canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoForward"] boolValue]),
87
87
  .isTopFrame = static_cast<bool>([[dictionary valueForKey:@"isTopFrame"] boolValue]),
@@ -98,7 +98,7 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
98
98
  .url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
99
99
  .lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
100
100
  .title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
101
- .navigationType = stringToOnLoadingStartNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
101
+ .navigationType = bootpayStringToOnLoadingStartNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
102
102
  .canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
103
103
  .canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoForward"] boolValue]),
104
104
  .loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
@@ -146,7 +146,7 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
146
146
  .url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
147
147
  .lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
148
148
  .title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
149
- .navigationType = stringToOnLoadingFinishNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String], [[dictionary valueForKey:@"navigationType"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])),
149
+ .navigationType = bootpayStringToOnLoadingFinishNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String], [[dictionary valueForKey:@"navigationType"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])),
150
150
  .canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
151
151
  .canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoForward"] boolValue]),
152
152
  .loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
@@ -36,7 +36,7 @@ shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
36
36
 
37
37
  @end
38
38
 
39
- @interface BPCWeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>
39
+ @interface RNCWeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>
40
40
 
41
41
  @property (nonatomic, weak, nullable) id<WKScriptMessageHandler> scriptDelegate;
42
42