X-plore v4.37.09版本的 MD5 值为:1ac588cd7c13e9578c2d4266387e2f4f

以下内容为反编译后的 TextViewer.java 源代码,内容仅作参考


package com.lonelycatgames.Xplore.ui;

import B5.AbstractC1030f;
import B5.AbstractC1034j;
import B5.E;
import B5.J;
import B5.s;
import C0.D;
import C7.o;
import F.C1128w;
import F.C1130y;
import F.InterfaceC1127v;
import F6.C;
import F6.C1141j;
import F7.x;
import H7.AbstractC1204h;
import H7.AbstractC1208j;
import H7.C1191a0;
import H7.InterfaceC1230u0;
import H7.W;
import I0.C1263x;
import I0.O;
import P.AbstractC1351i;
import P.AbstractC1363o;
import P.F0;
import P.H;
import P.I;
import P.InterfaceC1343e;
import P.InterfaceC1357l;
import P.InterfaceC1358l0;
import P.InterfaceC1378w;
import P.K;
import P.P0;
import P.R0;
import P.l1;
import P.v1;
import Q6.VBxU.ZXeKvxFHX;
import R6.L;
import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.view.ViewConfiguration;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
import androidx.compose.foundation.layout.C1694b;
import androidx.compose.foundation.layout.w;
import androidx.compose.foundation.layout.y;
import androidx.compose.foundation.relocation.zHt.VwmfTGoaDK;
import androidx.lifecycle.r;
import b0.InterfaceC1899b;
import b0.g;
import b7.t;
import com.lonelycatgames.Xplore.App;
import com.lonelycatgames.Xplore.FileContentProvider;
import com.lonelycatgames.Xplore.FileSystem.l;
import com.lonelycatgames.Xplore.ui.TextViewer;
import com.lonelycatgames.Xplore.utils.TextViewerWebView;
import h7.AbstractC6732u;
import h7.C6709J;
import h7.InterfaceC6723l;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import m7.InterfaceC7068d;
import o7.AbstractC7136l;
import r.aa.pWhGPktqxGVuO;
import u0.AbstractC7453v;
import u6.AbstractC7556B;
import u6.F;
import u6.G;
import v7.InterfaceC7625a;
import v7.p;
import v7.q;
import w0.InterfaceC7662g;
import w7.AbstractC7771k;
import w7.AbstractC7777q;
import w7.AbstractC7780t;
import w7.AbstractC7781u;
import w7.C7752K;
import y7.AbstractC7945c;
import z.C7951f;
import z.C7964s;
import z.InterfaceC7950e;
import z.InterfaceC7963r;

@SuppressLint({"SetJavaScriptEnabled"})
public final class TextViewer extends com.lonelycatgames.Xplore.ui.a {

    public static final a f47097m0 = new a(null);

    public static final int f47098n0 = 8;

    private Uri f47099c0;

    private String f47100d0;

    private WebView f47101e0;

    private boolean f47102f0;

    public L f47105i0;

    private InterfaceC1230u0 f47106j0;

    private boolean f47107k0;

    private final InterfaceC6723l f47103g0 = t6.k.e0(new g());

    private final InterfaceC6723l f47104h0 = t6.k.e0(new h());

    private final HashMap f47108l0 = new HashMap();

    public static final class a {
        private a() {
        }

        public a(AbstractC7771k abstractC7771k) {
            this();
        }
    }

    public class b extends AbstractC7777q implements InterfaceC7625a {
        b(Object obj) {
            super(0, obj, TextViewer.class, "finish", "finish()V", 0);
        }

        @Override
        public Object c() {
            o();
            return C6709J.f49946a;
        }

        public final void o() {
            ((TextViewer) this.f58225b).finish();
        }
    }

    public static final class c extends AbstractC7781u implements q {

        final InterfaceC1358l0 f47109b;

        final TextViewer f47110c;

        public static final class a extends AbstractC7781u implements v7.l {

            final TextViewer f47111b;

            final InterfaceC1358l0 f47112c;

            public static final class C0690a implements H {

                final TextViewer f47113a;

                public C0690a(TextViewer textViewer) {
                    this.f47113a = textViewer;
                }

                @Override
                public void a() {
                    WebView webView = this.f47113a.f47101e0;
                    if (webView == null) {
                        AbstractC7780t.r("webView");
                        webView = null;
                    }
                    webView.setFindListener(null);
                }
            }

            a(TextViewer textViewer, InterfaceC1358l0 interfaceC1358l0) {
                super(1);
                this.f47111b = textViewer;
                this.f47112c = interfaceC1358l0;
            }

            public static final void g(InterfaceC1358l0 interfaceC1358l0, int i9, int i10, boolean z8) {
                AbstractC7780t.f(interfaceC1358l0, "$searchState$delegate");
                c.j(interfaceC1358l0, new g(i9, i10, z8));
                App.f43875F0.o("find: " + c.i(interfaceC1358l0));
            }

            @Override
            public final H h(I i9) {
                AbstractC7780t.f(i9, "$this$DisposableEffect");
                WebView webView = this.f47111b.f47101e0;
                if (webView == null) {
                    AbstractC7780t.r("webView");
                    webView = null;
                }
                final InterfaceC1358l0 interfaceC1358l0 = this.f47112c;
                webView.setFindListener(new WebView.FindListener() {
                    @Override
                    public final void onFindResultReceived(int i10, int i11, boolean z8) {
                        TextViewer.c.a.g(InterfaceC1358l0.this, i10, i11, z8);
                    }
                });
                return new C0690a(this.f47111b);
            }
        }

        public static final class b extends AbstractC7781u implements v7.l {

            final TextViewer f47114b;

            b(TextViewer textViewer) {
                super(1);
                this.f47114b = textViewer;
            }

            public final void a(InterfaceC1127v interfaceC1127v) {
                AbstractC7780t.f(interfaceC1127v, "$this$$receiver");
                WebView webView = this.f47114b.f47101e0;
                if (webView == null) {
                    AbstractC7780t.r("webView");
                    webView = null;
                }
                webView.findNext(true);
            }

            @Override
            public Object h(Object obj) {
                a((InterfaceC1127v) obj);
                return C6709J.f49946a;
            }
        }

        public static final class C0691c extends AbstractC7781u implements v7.l {

            final TextViewer f47115b;

            final InterfaceC1358l0 f47116c;

            C0691c(TextViewer textViewer, InterfaceC1358l0 interfaceC1358l0) {
                super(1);
                this.f47115b = textViewer;
                this.f47116c = interfaceC1358l0;
            }

            public final void a(O o9) {
                AbstractC7780t.f(o9, "s");
                TextViewer.y1(this.f47116c, o9);
                WebView webView = this.f47115b.f47101e0;
                if (webView == null) {
                    AbstractC7780t.r("webView");
                    webView = null;
                }
                webView.findAllAsync(o9.f());
            }

            @Override
            public Object h(Object obj) {
                a((O) obj);
                return C6709J.f49946a;
            }
        }

        public static final class d extends AbstractC7781u implements p {

            final TextViewer f47117b;

            final InterfaceC1358l0 f47118c;

            public static final class a extends AbstractC7781u implements InterfaceC7625a {

                final TextViewer f47119b;

