2

Is there any possibility to support TLS 1.2 in a WebView on pre Kitkat?

I found this SO question but I wonder if anybody know an answer for it right now:

Enabling specific SSL protocols with Android WebViewClient

Community
  • 1
  • 1
Francesco verheye
  • 1,574
  • 2
  • 14
  • 32

1 Answers1

1

I've tried all the available solutions but non of the working for webview below 4.3. The solution I found would be replacing WebView with CrossWalk. downside would be increasing your apk file size by 40mb, unless you optimize it by splitting arm and x86.

in build.gradle

repositories {
    maven {
        url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
    }
}

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.1' //optional, in case you have compile issue.
    }
}

implementation 'org.xwalk:xwalk_core_library:19.49.514.5' //latest available library for min 14 API

layout

 <org.xwalk.core.XWalkView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/web_view"/>

code

XWalkView webview = (XWalkView) findViewById(R.id.web_view);
webview.load(url,null);

Javascript and DOM storage enabled by default. Two line of codes will do the basic job.

JR Tan
  • 1,703
  • 4
  • 17
  • 35