package X; import android.content.ClipboardManager; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.net.http.SslError; import android.os.Build; import android.os.Handler; import android.os.Looper; import android.view.inputmethod.InputMethodManager; import android.webkit.SslErrorHandler; import android.webkit.WebResourceError; import android.webkit.WebResourceRequest; import android.webkit.WebResourceResponse; import android.webkit.WebView; import android.widget.FrameLayout; import com.bytedance.covode.number.Covode; import com.bytedance.tux.navigation.TuxNavBar; import com.ss.android.ugc.aweme.crossplatform.platform.webview.SingleWebView; import com.ss.android.ugc.aweme.crossplatform.view.CrossPlatformWebView; import com.ss.android.ugc.aweme.setting.services.ISettingService; import com.ss.android.ugc.aweme.setting.services.SettingServiceImpl; import com.ss.android.ugc.aweme.wiki.AddWikiActivity; import com.ss.android.ugc.aweme.wiki.CheckAnchorModerationService; import com.zhiliaoapp.musically.R; import java.lang.reflect.Field; import java.util.Objects; import kotlin.g.b.m; /* renamed from: X.JVx reason: case insensitive filesystem */ public final class C49260JVx implements AbstractC48129Iv8 { public final /* synthetic */ AddWikiActivity LIZ; public boolean LIZIZ; static { Covode.recordClassIndex(111246); } /* JADX WARN: Incorrect args count in method signature: ()V */ public C49260JVx(AddWikiActivity addWikiActivity) { this.LIZ = addWikiActivity; } public static Object LIZ(AddWikiActivity addWikiActivity, String str) { Object obj; if (Build.VERSION.SDK_INT > 27 || !"clipboard".equals(str)) { if (!C16520lF.LIZIZ && "connectivity".equals(str)) { try { new AnonymousClass1ME().LIZ(); C16520lF.LIZIZ = true; obj = addWikiActivity.getSystemService(str); } catch (Throwable unused) { } } obj = addWikiActivity.getSystemService(str); } else if (C16520lF.LIZ) { synchronized (ClipboardManager.class) { try { obj = addWikiActivity.getSystemService(str); if (Thread.currentThread() != Looper.getMainLooper().getThread()) { try { Field declaredField = ClipboardManager.class.getDeclaredField("mHandler"); declaredField.setAccessible(true); declaredField.set(obj, new HandlerC16510lE((Handler) declaredField.get(obj))); } catch (Exception e) { AnonymousClass0O2.LIZ(e, "ClipboardManager Handler Reflect Fail"); } } C16520lF.LIZ = false; } finally { } } } else { obj = addWikiActivity.getSystemService(str); } return obj; } public static String LIZ(Intent intent, String str) { try { return intent.getStringExtra(str); } catch (Exception unused) { return null; } } @Override // X.AbstractC48129Iv8 public final void LIZ(WebView webView, int i2, String str, String str2) { if (Build.VERSION.SDK_INT < 23) { this.LIZIZ = true; } } @Override // X.AbstractC48129Iv8 public final void LIZ(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { } @Override // X.AbstractC48129Iv8 public final void LIZ(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) { if (webResourceRequest != null && webResourceRequest.isForMainFrame()) { this.LIZIZ = true; } } @Override // X.AbstractC48129Iv8 public final void LIZ(WebView webView, WebResourceRequest webResourceRequest, WebResourceResponse webResourceResponse) { } @Override // X.AbstractC48129Iv8 public final void LIZ(WebView webView, String str) { boolean z; String str2; this.LIZ.LJIILLIIL = false; FrameLayout frameLayout = this.LIZ.LIZIZ; if (frameLayout == null) { m.LIZ(""); } frameLayout.setVisibility(8); if (this.LIZIZ) { this.LIZ.LIZ((Object) "close", true); this.LIZ.LIZ((Object) "back", true); this.LIZ.LIZ((Object) "more", false); this.LIZ.LIZ(false); String LIZ2 = LIZ(this.LIZ.getIntent(), "enter_from"); if (LIZ2 != null && LIZ2.length() != 0) { if (AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "Yelp", true)) { C14300hf.LIZ("request_anchor_detail", new C12740f9().LIZ("enter_from", LIZ(this.LIZ.getIntent(), "enter_from")).LIZ("anchor_type", "Yelp").LIZ("anchor_entry", LIZ(this.LIZ.getIntent(), "anchor_entry")).LIZ("author_id", LIZ(this.LIZ.getIntent(), "author_id")).LIZ("group_id", LIZ(this.LIZ.getIntent(), "group_id")).LIZ("status", 0).LIZ("duration", System.currentTimeMillis() - this.LIZ.LJIILJJIL).LIZ); } else if (AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "TripAdvisor", true)) { C14300hf.LIZ("request_anchor_detail", new C12740f9().LIZ("enter_from", LIZ(this.LIZ.getIntent(), "enter_from")).LIZ("anchor_type", "TripAdvisor").LIZ("anchor_entry", LIZ(this.LIZ.getIntent(), "anchor_entry")).LIZ("author_id", LIZ(this.LIZ.getIntent(), "author_id")).LIZ("group_id", LIZ(this.LIZ.getIntent(), "group_id")).LIZ("status", 0).LIZ("duration", System.currentTimeMillis() - this.LIZ.LJIILJJIL).LIZ); } else { AddWikiActivity addWikiActivity = this.LIZ; C12740f9 r0 = new C12740f9(); m.LIZIZ(r0, ""); C14300hf.LIZ("request_wiki_detail", addWikiActivity.LIZ(r0).LIZ("status", 0).LIZ("duration", System.currentTimeMillis() - this.LIZ.LJIILJJIL).LIZ); } } } else { Uri parse = Uri.parse(str); AddWikiActivity addWikiActivity2 = this.LIZ; m.LIZIZ(parse, ""); String LIZ3 = addWikiActivity2.LIZ(parse, "title"); if (LIZ3 == null || LIZ3.length() == 0) { LIZ3 = this.LIZ.LJIJ; } if ((LIZ3 == null || LIZ3.length() == 0) && (webView == null || (LIZ3 = webView.getTitle()) == null)) { LIZ3 = ""; } boolean LIZ4 = (AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "Yelp", true) || AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "TripAdvisor", true) || AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "Quizlet", true)) ? true : AnonymousClass1ZS.LIZ(this.LIZ.LIZ(parse, "addButton"), "true", true); ISettingService LJIJJLI = SettingServiceImpl.LJIJJLI(); AddWikiActivity addWikiActivity3 = this.LIZ; String LIZ5 = addWikiActivity3.LIZ(parse, "lang"); if (LIZ5 == null) { LIZ5 = LJIJJLI.LJII(); } addWikiActivity3.LJIIIZ = LIZ5; String str3 = AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "TripAdvisor", true) ? (String) AnonymousClass1ZS.LIZ(LIZ3, new String[]{" - "}, 0, 6).get(0) : LIZ3; if (!AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "TripAdvisor", true)) { AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "Yelp", true); } if (m.LIZ((Object) this.LIZ.LJIIIIZZ, (Object) "Wiki")) { AddWikiActivity addWikiActivity4 = this.LIZ; addWikiActivity4.LJIIJ = ((LIZ4 || addWikiActivity4.LJIJJLI) && str3.length() > 0) ? CheckAnchorModerationService.LIZ.LIZ(0, this.LIZ.LIZ().getCurrentUrl(), str3, AddWikiActivity.LIZ(this.LIZ), null) : null; } String LIZ6 = LIZ(this.LIZ.getIntent(), "enter_from"); if (!(LIZ3 == null || LIZ3.length() == 0 || (LIZ6 != null && LIZ6.length() != 0 && (str2 = this.LIZ.LJIIZILJ) != null && str2.length() != 0))) { this.LIZ.LJIIZILJ = LIZ3; TuxNavBar LIZIZ2 = this.LIZ.LIZIZ(); BN1 LIZ7 = new BN1().LIZ(LIZ3); String string = this.LIZ.getString(R.string.a1b); m.LIZIZ(string, ""); LIZIZ2.LIZ(LIZ7.LIZIZ(AnonymousClass1ZS.LIZ(string, "%@", this.LIZ.LIZ(str), false))); } AddWikiActivity addWikiActivity5 = this.LIZ; addWikiActivity5.LJII = addWikiActivity5.LIZ(parse, "keyword"); AddWikiActivity addWikiActivity6 = this.LIZ; addWikiActivity6.LJI = AnonymousClass1ZS.LIZ(addWikiActivity6.LIZ(parse, "noRedirect"), "true", true); if (!this.LIZ.LJIJJ) { this.LIZ.LIZ(parse); } this.LIZ.LJIIL = null; AddWikiActivity addWikiActivity7 = this.LIZ; if (AnonymousClass1ZS.LIZ(addWikiActivity7.LJIIIIZZ, "Yelp", true)) { CrossPlatformWebView crossPlatformWebView = addWikiActivity7.LIZ; if (crossPlatformWebView == null) { m.LIZ(""); } String str4 = "javascript:(function extra(){" + "[].forEach.call(document.getElementsByClassName('lemon--div__32e33__1mboc banner__32e33__39b4o border-color--default__32e33__2oFDT'), el => el.style.display = 'none');" + "document.getElementById('smart-banner').style.display = 'none';" + "document.getElementById('fullscreen-pitch').style.display = 'none';" + "[].forEach.call(document.getElementsByClassName('fullscreen-pitch_close'), el => el.click());" + "})();"; m.LIZIZ(str4, ""); z = false; CrossPlatformWebView.LIZ(crossPlatformWebView, str4, false, null, 6); } else if (AnonymousClass1ZS.LIZ(addWikiActivity7.LJIIIIZZ, "TripAdvisor", true)) { CrossPlatformWebView crossPlatformWebView2 = addWikiActivity7.LIZ; if (crossPlatformWebView2 == null) { m.LIZ(""); } String str5 = "javascript:(function extra(){" + "[].forEach.call(document.getElementsByClassName('social-ugc-actions-UploaderActionButton__upload_container--1wUKt social-ugc-actions-SocialFab__overlay--31Qvx'), el => el.style.display = 'none');" + "[].forEach.call(document.getElementsByClassName('ppr_rup ppr_priv_daodao_mobile_open_app_smart_button_component'), el => el.style.display = 'none');" + "[].forEach.call(document.getElementsByClassName('cpm-ad-target-mobile-adhesion-MobileAdhesion__fixedAd--23r8Y cpm-ad-target-mobile-adhesion-MobileAdhesion__loaded--24Qa9'), el => el.style.display = 'none');" + "[].forEach.call(document.getElementsByClassName(' daodao-mobile-app-smartbutton-SmartButton__open_app_smartbutton--YE-xh daodao-mobile-app-smartbutton-SmartButton__is_shown--35tcaedAd--23r8Y cpm-ad-target-mobile-adhesion-MobileAdhesion__loaded--24Qa9'), el => el.style.display = 'none');" + "[].forEach.call(document.getElementsByClassName('hotels-hotel-review-persistent-header-and-footer-PersistentHeaderAndFooter__ui_persistent_footer--1MGGe hotels-hotel-review-persistent-header-and-footer-PersistentHeaderAndFooter__fixed--8x8LO'), el => el.style.display = 'none');" + "})();"; m.LIZIZ(str5, ""); z = false; CrossPlatformWebView.LIZ(crossPlatformWebView2, str5, false, null, 6); } else { z = false; } this.LIZ.LIZ(z); if (!(LIZ6 == null || LIZ6.length() == 0)) { if (AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "Yelp", true)) { C14300hf.LIZ("request_anchor_detail", new C12740f9().LIZ("enter_from", LIZ(this.LIZ.getIntent(), "enter_from")).LIZ("anchor_type", "Yelp").LIZ("anchor_entry", LIZ(this.LIZ.getIntent(), "anchor_entry")).LIZ("author_id", LIZ(this.LIZ.getIntent(), "author_id")).LIZ("group_id", LIZ(this.LIZ.getIntent(), "group_id")).LIZ("status", 1).LIZ("duration", System.currentTimeMillis() - this.LIZ.LJIILJJIL).LIZ); } else if (AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "TripAdvisor", true)) { C14300hf.LIZ("request_anchor_detail", new C12740f9().LIZ("enter_from", LIZ(this.LIZ.getIntent(), "enter_from")).LIZ("anchor_type", "TripAdvisor").LIZ("anchor_entry", LIZ(this.LIZ.getIntent(), "anchor_entry")).LIZ("author_id", LIZ(this.LIZ.getIntent(), "author_id")).LIZ("group_id", LIZ(this.LIZ.getIntent(), "group_id")).LIZ("status", 1).LIZ("duration", System.currentTimeMillis() - this.LIZ.LJIILJJIL).LIZ); } else if (AnonymousClass1ZS.LIZ(this.LIZ.LJIIIIZZ, "Quizlet", true)) { C14300hf.LIZ("request_anchor_detail", new C12740f9().LIZ("enter_from", LIZ(this.LIZ.getIntent(), "enter_from")).LIZ("anchor_type", "Quizlet").LIZ("anchor_entry", LIZ(this.LIZ.getIntent(), "anchor_entry")).LIZ("author_id", LIZ(this.LIZ.getIntent(), "author_id")).LIZ("group_id", LIZ(this.LIZ.getIntent(), "group_id")).LIZ("status", 1).LIZ("duration", System.currentTimeMillis() - this.LIZ.LJIILJJIL).LIZ); } else { AddWikiActivity addWikiActivity8 = this.LIZ; C12740f9 r02 = new C12740f9(); m.LIZIZ(r02, ""); C14300hf.LIZ("request_wiki_detail", addWikiActivity8.LIZ(r02).LIZ("status", 1).LIZ("duration", System.currentTimeMillis() - this.LIZ.LJIILJJIL).LIZ); } } if (this.LIZ.LJIILIIL) { this.LIZ.LJIILIIL = false; Object LIZ8 = LIZ(this.LIZ, "input_method"); Objects.requireNonNull(LIZ8, "null cannot be cast to non-null type android.view.inputmethod.InputMethodManager"); InputMethodManager inputMethodManager = (InputMethodManager) LIZ8; SingleWebView singleWebView = this.LIZ.LJFF; if (singleWebView == null) { m.LIZ(""); } inputMethodManager.showSoftInput(singleWebView, 1); } } } @Override // X.AbstractC48129Iv8 public final void LIZ(WebView webView, String str, Bitmap bitmap) { this.LIZIZ = false; if (m.LIZ((Object) LIZ(this.LIZ.getIntent(), "anchor_type"), (Object) "News")) { String str2 = this.LIZ.LJIJ; if ((str2.length() == 0) && (webView == null || (str2 = webView.getTitle()) == null)) { str2 = ""; } this.LIZ.LJIIZILJ = str2; TuxNavBar LIZIZ2 = this.LIZ.LIZIZ(); BN1 LIZ2 = new BN1().LIZ(str2); String string = this.LIZ.getString(R.string.a1b); m.LIZIZ(string, ""); LIZIZ2.LIZ(LIZ2.LIZIZ(AnonymousClass1ZS.LIZ(string, "%@", this.LIZ.LIZ(str), false))); AddWikiActivity addWikiActivity = this.LIZ; Uri parse = Uri.parse(str); m.LIZIZ(parse, ""); addWikiActivity.LIZ(parse); } } @Override // X.AbstractC48129Iv8 public final boolean LIZIZ(WebView webView, String str) { return false; } @Override // X.AbstractC48129Iv8 public final void LIZJ(WebView webView, String str) { } }