FlixOlé v4.4.0版本的 MD5 值为:50e7f767ca3e8715936523e9ef089581
以下内容为反编译后的 WebActivity.java 源代码,内容仅作参考
package com.magine.android.mamo.ui;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.MenuItem;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.databinding.ViewDataBinding;
import com.flixole.android.R;
import g.l.f;
import i.f.a.e.f.c0.e;
import i.f.a.e.f.q.b;
import i.f.a.e.f.y.n;
import i.f.a.e.i.f0;
import kotlin.Unit;
import l.g0.o;
import l.z.d.l;
public final class WebActivity extends b {
public f0 E;
public final class a extends WebViewClient {
public a() {
}
@Override
public void onPageFinished(WebView webView, String str) {
l.f(webView, "view");
l.f(str, "url");
super.onPageFinished(webView, str);
f0 f0Var = WebActivity.this.E;
if (f0Var != null) {
f0Var.G.h();
} else {
l.v("binding");
throw null;
}
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
l.f(webView, "view");
l.f(str, "url");
super.onPageStarted(webView, str, bitmap);
f0 f0Var = WebActivity.this.E;
if (f0Var != null) {
f0Var.G.g();
} else {
l.v("binding");
throw null;
}
}
@Override
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
String c = e.c(WebActivity.this, R.string.error_unknown_error, new Object[0]);
if (webView != null) {
webView.loadUrl("");
webView.loadData("<p style=\"text-align:center\">" + c + "</p>", "text/html", "UTF-8");
}
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
String uri;
l.f(webView, "view");
l.f(webResourceRequest, "request");
n.c(this, "web_view_url: " + webResourceRequest.getUrl());
String uri2 = webResourceRequest.getUrl().toString();
l.e(uri2, "request.url.toString()");
if (o.F(uri2, "https://www.return.to.app", false, 2, null)) {
WebActivity.this.finish();
return true;
}
String uri3 = webResourceRequest.getUrl().toString();
l.e(uri3, "request.url.toString()");
if (o.q(uri3, ".pdf", false, 2, null)) {
uri = "https://drive.google.com/viewerng/viewer?embedded=true&url=" + webResourceRequest.getUrl();
} else {
uri = webResourceRequest.getUrl().toString();
}
webView.loadUrl(uri);
return true;
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
l.f(webView, "view");
l.f(str, "url");
n.c(this, "web_view_url: " + str);
if (o.F(str, "https://www.return.to.app", false, 2, null)) {
WebActivity.this.finish();
return true;
}
if (o.q(str, ".pdf", false, 2, null)) {
str = "https://drive.google.com/viewerng/viewer?embedded=true&url=" + str;
}
webView.loadUrl(str);
return true;
}
}
@Override
public boolean I1() {
return false;
}
@Override
public void onBackPressed() {
f0 f0Var = this.E;
if (f0Var == null) {
l.v("binding");
throw null;
} else if (!f0Var.I.canGoBack()) {
super.onBackPressed();
} else {
f0 f0Var2 = this.E;
if (f0Var2 != null) {
f0Var2.I.goBack();
} else {
l.v("binding");
throw null;
}
}
}
@Override
public void onCreate(Bundle bundle) {
String string;
super.onCreate(bundle);
ViewDataBinding g2 = f.g(this, R.layout.activity_webview_layout);
l.e(g2, "setContentView<ActivityW…_webview_layout\n )");
f0 f0Var = (f0) g2;
this.E = f0Var;
Unit unit = null;
if (f0Var == null) {
l.v("binding");
throw null;
}
F1(f0Var.H);
g.b.k.a x1 = x1();
if (x1 != null) {
setTitle(e.c(this, R.string.app_name, new Object[0]));
x1.s(true);
}
f0 f0Var2 = this.E;
if (f0Var2 == null) {
l.v("binding");
throw null;
}
WebSettings settings = f0Var2.I.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setUserAgentString(settings.getUserAgentString() + "magine_webview");
f0 f0Var3 = this.E;
if (f0Var3 == null) {
l.v("binding");
throw null;
}
f0Var3.I.setWebViewClient(new a());
Bundle extras = getIntent().getExtras();
if (extras != null && (string = extras.getString("intent.extra.url")) != null) {
f0 f0Var4 = this.E;
if (f0Var4 == null) {
l.v("binding");
throw null;
} else {
f0Var4.I.loadUrl(string);
unit = Unit.a;
}
}
if (unit == null) {
throw new IllegalStateException("URL is missing".toString());
}
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
l.f(menuItem, "item");
if (menuItem.getItemId() == 16908332) {
finish();
return true;
}
return super.onOptionsItemSelected(menuItem);
}
}