package com.lt.app.views; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.text.TextUtils; import android.util.Log; import android.webkit.URLUtil; import android.webkit.WebResourceResponse; import android.webkit.WebView; import com.b.a.a; import com.c.e; import com.c.f; import com.c.h; import com.huawei.hms.push.constant.RemoteMessageConst; import com.lt.app.App; import com.lt.app.a.k; import com.lt.app.c; import com.lt.app.d; import com.lt.plugin.al; import com.lt.plugin.as; import com.lt.plugin.au; import com.lt.plugin.b; import com.lt.plugin.i; import com.lt.plugin.j; import java.io.File; import java.io.InputStream; import java.net.URLDecoder; import java.net.URLEncoder; import me.dhtv.app.R; import org.json.JSONArray; import org.json.JSONObject; /* compiled from: LTWebViewClient */ public class g extends com.b.a.g implements f { /* renamed from: ʼ reason: contains not printable characters */ private static boolean f6468 = false; /* renamed from: ʻ reason: contains not printable characters */ private final h f6469; @Override // com.c.f /* renamed from: ʽ reason: contains not printable characters */ public void m8733(e eVar, String str) { } public g(a aVar, h hVar) { super(aVar); this.f6469 = hVar; } /* renamed from: ʾ reason: contains not printable characters */ private boolean m8722(e eVar, String str) { if (!str.startsWith("jsbridge:")) { return false; } try { JSONArray jSONArray = new JSONArray(URLDecoder.decode(str.substring(9), "UTF-8")); if (jSONArray.length() <= 0) { return true; } k r7 = k.m8330(eVar); for (int i = 0; i < jSONArray.length(); i++) { JSONObject optJSONObject = jSONArray.optJSONObject(i); if (optJSONObject != null) { r7.m8332(eVar, optJSONObject.optString("name"), optJSONObject.optJSONObject(RemoteMessageConst.DATA)); } } return true; } catch (Exception e) { e.printStackTrace(); return true; } } /* renamed from: ʿ reason: contains not printable characters */ private boolean m8723(final e eVar, String str) { Activity activity = (Activity) eVar.getContext(); j r1 = as.m8887(); return r1 != null && r1.m8981(activity, str, new b<String>() { /* class com.lt.app.views.g.AnonymousClass1 */ /* renamed from: ʻ reason: contains not printable characters */ public void callback(String str) { if (!TextUtils.isEmpty(str)) { eVar.loadUrl(str, App.m8130().m8142(eVar.getUrl())); } } }); } /* renamed from: ˆ reason: contains not printable characters */ private boolean m8724(e eVar, String str) { al r1; if (App.m8121(60, true) && App.m8128() != null && App.m8128().m8522(26) && (r1 = as.m8923()) != null && r1.m8799(eVar.getContext(), str)) { return true; } return false; } /* JADX WARNING: Removed duplicated region for block: B:23:0x005e */ /* JADX WARNING: Removed duplicated region for block: B:24:0x0061 */ /* renamed from: ˈ reason: contains not printable characters */ private boolean m8725(e eVar, String str) { boolean z; i r3; if (App.m8121(40, true) && App.m8128() != null && App.m8128().m8521(58)) { try { if (!TextUtils.isEmpty(str) && d.m8555(str) && App.m8128().m8523(Uri.parse(str).getHost())) { z = true; if (z && (r3 = as.m8889()) != null) { r3.m8979((Activity) eVar.getContext(), !App.m8128().m8521(59) ? i.c.H5 : i.c.Native, i.d.Url, str, null, null, null, null); return true; } } } catch (Exception e) { e.printStackTrace(); } z = false; r3.m8979((Activity) eVar.getContext(), !App.m8128().m8521(59) ? i.c.H5 : i.c.Native, i.d.Url, str, null, null, null, null); return true; } return false; } /* renamed from: ˉ reason: contains not printable characters */ private boolean m8726(e eVar, String str) { if (TextUtils.isEmpty(str) || d.m8560(str)) { return false; } com.lt.app.c.a r0 = App.m8128(); if (r0 != null && !TextUtils.isEmpty(r0.igs)) { try { if (c.m8499(r0.igs, Uri.parse(str).getScheme())) { return true; } } catch (Exception e) { e.printStackTrace(); } } Activity activity = (Activity) eVar.getContext(); if (str.startsWith("intent:")) { try { activity.startActivity(Intent.parseUri(str, 1)); } catch (Exception e2) { e2.printStackTrace(); } } else { d.m8547((Context) activity, str, true); } return true; } @Override // com.c.f /* renamed from: ʻ reason: contains not printable characters */ public void m8729(e eVar, String str, Bitmap bitmap) { Log.d("YM", "WebView 开始加载 " + str); h hVar = this.f6469; if (hVar != null) { hVar.m8738(eVar, str, bitmap); } } @Override // com.c.f /* renamed from: ʻ reason: contains not printable characters */ public void m8728(e eVar, String str) { h hVar = this.f6469; if (hVar != null) { hVar.m8740(eVar, str); } } @Override // com.c.f /* renamed from: ʻ reason: contains not printable characters */ public boolean m8730(e eVar, h hVar) { Log.d("YM", "准备加载 " + hVar.f4542); if (super.shouldOverrideUrlLoading((WebView) null, hVar.f4542)) { return true; } if (m8722(eVar, hVar.f4542)) { Log.d("YM", "jsBridge 处理 " + hVar.f4542); return true; } else if (m8724(eVar, hVar.f4542)) { Log.d("YM", "播放视频 " + hVar.f4542); return true; } else if (m8725(eVar, hVar.f4542)) { Log.d("YM", "阿里百川处理 " + hVar.f4542); return true; } else if (m8726(eVar, hVar.f4542)) { Log.d("YM", "非 http(s) 处理 " + hVar.f4542); return true; } else if (m8723(eVar, hVar.f4542)) { Log.d("YM", "支付宝 h5 支付处理 " + hVar.f4542); return true; } else { Log.d("YM", "WebView 加载 " + hVar.f4542); h hVar2 = this.f6469; if (hVar2 == null || !hVar2.m8739(eVar, hVar)) { return false; } return true; } } @Override // com.c.f /* renamed from: ʼ reason: contains not printable characters */ public WebResourceResponse m8731(e eVar, String str) { String str2; InputStream inputStream; String str3 = null; if (URLUtil.isHttpsUrl(str) || URLUtil.isHttpUrl(str)) { com.lt.app.c.a r0 = App.m8128(); if (r0 == null) { return null; } if (App.m8130().m8137() && r0.ruleFs == 0) { return null; } str2 = App.m8128().m8519(str); } else { str2 = str; } if (str2 == null || !str2.startsWith("fs://")) { return null; } Log.w("YM", str + " -> " + str2); if (str2.startsWith("fs://www/")) { try { inputStream = eVar.getContext().getAssets().open(str2.substring(5)); } catch (Exception unused) { Log.w("YM", "not found " + str2); return null; } } else { File r7 = au.m8934(eVar.getContext(), str2); if (r7 != null) { try { inputStream = eVar.getContext().getContentResolver().openInputStream(au.m8931(eVar.getContext(), r7)); } catch (Exception e) { e.printStackTrace(); } } inputStream = null; } String r72 = TextUtils.isEmpty(null) ? au.m8937(str2) : null; if (TextUtils.isEmpty(null)) { str3 = "utf-8"; } WebResourceResponse webResourceResponse = new WebResourceResponse(r72, str3, inputStream); if (inputStream == null) { Log.e("YM", "not found " + str2); webResourceResponse.setStatusCodeAndReasonPhrase(404, "404:not found"); } return webResourceResponse; } @Override // com.c.f /* renamed from: ʼ reason: contains not printable characters */ public boolean m8732(e eVar, h hVar) { com.lt.app.c.a r0; if (hVar.f4543 && (r0 = App.m8128()) != null && !r0.m8522(18)) { Log.e("YM", "加载失败,Code:" + hVar.f4547 + " URL:" + hVar.f4542); if (hVar.f4542 != null && hVar.f4542.startsWith("http")) { if (hVar.f4547 >= 400 && !r0.m8521(15)) { return false; } eVar.stopLoading(); eVar.setErrorUrl(hVar.f4542); eVar.loadUrl("file:///android_asset/e.html?url=" + URLEncoder.encode(hVar.f4542), null); return true; } } return false; } @Override // com.c.f /* renamed from: ʻ reason: contains not printable characters */ public void m8727(e eVar, final f.a aVar) { com.lt.app.c.a r0 = App.m8128(); if (r0 == null || !r0.m8521(60)) { aVar.m6447(); return; } AlertDialog.Builder builder = new AlertDialog.Builder(eVar.getContext()); builder.setMessage(R.string.ssl_error); builder.setNegativeButton(R.string.ssl_continue, new DialogInterface.OnClickListener() { /* class com.lt.app.views.g.AnonymousClass2 */ public void onClick(DialogInterface dialogInterface, int i) { aVar.m6447(); } }); builder.setPositiveButton(R.string.ssl_cancel, new DialogInterface.OnClickListener() { /* class com.lt.app.views.g.AnonymousClass3 */ public void onClick(DialogInterface dialogInterface, int i) { aVar.m6448(); } }); builder.setCancelable(false); builder.create().show(); } }