                final InterfaceC1358l0 f47120c;

                a(TextViewer textViewer, InterfaceC1358l0 interfaceC1358l0) {
                    super(0);
                    this.f47119b = textViewer;
                    this.f47120c = interfaceC1358l0;
                }

                public final void a() {
                    WebView webView = null;
                    TextViewer.y1(this.f47120c, null);
                    WebView webView2 = this.f47119b.f47101e0;
                    if (webView2 == null) {
                        AbstractC7780t.r("webView");
                    } else {
                        webView = webView2;
                    }
                    webView.clearMatches();
                }

                @Override
                public Object c() {
                    a();
                    return C6709J.f49946a;
                }
            }

            d(TextViewer textViewer, InterfaceC1358l0 interfaceC1358l0) {
                super(2);
                this.f47117b = textViewer;
                this.f47118c = interfaceC1358l0;
            }

            public final void a(InterfaceC1357l interfaceC1357l, int i9) {
                if ((i9 & 11) == 2 && interfaceC1357l.s()) {
                    interfaceC1357l.z();
                } else {
                    if (AbstractC1363o.G()) {
                        AbstractC1363o.S(2016155985, i9, -1, "com.lonelycatgames.Xplore.ui.TextViewer.RenderContent.<anonymous>.<anonymous>.<anonymous>.<anonymous> (TextViewer.kt:285)");
                    }
                    int i10 = (5 ^ 0) >> 0;
                    AbstractC1030f.a(N.e.a(J.j()), null, null, null, Integer.valueOf(F.f56339e0), false, null, new a(this.f47117b, this.f47118c), interfaceC1357l, 0, 110);
                    if (AbstractC1363o.G()) {
                        AbstractC1363o.R();
                    }
                }
            }

            @Override
            public Object r(Object obj, Object obj2) {
                a((InterfaceC1357l) obj, ((Number) obj2).intValue());
                return C6709J.f49946a;
            }
        }

        public static final class e extends AbstractC7781u implements InterfaceC7625a {

            final TextViewer f47121b;

            e(TextViewer textViewer) {
                super(0);
                this.f47121b = textViewer;
            }

            public final void a() {
                WebView webView = this.f47121b.f47101e0;
                if (webView == null) {
                    AbstractC7780t.r("webView");
                    webView = null;
                }
                webView.findNext(false);
            }

            @Override
            public Object c() {
                a();
                return C6709J.f49946a;
            }
        }

        public static final class f extends AbstractC7781u implements InterfaceC7625a {

            final TextViewer f47122b;

            f(TextViewer textViewer) {
                super(0);
                this.f47122b = textViewer;
            }

            public final void a() {
                WebView webView = this.f47122b.f47101e0;
                if (webView == null) {
                    AbstractC7780t.r("webView");
                    webView = null;
                }
                webView.findNext(true);
            }

            @Override
            public Object c() {
                a();
                return C6709J.f49946a;
            }
        }

        public static final class g {

            private final int f47123a;

            private final int f47124b;

            private final boolean f47125c;

            public g(int i9, int i10, boolean z8) {
                this.f47123a = i9;
                this.f47124b = i10;
                this.f47125c = z8;
            }

            public final boolean a() {
                return this.f47125c;
            }

            public final int b() {
                return this.f47123a;
            }

            public final int c() {
                return this.f47124b;
            }

            public boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                if (!(obj instanceof g)) {
                    return false;
                }
                g gVar = (g) obj;
                return this.f47123a == gVar.f47123a && this.f47124b == gVar.f47124b && this.f47125c == gVar.f47125c;
            }

            public int hashCode() {
                return (((Integer.hashCode(this.f47123a) * 31) + Integer.hashCode(this.f47124b)) * 31) + Boolean.hashCode(this.f47125c);
            }

            public String toString() {
                return "SearchState(matchIndex=" + this.f47123a + ", numMatches=" + this.f47124b + ", done=" + this.f47125c + ')';
            }
        }

        public static final class h extends AbstractC7781u implements InterfaceC7625a {

            final InterfaceC1358l0 f47126b;

            h(InterfaceC1358l0 interfaceC1358l0) {
                super(0);
                this.f47126b = interfaceC1358l0;
            }

            public final void a() {
                TextViewer.y1(this.f47126b, new O("", 0L, (D) null, 6, (AbstractC7771k) null));
            }

            @Override
            public Object c() {
                a();
                return C6709J.f49946a;
            }
        }

        public static final class i extends AbstractC7781u implements InterfaceC7625a {

            final TextViewer f47127b;

            final Uri f47128c;

            i(TextViewer textViewer, Uri uri) {
                super(0);
                this.f47127b = textViewer;
                this.f47128c = uri;
            }

            public final void a() {
                this.f47127b.startActivity(new Intent("android.intent.action.EDIT", this.f47128c, this.f47127b.getApplicationContext(), TextEditor.class));
                this.f47127b.finish();
            }

            @Override
            public Object c() {
                a();
                return C6709J.f49946a;
            }
        }

        c(InterfaceC1358l0 interfaceC1358l0, TextViewer textViewer) {
            super(3);
            this.f47109b = interfaceC1358l0;
            this.f47110c = textViewer;
        }

        public static final g i(InterfaceC1358l0 interfaceC1358l0) {
            return (g) interfaceC1358l0.getValue();
        }

        public static final void j(InterfaceC1358l0 interfaceC1358l0, g gVar) {
            interfaceC1358l0.setValue(gVar);
        }

        @Override
        public Object f(Object obj, Object obj2, Object obj3) {
            g((InterfaceC7963r) obj, (InterfaceC1357l) obj2, ((Number) obj3).intValue());
            return C6709J.f49946a;
        }

