Revert
This commit is contained in:
parent
742629c01a
commit
a8cfeba8bc
|
|
@ -1,16 +0,0 @@
|
||||||
package com.github.catvod.hook;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.ContextWrapper;
|
|
||||||
|
|
||||||
public class Ctx extends ContextWrapper {
|
|
||||||
|
|
||||||
public Ctx(Context base) {
|
|
||||||
super(base);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPackageName() {
|
|
||||||
return "com.android.chrome";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -8,7 +8,6 @@ import android.os.Looper;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.github.catvod.crawler.SpiderDebug;
|
import com.github.catvod.crawler.SpiderDebug;
|
||||||
import com.github.catvod.hook.Ctx;
|
|
||||||
import com.github.catvod.utils.Trans;
|
import com.github.catvod.utils.Trans;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
@ -39,10 +38,6 @@ public class Init {
|
||||||
return get().app;
|
return get().app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Context fakeCtx() {
|
|
||||||
return new Ctx(get().app);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void init(Context context) {
|
public static void init(Context context) {
|
||||||
SpiderDebug.log("自定義爬蟲代碼載入成功!");
|
SpiderDebug.log("自定義爬蟲代碼載入成功!");
|
||||||
get().app = ((Application) context);
|
get().app = ((Application) context);
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ public class Utils {
|
||||||
|
|
||||||
public static void loadWebView(String url, WebViewClient client) {
|
public static void loadWebView(String url, WebViewClient client) {
|
||||||
Init.run(() -> {
|
Init.run(() -> {
|
||||||
WebView webView = new WebView(Init.fakeCtx());
|
WebView webView = new WebView(Init.context());
|
||||||
webView.getSettings().setDatabaseEnabled(true);
|
webView.getSettings().setDatabaseEnabled(true);
|
||||||
webView.getSettings().setDomStorageEnabled(true);
|
webView.getSettings().setDomStorageEnabled(true);
|
||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue