cordova-certificate-plugin icon indicating copy to clipboard operation
cordova-certificate-plugin copied to clipboard

android inappbrowser is not opening

Open nissarcs opened this issue 9 years ago • 16 comments

I could not able to display the self signed url from inappbrowser

function onDeviceReady(){ ref = window.open('test url /self signed, '_blank', ); }

getting the below error


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

nissarcs avatar Oct 19 '15 15:10 nissarcs

what cordova and android version are you using?

hypery2k avatar Oct 19 '15 20:10 hypery2k

cordova 5.3.3 and android api 22

nissarcs avatar Oct 20 '15 04:10 nissarcs

my logcat error actually this

10-20 13:54:42.979 5695-5695/? D/dalvikvm: Late-enabling CheckJNI 10-20 13:54:43.199 5695-5695/cbl.cblife I/dalvikvm: Could not find method android.webkit.WebView.setWebContentsDebuggingEnabled, referenced from method org.apache.cordova.engine.SystemWebViewEngine.enableRemoteDebugging 10-20 13:54:43.199 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to resolve static method 268: Landroid/webkit/WebView;.setWebContentsDebuggingEnabled (Z)V 10-20 13:54:43.199 5695-5695/cbl.cblife D/dalvikvm: VFY: replacing opcode 0x71 at 0x0001 10-20 13:54:43.339 5695-5695/cbl.cblife I/webclipboard: clipservice: android.sec.clipboard.ClipboardExManager@4227aa40 10-20 13:54:43.499 5695-5695/cbl.cblife I/dalvikvm: Could not find method android.webkit.CookieManager.setAcceptThirdPartyCookies, referenced from method org.apache.cordova.engine.SystemCookieManager. 10-20 13:54:43.499 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to resolve virtual method 206: Landroid/webkit/CookieManager;.setAcceptThirdPartyCookies (Landroid/webkit/WebView;Z)V 10-20 13:54:43.499 5695-5695/cbl.cblife D/dalvikvm: VFY: replacing opcode 0x6e at 0x0016 10-20 13:54:43.499 5695-5695/cbl.cblife I/dalvikvm: Could not find method android.webkit.CookieManager.flush, referenced from method org.apache.cordova.engine.SystemCookieManager.flush 10-20 13:54:43.499 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to resolve virtual method 200: Landroid/webkit/CookieManager;.flush ()V 10-20 13:54:43.499 5695-5695/cbl.cblife D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008 10-20 13:54:43.560 5695-5734/cbl.cblife V/webkit: BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {422782c0} 10-20 13:54:43.560 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;) 10-20 13:54:43.570 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;) 10-20 13:54:43.570 5695-5695/cbl.cblife I/dalvikvm: Could not find method android.webkit.WebViewClient.onReceivedClientCertRequest, referenced from method org.apache.cordova.engine.SystemWebViewClient.onReceivedClientCertRequest 10-20 13:54:43.570 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to resolve virtual method 273: Landroid/webkit/WebViewClient;.onReceivedClientCertRequest (Landroid/webkit/WebView;Landroid/webkit/ClientCertRequest;)V 10-20 13:54:43.570 5695-5695/cbl.cblife D/dalvikvm: VFY: replacing opcode 0x6f at 0x001a 10-20 13:54:43.580 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/PermissionRequest;) 10-20 13:54:43.580 5695-5695/cbl.cblife I/dalvikvm: Could not find method android.webkit.PermissionRequest.getResources, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onPermissionRequest 10-20 13:54:43.580 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to resolve virtual method 217: Landroid/webkit/PermissionRequest;.getResources ()[Ljava/lang/String; 10-20 13:54:43.580 5695-5695/cbl.cblife D/dalvikvm: VFY: replacing opcode 0x6e at 0x000d 10-20 13:54:43.580 5695-5695/cbl.cblife I/dalvikvm: Could not find method android.webkit.WebChromeClient$FileChooserParams.createIntent, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onShowFileChooser 10-20 13:54:43.580 5695-5695/cbl.cblife W/dalvikvm: VFY: unable to resolve virtual method 222: Landroid/webkit/WebChromeClient$FileChooserParams;.createIntent ()Landroid/content/Intent; 10-20 13:54:43.580 5695-5695/cbl.cblife D/dalvikvm: VFY: replacing opcode 0x6e at 0x0000 10-20 13:54:43.580 5695-5695/cbl.cblife D/SystemWebViewEngine: CordovaWebView is running on device made by: samsung 10-20 13:54:43.630 5695-5695/cbl.cblife D/dalvikvm: GC_FOR_ALLOC freed 156K, 15% free 8731K/10168K, paused 26ms, total 26ms 10-20 13:54:43.630 5695-5695/cbl.cblife I/dalvikvm-heap: Grow heap (frag case) to 11.239MB for 1536016-byte allocation 10-20 13:54:43.680 5695-5749/cbl.cblife D/dalvikvm: GC_FOR_ALLOC freed 4K, 13% free 10227K/11672K, paused 41ms, total 41ms 10-20 13:54:43.740 5695-5695/cbl.cblife D/WebView: loadUrlImpl: called 10-20 13:54:43.790 5695-5699/cbl.cblife E/dalvikvm: adjustAdaptiveCoef max=4194304, min=1048576, ut=568 10-20 13:54:43.800 5695-5699/cbl.cblife D/dalvikvm: GC_CONCURRENT freed 55K, 12% free 10297K/11692K, paused 17ms+21ms, total 107ms 10-20 13:54:43.810 5695-5695/cbl.cblife D/libEGL: loaded /vendor/lib/egl/libGLES_vc4.so 10-20 13:54:43.820 5695-5734/cbl.cblife D/webcore: CORE loadUrl: called 10-20 13:54:43.820 5695-5734/cbl.cblife D/webkit: Firewall not null 10-20 13:54:43.820 5695-5734/cbl.cblife D/webkit: euler: isUrlBlocked = false 10-20 13:54:43.830 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:43.830 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4e6727f8, 480x800 hintTransform 0x0 do_pre 1 10-20 13:54:43.900 5695-5695/cbl.cblife D/OpenGLRenderer: Enabling debug mode 0 10-20 13:54:43.910 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:43.910 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4f52a7e8, 480x800 hintTransform 0x0 do_pre 1 10-20 13:54:43.910 5695-5695/cbl.cblife D/WebView: onSizeChanged - w:480 h:762 10-20 13:54:44.190 5695-5695/cbl.cblife D/JsMessageQueue: Set native->JS mode to OnlineEventsBridgeMode 10-20 13:54:44.240 5695-5734/cbl.cblife I/GATE: <GATE-M>DEV_ACTION_COMPLETED</GATE-M> 10-20 13:54:44.310 5695-5734/cbl.cblife D/CordovaNetworkManager: Connection Type: wifi 10-20 13:54:44.310 5695-5734/cbl.cblife D/CordovaNetworkManager: Connection Extra Info: "Trigent_wap-CA" 10-20 13:54:44.320 5695-5695/cbl.cblife D/TilesManager: Starting TG #0, 0x4f535d38 10-20 13:54:44.320 5695-5695/cbl.cblife D/TilesManager: new EGLContext from framework: 4f251368 10-20 13:54:44.320 5695-5695/cbl.cblife D/GLWebViewState: Reinit shader 10-20 13:54:44.350 5695-5695/cbl.cblife D/GLWebViewState: Reinit transferQueue 10-20 13:54:44.360 5695-5695/cbl.cblife D/CordovaNetworkManager: Connection Type: wifi 10-20 13:54:44.360 5695-5695/cbl.cblife D/CordovaNetworkManager: Connection Extra Info: "Trigent_wap-CA" 10-20 13:54:45.241 5695-5734/cbl.cblife D/InAppBrowser: target = blank 10-20 13:54:45.251 5695-5695/cbl.cblife D/InAppBrowser: in blank 10-20 13:54:45.451 5695-5734/cbl.cblife V/webkit: BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {424af0d0} 10-20 13:54:45.451 5695-5695/cbl.cblife I/webclipboard: clipservice: android.sec.clipboard.ClipboardExManager@4227aa40 10-20 13:54:45.481 5695-5695/cbl.cblife D/WebView: loadUrlImpl: called 10-20 13:54:45.491 5695-5734/cbl.cblife D/webcore: CORE loadUrl: called 10-20 13:54:45.491 5695-5734/cbl.cblife D/webkit: Firewall not null 10-20 13:54:45.491 5695-5734/cbl.cblife D/webkit: euler: isUrlBlocked = false 10-20 13:54:45.561 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:45.561 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4f92bd58, 480x762 hintTransform 0x0 do_pre 1 10-20 13:54:45.561 5695-5695/cbl.cblife D/WebView: onSizeChanged - w:480 h:762 10-20 13:54:45.812 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:45.812 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4f9dc578, 480x307 hintTransform 0x0 do_pre 1 10-20 13:54:47.573 5695-5784/cbl.cblife V/chromium: external/chromium/net/socket/ssl_client_socket_openssl.cc:310: [1020/135447:INFO:ssl_client_socket_openssl.cc(310)] ssl_ctx is used 10-20 13:54:47.764 5695-5695/cbl.cblife D/GestureDetector: [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 3 mFalseSizeCnt:0 10-20 13:54:47.814 5695-5695/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x933 10-20 13:54:47.844 5695-5695/cbl.cblife D/ProgressBar: setProgress = 0 10-20 13:54:47.844 5695-5695/cbl.cblife D/ProgressBar: setProgress = 0, fromUser = false 10-20 13:54:47.844 5695-5695/cbl.cblife D/ProgressBar: mProgress = 0mIndeterminate = false, mMin = 0, mMax = 10000 10-20 13:54:47.894 5695-5695/cbl.cblife D/ProgressBar: setProgress = 0 10-20 13:54:47.894 5695-5695/cbl.cblife D/ProgressBar: setProgress = 0, fromUser = false 10-20 13:54:47.894 5695-5695/cbl.cblife D/ProgressBar: mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100 10-20 13:54:47.924 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:47.924 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4f9dc578, 72x72 hintTransform 0x0 do_pre 1 10-20 13:54:47.924 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: left = 0 10-20 13:54:47.924 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: top = 0 10-20 13:54:47.924 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: right = 72 10-20 13:54:47.924 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: bottom = 72 10-20 13:54:47.944 5695-5695/cbl.cblife E/ViewRootImpl: sendUserActionEvent() mView == null 10-20 13:54:50.646 5695-5784/cbl.cblife V/chromium: external/chromium/net/socket/ssl_client_socket_openssl.cc:508: [1020/135450:INFO:ssl_client_socket_openssl.cc(508)] ~SSLClientSocketOpenSSL() 10-20 13:54:50.656 5695-5734/cbl.cblife I/GATE: <GATE-M>DEV_ACTION_COMPLETED</GATE-M> 10-20 13:54:50.666 5695-5695/cbl.cblife W/Web Console: The page displayed insecure content! 10-20 13:54:50.666 5695-5695/cbl.cblife W/Web Console: :1 10-20 13:54:50.747 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:50.747 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4fa69588, 480x307 hintTransform 0x0 do_pre 1 10-20 13:54:52.128 5695-5699/cbl.cblife D/dalvikvm: GC_CONCURRENT freed 682K, 16% free 10909K/12872K, paused 2ms+3ms, total 34ms 10-20 13:54:52.188 5695-5695/cbl.cblife D/GestureDetector: [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 2 mFalseSizeCnt:0 10-20 13:54:52.218 5695-5695/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x933 10-20 13:54:52.238 5695-5734/cbl.cblife I/GATE: <GATE-M>DEV_ACTION_COMPLETED</GATE-M> 10-20 13:54:52.258 5695-5695/cbl.cblife D/ProgressBar: setProgress = 0 10-20 13:54:52.258 5695-5695/cbl.cblife D/ProgressBar: setProgress = 0, fromUser = false 10-20 13:54:52.258 5695-5695/cbl.cblife D/ProgressBar: mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100 10-20 13:54:52.378 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: left = 0 10-20 13:54:52.378 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: top = 0 10-20 13:54:52.378 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: right = 72 10-20 13:54:52.378 5695-5695/cbl.cblife D/ProgressBar: updateDrawableBounds: bottom = 72 10-20 13:54:52.388 5695-5695/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x933 10-20 13:54:52.418 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:52.418 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4f4b3368, 480x307 hintTransform 0x0 do_pre 1 10-20 13:54:52.428 5695-5695/cbl.cblife E/ViewRootImpl: sendUserActionEvent() mView == null 10-20 13:54:52.468 5695-5695/cbl.cblife E/ViewRootImpl: sendUserActionEvent() mView == null 10-20 13:54:54.150 5695-5695/cbl.cblife D/GestureDetector: [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 3 mFalseSizeCnt:0 10-20 13:54:54.680 5695-5695/cbl.cblife D/GestureDetector: [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 3 mFalseSizeCnt:0 10-20 13:54:54.700 5695-5695/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x933 10-20 13:54:54.791 5695-5695/cbl.cblife W/khrn_client: init_window num_buffers 3 min undequeued buffers 1 10-20 13:54:54.791 5695-5695/cbl.cblife W/khrn_client: init_window window 0x4f9dc578, 480x307 hintTransform 0x0 do_pre 1 10-20 13:54:54.811 5695-5831/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x133 10-20 13:54:54.821 5695-5831/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x133 10-20 13:54:54.831 5695-5695/cbl.cblife E/ViewRootImpl: sendUserActionEvent() mView == null 10-20 13:54:54.841 5695-5831/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x133 10-20 13:54:54.841 5695-5831/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x133 10-20 13:54:55.601 5695-5695/cbl.cblife D/GestureDetector: [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 2 mFalseSizeCnt:0 10-20 13:54:55.621 5695-5695/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x933 10-20 13:54:55.661 5695-5695/cbl.cblife E/ViewRootImpl: sendUserActionEvent() mView == null 10-20 13:54:55.872 5695-5831/cbl.cblife I/brcm-gr: [gralloc_lock]: new usage 0x133

nissarcs avatar Oct 20 '15 08:10 nissarcs

i cannot see any issue from my plugin. It's just cordova core errors in the log data. Did you tried without the plugin?

hypery2k avatar Oct 20 '15 10:10 hypery2k

were i have to add this code cordova.plugins.certificates.trustUnsecureCerts(true)

nissarcs avatar Oct 20 '15 10:10 nissarcs

after the deviceReady but before you're window.open

hypery2k avatar Oct 20 '15 11:10 hypery2k

now its coming web page not available in browser am not getting any idea please help me out for this issue if possible i will send you the code by mail

nissarcs avatar Oct 20 '15 11:10 nissarcs

send me your project via mail. I can take a look at it

hypery2k avatar Oct 23 '15 14:10 hypery2k

could you send me your mail id

On Fri, Oct 23, 2015 at 8:29 PM, Martin Reinhardt [email protected] wrote:

send me your project via mail. I can take a look at it

— Reply to this email directly or view it on GitHub https://github.com/hypery2k/cordova-certificate-plugin/issues/10#issuecomment-150598796 .

nissarcs avatar Oct 29 '15 09:10 nissarcs

You find it in my Profile https://github.com/hypery2k

hypery2k avatar Oct 29 '15 12:10 hypery2k

Hi i sent project to your mail please look and give me some solution regreding self signed certificate

On Thu, Oct 29, 2015 at 6:17 PM, Martin Reinhardt [email protected] wrote:

You find it in my Profile https://github.com/hypery2k

— Reply to this email directly or view it on GitHub https://github.com/hypery2k/cordova-certificate-plugin/issues/10#issuecomment-152167910 .

nissarcs avatar Nov 09 '15 10:11 nissarcs

I've received you're mail, but you need to confirm the GoogleDrive invitation you sent to me

hypery2k avatar Nov 10 '15 07:11 hypery2k

@hypery2k I'm impressed by your patience :)

escapedcat avatar Nov 10 '15 08:11 escapedcat

you have to edit InAppBrower.java file in the inappbrowser plugin, see https://github.com/apache/cordova-plugin-inappbrowser/blob/master/src/android/InAppBrowser.java#L851

Add this code:

public void onReceivedSslError(WebView view,
            SslErrorHandler handler, SslError error) {
    handler.proceed();
}

to the InAppBrower.java file from the plugin.

Do overcome this completly I have to also include the inappbrowser within this plugin to get this working

Hope this helps!

hypery2k avatar Nov 11 '15 13:11 hypery2k

Thanks for your patience and i have done it already its working you could have seen in my code i commented that because by proceeding handler.proceed(); this function loastart() loadstop() events are not firing because based on loadstart and loadstop am adding spinner as well as some other functionalities based on the loadstart url . Even its great help from your side because i have tried with all the solution then only i written here . once more i appreciated your patience . i will ask my company people to provide payed certificate to go ahead with this work

On Wed, Nov 11, 2015 at 6:59 PM, Martin Reinhardt [email protected] wrote:

you have to edit InAppBrower.java file in the inappbrowser plugin, see https://github.com/apache/cordova-plugin-inappbrowser/blob/master/src/android/InAppBrowser.java#L851

Add this code:

public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { handler.proceed(); }

to the InAppBrower.java file from the plugin.

Do overcome this completly I have to also include the inappbrowser within this plugin to get this working

Hope this helps!

— Reply to this email directly or view it on GitHub https://github.com/hypery2k/cordova-certificate-plugin/issues/10#issuecomment-155785607 .

nissarcs avatar Nov 12 '15 05:11 nissarcs

Hello @hypery2k how to enable this code on device ready function? cordova.plugins.certificates.trustUnsecureCerts(true); Getting an error "Cannot find name cordova". Am I missing to import something?

baldawayash15 avatar Apr 08 '18 10:04 baldawayash15