Driving Zone: Germany v1.22.4版本的 MD5 值为:2b6e2d8e8733a3104dcc306c5770286c
以下内容为反编译后的 z.java 源代码,内容仅作参考
package com.my.target;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.ConsoleMessage;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.my.target.z;
public final class z extends b0 {
public a b;
public boolean c;
public boolean d;
public d e;
public interface a {
void a(WebView webView);
void a(String str);
void b(String str);
}
public static final class b extends WebChromeClient {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
w8.a("BannerWebView$MyWebChromeClient: JS console message " + consoleMessage.message() + " at line " + consoleMessage.lineNumber());
return false;
}
}
public final class c extends WebViewClient {
public c() {
}
@Override
public void onPageFinished(WebView webView, String str) {
if (z.this.c) {
return;
}
z.this.c = true;
w8.a("BannerWebView$MyWebViewClient: Page loaded");
super.onPageFinished(webView, str);
if (z.this.b != null) {
z.this.b.a(webView);
}
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
w8.a("BannerWebView$MyWebViewClient: Load page started");
super.onPageStarted(webView, str, bitmap);
}
@Override
public void onReceivedError(WebView webView, int i, String str, String str2) {
w8.a("BannerWebView$MyWebViewClient: Load failed. Error - " + i + ", description - " + str + ", url - " + str2);
super.onReceivedError(webView, i, str, str2);
if (z.this.b == null) {
return;
}
a aVar = z.this.b;
if (str == null) {
str = "unknown JS error";
}
aVar.a(str);
}
@Override
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;
w8.a("BannerWebView$MyWebViewClient: Load failed. Error - " + webResourceError.getErrorCode() + ", description - " + charSequence + ", url - " + webResourceRequest.getUrl().toString());
if (z.this.b == null) {
return;
}
a aVar = z.this.b;
if (charSequence == null) {
charSequence = "Unknown JS error";
}
aVar.a(charSequence);
}
@Override
public void onScaleChanged(WebView webView, float f, float f2) {
super.onScaleChanged(webView, f, f2);
w8.a("BannerWebView$MyWebViewClient: Scale new - " + f2 + ", old - " + f);
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
Uri url;
if (!z.this.d || (url = webResourceRequest.getUrl()) == null) {
return true;
}
z.this.b(url.toString());
z.this.h();
return true;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (z.this.d && str != null) {
z.this.b(str);
z.this.h();
}
return true;
}
}
public interface d {
void a();
}
public static final class e extends GestureDetector {
public final View f5423a;
public a b;
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.f5423a = view;
setIsLongpressEnabled(false);
}
public void a(MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action != 0) {
if (action == 1) {
if (this.b == null) {
w8.a("BannerWebView$ViewGestureDetector: View's onUserClick() is not registered");
return;
} else {
w8.a("BannerWebView$ViewGestureDetector: Gestures - user clicked");
this.b.a();
return;
}
}
if (action != 2 || !a(motionEvent, this.f5423a)) {
return;
}
}
onTouchEvent(motionEvent);
}
public void a(a aVar) {
this.b = aVar;
}
public final boolean a(MotionEvent motionEvent, View view) {
if (motionEvent == null || view == null) {
return false;
}
float x = motionEvent.getX();
float y = motionEvent.getY();
return x >= 0.0f && x <= ((float) view.getWidth()) && y >= 0.0f && y <= ((float) view.getHeight());
}
}
public z(Context context) {
super(context);
b bVar = new b();
c cVar = new c();
final e eVar = new e(getContext(), this);
eVar.a(new e.a() {
@Override
public final void a() {
z.this.g();
}
});
setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
return z.a(z.e.this, view, motionEvent);
}
});
setHorizontalScrollBarEnabled(false);
setVerticalScrollBarEnabled(false);
WebSettings settings = getSettings();
if (settings != null) {
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setAppCacheEnabled(true);
settings.setSupportZoom(false);
settings.setAppCachePath(getContext().getCacheDir().getAbsolutePath());
settings.setAllowFileAccess(false);
settings.setAllowContentAccess(false);
if (Build.VERSION.SDK_INT >= 16) {
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.d = true;
}
public void b(String str) {
a aVar = this.b;
if (aVar != null) {
aVar.b(str);
}
}
public void h() {
this.d = false;
}
@Override
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
d dVar = this.e;
if (dVar != null) {
dVar.a();
}
}
public void setBannerWebViewListener(a aVar) {
this.b = aVar;
}
public void setData(String str) {
this.c = false;
this.d = false;
a("https://ad.mail.ru/", str, "text/html", "UTF-8", null);
}
public void setOnLayoutListener(d dVar) {
this.e = dVar;
}
}