Proxy Master v3.4.9版本的 MD5 值为:14d0aa2468d13530c8f6e96bcc114bf5
以下内容为反编译后的 e0.java 源代码,内容仅作参考
package com.my.target;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.ConsoleMessage;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public final class e0 extends h0 {
public a f9355d;
public boolean f9356e;
public boolean f9357f;
public d f9358g;
public interface a {
void a(WebView webView);
void a(String str);
@TargetApi(26)
void b();
void b(String str);
}
public static final class b extends WebChromeClient {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
String message = consoleMessage.message();
int lineNumber = consoleMessage.lineNumber();
ba.a("BannerWebView$MyWebChromeClient: JS console message " + message + " at line " + lineNumber);
return false;
}
}
public final class c extends WebViewClient {
public c() {
e0.this = r1;
}
@Override
public void onPageFinished(WebView webView, String str) {
e0 e0Var = e0.this;
if (e0Var.f9356e) {
return;
}
e0Var.f9356e = true;
ba.a("BannerWebView$MyWebViewClient: Page loaded");
super.onPageFinished(webView, str);
a aVar = e0.this.f9355d;
if (aVar != null) {
aVar.a(webView);
}
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
ba.a("BannerWebView$MyWebViewClient: Load page started");
super.onPageStarted(webView, str, bitmap);
}
@Override
public void onReceivedError(WebView webView, int i10, String str, String str2) {
ba.a("BannerWebView$MyWebViewClient: Load failed. Error - " + i10 + ", description - " + str + ", url - " + str2);
super.onReceivedError(webView, i10, str, str2);
a aVar = e0.this.f9355d;
if (aVar == null) {
return;
}
if (str == null) {
str = "unknown JS error";
}
aVar.a(str);
}
@Override
@TargetApi(23)
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
super.onReceivedError(webView, webResourceRequest, webResourceError);
CharSequence description = webResourceError.getDescription();
String charSequence = description != null ? description.toString() : null;
int errorCode = webResourceError.getErrorCode();
String uri = webResourceRequest.getUrl().toString();
ba.a("BannerWebView$MyWebViewClient: Load failed. Error - " + errorCode + ", description - " + charSequence + ", url - " + uri);
a aVar = e0.this.f9355d;
if (aVar == null) {
return;
}
if (charSequence == null) {
charSequence = "Unknown JS error";
}
aVar.a(charSequence);
}
@Override
@TargetApi(26)
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
ba.b("WebView crashed");
a aVar = e0.this.f9355d;
if (aVar != null) {
aVar.b();
return true;
}
return true;
}
@Override
public void onScaleChanged(WebView webView, float f10, float f11) {
super.onScaleChanged(webView, f10, f11);
ba.a("BannerWebView$MyWebViewClient: Scale new - " + f11 + ", old - " + f10);
}
@Override
@TargetApi(24)
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
Uri url;
if (e0.this.f9357f && (url = webResourceRequest.getUrl()) != null) {
e0.this.c(url.toString());
e0.this.h();
return true;
}
return true;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
e0 e0Var = e0.this;
if (e0Var.f9357f && str != null) {
e0Var.c(str);
e0.this.h();
}
return true;
}
}
public interface d {
void a();
}
public static final class e extends GestureDetector {
public final View f9360a;
public a f9361b;
public interface a {
void a();
}
public e(Context context, View view) {
this(context, view, new GestureDetector.SimpleOnGestureListener());
}
public e(Context context, View view, GestureDetector.SimpleOnGestureListener simpleOnGestureListener) {
super(context, simpleOnGestureListener);
this.f9360a = view;
setIsLongpressEnabled(false);
}
public void a(MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action != 0) {
if (action == 1) {
if (this.f9361b == null) {
ba.a("BannerWebView$ViewGestureDetector: View's onUserClick() is not registered");
return;
}
ba.a("BannerWebView$ViewGestureDetector: Gestures - user clicked");
this.f9361b.a();
return;
} else if (action != 2 || !a(motionEvent, this.f9360a)) {
return;
}
}
onTouchEvent(motionEvent);
}
public void a(a aVar) {
this.f9361b = aVar;
}
public final boolean a(MotionEvent motionEvent, View view) {
if (motionEvent == null || view == null) {
return false;
}
float x8 = motionEvent.getX();
float y5 = motionEvent.getY();
return x8 >= 0.0f && x8 <= ((float) view.getWidth()) && y5 >= 0.0f && y5 <= ((float) view.getHeight());
}
}
@SuppressLint({"SetJavaScriptEnabled"})
public e0(Context context) {
super(context);
b bVar = new b();
c cVar = new c();
e eVar = new e(getContext(), this);
eVar.a(new e4.e(this, 18));
setOnTouchListener(new wa(eVar, 0));
setHorizontalScrollBarEnabled(false);
setVerticalScrollBarEnabled(false);
WebSettings settings = getSettings();
if (settings != null) {
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setSupportZoom(false);
settings.setAllowFileAccess(false);
settings.setAllowContentAccess(false);
settings.setAllowFileAccessFromFileURLs(false);
settings.setAllowUniversalAccessFromFileURLs(false);
}
setWebChromeClient(bVar);
setWebViewClient(cVar);
}
public static boolean a(e eVar, View view, MotionEvent motionEvent) {
eVar.a(motionEvent);
return false;
}
public void g() {
this.f9357f = true;
}
public void b(String str) {
WebView webView = getWebView();
if (webView == null) {
return;
}
webView.evaluateJavascript(str, null);
}
public void c(String str) {
a aVar = this.f9355d;
if (aVar != null) {
aVar.b(str);
}
}
public void h() {
this.f9357f = false;
}
@Override
public void onLayout(boolean z6, int i10, int i11, int i12, int i13) {
super.onLayout(z6, i10, i11, i12, i13);
d dVar = this.f9358g;
if (dVar != null) {
dVar.a();
}
}
public void setBannerWebViewListener(a aVar) {
this.f9355d = aVar;
}
public void setData(String str) {
this.f9356e = false;
this.f9357f = false;
a("https://ad.mail.ru/", str, "text/html", "UTF-8", null);
}
public void setForceMediaPlayback(boolean z6) {
WebView webView = getWebView();
if (webView == null) {
return;
}
webView.getSettings().setMediaPlaybackRequiresUserGesture(!z6);
}
public void setOnLayoutListener(d dVar) {
this.f9358g = dVar;
}
}