|
@@ -1,6 +1,7 @@
|
|
|
package com.sheep.gamegroup.module.webview.fragment;
|
|
package com.sheep.gamegroup.module.webview.fragment;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
|
|
+import android.util.Log;
|
|
|
import com.tencent.smtt.sdk.CookieManager;
|
|
import com.tencent.smtt.sdk.CookieManager;
|
|
|
import com.tencent.smtt.sdk.CookieSyncManager;
|
|
import com.tencent.smtt.sdk.CookieSyncManager;
|
|
|
|
|
|
|
@@ -13,14 +14,14 @@ import java.util.Collection;
|
|
|
public class WebViewUtils {
|
|
public class WebViewUtils {
|
|
|
public static void deleteWebViewCookiesForDomains(Context context, Collection<String> domains) {
|
|
public static void deleteWebViewCookiesForDomains(Context context, Collection<String> domains) {
|
|
|
for (String d : domains) {
|
|
for (String d : domains) {
|
|
|
- deleteWebViewCookiesForDomain(context, d, false);
|
|
|
|
|
|
|
+ //deleteWebViewCookiesForDomain(context, d, false);
|
|
|
deleteWebViewCookiesForDomain(context, d, true);
|
|
deleteWebViewCookiesForDomain(context, d, true);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void deleteWebViewCookiesForDomain(Context context, String domain, boolean secure) {
|
|
public static void deleteWebViewCookiesForDomain(Context context, String domain, boolean secure) {
|
|
|
CookieManager cm = CookieManager.getInstance();
|
|
CookieManager cm = CookieManager.getInstance();
|
|
|
-
|
|
|
|
|
|
|
+ cm.setAcceptCookie(true);
|
|
|
/* http://code.google.com/p/android/issues/detail?id=19294 */
|
|
/* http://code.google.com/p/android/issues/detail?id=19294 */
|
|
|
/*if (AndroidUtils.SDK_INT >= 11) {
|
|
/*if (AndroidUtils.SDK_INT >= 11) {
|
|
|
// don't trim leading '.'s
|
|
// don't trim leading '.'s
|
|
@@ -33,6 +34,7 @@ public class WebViewUtils {
|
|
|
* https) (although they do have an optional 'secure' flag.) */
|
|
* https) (although they do have an optional 'secure' flag.) */
|
|
|
domain = "http" + (secure ? "s" : "") + "://" + domain;
|
|
domain = "http" + (secure ? "s" : "") + "://" + domain;
|
|
|
String cookieGlob = cm.getCookie(domain);
|
|
String cookieGlob = cm.getCookie(domain);
|
|
|
|
|
+ Log.d("@@@@@@",cookieGlob);
|
|
|
if (cookieGlob != null) {
|
|
if (cookieGlob != null) {
|
|
|
String[] cookies = cookieGlob.split(";");
|
|
String[] cookies = cookieGlob.split(";");
|
|
|
for (String cookieTuple : cookies) {
|
|
for (String cookieTuple : cookies) {
|