        public final void g(InterfaceC7963r interfaceC7963r, InterfaceC1357l interfaceC1357l, int i9) {
            int i10;
            InterfaceC1357l interfaceC1357l2;
            String str;
            AbstractC7780t.f(interfaceC7963r, "$this$LcToolbar");
            if ((i9 & 14) == 0) {
                i10 = i9 | (interfaceC1357l.P(interfaceC7963r) ? 4 : 2);
            } else {
                i10 = i9;
            }
            if ((i10 & 91) == 18 && interfaceC1357l.s()) {
                interfaceC1357l.z();
                return;
            }
            if (AbstractC1363o.G()) {
                AbstractC1363o.S(959869959, i10, -1, "com.lonelycatgames.Xplore.ui.TextViewer.RenderContent.<anonymous>.<anonymous> (TextViewer.kt:251)");
            }
            O x12 = TextViewer.x1(this.f47109b);
            interfaceC1357l.e(1744883457);
            C6709J c6709j = null;
            if (x12 == null) {
                interfaceC1357l2 = interfaceC1357l;
            } else {
                TextViewer textViewer = this.f47110c;
                InterfaceC1358l0 interfaceC1358l0 = this.f47109b;
                interfaceC1357l.e(-1674001858);
                Object f9 = interfaceC1357l.f();
                if (f9 == InterfaceC1357l.f8665a.a()) {
                    f9 = l1.d(new g(0, 0, false), null, 2, null);
                    interfaceC1357l.H(f9);
                }
                InterfaceC1358l0 interfaceC1358l02 = (InterfaceC1358l0) f9;
                interfaceC1357l.M();
                androidx.compose.ui.focus.j a9 = AbstractC1034j.a(interfaceC1357l, 0);
                K.a(Boolean.TRUE, new a(textViewer, interfaceC1358l02), interfaceC1357l, 6);
                C1130y c1130y = new C1130y(0, false, 0, C1263x.f5260b.g(), null, 21, null);
                C1128w c1128w = new C1128w(null, null, null, null, new b(textViewer), null, 47, null);
                g.a aVar = b0.g.f21476a;
                b0.g a10 = androidx.compose.ui.focus.k.a(InterfaceC7963r.c(interfaceC7963r, aVar, 1.0f, false, 2, null), a9);
                boolean z8 = i(interfaceC1358l02).a() && i(interfaceC1358l02).c() == 0 && x12.f().length() > 0;
                int i11 = F.f56361g2;
                interfaceC1357l2 = interfaceC1357l;
                B5.D.a(x12, new C0691c(textViewer, interfaceC1358l0), a10, false, B5.I.b(J.m(interfaceC1357l, 0)), Integer.valueOf(i11), null, null, null, X.c.b(interfaceC1357l, 2016155985, true, new d(textViewer, interfaceC1358l0)), null, null, z8, null, c1130y, c1128w, true, 0, 0, null, interfaceC1357l, 805306368, 1597440, 929224);
                g i12 = i(interfaceC1358l02);
                boolean z9 = i12.a() && i12.c() > 1;
                b0.g d9 = y.d(aVar, 0.0f, 1, null);
                InterfaceC1899b.a aVar2 = InterfaceC1899b.f21449a;
                InterfaceC1899b.InterfaceC0513b f10 = aVar2.f();
                interfaceC1357l2.e(-483455358);
                C1694b c1694b = C1694b.f16520a;
                u0.D a11 = androidx.compose.foundation.layout.g.a(c1694b.f(), f10, interfaceC1357l2, 48);
                interfaceC1357l2.e(-1323940314);
                int a12 = AbstractC1351i.a(interfaceC1357l2, 0);
                InterfaceC1378w D8 = interfaceC1357l.D();
                InterfaceC7662g.a aVar3 = InterfaceC7662g.f57727C;
                InterfaceC7625a a13 = aVar3.a();
                q a14 = AbstractC7453v.a(d9);
                if (!(interfaceC1357l.t() instanceof InterfaceC1343e)) {
                    AbstractC1351i.c();
                }
                interfaceC1357l.r();
                if (interfaceC1357l.m()) {
                    interfaceC1357l2.l(a13);
                } else {
                    interfaceC1357l.F();
                }
                InterfaceC1357l a15 = v1.a(interfaceC1357l);
                v1.b(a15, a11, aVar3.c());
                v1.b(a15, D8, aVar3.e());
                p b9 = aVar3.b();
                if (a15.m() || !AbstractC7780t.a(a15.f(), Integer.valueOf(a12))) {
                    a15.H(Integer.valueOf(a12));
                    a15.Q(Integer.valueOf(a12), b9);
                }
                a14.f(R0.a(R0.b(interfaceC1357l)), interfaceC1357l2, 0);
                interfaceC1357l2.e(2058660585);
                b0.g b10 = InterfaceC7950e.b(C7951f.f59712a, aVar, 1.0f, false, 2, null);
                interfaceC1357l2.e(693286680);
                u0.D a16 = w.a(c1694b.e(), aVar2.k(), interfaceC1357l2, 0);
                interfaceC1357l2.e(-1323940314);
                int a17 = AbstractC1351i.a(interfaceC1357l2, 0);
                InterfaceC1378w D9 = interfaceC1357l.D();
                InterfaceC7625a a18 = aVar3.a();
                q a19 = AbstractC7453v.a(b10);
                if (!(interfaceC1357l.t() instanceof InterfaceC1343e)) {
                    AbstractC1351i.c();
                }
                interfaceC1357l.r();
                if (interfaceC1357l.m()) {
                    interfaceC1357l2.l(a18);
                } else {
                    interfaceC1357l.F();
                }
                InterfaceC1357l a20 = v1.a(interfaceC1357l);
                v1.b(a20, a16, aVar3.c());
                v1.b(a20, D9, aVar3.e());
                p b11 = aVar3.b();
                if (a20.m() || !AbstractC7780t.a(a20.f(), Integer.valueOf(a17))) {
                    a20.H(Integer.valueOf(a17));
                    a20.Q(Integer.valueOf(a17), b11);
                }
                a19.f(R0.a(R0.b(interfaceC1357l)), interfaceC1357l2, 0);
                interfaceC1357l2.e(2058660585);
                C7964s c7964s = C7964s.f59771a;
                K.a aVar4 = K.a.f6572a;
                boolean z10 = z9;
                AbstractC1030f.a(L.a.a(aVar4), null, null, null, Integer.valueOf(F.f56096D4), z10, null, new e(textViewer), interfaceC1357l, 0, 78);
                AbstractC1030f.a(L.b.a(aVar4), null, null, null, Integer.valueOf(F.f56381i2), z10, null, new f(textViewer), interfaceC1357l, 0, 78);
                interfaceC1357l.M();
                interfaceC1357l.N();
                interfaceC1357l.M();
                interfaceC1357l.M();
                if (!i12.a() || i12.c() <= 0) {
                    str = "";
                } else {
                    StringBuilder sb = new StringBuilder();
                    sb.append(i12.b() + 1);
                    sb.append('/');
                    sb.append(i12.c());
                    str = sb.toString();
                }
                E.a(str, null, 0L, 0L, null, null, null, 0L, null, null, 0L, 0, false, 0, 0, null, B5.I.c(J.m(interfaceC1357l2, 0)), false, interfaceC1357l, 0, 0, 196606);
                interfaceC1357l.M();
                interfaceC1357l.N();
                interfaceC1357l.M();
                interfaceC1357l.M();
                c6709j = C6709J.f49946a;
            }
            interfaceC1357l.M();
            if (c6709j == null) {
                TextViewer textViewer2 = this.f47110c;
                InterfaceC1358l0 interfaceC1358l03 = this.f47109b;
                InterfaceC1357l interfaceC1357l3 = interfaceC1357l2;
                B5.H.b(textViewer2.getTitle().toString(), InterfaceC7963r.c(interfaceC7963r, b0.g.f21476a, 1.0f, false, 2, null), null, interfaceC1357l, 0, 4);
                Integer valueOf = Integer.valueOf(AbstractC7556B.f55790r2);
                Integer valueOf2 = Integer.valueOf(F.f56361g2);
                interfaceC1357l3.e(-1673998285);
                Object f11 = interfaceC1357l.f();
                if (f11 == InterfaceC1357l.f8665a.a()) {
                    f11 = new h(interfaceC1358l03);
                    interfaceC1357l3.H(f11);
                }
                interfaceC1357l.M();
                AbstractC1030f.a(valueOf, null, null, null, valueOf2, false, null, (InterfaceC7625a) f11, interfaceC1357l, 12582912, 110);
                Uri T12 = textViewer2.T1();
                interfaceC1357l3.e(1744887354);
                if (T12 != null) {
                    AbstractC1030f.a(Integer.valueOf(AbstractC7556B.f55711b3), null, null, null, Integer.valueOf(F.f56528x1), false, null, new i(textViewer2, T12), interfaceC1357l, 0, 110);
                    C6709J c6709j2 = C6709J.f49946a;
                }
                interfaceC1357l.M();
            }
            if (AbstractC1363o.G()) {
                AbstractC1363o.R();
            }
        }
    }

    public static final class d extends AbstractC7781u implements v7.l {

        public static final class a extends AbstractC7781u implements v7.l {

            final TextViewer f47130b;

            public static final class C0692a extends AbstractC7781u implements InterfaceC7625a {

                final TextViewer f47131b;

                C0692a(TextViewer textViewer) {
                    super(0);
                    this.f47131b = textViewer;
                }

                public final void a() {
                    if (!this.f47131b.f47107k0) {
                        this.f47131b.X1();
                    }
                }

                @Override
                public Object c() {
                    a();
                    return C6709J.f49946a;
                }
            }

            public static final class b extends AbstractC7781u implements v7.l {

                final TextViewer f47132b;

                public static final class C0693a extends AbstractC7781u implements InterfaceC7625a {

                    final TextViewer f47133b;

                    C0693a(TextViewer textViewer) {
                        super(0);
                        this.f47133b = textViewer;
                    }

                    public final void a() {
                        WebView webView = this.f47133b.f47101e0;
                        if (webView == null) {
                            AbstractC7780t.r("webView");
                            webView = null;
                            int i9 = 3 << 0;
                        }
                        webView.pageUp(true);
                    }

                    @Override
                    public Object c() {
                        a();
                        return C6709J.f49946a;
                    }
                }

                public static final class C0694b extends AbstractC7781u implements InterfaceC7625a {

                    final TextViewer f47134b;

                    C0694b(TextViewer textViewer) {
                        super(0);
                        this.f47134b = textViewer;
                    }

                    public final void a() {
                        WebView webView = this.f47134b.f47101e0;
                        if (webView == null) {
                            AbstractC7780t.r("webView");
                            webView = null;
                        }
                        webView.pageDown(true);
                    }

                    @Override
                    public Object c() {
                        a();
                        return C6709J.f49946a;
                    }
                }

                b(TextViewer textViewer) {
                    super(1);
                    this.f47132b = textViewer;
                }

                public final void a(s sVar) {
                    AbstractC7780t.f(sVar, "$this$submenu");
                    s.F(sVar, Integer.valueOf(F.f56525w7), null, 0, new C0693a(this.f47132b), 6, null);
                    s.F(sVar, Integer.valueOf(F.f56163L), null, 0, new C0694b(this.f47132b), 6, null);
                }

                @Override
                public Object h(Object obj) {
                    a((s) obj);
                    return C6709J.f49946a;
                }
            }

            a(TextViewer textViewer) {
                super(1);
                this.f47130b = textViewer;
            }

            public final void a(s sVar) {
                AbstractC7780t.f(sVar, "$this$$receiver");
                int i9 = 5 >> 0;
                s.F(sVar, Integer.valueOf(F.f56249U4), Integer.valueOf(AbstractC7556B.f55645L2), 0, new C0692a(this.f47130b), 4, null);
                int i10 = 6 << 0;
                s.W(sVar, Integer.valueOf(F.f56148J2), null, new b(this.f47130b), 2, null);
            }

            @Override
            public Object h(Object obj) {
                a((s) obj);
                return C6709J.f49946a;
            }
        }

        d() {
            super(1);
        }

        @Override
        public final s h(InterfaceC7625a interfaceC7625a) {
            AbstractC7780t.f(interfaceC7625a, "it");
            return new s(false, false, null, null, false, null, false, new a(TextViewer.this), 126, null);
        }
    }

    public static final class e extends AbstractC7781u implements v7.l {
        e() {
            super(1);
        }

        @Override
        public final WebView h(Context context) {
            AbstractC7780t.f(context, "it");
            WebView webView = TextViewer.this.f47101e0;
            if (webView == null) {
                AbstractC7780t.r("webView");
                webView = null;
            }
            return webView;
        }
    }

    public static final class f extends AbstractC7781u implements p {

        final int f47137c;

        f(int i9) {
            super(2);
            this.f47137c = i9;
        }

        public final void a(InterfaceC1357l interfaceC1357l, int i9) {
            TextViewer.this.K0(interfaceC1357l, F0.a(this.f47137c | 1));
        }

        @Override
        public Object r(Object obj, Object obj2) {
            a((InterfaceC1357l) obj, ((Number) obj2).intValue());
            return C6709J.f49946a;
        }
    }

    static final class g extends AbstractC7781u implements InterfaceC7625a {
        g() {
            super(0);
        }

        @Override
        public final C1141j c() {
            Parcelable parcelable;
            C e9;
            com.lonelycatgames.Xplore.FileSystem.h h02;
            Object parcelableExtra;
            t tVar = t.f22031a;
            Intent intent = TextViewer.this.getIntent();
            AbstractC7780t.e(intent, "getIntent(...)");
            if (Build.VERSION.SDK_INT >= 33) {
                parcelableExtra = intent.getParcelableExtra("com.lonelycatgames.Xplore.contentUri", Uri.class);
                parcelable = (Parcelable) parcelableExtra;
            } else {
                parcelable = (Uri) intent.getParcelableExtra("com.lonelycatgames.Xplore.contentUri");
            }
            Uri uri = (Uri) parcelable;
            if (uri == null) {
                uri = TextViewer.this.getIntent().getData();
            }
            C1141j c1141j = null;
            if (uri != null) {
                TextViewer textViewer = TextViewer.this;
                if (t6.k.Z(uri)) {
                    String S8 = t6.k.S(uri);
                    e9 = l.a.f(com.lonelycatgames.Xplore.FileSystem.l.f44637n, S8, false, 2, null).N0(S8);
                } else {
                    FileContentProvider.a aVar = FileContentProvider.f44237E;
                    ContentResolver contentResolver = textViewer.getContentResolver();
                    AbstractC7780t.e(contentResolver, "getContentResolver(...)");
                    e9 = aVar.e(contentResolver, uri);
                }
                if (e9 != null && (h02 = e9.h0()) != null) {
                    c1141j = h02.B0(e9);
                }
            }
            return c1141j;
        }
    }

    static final class h extends AbstractC7781u implements InterfaceC7625a {
        h() {
            super(0);
        }

        @Override
        public final Uri c() {
            Parcelable parcelable;
            Object parcelableExtra;
            Intent intent = TextViewer.this.getIntent();
            t tVar = t.f22031a;
            AbstractC7780t.c(intent);
            if (Build.VERSION.SDK_INT >= 33) {
                parcelableExtra = intent.getParcelableExtra("com.lonelycatgames.Xplore.contentUri", Uri.class);
                parcelable = (Parcelable) parcelableExtra;
            } else {
                parcelable = (Uri) intent.getParcelableExtra("com.lonelycatgames.Xplore.contentUri");
            }
            Uri uri = (Uri) parcelable;
            if (uri == null) {
                uri = intent.getData();
                if (uri != null) {
                    TextViewer textViewer = TextViewer.this;
                    if (!t6.k.Z(uri)) {
                        FileContentProvider.a aVar = FileContentProvider.f44237E;
                        ContentResolver contentResolver = textViewer.getContentResolver();
                        AbstractC7780t.e(contentResolver, "getContentResolver(...)");
                        C e9 = aVar.e(contentResolver, uri);
                        if (e9 != null) {
                        }
                    }
                }
                uri = null;
            }
            return uri;
        }
    }

    public static final class i extends AbstractC7136l implements p {

        final String f47140E;

        final TextViewer f47141F;

        int f47142e;

        public static final class a extends AbstractC7136l implements p {

            final TextViewer f47143E;

            final String f47144F;

            int f47145e;

            a(TextViewer textViewer, String str, InterfaceC7068d interfaceC7068d) {
                super(2, interfaceC7068d);
                this.f47143E = textViewer;
                this.f47144F = str;
            }

            @Override
            public final Object r(H7.L l9, InterfaceC7068d interfaceC7068d) {
                return ((a) u(l9, interfaceC7068d)).z(C6709J.f49946a);
            }

            @Override
            public final InterfaceC7068d u(Object obj, InterfaceC7068d interfaceC7068d) {
                return new a(this.f47143E, this.f47144F, interfaceC7068d);
            }

            @Override
            public final Object z(Object obj) {
                n7.d.f();
                if (this.f47145e != 0) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC6732u.b(obj);
                return this.f47143E.U1(this.f47144F);
            }
        }

        public static final class b extends AbstractC7136l implements p {

            final C f47146E;

            final TextViewer f47147F;

            int f47148e;

            b(C c9, TextViewer textViewer, InterfaceC7068d interfaceC7068d) {
                super(2, interfaceC7068d);
                this.f47146E = c9;
                this.f47147F = textViewer;
            }

            @Override
            public final Object r(H7.L l9, InterfaceC7068d interfaceC7068d) {
                return ((b) u(l9, interfaceC7068d)).z(C6709J.f49946a);
            }

            @Override
            public final InterfaceC7068d u(Object obj, InterfaceC7068d interfaceC7068d) {
                return new b(this.f47146E, this.f47147F, interfaceC7068d);
            }

            @Override
            public final Object z(Object obj) {
                n7.d.f();
                if (this.f47148e != 0) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC6732u.b(obj);
                try {
                    InputStream R02 = C.R0(this.f47146E, 0, 1, null);
                    try {
                        String W12 = this.f47147F.W1(R02);
                        t7.c.a(R02, null);
                        return W12;
                    } finally {
                    }
                } catch (Exception e9) {
                    return "Error loading file: " + t6.k.Q(e9);
                }
            }
        }

        i(String str, TextViewer textViewer, InterfaceC7068d interfaceC7068d) {
            super(2, interfaceC7068d);
            this.f47140E = str;
            this.f47141F = textViewer;
        }

        @Override
        public final Object r(H7.L l9, InterfaceC7068d interfaceC7068d) {
            return ((i) u(l9, interfaceC7068d)).z(C6709J.f49946a);
        }

        @Override
        public final InterfaceC7068d u(Object obj, InterfaceC7068d interfaceC7068d) {
            return new i(this.f47140E, this.f47141F, interfaceC7068d);
        }

        @Override
        public final Object z(Object obj) {
            Object f9;
            String str;
            String R8;
            f9 = n7.d.f();
            int i9 = this.f47142e;
            String str2 = null;
            if (i9 == 0) {
                AbstractC6732u.b(obj);
                H7.H b9 = C1191a0.b();
                a aVar = new a(this.f47141F, this.f47140E, null);
                this.f47142e = 1;
                obj = AbstractC1204h.g(b9, aVar, this);
                if (obj == f9) {
                    return f9;
                }
            } else {
                if (i9 != 1) {
                    if (i9 != 2) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    AbstractC6732u.b(obj);
                    str = (String) obj;
                    TextViewer textViewer = this.f47141F;
                    R8 = t6.k.R(this.f47140E);
                    if (R8 != null) {
                        str2 = R8 + '/';
                    }
                    textViewer.Q1(str, str2);
                    return C6709J.f49946a;
                }
                AbstractC6732u.b(obj);
            }
            C c9 = (C) obj;
            if (c9 == null) {
                str = pWhGPktqxGVuO.GKrzgCkGyZwfPok + this.f47140E + '\'';
                TextViewer textViewer2 = this.f47141F;
                R8 = t6.k.R(this.f47140E);
                if (R8 != null) {
                }
                textViewer2.Q1(str, str2);
                return C6709J.f49946a;
            }
            H7.H b10 = C1191a0.b();
            b bVar = new b(c9, this.f47141F, null);
            this.f47142e = 2;
            obj = AbstractC1204h.g(b10, bVar, this);
            if (obj == f9) {
                return f9;
            }
            str = (String) obj;
            TextViewer textViewer22 = this.f47141F;
            R8 = t6.k.R(this.f47140E);
            if (R8 != null) {
            }
            textViewer22.Q1(str, str2);
            return C6709J.f49946a;
        }
    }

    public static final class j extends WebViewClient {

        final int f47150b;

        static final class a extends AbstractC7136l implements p {

            final TextViewer f47151E;

            final int f47152F;

            int f47153e;

            a(TextViewer textViewer, int i9, InterfaceC7068d interfaceC7068d) {
                super(2, interfaceC7068d);
                this.f47151E = textViewer;
                this.f47152F = i9;
            }

            @Override
            public final Object r(H7.L l9, InterfaceC7068d interfaceC7068d) {
                return ((a) u(l9, interfaceC7068d)).z(C6709J.f49946a);
            }

            @Override
            public final InterfaceC7068d u(Object obj, InterfaceC7068d interfaceC7068d) {
                return new a(this.f47151E, this.f47152F, interfaceC7068d);
            }

            @Override
            public final Object z(Object obj) {
                Object f9;
                f9 = n7.d.f();
                int i9 = this.f47153e;
                if (i9 == 0) {
                    AbstractC6732u.b(obj);
                    this.f47153e = 1;
                    if (W.a(100L, this) == f9) {
                        return f9;
                    }
                } else {
                    if (i9 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    AbstractC6732u.b(obj);
                }
                WebView webView = this.f47151E.f47101e0;
                if (webView == null) {
                    AbstractC7780t.r("webView");
                    webView = null;
                }
                webView.scrollTo(0, this.f47152F);
                return C6709J.f49946a;
            }
        }

        j(int i9) {
            this.f47150b = i9;
        }

        private final String a(Uri uri) {
            String R02;
            if (!AbstractC7780t.a(uri.getScheme(), "http") || !AbstractC7780t.a(uri.getAuthority(), "--xplore-text-viewer--")) {
                return null;
            }
            R02 = x.R0(t6.k.S(uri), '/');
            return R02;
        }

        @Override
        public void onPageFinished(WebView webView, String str) {
            AbstractC7780t.f(webView, "view");
            AbstractC7780t.f(str, "url");
            TextViewer.this.f47107k0 = false;
            if (TextViewer.this.f47102f0) {
                TextViewer.this.e2();
            }
            if (this.f47150b != 0) {
                AbstractC1208j.d(r.a(TextViewer.this), null, null, new a(TextViewer.this, this.f47150b, null), 3, null);
            }
        }

        @Override
        public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
            AbstractC7780t.f(webView, "wv");
            AbstractC7780t.f(webResourceRequest, "request");
            AbstractC7780t.f(webResourceError, "error");
            if (webResourceRequest.isForMainFrame()) {
                TextViewer.this.b2(webResourceError.getDescription().toString());
            }
        }

        @Override
        public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
            C U12;
            AbstractC7780t.f(webView, "view");
            AbstractC7780t.f(webResourceRequest, "req");
            Uri url = webResourceRequest.getUrl();
            AbstractC7780t.c(url);
            String a9 = a(url);
            if (a9 != null && (U12 = TextViewer.this.U1(a9)) != null) {
                try {
                    return new WebResourceResponse(U12.A(), null, C.R0(U12, 0, 1, null));
                } catch (Exception e9) {
                    App.f43875F0.e(t6.k.Q(e9));
                }
            }
            return null;
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
            com.lonelycatgames.Xplore.f a9;
            String scheme;
            AbstractC7780t.f(webView, "view");
            AbstractC7780t.f(webResourceRequest, "req");
            Uri url = webResourceRequest.getUrl();
            AbstractC7780t.c(url);
            String a10 = a(url);
            if (a10 != null) {
                TextViewer.this.V1(a10);
                return true;
            }
            if (!TextViewer.this.T0().v1() && (a9 = com.lonelycatgames.Xplore.f.f46048k.a()) != null && a9.h() && (scheme = url.getScheme()) != null) {
                int hashCode = scheme.hashCode();
                if (hashCode != -1081306052) {
                    if (hashCode != 3213448) {
                        if (hashCode == 99617003 && scheme.equals("https")) {
                        }
                    }
                }
                try {
                    TextViewer.this.startActivity(new Intent("android.intent.action.VIEW", url));
                    return true;
                } catch (Exception e9) {
                    TextViewer.this.T0().z2(e9);
                }
            }
            return false;
        }
    }

    public static final class k extends AbstractC7136l implements p {

        final Uri f47155F;

        int f47156e;

        public static final class a extends AbstractC7136l implements p {

            final TextViewer f47157E;

            final Uri f47158F;

            int f47159e;

            a(TextViewer textViewer, Uri uri, InterfaceC7068d interfaceC7068d) {
                super(2, interfaceC7068d);
                this.f47157E = textViewer;
                this.f47158F = uri;
            }

            @Override
            public final Object r(H7.L l9, InterfaceC7068d interfaceC7068d) {
                return ((a) u(l9, interfaceC7068d)).z(C6709J.f49946a);
            }

            @Override
            public final InterfaceC7068d u(Object obj, InterfaceC7068d interfaceC7068d) {
                return new a(this.f47157E, this.f47158F, interfaceC7068d);
            }

            @Override
            public final Object z(Object obj) {
                n7.d.f();
                if (this.f47159e != 0) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC6732u.b(obj);
                try {
                    InputStream openInputStream = this.f47157E.getContentResolver().openInputStream(this.f47158F);
                    String str = null;
                    if (openInputStream != null) {
                        try {
                            String W12 = this.f47157E.W1(openInputStream);
                            t7.c.a(openInputStream, null);
                            str = W12;
                        } finally {
                        }
                    }
                    if (!AbstractC7780t.a(this.f47157E.f47100d0, "text/markdown") || str == null) {
                        return str;
                    }
                    String Z12 = this.f47157E.Z1(str);
                    this.f47157E.f47100d0 = "text/html";
                    return Z12;
                } catch (Exception e9) {
                    return "Error loading file: " + t6.k.Q(e9);
                }
            }
        }

        k(Uri uri, InterfaceC7068d interfaceC7068d) {
            super(2, interfaceC7068d);
            this.f47155F = uri;
        }

        @Override
        public final Object r(H7.L l9, InterfaceC7068d interfaceC7068d) {
            return ((k) u(l9, interfaceC7068d)).z(C6709J.f49946a);
        }

        @Override
        public final InterfaceC7068d u(Object obj, InterfaceC7068d interfaceC7068d) {
            return new k(this.f47155F, interfaceC7068d);
        }

        @Override
        public final Object z(Object obj) {
            Object f9;
            f9 = n7.d.f();
            int i9 = this.f47156e;
            if (i9 == 0) {
                AbstractC6732u.b(obj);
                H7.H b9 = C1191a0.b();
                a aVar = new a(TextViewer.this, this.f47155F, null);
                this.f47156e = 1;
                obj = AbstractC1204h.g(b9, aVar, this);
                if (obj == f9) {
                    return f9;
                }
            } else {
                if (i9 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC6732u.b(obj);
            }
            TextViewer.this.Q1((String) obj, null);
            return C6709J.f49946a;
        }
    }

    public static final class l extends WebChromeClient {
        l() {
        }
    }

    public static final class m extends ScaleGestureDetector.SimpleOnScaleGestureListener {

        final C7752K f47160a;

        final TextViewer f47161b;

        m(C7752K c7752k, TextViewer textViewer) {
            this.f47160a = c7752k;
            this.f47161b = textViewer;
        }

        @Override
        public boolean onScale(ScaleGestureDetector scaleGestureDetector) {
            float j9;
            int d9;
            AbstractC7780t.f(scaleGestureDetector, ZXeKvxFHX.vFcWHDdRjLQEh);
            float scaleFactor = scaleGestureDetector.getScaleFactor();
            if (0.1f <= scaleFactor && scaleFactor <= 2.0f) {
                C7752K c7752k = this.f47160a;
                j9 = o.j(c7752k.f58203a * (((scaleFactor - 1.0f) * 0.2f) + 1.0f), 30.0f, 500.0f);
                c7752k.f58203a = j9;
                WebView webView = this.f47161b.f47101e0;
                if (webView == null) {
                    AbstractC7780t.r("webView");
                    webView = null;
                }
                WebSettings settings = webView.getSettings();
                d9 = AbstractC7945c.d(this.f47160a.f58203a);
                settings.setTextZoom(d9);
            }
            return true;
        }
    }

    static final class n extends AbstractC7781u implements InterfaceC7625a {
        n() {
            super(0);
        }

        public final void a() {
            WebView webView = TextViewer.this.f47101e0;
            if (webView == null) {
                AbstractC7780t.r("webView");
                webView = null;
                int i9 = 3 & 0;
            }
            webView.destroy();
        }

        @Override
        public Object c() {
            a();
            return C6709J.f49946a;
        }
    }

    public final void Q1(String str, String str2) {
        try {
            WebView webView = this.f47101e0;
            if (webView == null) {
                AbstractC7780t.r("webView");
                webView = null;
            }
            WebView webView2 = webView;
            StringBuilder sb = new StringBuilder();
            sb.append("http://--xplore-text-viewer--/");
            sb.append(str2 == null ? "" : str2);
            webView2.loadDataWithBaseURL(sb.toString(), str == null ? "Error loading file" : str, (!AbstractC7780t.a(this.f47100d0, "text/html") || str == null) ? "text/plain" : "text/html", "UTF-8", null);
        } catch (OutOfMemoryError unused) {
            App.C6336a.q(App.f43875F0, this, "Out of memory", false, 4, null);
        }
    }

    private final C1141j S1() {
        return (C1141j) this.f47103g0.getValue();
    }

    public final Uri T1() {
        return (Uri) this.f47104h0.getValue();
    }

    public final synchronized C U1(String str) {
        List t02;
        Object obj;
        boolean t9;
        try {
            C S12 = S1();
            if (S12 == null) {
                return null;
            }
            int i9 = 0;
            t02 = x.t0(str, new String[]{"/"}, false, 0, 6, null);
            ArrayList arrayList = new ArrayList();
            for (Object obj2 : t02) {
                if (((String) obj2).length() > 0) {
                    arrayList.add(obj2);
                }
            }
            if (arrayList.isEmpty()) {
                return null;
            }
            while (true) {
                HashMap hashMap = this.f47108l0;
                String i02 = ((C1141j) S12).i0();
                Object obj3 = hashMap.get(i02);
                if (obj3 == null) {
                    try {
                        obj3 = ((C1141j) S12).B1();
                    } catch (Exception unused) {
                        obj3 = null;
                    }
                    hashMap.put(i02, obj3);
                }
                List list = (List) obj3;
                if (list == null) {
                    return null;
                }
                int i10 = i9 + 1;
                String str2 = (String) arrayList.get(i9);
                Iterator it = list.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        obj = null;
                        break;
                    }
                    obj = it.next();
                    t9 = F7.w.t(((C) obj).p0(), str2, true);
                    if (t9) {
                        break;
                    }
                }
                S12 = (C) obj;
                if (S12 == null) {
                    return null;
                }
                if (i10 == arrayList.size()) {
                    break;
                }
                if (!(S12 instanceof C1141j)) {
                    return null;
                }
                i9 = i10;
            }
        } catch (Throwable th) {
            throw th;
        }
    }

    public final void V1(String str) {
        AbstractC1208j.d(r.a(this), null, null, new i(str, this, null), 3, null);
    }

    public final String W1(InputStream inputStream) {
        InputStreamReader inputStreamReader;
        String str;
        String k9 = X0().k();
        BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
        bufferedInputStream.mark(4);
        try {
            try {
                try {
                    byte[] bArr = new byte[3];
                    int read = bufferedInputStream.read(bArr);
                    if (read >= 2) {
                        int i9 = 6 << 1;
                        if (read >= 3 && bArr[0] == -17 && bArr[1] == -69 && bArr[2] == -65) {
                            k9 = "utf-8";
                        } else {
                            byte b9 = bArr[0];
                            if (b9 == -2 && bArr[1] == -1) {
                                k9 = "utf-16be";
                            } else if (b9 == -1) {
                                if (bArr[1] == -2) {
                                    k9 = "utf-16";
                                }
                            }
                        }
                    }
                    bufferedInputStream.reset();
                } catch (IOException e9) {
                    e9.printStackTrace();
                    bufferedInputStream.reset();
                }
            } catch (Throwable th) {
                try {
                    bufferedInputStream.reset();
                } catch (IOException e10) {
                    e10.printStackTrace();
                }
                throw th;
            }
        } catch (IOException e11) {
            e11.printStackTrace();
        }
        try {
            inputStreamReader = new InputStreamReader(bufferedInputStream, k9);
        } catch (UnsupportedEncodingException unused) {
            inputStreamReader = new InputStreamReader(bufferedInputStream);
        }
        StringBuilder sb = new StringBuilder();
        try {
            char[] cArr = new char[4096];
            while (true) {
                int read2 = inputStreamReader.read(cArr);
                if (read2 < 0) {
                    try {
                        break;
                    } catch (OutOfMemoryError unused2) {
                        str = "Error: Out of memory - text file is too big!";
                    }
                } else {
                    try {
                        sb.append(cArr, 0, read2);
                    } catch (OutOfMemoryError unused3) {
                        str = null;
                    }
                }
                t6.k.k(inputStream);
                t6.k.k(inputStreamReader);
                return str;
            }
            str = sb.toString();
            t6.k.k(inputStream);
            t6.k.k(inputStreamReader);
            return str;
        } catch (Throwable th2) {
            t6.k.k(inputStreamReader);
            throw th2;
        }
    }

    public final void X1() {
        InterfaceC1230u0 interfaceC1230u0 = this.f47106j0;
        WebView webView = null;
        if (interfaceC1230u0 != null) {
            InterfaceC1230u0.a.a(interfaceC1230u0, null, 1, null);
        }
        this.f47106j0 = null;
        this.f47107k0 = true;
        WebView webView2 = this.f47101e0;
        if (webView2 == null) {
            AbstractC7780t.r("webView");
            webView2 = null;
        }
        int scrollY = webView2.getScrollY();
        Uri uri = this.f47099c0;
        if (uri == null) {
            return;
        }
        WebView webView3 = this.f47101e0;
        if (webView3 == null) {
            AbstractC7780t.r("webView");
        } else {
            webView = webView3;
        }
        webView.setWebViewClient(new j(scrollY));
        d2(AbstractC7780t.a(this.f47100d0, "text/html"));
        Y1(uri);
    }

    private final void Y1(Uri uri) {
        InterfaceC1230u0 d9;
        d9 = AbstractC1208j.d(r.a(this), null, null, new k(uri, null), 3, null);
        this.f47106j0 = d9;
    }

    public final String Z1(String str) {
        String i9 = r8.f.h().h().i(m8.e.a().g().c(str));
        AbstractC7780t.e(i9, "render(...)");
        return i9;
    }

    public static final boolean a2(ScaleGestureDetector scaleGestureDetector, View view, MotionEvent motionEvent) {
        AbstractC7780t.f(scaleGestureDetector, "$gd");
        scaleGestureDetector.onTouchEvent(motionEvent);
        return scaleGestureDetector.isInProgress();
    }

    public final void b2(String str) {
        String str2;
        WebView webView = this.f47101e0;
        if (webView == null) {
            AbstractC7780t.r("webView");
            webView = null;
        }
        webView.stopLoading();
        TextView textView = new TextView(this);
        setContentView(textView);
        if (this.f47099c0 != null) {
            str2 = "Error loading url " + this.f47099c0;
        } else {
            str2 = "";
        }
        textView.setText(str2 + "\nError: " + str);
    }

    private final void d2(boolean z8) {
        this.f47102f0 &= !z8;
        WebView webView = this.f47101e0;
        WebView webView2 = null;
        if (webView == null) {
            AbstractC7780t.r("webView");
            webView = null;
        }
        webView.setBackgroundColor(this.f47102f0 ? -16777216 : -1);
        if (z8) {
            WebView webView3 = this.f47101e0;
            if (webView3 == null) {
                AbstractC7780t.r("webView");
            } else {
                webView2 = webView3;
            }
            webView2.getSettings().setJavaScriptEnabled(true);
        }
    }

    public final void e2() {
        WebView webView = this.f47101e0;
        if (webView == null) {
            AbstractC7780t.r("webView");
            webView = null;
        }
        webView.getSettings().setJavaScriptEnabled(true);
        WebView webView2 = this.f47101e0;
        if (webView2 == null) {
            AbstractC7780t.r("webView");
            webView2 = null;
        }
        webView2.evaluateJavascript("document.body.style.color='white';", null);
    }

    public static final O x1(InterfaceC1358l0 interfaceC1358l0) {
        return (O) interfaceC1358l0.getValue();
    }

    public static final void y1(InterfaceC1358l0 interfaceC1358l0, O o9) {
        interfaceC1358l0.setValue(o9);
    }

    @Override
    public void K0(InterfaceC1357l interfaceC1357l, int i9) {
        InterfaceC1357l p9 = interfaceC1357l.p(-1513367990);
        if (AbstractC1363o.G()) {
            AbstractC1363o.S(-1513367990, i9, -1, VwmfTGoaDK.sgXAvYyrsyqMP);
        }
        g.a aVar = b0.g.f21476a;
        b0.g f9 = y.f(aVar, 0.0f, 1, null);
        p9.e(-483455358);
        u0.D a9 = androidx.compose.foundation.layout.g.a(C1694b.f16520a.f(), InterfaceC1899b.f21449a.j(), p9, 0);
        p9.e(-1323940314);
        int a10 = AbstractC1351i.a(p9, 0);
        InterfaceC1378w D8 = p9.D();
        InterfaceC7662g.a aVar2 = InterfaceC7662g.f57727C;
        InterfaceC7625a a11 = aVar2.a();
        q a12 = AbstractC7453v.a(f9);
        if (!(p9.t() instanceof InterfaceC1343e)) {
            AbstractC1351i.c();
        }
        p9.r();
        if (p9.m()) {
            p9.l(a11);
        } else {
            p9.F();
        }
        InterfaceC1357l a13 = v1.a(p9);
        v1.b(a13, a9, aVar2.c());
        v1.b(a13, D8, aVar2.e());
        p b9 = aVar2.b();
        if (a13.m() || !AbstractC7780t.a(a13.f(), Integer.valueOf(a10))) {
            a13.H(Integer.valueOf(a10));
            a13.Q(Integer.valueOf(a10), b9);
        }
        a12.f(R0.a(R0.b(p9)), p9, 0);
        p9.e(2058660585);
        C7951f c7951f = C7951f.f59712a;
        p9.e(-899501467);
        Object f10 = p9.f();
        if (f10 == InterfaceC1357l.f8665a.a()) {
            f10 = l1.d(null, null, 2, null);
            p9.H(f10);
        }
        p9.M();
        B5.H.a(null, null, 0L, new b(this), X.c.b(p9, 959869959, true, new c((InterfaceC1358l0) f10, this)), null, new d(), p9, 24582, 38);
        if (W0()) {
            p9.e(-899496489);
            androidx.compose.ui.viewinterop.e.a(new e(), e0.e.b(y.f(aVar, 0.0f, 1, null)), null, p9, 48, 4);
            p9.M();
        } else {
            p9.e(-899496293);
            super.K0(p9, 8);
            p9.M();
        }
        p9.M();
        p9.N();
        p9.M();
        p9.M();
        if (AbstractC1363o.G()) {
            AbstractC1363o.R();
        }
        P0 v8 = p9.v();
        if (v8 != null) {
            v8.a(new f(i9));
        }
    }

    @Override
    public L U0() {
        L l9 = this.f47105i0;
        if (l9 != null) {
            return l9;
        }
        AbstractC7780t.r("binding");
        return null;
    }

    public void c2(L l9) {
        AbstractC7780t.f(l9, "<set-?>");
        this.f47105i0 = l9;
    }

    @Override
    public void onBackPressed() {
        WebView webView = this.f47101e0;
        WebView webView2 = null;
        if (webView == null) {
            AbstractC7780t.r("webView");
            webView = null;
        }
        if (!webView.canGoBack()) {
            super.onBackPressed();
            return;
        }
        WebView webView3 = this.f47101e0;
        if (webView3 == null) {
            AbstractC7780t.r("webView");
        } else {
            webView2 = webView3;
        }
        webView2.goBack();
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        WebView webView = null;
        com.lonelycatgames.Xplore.ui.a.a1(this, false, 1, null);
        if (T0().p1()) {
            setTheme(G.f56556d);
            this.f47102f0 = true;
        }
        SharedPreferences F02 = T0().F0();
        if (getSharedPreferences("WebViewSettings", 0).getInt("double_tap_toast_count", 1) > 0) {
            SharedPreferences.Editor edit = F02.edit();
            edit.putInt("double_tap_toast_count", 0);
            edit.apply();
        }
        g1();
        if (W0()) {
            this.f47101e0 = new WebView(this);
        } else {
            L c9 = L.c(getLayoutInflater());
            AbstractC7780t.e(c9, "inflate(...)");
            c2(c9);
            TextViewerWebView textViewerWebView = U0().f10441b;
            AbstractC7780t.e(textViewerWebView, "webView");
            this.f47101e0 = textViewerWebView;
        }
        Intent intent = getIntent();
        if (intent == null) {
            return;
        }
        String stringExtra = intent.getStringExtra("title");
        Uri data = intent.getData();
        if (data != null) {
            this.f47099c0 = data;
            this.f47100d0 = intent.getType();
            if (stringExtra == null) {
                ContentResolver contentResolver = getContentResolver();
                AbstractC7780t.e(contentResolver, "getContentResolver(...)");
                stringExtra = t6.k.C(contentResolver, data);
                String B02 = T0().B0(t6.k.E(stringExtra));
                if (B02 != null) {
                    this.f47100d0 = B02;
                }
            }
        }
        if (stringExtra != null) {
            setTitle(stringExtra);
        } else {
            Uri uri = this.f47099c0;
            if (uri != null) {
                setTitle(uri.getPath());
            }
        }
        WebView webView2 = this.f47101e0;
        if (webView2 == null) {
            AbstractC7780t.r("webView");
            webView2 = null;
        }
        WebSettings settings = webView2.getSettings();
        settings.setFixedFontFamily(settings.getSansSerifFontFamily());
        settings.setSupportZoom(false);
        settings.setAllowContentAccess(true);
        C7752K c7752k = new C7752K();
        WebView webView3 = this.f47101e0;
        if (webView3 == null) {
            AbstractC7780t.r("webView");
            webView3 = null;
        }
        c7752k.f58203a = webView3.getSettings().getTextZoom();
        final ScaleGestureDetector scaleGestureDetector = new ScaleGestureDetector(this, new m(c7752k, this));
        WebView webView4 = this.f47101e0;
        if (webView4 == null) {
            AbstractC7780t.r("webView");
            webView4 = null;
        }
        webView4.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public final boolean onTouch(View view, MotionEvent motionEvent) {
                boolean a22;
                a22 = TextViewer.a2(scaleGestureDetector, view, motionEvent);
                return a22;
            }
        });
        WebView webView5 = this.f47101e0;
        if (webView5 == null) {
            AbstractC7780t.r("webView");
            webView5 = null;
        }
        webView5.setWebChromeClient(new l());
        WebView webView6 = this.f47101e0;
        if (webView6 == null) {
            AbstractC7780t.r("webView");
        } else {
            webView = webView6;
        }
        webView.clearHistory();
        X1();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (this.f47101e0 != null) {
            t6.k.j0(((int) ViewConfiguration.getZoomControlsTimeout()) + 1000, new n());
        }
    }
}