Weather Tracker v1.0.0版本的 MD5 值为:3edef27647e42a8ea0e7c0d2dbf56f97
以下内容为反编译后的 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;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.my.target.e0;
public final class e0 extends g0 {
@Nullable
public a d;
public boolean e;
public boolean f;
@Nullable
public d g;
public interface a {
void a(@NonNull WebView webView);
void a(@NonNull String str);
void b(@NonNull String str);
@TargetApi(26)
void c();
}
public static final class b extends WebChromeClient {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
String message = consoleMessage.message();
int lineNumber = consoleMessage.lineNumber();
o9.a("BannerWebView$MyWebChromeClient: JS console message " + message + " at line " + lineNumber);
return false;
}
}
public final class c extends WebViewClient {
public c() {
}
@Override
public void onPageFinished(WebView webView, String str) {
if (e0.this.e) {
return;
}
e0.this.e = true;
o9.a("BannerWebView$MyWebViewClient: Page loaded");
super.onPageFinished(webView, str);
a aVar = e0.this.d;
if (aVar != null) {
aVar.a(webView);
}
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
o9.a("BannerWebView$MyWebViewClient: Load page started");
super.onPageStarted(webView, str, bitmap);
}
@Override
public void onReceivedError(WebView webView, int i, String str, String str2) {
o9.a("BannerWebView$MyWebViewClient: Load failed. Error - " + i + ", description - " + str + ", url - " + str2);
super.onReceivedError(webView, i, str, str2);
a aVar = e0.this.d;
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();
o9.a("BannerWebView$MyWebViewClient: Load failed. Error - " + errorCode + ", description - " + charSequence + ", url - " + uri);
a aVar = e0.this.d;
if (aVar == null) {
return;
}
if (charSequence == null) {
charSequence = "Unknown JS error";
}
aVar.a(charSequence);
}
@Override
@TargetApi(26)
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
o9.b("WebView crashed");
a aVar = e0.this.d;
if (aVar != null) {
aVar.c();
return true;
}
return true;
}
@Override
public void onScaleChanged(WebView webView, float f, float f2) {
super.onScaleChanged(webView, f, f2);
o9.a("BannerWebView$MyWebViewClient: Scale new - " + f2 + ", old - " + f);
}
@Override
@TargetApi(24)
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
Uri url;
if (e0.this.f && (url = webResourceRequest.getUrl()) != null) {
e0.this.c(url.toString());
e0.this.h();
return true;
}
return true;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
if (e0.this.f && str != null) {
e0.this.c(str);
e0.this.h();
}
return true;
}
}
public interface d {
void a();
}
public static final class e extends GestureDetector {
@NonNull
public final View a;
@Nullable
public a f4381b;
public interface a {
void a();
}
public e(@NonNull Context context, @NonNull View view) {
this(context, view, new GestureDetector.SimpleOnGestureListener());
}
public e(@NonNull Context context, @NonNull View view, @NonNull GestureDetector.SimpleOnGestureListener simpleOnGestureListener) {
super(context, simpleOnGestureListener);
this.a = view;
setIsLongpressEnabled(false);
}
public void a(@NonNull MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action != 0) {
if (action == 1) {
if (this.f4381b == null) {
o9.a("BannerWebView$ViewGestureDetector: View's onUserClick() is not registered");
return;
}
o9.a("BannerWebView$ViewGestureDetector: Gestures - user clicked");
this.f4381b.a();
return;
} else if (action != 2 || !a(motionEvent, this.a)) {
return;
}
}
onTouchEvent(motionEvent);
}
public void a(@Nullable a aVar) {
this.f4381b = aVar;
}
public final boolean a(@Nullable MotionEvent motionEvent, @Nullable 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());
}
}
@SuppressLint({"SetJavaScriptEnabled"})
public e0(@NonNull 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() {
e0.this.g();
}
});
setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
return e0.a(e0.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);
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.f = true;
}
public void b(@NonNull String str) {
WebView webView = getWebView();
if (webView == null) {
return;
}
webView.evaluateJavascript(str, null);
}
public void c(@NonNull String str) {
a aVar = this.d;
if (aVar != null) {
aVar.b(str);
}
}
public void h() {
this.f = 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.g;
if (dVar != null) {
dVar.a();
}
}
public void setBannerWebViewListener(@Nullable a aVar) {
this.d = aVar;
}
public void setData(@NonNull String str) {
this.e = false;
this.f = false;
a("https://ad.mail.ru/", str, "text/html", "UTF-8", null);
}
public void setForceMediaPlayback(boolean z) {
WebView webView = getWebView();
if (webView == null) {
return;
}
webView.getSettings().setMediaPlaybackRequiresUserGesture(!z);
}
public void setOnLayoutListener(@Nullable d dVar) {
this.g = dVar;
}
}