diff --git a/WebCast/src/main/java/com/github/warren_bank/webcast/webview/BrowserActivity.java b/WebCast/src/main/java/com/github/warren_bank/webcast/webview/BrowserActivity.java index ca46481..3a35b79 100644 --- a/WebCast/src/main/java/com/github/warren_bank/webcast/webview/BrowserActivity.java +++ b/WebCast/src/main/java/com/github/warren_bank/webcast/webview/BrowserActivity.java @@ -11,19 +11,15 @@ import android.graphics.Bitmap; import android.os.Build; import android.os.Bundle; -import com.google.android.material.snackbar.Snackbar; -import androidx.drawerlayout.widget.DrawerLayout; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.SearchView; -import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.webkit.CookieManager; import android.webkit.WebResourceError; import android.webkit.WebResourceRequest; import android.webkit.WebSettings; +import android.webkit.WebStorage; import android.webkit.WebView; import android.widget.AdapterView; import android.widget.ArrayAdapter; @@ -31,6 +27,12 @@ import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.SearchView; +import androidx.appcompat.widget.Toolbar; +import com.google.android.material.snackbar.Snackbar; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -245,6 +247,16 @@ public void onDestroy() { webView.clearCache(true); webView.clearHistory(); + webView.clearFormData(); + webView.clearSslPreferences(); + WebStorage.getInstance().deleteAllData(); + if (Build.VERSION.SDK_INT >= 21) { + CookieManager.getInstance().removeAllCookies(null); + CookieManager.getInstance().flush(); + } + else { + CookieManager.getInstance().removeAllCookie(); + } } // --------------------------------------------------------------------------------------------- @@ -825,6 +837,7 @@ public void onReceivedError(WebView view, WebResourceRequest request, WebResourc webSettings.setDisplayZoomControls(true); webSettings.setUseWideViewPort(false); webSettings.setJavaScriptEnabled(true); + webSettings.setDomStorageEnabled(true); webSettings.setUserAgentString( getResources().getString(R.string.user_agent) ); diff --git a/constants.gradle b/constants.gradle index 8038a19..862a988 100644 --- a/constants.gradle +++ b/constants.gradle @@ -1,11 +1,11 @@ project.ext { - releaseVersionCode = 004070316 - releaseVersion = '004.07.03-16API' + releaseVersionCode = 004070416 + releaseVersion = '004.07.04-16API' minSdkVersion = 16 targetSdkVersion = 28 compileSdkVersion = 28 buildToolsVersion = '28.0.3' - jetpackVersion = '1.0.0' javaVersion = JavaVersion.VERSION_1_8 + jetpackVersion = '1.0.0' exoPlayerVersion = '2.10.0' }