导航菜单

页面标题

页面副标题

Uptodown App Store v6.80 - C1600m1.java 源代码

正在查看: Uptodown App Store v6.80 应用的 C1600m1.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package d2;

import N1.k;
import S2.AbstractC0692o;
import W1.C0703h;
import W1.G;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.text.Editable;
import android.text.Spanned;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.animation.Animation;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.widget.Toolbar;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import b2.C0892i;
import b2.C0895l;
import c2.C0918A;
import c2.C0923b;
import c2.C0925c;
import c2.C0935h;
import c2.C0939j;
import c2.C0945m;
import c2.C0951p;
import c2.C0958t;
import c2.C0961u0;
import c2.C0964w;
import c2.C0965w0;
import c2.C0966x;
import c2.C0969y0;
import c2.C0970z;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.newinterstitial.out.MBNewInterstitialHandler;
import com.mbridge.msdk.newinterstitial.out.NewInterstitialListener;
import com.mbridge.msdk.out.BannerAdListener;
import com.mbridge.msdk.out.BannerSize;
import com.mbridge.msdk.out.MBBannerView;
import com.mbridge.msdk.out.MBridgeIds;
import com.mbridge.msdk.out.RewardInfo;
import com.uptodown.UptodownApp;
import com.uptodown.activities.AbstractActivityC1500a;
import com.uptodown.activities.AppDetailActivity;
import com.uptodown.activities.AppInstalledDetailsActivity;
import com.uptodown.activities.FreeUpSpaceActivity;
import com.uptodown.activities.Gallery;
import com.uptodown.activities.InformationActivity;
import com.uptodown.activities.LoginActivity;
import com.uptodown.activities.MainActivity;
import com.uptodown.activities.MoreInfo;
import com.uptodown.activities.OldVersionsActivity;
import com.uptodown.activities.OrganizationActivity;
import com.uptodown.activities.PublicProfileActivity;
import com.uptodown.activities.RepliesActivity;
import com.uptodown.activities.ReviewsActivity;
import com.uptodown.activities.SearchActivity;
import com.uptodown.activities.VirusTotalReport;
import com.uptodown.activities.YouTubeActivity;
import com.uptodown.activities.preferences.a;
import com.uptodown.util.views.UsernameTextView;
import com.uptodown.workers.DownloadApkWorker;
import com.uptodown.workers.DownloadWorker;
import com.uptodown.workers.GenerateQueueWorker;
import com.uptodown.workers.GetUserDataWorker;
import d2.C1600m1;
import d2.C1643s1;
import d3.InterfaceC1665a;
import d3.InterfaceC1680p;
import f2.InterfaceC1715D;
import f2.InterfaceC1720a;
import f2.InterfaceC1723d;
import f2.InterfaceC1729j;
import f2.InterfaceC1736q;
import g2.C1751E;
import g2.C1755I;
import g2.C1759c;
import g2.C1760d;
import g2.C1762f;
import g2.C1764h;
import g2.C1765i;
import g2.C1770n;
import g2.C1771o;
import g2.C1772p;
import g2.C1773q;
import g2.C1775t;
import g2.C1780y;
import g2.S;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import kotlin.jvm.internal.AbstractC2020b;
import kotlin.jvm.internal.AbstractC2025g;
import o3.AbstractC2156G;
import o3.AbstractC2172g;
import o3.AbstractC2176i;
import o3.InterfaceC2159J;
import r3.InterfaceC2325f;
import u2.C2433a;
import u2.C2445m;
import u2.H;
import u2.O;
import u2.p;
import u2.v;
import w2.C2494c;
import w2.C2495d;
import w2.k;

public final class C1600m1 extends Fragment {

    public static final C1601a f19646n = new C1601a(null);

    public C1762f f19647a;

    private C0923b f19648b;

    private u2.z f19650d;

    private AlertDialog f19651e;

    private ArrayList f19652f;

    private Menu f19653g;

    private M1.I f19654h;

    private M1.I f19655i;

    private final ActivityResultLauncher f19658l;

    private final ActivityResultLauncher f19659m;

    private final R2.g f19649c = FragmentViewModelLazyKt.createViewModelLazy(this, kotlin.jvm.internal.D.b(C1643s1.class), new V(new U(this)), null);

    private ArrayList f19656j = new ArrayList();

    private final C1613m f19657k = new C1613m();

    static final class A extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19660a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19662a;

            a(C1600m1 c1600m1) {
                this.f19662a = c1600m1;
            }

            @Override
            public final Object emit(u2.H h4, V2.d dVar) {
                if (!(h4 instanceof H.a)) {
                    if (h4 instanceof H.c) {
                        H.c cVar = (H.c) h4;
                        ArrayList b5 = ((C1643s1.b) cVar.a()).b();
                        if (b5 == null || b5.isEmpty()) {
                            ArrayList a5 = ((C1643s1.b) cVar.a()).a();
                            if (a5 != null && !a5.isEmpty()) {
                                this.f19662a.t5(((C1643s1.b) cVar.a()).a());
                            }
                        } else {
                            this.f19662a.Q5(((C1643s1.b) cVar.a()).b());
                        }
                    } else if (!(h4 instanceof H.b)) {
                        throw new R2.k();
                    }
                }
                return R2.s.f4667a;
            }
        }

        A(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new A(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19660a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I G4 = C1600m1.this.U3().G();
                a aVar = new a(C1600m1.this);
                this.f19660a = 1;
                if (G4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((A) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class B extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19663a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19665a;

            a(C1600m1 c1600m1) {
                this.f19665a = c1600m1;
            }

            @Override
            public final Object emit(u2.H h4, V2.d dVar) {
                if (!(h4 instanceof H.a)) {
                    if (h4 instanceof H.c) {
                        H.c cVar = (H.c) h4;
                        this.f19665a.N5(((C1643s1.c) cVar.a()).b());
                        this.f19665a.x5(((C1643s1.c) cVar.a()).a());
                    } else if (!(h4 instanceof H.b)) {
                        throw new R2.k();
                    }
                }
                return R2.s.f4667a;
            }
        }

        B(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new B(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19663a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I I4 = C1600m1.this.U3().I();
                a aVar = new a(C1600m1.this);
                this.f19663a = 1;
                if (I4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((B) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19666a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19668a;

            a(C1600m1 c1600m1) {
                this.f19668a = c1600m1;
            }

            public static final void e(C1600m1 c1600m1, u2.H h4, View view) {
                if (UptodownApp.f17145F.a0()) {
                    c1600m1.L6((ArrayList) ((H.c) h4).a());
                }
            }

            @Override
            public final Object emit(final u2.H h4, V2.d dVar) {
                if (!(h4 instanceof H.a)) {
                    if (h4 instanceof H.c) {
                        if (((Collection) ((H.c) h4).a()).isEmpty()) {
                            this.f19668a.Q3().f7736L.f8043b.setVisibility(8);
                            this.f19668a.W3(com.uptodown.R.id.action_remote_install);
                        } else {
                            if (((Number) this.f19668a.U3().P().getValue()).intValue() == -1) {
                                this.f19668a.Q3().f7736L.f8043b.setVisibility(0);
                            }
                            this.f19668a.K6(com.uptodown.R.id.action_remote_install);
                            ImageView imageView = this.f19668a.Q3().f7736L.f8043b;
                            final C1600m1 c1600m1 = this.f19668a;
                            imageView.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public final void onClick(View view) {
                                    C1600m1.C.a.e(C1600m1.this, h4, view);
                                }
                            });
                        }
                    } else if (!(h4 instanceof H.b)) {
                        throw new R2.k();
                    }
                }
                return R2.s.f4667a;
            }
        }

        C(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19666a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I j02 = C1600m1.this.U3().j0();
                a aVar = new a(C1600m1.this);
                this.f19666a = 1;
                if (j02.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class E implements f2.V {
        E() {
        }

        @Override
        public void a(C1755I reportVT) {
            kotlin.jvm.internal.m.e(reportVT, "reportVT");
            if (C1600m1.this.getActivity() == null || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            Intent intent = new Intent(C1600m1.this.requireActivity(), (Class<?>) VirusTotalReport.class);
            intent.putExtra("appInfo", C1600m1.this.P3());
            intent.putExtra("appReportVT", reportVT);
            C1600m1 c1600m1 = C1600m1.this;
            UptodownApp.a aVar = UptodownApp.f17145F;
            FragmentActivity requireActivity = c1600m1.requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            c1600m1.startActivity(intent, aVar.a(requireActivity));
            C1600m1.this.U3().k0().setValue(Boolean.FALSE);
        }

        @Override
        public void b() {
            if (C1600m1.this.getActivity() == null || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            String o02 = C1600m1.this.P3().o0();
            if (o02 != null && o02.length() != 0) {
                String o03 = C1600m1.this.P3().o0();
                kotlin.jvm.internal.m.b(o03);
                if (Long.parseLong(o03) > 650000000) {
                    Intent intent = new Intent(C1600m1.this.requireActivity(), (Class<?>) VirusTotalReport.class);
                    intent.putExtra("appInfo", C1600m1.this.P3());
                    intent.putExtra("isVirusTotalReportAvaialable", false);
                    C1600m1 c1600m1 = C1600m1.this;
                    UptodownApp.a aVar = UptodownApp.f17145F;
                    FragmentActivity requireActivity = c1600m1.requireActivity();
                    kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
                    c1600m1.startActivity(intent, aVar.a(requireActivity));
                    C1600m1.this.U3().k0().setValue(Boolean.FALSE);
                    return;
                }
            }
            FragmentActivity activity = C1600m1.this.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            ((AbstractActivityC1500a) activity).G2(C1600m1.this.P3().l0());
        }
    }

    public static final class F implements H1.b {

        final Context f19672b;

        F(Context context) {
            this.f19672b = context;
        }

        @Override
        public void a(Exception e5) {
            kotlin.jvm.internal.m.e(e5, "e");
            e5.printStackTrace();
            C1600m1 c1600m1 = C1600m1.this;
            c1600m1.V5(c1600m1.Q3().f7739O.f7864b, this.f19672b);
        }

        @Override
        public void onSuccess() {
            C1600m1 c1600m1 = C1600m1.this;
            c1600m1.V5(c1600m1.Q3().f7739O.f7864b, this.f19672b);
        }
    }

    public static final class G implements InterfaceC1723d {
        G() {
        }

        @Override
        public void a(C1762f app) {
            kotlin.jvm.internal.m.e(app, "app");
            if (!UptodownApp.f17145F.a0() || C1600m1.this.getActivity() == null || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            C1600m1.this.i5(app);
        }
    }

    public static final class H implements InterfaceC1720a {
        H() {
        }

        @Override
        public void a(C1762f appInfo, int i4) {
            kotlin.jvm.internal.m.e(appInfo, "appInfo");
            C1600m1.this.F6(appInfo);
        }
    }

    public static final class I implements ViewTreeObserver.OnPreDrawListener {

        final C0965w0 f19675a;

        I(C0965w0 c0965w0) {
            this.f19675a = c0965w0;
        }

        @Override
        public boolean onPreDraw() {
            this.f19675a.f8358n.getViewTreeObserver().removeOnPreDrawListener(this);
            TextView tvBodyReview = this.f19675a.f8358n;
            kotlin.jvm.internal.m.d(tvBodyReview, "tvBodyReview");
            if (!w2.s.a(tvBodyReview)) {
                return true;
            }
            this.f19675a.f8363s.setVisibility(0);
            this.f19675a.f8363s.setTypeface(N1.k.f3913g.w());
            return true;
        }
    }

    public static final class J implements ViewTreeObserver.OnPreDrawListener {

        final C0969y0 f19676a;

        J(C0969y0 c0969y0) {
            this.f19676a = c0969y0;
        }

        @Override
        public boolean onPreDraw() {
            this.f19676a.f8406n.getViewTreeObserver().removeOnPreDrawListener(this);
            TextView tvBodyReview = this.f19676a.f8406n;
            kotlin.jvm.internal.m.d(tvBodyReview, "tvBodyReview");
            if (!w2.s.a(tvBodyReview)) {
                return true;
            }
            this.f19676a.f8411s.setVisibility(0);
            this.f19676a.f8411s.setTypeface(N1.k.f3913g.w());
            return true;
        }
    }

    public static final class K implements InterfaceC1715D {

        final ArrayList f19678b;

        final kotlin.jvm.internal.C f19679c;

        final ArrayList f19680d;

        K(ArrayList arrayList, kotlin.jvm.internal.C c5, ArrayList arrayList2) {
            this.f19678b = arrayList;
            this.f19679c = c5;
            this.f19680d = arrayList2;
        }

        @Override
        public void a(g2.M screenshot) {
            kotlin.jvm.internal.m.e(screenshot, "screenshot");
            UptodownApp.a aVar = UptodownApp.f17145F;
            if (!aVar.a0() || C1600m1.this.getActivity() == null || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            Intent intent = new Intent(C1600m1.this.requireActivity(), (Class<?>) Gallery.class);
            Bundle bundle = new Bundle();
            bundle.putParcelableArrayList("images", this.f19678b);
            bundle.putInt("index", this.f19678b.indexOf(screenshot));
            intent.putExtra("bundle", bundle);
            C1600m1 c1600m1 = C1600m1.this;
            FragmentActivity requireActivity = c1600m1.requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            c1600m1.startActivity(intent, aVar.a(requireActivity));
        }

        @Override
        public void b(g2.M screenshot) {
            kotlin.jvm.internal.m.e(screenshot, "screenshot");
            this.f19678b.remove(screenshot);
            M1.B b5 = (M1.B) this.f19679c.f21881a;
            if (b5 != null) {
                b5.c(screenshot);
            }
        }

        @Override
        public void c(g2.X video) {
            kotlin.jvm.internal.m.e(video, "video");
            this.f19680d.remove(video);
            M1.B b5 = (M1.B) this.f19679c.f21881a;
            if (b5 != null) {
                b5.c(video);
            }
        }

        @Override
        public void d(g2.X video) {
            kotlin.jvm.internal.m.e(video, "video");
            if (!UptodownApp.f17145F.a0() || C1600m1.this.getActivity() == null || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            Intent intent = new Intent(C1600m1.this.getActivity(), (Class<?>) YouTubeActivity.class);
            intent.putExtra("id_youtube", video.a());
            C1600m1.this.startActivity(intent);
        }
    }

    public static final class L implements InterfaceC1723d {
        L() {
        }

        @Override
        public void a(C1762f app) {
            kotlin.jvm.internal.m.e(app, "app");
            if (!UptodownApp.f17145F.a0() || C1600m1.this.getActivity() == null || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            C1600m1.this.i5(app);
        }
    }

    public static final class M implements InterfaceC1720a {
        M() {
        }

        @Override
        public void a(C1762f appInfo, int i4) {
            kotlin.jvm.internal.m.e(appInfo, "appInfo");
            C1600m1.this.F6(appInfo);
        }
    }

    public static final class N implements InterfaceC1723d {
        N() {
        }

        @Override
        public void a(C1762f app) {
            kotlin.jvm.internal.m.e(app, "app");
            if (!UptodownApp.f17145F.a0() || C1600m1.this.getActivity() == null || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            C1600m1.this.i5(app);
        }
    }

    public static final class O implements InterfaceC1720a {
        O() {
        }

        @Override
        public void a(C1762f appInfo, int i4) {
            kotlin.jvm.internal.m.e(appInfo, "appInfo");
            C1600m1.this.F6(appInfo);
        }
    }

    static final class P extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19685a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19687a;

            static final class C0256a extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

                int f19688a;

                final C1600m1 f19689b;

                C0256a(C1600m1 c1600m1, V2.d dVar) {
                    super(2, dVar);
                    this.f19689b = c1600m1;
                }

                @Override
                public final V2.d create(Object obj, V2.d dVar) {
                    return new C0256a(this.f19689b, dVar);
                }

                @Override
                public final Object invokeSuspend(Object obj) {
                    W2.b.c();
                    if (this.f19688a != 0) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    R2.n.b(obj);
                    if (this.f19689b.P3().g0() == 1) {
                        C1600m1 c1600m1 = this.f19689b;
                        String string = c1600m1.getString(com.uptodown.R.string.remove_recommended);
                        kotlin.jvm.internal.m.d(string, "getString(...)");
                        c1600m1.c6(com.uptodown.R.id.action_recommended, string);
                        this.f19689b.Q3().f7740P.setBackground(ContextCompat.getDrawable(this.f19689b.requireContext(), com.uptodown.R.drawable.ripple_blue_primary_button));
                        this.f19689b.Q3().f7771k.setImageDrawable(ContextCompat.getDrawable(this.f19689b.requireContext(), com.uptodown.R.drawable.vector_bookmark_white));
                        this.f19689b.Q3().f7792u0.setTextColor(ContextCompat.getColor(this.f19689b.requireContext(), com.uptodown.R.color.white));
                        this.f19689b.Q3().f7792u0.setText(this.f19689b.getString(com.uptodown.R.string.remove_recommended));
                    } else {
                        C1600m1 c1600m12 = this.f19689b;
                        String string2 = c1600m12.getString(com.uptodown.R.string.add_recommended);
                        kotlin.jvm.internal.m.d(string2, "getString(...)");
                        c1600m12.c6(com.uptodown.R.id.action_recommended, string2);
                        this.f19689b.Q3().f7740P.setBackground(ContextCompat.getDrawable(this.f19689b.requireContext(), com.uptodown.R.drawable.ripple_stroke_blue_primary));
                        this.f19689b.Q3().f7771k.setImageDrawable(ContextCompat.getDrawable(this.f19689b.requireContext(), com.uptodown.R.drawable.vector_bookmark_stroke));
                        this.f19689b.Q3().f7792u0.setTextColor(ContextCompat.getColor(this.f19689b.requireContext(), com.uptodown.R.color.text_terciary));
                        this.f19689b.Q3().f7792u0.setText(this.f19689b.getString(com.uptodown.R.string.add_recommended));
                    }
                    return R2.s.f4667a;
                }

                @Override
                public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
                    return ((C0256a) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
                }
            }

            a(C1600m1 c1600m1) {
                this.f19687a = c1600m1;
            }

            public final Object b(int i4, V2.d dVar) {
                this.f19687a.P3().V0(i4);
                Object g4 = AbstractC2172g.g(o3.Y.c(), new C0256a(this.f19687a, null), dVar);
                return g4 == W2.b.c() ? g4 : R2.s.f4667a;
            }

            @Override
            public Object emit(Object obj, V2.d dVar) {
                return b(((Number) obj).intValue(), dVar);
            }
        }

        P(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new P(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19685a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.t W4 = C1600m1.this.U3().W();
                a aVar = new a(C1600m1.this);
                this.f19685a = 1;
                if (W4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((P) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class Q implements ViewTreeObserver.OnPreDrawListener {

        final View f19690a;

        final C1600m1 f19691b;

        Q(View view, C1600m1 c1600m1) {
            this.f19690a = view;
            this.f19691b = c1600m1;
        }

        @Override
        public boolean onPreDraw() {
            this.f19690a.getViewTreeObserver().removeOnPreDrawListener(this);
            this.f19691b.startPostponedEnterTransition();
            return true;
        }
    }

    static final class R extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19692a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19694a;

            a(C1600m1 c1600m1) {
                this.f19694a = c1600m1;
            }

            @Override
            public final Object emit(u2.H h4, V2.d dVar) {
                if (!(h4 instanceof H.a)) {
                    if (h4 instanceof H.c) {
                        H.c cVar = (H.c) h4;
                        if (((C1643s1.f) cVar.a()).b()) {
                            FragmentActivity activity = this.f19694a.getActivity();
                            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                            String string = this.f19694a.requireContext().getString(com.uptodown.R.string.review_sended);
                            kotlin.jvm.internal.m.d(string, "getString(...)");
                            ((AbstractActivityC1500a) activity).r0(string);
                        } else if (!((C1643s1.f) cVar.a()).b() && ((C1643s1.f) cVar.a()).a() == 0) {
                            FragmentActivity activity2 = this.f19694a.getActivity();
                            kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                            String string2 = this.f19694a.getString(com.uptodown.R.string.error_review_already_submitted);
                            kotlin.jvm.internal.m.d(string2, "getString(...)");
                            ((AbstractActivityC1500a) activity2).r0(string2);
                        } else if (((C1643s1.f) cVar.a()).a() == 401) {
                            this.f19694a.P4();
                        } else if (((C1643s1.f) cVar.a()).a() == 403) {
                            FragmentActivity activity3 = this.f19694a.getActivity();
                            kotlin.jvm.internal.m.c(activity3, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                            String string3 = this.f19694a.getString(com.uptodown.R.string.email_validation_msg);
                            kotlin.jvm.internal.m.d(string3, "getString(...)");
                            ((AbstractActivityC1500a) activity3).r0(string3);
                        } else {
                            FragmentActivity activity4 = this.f19694a.getActivity();
                            kotlin.jvm.internal.m.c(activity4, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                            String string4 = this.f19694a.getString(com.uptodown.R.string.error_generico);
                            kotlin.jvm.internal.m.d(string4, "getString(...)");
                            ((AbstractActivityC1500a) activity4).r0(string4);
                        }
                    } else if (!(h4 instanceof H.b)) {
                        throw new R2.k();
                    }
                }
                return R2.s.f4667a;
            }
        }

        R(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new R(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19692a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I c02 = C1600m1.this.U3().c0();
                a aVar = new a(C1600m1.this);
                this.f19692a = 1;
                if (c02.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((R) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class S implements NewInterstitialListener {

        final MBNewInterstitialHandler f19696b;

        S(MBNewInterstitialHandler mBNewInterstitialHandler) {
            this.f19696b = mBNewInterstitialHandler;
        }

        @Override
        public void onAdClicked(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
            Bundle bundle = new Bundle();
            bundle.putString("type", "clicked");
            new u2.z(C1600m1.this.getContext()).d("mintegral_interstitial", bundle);
        }

        @Override
        public void onAdClose(MBridgeIds ids, RewardInfo info) {
            kotlin.jvm.internal.m.e(ids, "ids");
            kotlin.jvm.internal.m.e(info, "info");
            Bundle bundle = new Bundle();
            bundle.putString("type", "closed");
            new u2.z(C1600m1.this.getContext()).d("mintegral_interstitial", bundle);
        }

        @Override
        public void onAdCloseWithNIReward(MBridgeIds ids, RewardInfo info) {
            kotlin.jvm.internal.m.e(ids, "ids");
            kotlin.jvm.internal.m.e(info, "info");
        }

        @Override
        public void onAdShow(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
            if (C1600m1.this.getContext() != null) {
                Bundle bundle = new Bundle();
                bundle.putString("type", "show");
                new u2.z(C1600m1.this.getContext()).d("mintegral_interstitial", bundle);
                a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
                Context requireContext = C1600m1.this.requireContext();
                kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                c0246a.N0(requireContext, System.currentTimeMillis());
            }
        }

        @Override
        public void onEndcardShow(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
        }

        @Override
        public void onLoadCampaignSuccess(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
        }

        @Override
        public void onResourceLoadFail(MBridgeIds ids, String errorMsg) {
            String str;
            kotlin.jvm.internal.m.e(ids, "ids");
            kotlin.jvm.internal.m.e(errorMsg, "errorMsg");
            Bundle bundle = new Bundle();
            bundle.putString("type", "load_failed");
            if (errorMsg.length() > 10) {
                str = errorMsg.substring(0, 10);
                kotlin.jvm.internal.m.d(str, "substring(...)");
            } else {
                str = errorMsg.length() > 0 ? errorMsg : null;
            }
            if (str != null) {
                bundle.putString(CampaignEx.JSON_NATIVE_VIDEO_ERROR, errorMsg);
            }
            new u2.z(C1600m1.this.getContext()).d("mintegral_interstitial", bundle);
        }

        @Override
        public void onResourceLoadSuccess(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
            Bundle bundle = new Bundle();
            bundle.putString("type", "loaded");
            new u2.z(C1600m1.this.getContext()).d("mintegral_interstitial", bundle);
            if (this.f19696b.isReady()) {
                this.f19696b.show();
            }
        }

        @Override
        public void onShowFail(MBridgeIds ids, String errorMsg) {
            String str;
            kotlin.jvm.internal.m.e(ids, "ids");
            kotlin.jvm.internal.m.e(errorMsg, "errorMsg");
            Bundle bundle = new Bundle();
            bundle.putString("type", "show_failed");
            if (errorMsg.length() > 10) {
                str = errorMsg.substring(0, 10);
                kotlin.jvm.internal.m.d(str, "substring(...)");
            } else {
                str = errorMsg.length() > 0 ? errorMsg : null;
            }
            if (str != null) {
                bundle.putString(CampaignEx.JSON_NATIVE_VIDEO_ERROR, errorMsg);
            }
            new u2.z(C1600m1.this.getContext()).d("mintegral_interstitial", bundle);
        }

        @Override
        public void onVideoComplete(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
            Bundle bundle = new Bundle();
            bundle.putString("type", "video_completed");
            new u2.z(C1600m1.this.getContext()).d("mintegral_interstitial", bundle);
        }
    }

    public static final class T implements f2.K {

        final ArrayList f19697a;

        final ArrayList f19698b;

        final kotlin.jvm.internal.z f19699c;

        T(ArrayList arrayList, ArrayList arrayList2, kotlin.jvm.internal.z zVar) {
            this.f19697a = arrayList;
            this.f19698b = arrayList2;
            this.f19699c = zVar;
        }

        @Override
        public void a(int i4) {
            if (((g2.V) this.f19697a.get(i4)).d() != 0) {
                this.f19699c.f21898a = !r3.f21898a;
            } else if (this.f19698b.contains(this.f19697a.get(i4))) {
                this.f19698b.remove(this.f19697a.get(i4));
            } else {
                this.f19698b.add(this.f19697a.get(i4));
            }
        }
    }

    public static final class U extends kotlin.jvm.internal.n implements InterfaceC1665a {

        final Fragment f19700a;

        public U(Fragment fragment) {
            super(0);
            this.f19700a = fragment;
        }

        @Override
        public final Fragment invoke() {
            return this.f19700a;
        }
    }

    public static final class V extends kotlin.jvm.internal.n implements InterfaceC1665a {

        final InterfaceC1665a f19701a;

        public V(InterfaceC1665a interfaceC1665a) {
            super(0);
            this.f19701a = interfaceC1665a;
        }

        @Override
        public final ViewModelStore invoke() {
            ViewModelStore viewModelStore = ((ViewModelStoreOwner) this.f19701a.invoke()).getViewModelStore();
            kotlin.jvm.internal.m.d(viewModelStore, "ownerProducer().viewModelStore");
            return viewModelStore;
        }
    }

    static final class W extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19702a;

        final Context f19704c;

        W(Context context, V2.d dVar) {
            super(2, dVar);
            this.f19704c = context;
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new W(this.f19704c, dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19702a;
            if (i4 == 0) {
                R2.n.b(obj);
                C1600m1 c1600m1 = C1600m1.this;
                Context context = this.f19704c;
                this.f19702a = 1;
                if (c1600m1.S2(context, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((W) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class X extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19705a;

        final String f19706b;

        final C1600m1 f19707c;

        X(String str, C1600m1 c1600m1, V2.d dVar) {
            super(2, dVar);
            this.f19706b = str;
            this.f19707c = c1600m1;
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return new X(this.f19706b, this.f19707c, dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object obj2;
            Object obj3;
            Object obj4;
            W2.b.c();
            if (this.f19705a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            String str = this.f19706b;
            if (str != null && str.length() != 0) {
                if (this.f19707c.f19654h != null) {
                    M1.I i4 = this.f19707c.f19654h;
                    kotlin.jvm.internal.m.b(i4);
                    ArrayList c5 = i4.c();
                    String str2 = this.f19706b;
                    int size = c5.size();
                    int i5 = 0;
                    while (true) {
                        if (i5 >= size) {
                            obj4 = null;
                            break;
                        }
                        obj4 = c5.get(i5);
                        i5++;
                        if (kotlin.jvm.internal.m.a(((C1762f) obj4).R(), str2)) {
                            break;
                        }
                    }
                    M1.I i6 = this.f19707c.f19654h;
                    kotlin.jvm.internal.m.b(i6);
                    int K4 = AbstractC0692o.K(i6.c(), (C1762f) obj4);
                    M1.I i7 = this.f19707c.f19654h;
                    kotlin.jvm.internal.m.b(i7);
                    i7.notifyItemChanged(K4);
                }
                if (this.f19707c.f19655i != null) {
                    M1.I i8 = this.f19707c.f19655i;
                    kotlin.jvm.internal.m.b(i8);
                    ArrayList c6 = i8.c();
                    String str3 = this.f19706b;
                    int size2 = c6.size();
                    int i9 = 0;
                    while (true) {
                        if (i9 >= size2) {
                            obj3 = null;
                            break;
                        }
                        obj3 = c6.get(i9);
                        i9++;
                        if (kotlin.jvm.internal.m.a(((C1762f) obj3).R(), str3)) {
                            break;
                        }
                    }
                    M1.I i10 = this.f19707c.f19655i;
                    kotlin.jvm.internal.m.b(i10);
                    int K5 = AbstractC0692o.K(i10.c(), (C1762f) obj3);
                    M1.I i11 = this.f19707c.f19655i;
                    kotlin.jvm.internal.m.b(i11);
                    i11.notifyItemChanged(K5);
                }
                if (!this.f19707c.f19656j.isEmpty()) {
                    Iterator it = this.f19707c.f19656j.iterator();
                    kotlin.jvm.internal.m.d(it, "iterator(...)");
                    while (it.hasNext()) {
                        Object next = it.next();
                        kotlin.jvm.internal.m.d(next, "next(...)");
                        M1.I i12 = (M1.I) next;
                        ArrayList c7 = i12.c();
                        String str4 = this.f19706b;
                        int size3 = c7.size();
                        int i13 = 0;
                        while (true) {
                            if (i13 >= size3) {
                                obj2 = null;
                                break;
                            }
                            obj2 = c7.get(i13);
                            i13++;
                            if (kotlin.jvm.internal.m.a(((C1762f) obj2).R(), str4)) {
                                break;
                            }
                        }
                        i12.notifyItemChanged(AbstractC0692o.K(i12.c(), (C1762f) obj2));
                    }
                }
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((X) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class Y extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19708a;

        final String f19709b;

        final C1600m1 f19710c;

        Y(String str, C1600m1 c1600m1, V2.d dVar) {
            super(2, dVar);
            this.f19709b = str;
            this.f19710c = c1600m1;
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return new Y(this.f19709b, this.f19710c, dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            FragmentActivity activity;
            W2.b.c();
            if (this.f19708a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            if (m3.m.p(this.f19709b, this.f19710c.P3().R(), true) && (activity = this.f19710c.getActivity()) != null) {
                this.f19710c.Q6(activity);
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((Y) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class Z extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19711a;

        final a0 f19713c;

        Z(a0 a0Var, V2.d dVar) {
            super(2, dVar);
            this.f19713c = a0Var;
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new Z(this.f19713c, dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19711a;
            if (i4 == 0) {
                R2.n.b(obj);
                GetUserDataWorker.a aVar = GetUserDataWorker.f19234b;
                Context requireContext = C1600m1.this.requireContext();
                kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                a0 a0Var = this.f19713c;
                this.f19711a = 1;
                if (aVar.a(requireContext, a0Var, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((Z) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class C1601a {
        public C1601a(AbstractC2025g abstractC2025g) {
            this();
        }

        public final C1600m1 a(C1762f c1762f) {
            C1600m1 c1600m1 = new C1600m1();
            Bundle bundle = new Bundle();
            if (c1762f != null) {
                bundle.putParcelable("appInfo", c1762f);
            }
            c1600m1.setArguments(bundle);
            return c1600m1;
        }

        private C1601a() {
        }
    }

    public static final class a0 implements f2.L {
        a0() {
        }

        @Override
        public void a() {
            S.b bVar = g2.S.f20411m;
            Context requireContext = C1600m1.this.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            g2.S e5 = bVar.e(requireContext);
            if (e5 == null || !e5.n()) {
                return;
            }
            C1600m1.this.Q3().f7724D.setVisibility(8);
        }
    }

    public final class RunnableC1602b implements Runnable {

        private final int f19715a;

        private final g2.P f19716b;

        public RunnableC1602b(int i4, g2.P p4) {
            this.f19715a = i4;
            this.f19716b = p4;
        }

        @Override
        public void run() {
            File n4;
            g2.P p4 = this.f19716b;
            if (p4 == null || !m3.m.p(p4.h(), C1600m1.this.P3().R(), true)) {
                return;
            }
            int i4 = this.f19715a;
            if (i4 != 108) {
                if (i4 == 109) {
                    C1600m1.this.S3();
                    C1600m1.this.x6(this.f19716b);
                    return;
                } else {
                    if (i4 == 201) {
                        C1600m1.this.x6(this.f19716b);
                        return;
                    }
                    FragmentActivity activity = C1600m1.this.getActivity();
                    if (activity != null) {
                        C1600m1.this.Q6(activity);
                        return;
                    }
                    return;
                }
            }
            if (C1600m1.this.getContext() != null) {
                C1600m1 c1600m1 = C1600m1.this;
                Context requireContext = c1600m1.requireContext();
                kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                c1600m1.Q6(requireContext);
                g2.P p5 = this.f19716b;
                Context requireContext2 = C1600m1.this.requireContext();
                kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                C1772p b5 = p5.b(requireContext2);
                if (b5 == null || (n4 = b5.n()) == null || !n4.exists()) {
                    return;
                }
                C1600m1.this.I4(n4);
            }
        }
    }

    static final class b0 extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19718a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19720a;

            static final class C0257a extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

                int f19721a;

                final C1600m1 f19722b;

                C0257a(C1600m1 c1600m1, V2.d dVar) {
                    super(2, dVar);
                    this.f19722b = c1600m1;
                }

                @Override
                public final V2.d create(Object obj, V2.d dVar) {
                    return new C0257a(this.f19722b, dVar);
                }

                @Override
                public final Object invokeSuspend(Object obj) {
                    W2.b.c();
                    if (this.f19721a != 0) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    R2.n.b(obj);
                    if (this.f19722b.P3().D0() == 1) {
                        C1600m1 c1600m1 = this.f19722b;
                        String string = c1600m1.getString(com.uptodown.R.string.app_detail_remove_wishlist_title);
                        kotlin.jvm.internal.m.d(string, "getString(...)");
                        c1600m1.c6(com.uptodown.R.id.action_wishlist, string);
                        this.f19722b.Q3().f7745U.setBackground(ContextCompat.getDrawable(this.f19722b.requireContext(), com.uptodown.R.drawable.ripple_blue_primary_button));
                        this.f19722b.Q3().f7775m.setImageDrawable(ContextCompat.getDrawable(this.f19722b.requireContext(), com.uptodown.R.drawable.vector_heart_white));
                        this.f19722b.Q3().f7727E0.setTextColor(ContextCompat.getColor(this.f19722b.requireContext(), com.uptodown.R.color.white));
                        this.f19722b.Q3().f7727E0.setText(this.f19722b.getString(com.uptodown.R.string.app_detail_remove_wishlist_title));
                    } else {
                        C1600m1 c1600m12 = this.f19722b;
                        String string2 = c1600m12.getString(com.uptodown.R.string.app_detail_add_wishlist_title);
                        kotlin.jvm.internal.m.d(string2, "getString(...)");
                        c1600m12.c6(com.uptodown.R.id.action_wishlist, string2);
                        this.f19722b.Q3().f7745U.setBackground(ContextCompat.getDrawable(this.f19722b.requireContext(), com.uptodown.R.drawable.ripple_stroke_blue_primary));
                        this.f19722b.Q3().f7775m.setImageDrawable(ContextCompat.getDrawable(this.f19722b.requireContext(), com.uptodown.R.drawable.vector_heart_stroke));
                        this.f19722b.Q3().f7727E0.setTextColor(ContextCompat.getColor(this.f19722b.requireContext(), com.uptodown.R.color.text_terciary));
                        this.f19722b.Q3().f7727E0.setText(this.f19722b.getString(com.uptodown.R.string.app_detail_add_wishlist_title));
                    }
                    return R2.s.f4667a;
                }

                @Override
                public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
                    return ((C0257a) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
                }
            }

            a(C1600m1 c1600m1) {
                this.f19720a = c1600m1;
            }

            public final Object b(int i4, V2.d dVar) {
                this.f19720a.P3().a1(i4);
                Object g4 = AbstractC2172g.g(o3.Y.c(), new C0257a(this.f19720a, null), dVar);
                return g4 == W2.b.c() ? g4 : R2.s.f4667a;
            }

            @Override
            public Object emit(Object obj, V2.d dVar) {
                return b(((Number) obj).intValue(), dVar);
            }
        }

        b0(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new b0(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19718a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.t n02 = C1600m1.this.U3().n0();
                a aVar = new a(C1600m1.this);
                this.f19718a = 1;
                if (n02.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((b0) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public final class RunnableC1603c implements Runnable {

        private final String f19723a;

        private final int f19724b;

        final C1600m1 f19725c;

        public RunnableC1603c(C1600m1 c1600m1, String packagename, int i4) {
            kotlin.jvm.internal.m.e(packagename, "packagename");
            this.f19725c = c1600m1;
            this.f19723a = packagename;
            this.f19724b = i4;
        }

        @Override
        public void run() {
            String R4 = this.f19725c.P3().R();
            if (R4 == null || R4.length() == 0 || !m3.m.p(this.f19725c.P3().R(), this.f19723a, true)) {
                return;
            }
            int i4 = this.f19724b;
            switch (i4) {
                case 301:
                    C1600m1 c1600m1 = this.f19725c;
                    String string = c1600m1.getString(com.uptodown.R.string.installing);
                    kotlin.jvm.internal.m.d(string, "getString(...)");
                    c1600m1.l6(string);
                    break;
                case 302:
                    FragmentActivity activity = this.f19725c.getActivity();
                    if (activity != null) {
                        this.f19725c.q6(activity);
                        break;
                    }
                    break;
                case 303:
                    C1600m1 c1600m12 = this.f19725c;
                    String string2 = c1600m12.getString(com.uptodown.R.string.install_compatibility_error, c1600m12.P3().M());
                    kotlin.jvm.internal.m.d(string2, "getString(...)");
                    c1600m12.j3(string2);
                    this.f19725c.m6();
                    break;
                case 304:
                    C1600m1 c1600m13 = this.f19725c;
                    String string3 = c1600m13.getString(com.uptodown.R.string.msg_root_install_failed_invalid_versioncode);
                    kotlin.jvm.internal.m.d(string3, "getString(...)");
                    c1600m13.j3(string3);
                    this.f19725c.m6();
                    break;
                case 305:
                    C1600m1 c1600m14 = this.f19725c;
                    String string4 = c1600m14.getString(com.uptodown.R.string.uninstalling);
                    kotlin.jvm.internal.m.d(string4, "getString(...)");
                    c1600m14.l6(string4);
                    break;
                case 306:
                    FragmentActivity activity2 = this.f19725c.getActivity();
                    if (activity2 != null) {
                        this.f19725c.g6(activity2);
                        break;
                    }
                    break;
                case 307:
                    FragmentActivity activity3 = this.f19725c.getActivity();
                    if (activity3 != null) {
                        C1600m1 c1600m15 = this.f19725c;
                        FragmentActivity activity4 = c1600m15.getActivity();
                        kotlin.jvm.internal.m.c(activity4, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                        String string5 = c1600m15.getString(com.uptodown.R.string.error_generico);
                        kotlin.jvm.internal.m.d(string5, "getString(...)");
                        ((AbstractActivityC1500a) activity4).r0(string5);
                        c1600m15.Q6(activity3);
                        break;
                    }
                    break;
                default:
                    switch (i4) {
                    }
            }
        }
    }

    public final class RunnableC1604d implements Runnable {

        private final int f19726a;

        private final C1772p f19727b;

        public RunnableC1604d(int i4, C1772p c1772p) {
            this.f19726a = i4;
            this.f19727b = c1772p;
        }

        @Override
        public void run() {
            C1772p c1772p = this.f19727b;
            String w4 = c1772p != null ? c1772p.w() : null;
            if (w4 != null && w4.length() != 0) {
                C1772p c1772p2 = this.f19727b;
                if (m3.m.p(c1772p2 != null ? c1772p2.w() : null, C1600m1.this.P3().R(), true)) {
                    switch (this.f19726a) {
                        case 199:
                            C1600m1.this.i6(null);
                            break;
                        case 200:
                            C1600m1.this.S3();
                            if (C1600m1.F4(C1600m1.this, null, 1, null)) {
                                C1600m1.this.i6(this.f19727b);
                                C1772p c1772p3 = this.f19727b;
                                if ((c1772p3 == null || C1600m1.this.P3().I() != c1772p3.E()) && C1600m1.this.getActivity() != null && (C1600m1.this.getActivity() instanceof AbstractActivityC1500a)) {
                                    FragmentActivity activity = C1600m1.this.getActivity();
                                    kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                                    C1600m1 c1600m1 = C1600m1.this;
                                    String string = c1600m1.getString(com.uptodown.R.string.recent_version_available, c1600m1.P3().M());
                                    kotlin.jvm.internal.m.d(string, "getString(...)");
                                    ((AbstractActivityC1500a) activity).r0(string);
                                    break;
                                }
                            }
                            break;
                        case 201:
                            if (C1600m1.F4(C1600m1.this, null, 1, null)) {
                                C1600m1.this.i6(this.f19727b);
                                break;
                            }
                            break;
                        case 202:
                            FragmentActivity activity2 = C1600m1.this.getActivity();
                            if (activity2 != null) {
                                C1600m1 c1600m12 = C1600m1.this;
                                C1772p c1772p4 = this.f19727b;
                                if (c1772p4 != null) {
                                    c1600m12.C4(c1772p4, activity2);
                                    break;
                                }
                            }
                            break;
                        case 203:
                            FragmentActivity activity3 = C1600m1.this.getActivity();
                            if (activity3 != null) {
                                C1600m1 c1600m13 = C1600m1.this;
                                String string2 = c1600m13.getString(com.uptodown.R.string.download_error_message);
                                kotlin.jvm.internal.m.d(string2, "getString(...)");
                                c1600m13.j3(string2);
                                c1600m13.g6(activity3);
                                break;
                            }
                            break;
                        case 205:
                            C1600m1.this.i6(this.f19727b);
                            break;
                        case 207:
                            FragmentActivity activity4 = C1600m1.this.getActivity();
                            if (activity4 != null) {
                                C1600m1.this.g6(activity4);
                                break;
                            }
                            break;
                        case 208:
                            FragmentActivity activity5 = C1600m1.this.getActivity();
                            if (activity5 != null) {
                                C1600m1 c1600m14 = C1600m1.this;
                                String string3 = c1600m14.getString(com.uptodown.R.string.no_free_space);
                                kotlin.jvm.internal.m.d(string3, "getString(...)");
                                c1600m14.j3(string3);
                                c1600m14.Q6(activity5);
                                break;
                            }
                            break;
                        case 209:
                            FragmentActivity activity6 = C1600m1.this.getActivity();
                            if (activity6 != null) {
                                C1600m1 c1600m15 = C1600m1.this;
                                String string4 = c1600m15.getString(com.uptodown.R.string.error_no_connection);
                                kotlin.jvm.internal.m.d(string4, "getString(...)");
                                c1600m15.j3(string4);
                                c1600m15.Q6(activity6);
                                break;
                            }
                            break;
                        case 210:
                            FragmentActivity activity7 = C1600m1.this.getActivity();
                            if (activity7 != null) {
                                C1600m1.this.Q6(activity7);
                                break;
                            }
                            break;
                        case 211:
                            C1600m1.this.r6(this.f19727b);
                            break;
                    }
                    return;
                }
            }
            C1600m1 c1600m16 = C1600m1.this;
            C1772p c1772p5 = this.f19727b;
            c1600m16.X6(c1772p5 != null ? c1772p5.w() : null);
        }
    }

    static final class C1605e extends kotlin.coroutines.jvm.internal.d {

        Object f19729a;

        Object f19730b;

        int f19732d;

        C1605e(V2.d dVar) {
            super(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            this.f19730b = obj;
            this.f19732d |= Integer.MIN_VALUE;
            return C1600m1.this.N2(this);
        }
    }

    static final class C1606f extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19733a;

        C1606f(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1606f(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            String R4;
            W2.b.c();
            if (this.f19733a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            if (C1600m1.this.getContext() != null && (R4 = C1600m1.this.P3().R()) != null && R4.length() != 0) {
                v.a aVar = u2.v.f23867v;
                Context requireContext = C1600m1.this.requireContext();
                kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                u2.v a5 = aVar.a(requireContext);
                a5.a();
                String R5 = C1600m1.this.P3().R();
                kotlin.jvm.internal.m.b(R5);
                C1760d W4 = a5.W(R5);
                if (W4 != null) {
                    C1600m1.this.U3().Q().setValue(W4);
                }
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1606f) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1607g extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19735a;

        C1607g(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1607g(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            W2.b.c();
            if (this.f19735a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            if (C1600m1.this.U3().Q().getValue() != null) {
                Object value = C1600m1.this.U3().Q().getValue();
                kotlin.jvm.internal.m.b(value);
                if (((C1760d) value).e() == 0) {
                    C1600m1 c1600m1 = C1600m1.this;
                    String string = c1600m1.getString(com.uptodown.R.string.not_offer_updates);
                    kotlin.jvm.internal.m.d(string, "getString(...)");
                    c1600m1.c6(com.uptodown.R.id.action_exclude, string);
                    return R2.s.f4667a;
                }
            }
            C1600m1 c1600m12 = C1600m1.this;
            String string2 = c1600m12.getString(com.uptodown.R.string.offer_updates_again);
            kotlin.jvm.internal.m.d(string2, "getString(...)");
            c1600m12.c6(com.uptodown.R.id.action_exclude, string2);
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1607g) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1608h extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19737a;

        final Context f19739c;

        final kotlin.jvm.internal.C f19740d;

        final kotlin.jvm.internal.z f19741e;

        final kotlin.jvm.internal.z f19742f;

        C1608h(Context context, kotlin.jvm.internal.C c5, kotlin.jvm.internal.z zVar, kotlin.jvm.internal.z zVar2, V2.d dVar) {
            super(2, dVar);
            this.f19739c = context;
            this.f19740d = c5;
            this.f19741e = zVar;
            this.f19742f = zVar2;
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1608h(this.f19739c, this.f19740d, this.f19741e, this.f19742f, dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            String u4;
            W2.b.c();
            if (this.f19737a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            C1600m1.this.Q3().f7736L.f8048g.setVisibility(8);
            C1600m1.this.Q3().f7732H.f7173g.setVisibility(8);
            if (C1600m1.this.P3().c()) {
                C1600m1.this.Q3().f7797x.setVisibility(0);
            } else {
                C1600m1.this.Q3().f7797x.setVisibility(8);
            }
            if (C1600m1.this.U3().Q().getValue() != null) {
                C1600m1.this.Q3().f7736L.f8044c.setVisibility(0);
            } else {
                C1600m1.this.Q3().f7736L.f8044c.setVisibility(8);
            }
            if (C1600m1.this.P3().M0()) {
                C1600m1.this.t6(this.f19739c);
            } else if (C1600m1.this.P3().J0()) {
                C1600m1.this.e6();
            } else if (C1600m1.this.P3().I0()) {
                C1600m1.this.g6(this.f19739c);
            } else if (C1600m1.this.P3().K0()) {
                C1600m1.this.s6();
            } else if (!com.uptodown.activities.preferences.a.f18568a.M(this.f19739c)) {
                C1600m1.this.b6();
            } else if (C1600m1.this.P3().E0()) {
                if (!C1600m1.this.V3()) {
                    C1600m1.this.o6(this.f19739c, (C1772p) this.f19740d.f21881a);
                } else if (((Boolean) C1600m1.this.U3().M().getValue()).booleanValue() || C1600m1.this.P3().G0()) {
                    C1600m1 c1600m1 = C1600m1.this;
                    String string = c1600m1.getString(com.uptodown.R.string.app_detail_not_available);
                    kotlin.jvm.internal.m.d(string, "getString(...)");
                    c1600m1.f6(string);
                } else if (C1600m1.this.U3().Q().getValue() != null) {
                    if (C1600m1.this.U3().h0().getValue() != null) {
                        Object value = C1600m1.this.U3().h0().getValue();
                        kotlin.jvm.internal.m.b(value);
                        if (!((g2.P) value).m()) {
                            Object value2 = C1600m1.this.U3().Q().getValue();
                            kotlin.jvm.internal.m.b(value2);
                            if (((C1760d) value2).e() != 1) {
                                Object obj2 = this.f19740d.f21881a;
                                if (obj2 == null) {
                                    C1600m1.this.g6(this.f19739c);
                                } else if (((C1772p) obj2).f()) {
                                    C1600m1.this.z6(this.f19739c);
                                } else {
                                    if (!this.f19741e.f21898a) {
                                        C1600m1 c1600m12 = C1600m1.this;
                                        if (!c1600m12.E4((g2.P) c1600m12.U3().h0().getValue())) {
                                            if (((C1772p) this.f19740d.f21881a).y() > 0) {
                                                C1600m1.this.B6();
                                            } else {
                                                C1600m1.this.g6(this.f19739c);
                                            }
                                        }
                                    }
                                    C1600m1.this.i6((C1772p) this.f19740d.f21881a);
                                }
                            }
                        }
                    }
                    Object value3 = C1600m1.this.U3().Q().getValue();
                    kotlin.jvm.internal.m.b(value3);
                    if (((C1760d) value3).H()) {
                        C1600m1.this.Q3().f7736L.getRoot().setVisibility(4);
                        C1600m1.this.Q3().f7732H.getRoot().setVisibility(8);
                    } else {
                        C1600m1.this.q6(this.f19739c);
                    }
                } else {
                    T1.a i4 = N1.k.f3913g.i();
                    if (m3.m.p(i4 != null ? i4.b() : null, C1600m1.this.P3().R(), true)) {
                        C1600m1 c1600m13 = C1600m1.this;
                        String string2 = c1600m13.getString(com.uptodown.R.string.installing);
                        kotlin.jvm.internal.m.d(string2, "getString(...)");
                        c1600m13.l6(string2);
                    } else {
                        Object obj3 = this.f19740d.f21881a;
                        if (obj3 == null) {
                            C1600m1.this.g6(this.f19739c);
                        } else if (((C1772p) obj3).f()) {
                            C1600m1.this.m6();
                        } else if ((C1600m1.F4(C1600m1.this, null, 1, null) || this.f19741e.f21898a) && this.f19742f.f21898a) {
                            C1600m1.this.i6((C1772p) this.f19740d.f21881a);
                        } else {
                            C1600m1.this.g6(this.f19739c);
                        }
                    }
                }
            } else if (C1600m1.this.U3().Q().getValue() != null) {
                C1600m1.this.q6(this.f19739c);
                C1600m1.this.M4(1);
            } else {
                C1600m1 c1600m14 = C1600m1.this;
                String string3 = c1600m14.getString(com.uptodown.R.string.app_detail_not_compatible);
                kotlin.jvm.internal.m.d(string3, "getString(...)");
                c1600m14.f6(string3);
                C1600m1.this.M4(0);
            }
            C1600m1.this.U3().L().setValue(kotlin.coroutines.jvm.internal.b.a(true));
            if (C1600m1.this.U3().Q().getValue() != null) {
                C1600m1.this.K6(com.uptodown.R.id.action_app_details_settings);
                C1600m1.this.K6(com.uptodown.R.id.action_exclude);
            } else {
                C1600m1.this.W3(com.uptodown.R.id.action_app_details_settings);
                C1600m1.this.W3(com.uptodown.R.id.action_exclude);
            }
            if (!C1600m1.this.P3().I0() || (u4 = C1600m1.this.P3().u()) == null || u4.length() == 0) {
                C1600m1.this.Q3().f7779o.getRoot().setVisibility(8);
                C1600m1.this.Q3().f7779o.f7319c.setVisibility(8);
            } else {
                TextView textView = C1600m1.this.Q3().f7779o.f7319c;
                C1600m1 c1600m15 = C1600m1.this;
                textView.setTypeface(N1.k.f3913g.x());
                textView.setText(c1600m15.P3().u());
                C1600m1.this.Q3().f7779o.getRoot().setVisibility(0);
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1608h) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1609i extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19743a;

        C1609i(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1609i(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            W2.b.c();
            if (this.f19743a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            if (C1600m1.this.P3().K0()) {
                C1600m1.this.s6();
            } else {
                C1600m1 c1600m1 = C1600m1.this;
                String string = c1600m1.getString(com.uptodown.R.string.app_detail_not_available);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                c1600m1.f6(string);
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1609i) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1610j extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19745a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19747a;

            a(C1600m1 c1600m1) {
                this.f19747a = c1600m1;
            }

            @Override
            public final Object emit(u2.H h4, V2.d dVar) {
                String a5;
                if (!(h4 instanceof H.a)) {
                    if (h4 instanceof H.c) {
                        H.c cVar = (H.c) h4;
                        if (((C1643s1.e) cVar.a()).b()) {
                            C1600m1 c1600m1 = this.f19747a;
                            TextView tvDownloadCancelBad = c1600m1.Q3().f7736L.f8049h;
                            kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
                            c1600m1.I2(tvDownloadCancelBad);
                            C1600m1 c1600m12 = this.f19747a;
                            RelativeLayout rlStatusPreRegister = c1600m12.Q3().f7732H.f7174h;
                            kotlin.jvm.internal.m.d(rlStatusPreRegister, "rlStatusPreRegister");
                            c1600m12.I2(rlStatusPreRegister);
                            this.f19747a.Q3().f7732H.f7170d.setVisibility(8);
                            if (this.f19747a.getContext() != null && (a5 = ((C1643s1.e) cVar.a()).a()) != null && a5.length() != 0) {
                                C1600m1 c1600m13 = this.f19747a;
                                TextView tvDownloadCancelBad2 = c1600m13.Q3().f7736L.f8049h;
                                kotlin.jvm.internal.m.d(tvDownloadCancelBad2, "tvDownloadCancelBad");
                                c1600m13.a6(tvDownloadCancelBad2, ((C1643s1.e) cVar.a()).a());
                                this.f19747a.Q3().f7732H.f7174h.setBackground(ContextCompat.getDrawable(this.f19747a.requireContext(), com.uptodown.R.drawable.ripple_open_button));
                                this.f19747a.Q3().f7732H.f7181o.setTextColor(ContextCompat.getColorStateList(this.f19747a.requireContext(), com.uptodown.R.color.selector_wizard_accept_button_text));
                                this.f19747a.Q3().f7732H.f7181o.setText(((C1643s1.e) cVar.a()).a());
                            }
                            v.a aVar = u2.v.f23867v;
                            Context requireContext = this.f19747a.requireContext();
                            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                            u2.v a6 = aVar.a(requireContext);
                            a6.a();
                            C1751E u02 = a6.u0(this.f19747a.P3().e());
                            a6.i();
                            if (u02 != null) {
                                this.f19747a.Q3().f7726E.setVisibility(0);
                                this.f19747a.Q3().f7749Y.setChecked(u02.d() == 1);
                            } else {
                                this.f19747a.Q3().f7749Y.setChecked(true);
                            }
                        } else {
                            C1600m1 c1600m14 = this.f19747a;
                            TextView tvDownloadCancelBad3 = c1600m14.Q3().f7736L.f8049h;
                            kotlin.jvm.internal.m.d(tvDownloadCancelBad3, "tvDownloadCancelBad");
                            c1600m14.v2(tvDownloadCancelBad3);
                            C1600m1 c1600m15 = this.f19747a;
                            RelativeLayout rlStatusPreRegister2 = c1600m15.Q3().f7732H.f7174h;
                            kotlin.jvm.internal.m.d(rlStatusPreRegister2, "rlStatusPreRegister");
                            c1600m15.v2(rlStatusPreRegister2);
                            this.f19747a.Q3().f7732H.f7170d.setVisibility(0);
                            if (this.f19747a.getContext() != null) {
                                C1600m1 c1600m16 = this.f19747a;
                                TextView tvDownloadCancelBad4 = c1600m16.Q3().f7736L.f8049h;
                                kotlin.jvm.internal.m.d(tvDownloadCancelBad4, "tvDownloadCancelBad");
                                String string = this.f19747a.getString(com.uptodown.R.string.pre_registration_title);
                                kotlin.jvm.internal.m.d(string, "getString(...)");
                                c1600m16.Z5(tvDownloadCancelBad4, string);
                                this.f19747a.Q3().f7732H.f7174h.setBackground(ContextCompat.getDrawable(this.f19747a.requireContext(), com.uptodown.R.drawable.ripple_blue_primary_button));
                                this.f19747a.Q3().f7732H.f7181o.setText(this.f19747a.getString(com.uptodown.R.string.pre_registration_title));
                                this.f19747a.Q3().f7732H.f7181o.setTextColor(ContextCompat.getColor(this.f19747a.requireContext(), com.uptodown.R.color.white));
                            }
                        }
                    } else if (!(h4 instanceof H.b)) {
                        throw new R2.k();
                    }
                }
                return R2.s.f4667a;
            }
        }

        C1610j(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1610j(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19745a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I T4 = C1600m1.this.U3().T();
                a aVar = new a(C1600m1.this);
                this.f19745a = 1;
                if (T4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1610j) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class C1611k implements f2.V {
        C1611k() {
        }

        public static final R2.s e(C1600m1 c1600m1) {
            c1600m1.H3();
            return R2.s.f4667a;
        }

        public static final R2.s f(C1600m1 c1600m1) {
            FragmentActivity requireActivity = c1600m1.requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            c1600m1.H2(requireActivity);
            return R2.s.f4667a;
        }

        @Override
        public void a(C1755I reportVT) {
            kotlin.jvm.internal.m.e(reportVT, "reportVT");
            if (C1600m1.this.getActivity() == null || !(C1600m1.this.getActivity() instanceof AbstractActivityC1500a) || C1600m1.this.requireActivity().isFinishing()) {
                return;
            }
            C1600m1.this.P3().W0(reportVT);
            if (reportVT.d() <= 0) {
                C1600m1.this.H3();
                return;
            }
            FragmentActivity activity = C1600m1.this.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            C1762f P32 = C1600m1.this.P3();
            final C1600m1 c1600m1 = C1600m1.this;
            InterfaceC1665a interfaceC1665a = new InterfaceC1665a() {
                @Override
                public final Object invoke() {
                    R2.s e5;
                    e5 = C1600m1.C1611k.e(C1600m1.this);
                    return e5;
                }
            };
            final C1600m1 c1600m12 = C1600m1.this;
            ((AbstractActivityC1500a) activity).e2(P32, interfaceC1665a, new InterfaceC1665a() {
                @Override
                public final Object invoke() {
                    R2.s f4;
                    f4 = C1600m1.C1611k.f(C1600m1.this);
                    return f4;
                }
            });
        }

        @Override
        public void b() {
            C1600m1.this.H3();
        }
    }

    public static final class C1613m implements InterfaceC1729j {
        C1613m() {
        }

        @Override
        public void a(long j4) {
            C1600m1.this.h5(j4);
        }

        @Override
        public void b(C1764h category) {
            kotlin.jvm.internal.m.e(category, "category");
            C1600m1.this.V4(category);
        }
    }

    static final class C1614n extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19751a;

        C1614n(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1614n(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19751a;
            if (i4 == 0) {
                R2.n.b(obj);
                C1600m1 c1600m1 = C1600m1.this;
                this.f19751a = 1;
                if (c1600m1.N2(this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            return R2.s.f4667a;
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1614n) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class C1615o implements InterfaceC1736q {
        C1615o() {
        }

        @Override
        public void c(int i4) {
            if (i4 == 404) {
                C1600m1.this.U3().M().setValue(Boolean.TRUE);
            }
        }

        @Override
        public void d(C1762f appInfo) {
            kotlin.jvm.internal.m.e(appInfo, "appInfo");
            C1600m1.this.Y5(appInfo);
            C1600m1.this.w5();
            C1600m1.this.x2();
        }
    }

    static final class C1616p extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19754a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19756a;

            a(C1600m1 c1600m1) {
                this.f19756a = c1600m1;
            }

            @Override
            public final Object emit(ArrayList arrayList, V2.d dVar) {
                this.f19756a.y5(arrayList);
                return R2.s.f4667a;
            }
        }

        C1616p(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1616p(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19754a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I V4 = C1600m1.this.U3().V();
                a aVar = new a(C1600m1.this);
                this.f19754a = 1;
                if (V4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1616p) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class C1617q implements S1.h {
        C1617q() {
        }

        @Override
        public void a() {
            C1600m1 c1600m1 = C1600m1.this;
            String string = c1600m1.getString(com.uptodown.R.string.installing);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            c1600m1.l6(string);
        }

        @Override
        public void b(String str) {
            if (str != null) {
                C1600m1.this.j3(str);
                return;
            }
            C1600m1 c1600m1 = C1600m1.this;
            String string = c1600m1.getString(com.uptodown.R.string.error_generico);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            c1600m1.j3(string);
        }
    }

    static final class C1619s extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19760a;

        final g2.L f19762c;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19763a;

            final g2.L f19764b;

            a(C1600m1 c1600m1, g2.L l4) {
                this.f19763a = c1600m1;
                this.f19764b = l4;
            }

            public final Object b(int i4, V2.d dVar) {
                if (i4 == 0) {
                    FragmentActivity activity = this.f19763a.getActivity();
                    kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                    String string = this.f19763a.getString(com.uptodown.R.string.error_generico);
                    kotlin.jvm.internal.m.d(string, "getString(...)");
                    ((AbstractActivityC1500a) activity).r0(string);
                } else if (i4 == 1) {
                    Iterator it = ((Iterable) this.f19763a.U3().Z().getValue()).iterator();
                    int i5 = 0;
                    while (true) {
                        if (!it.hasNext()) {
                            i5 = -1;
                            break;
                        }
                        int i6 = i5 + 1;
                        if (((g2.L) it.next()).f() == this.f19764b.f()) {
                            break;
                        }
                        i5 = i6;
                    }
                    if (i5 > 0 && i5 < ((ArrayList) this.f19763a.U3().Z().getValue()).size()) {
                        this.f19763a.Y6(this.f19764b, i5);
                    }
                }
                return R2.s.f4667a;
            }

            @Override
            public Object emit(Object obj, V2.d dVar) {
                return b(((Number) obj).intValue(), dVar);
            }
        }

        C1619s(g2.L l4, V2.d dVar) {
            super(2, dVar);
            this.f19762c = l4;
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1619s(this.f19762c, dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19760a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I X4 = C1600m1.this.U3().X();
                a aVar = new a(C1600m1.this, this.f19762c);
                this.f19760a = 1;
                if (X4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1619s) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public static final class C1620t implements BannerAdListener {
        C1620t() {
        }

        public static final void b(C1600m1 c1600m1, View view) {
            c1600m1.P6();
        }

        @Override
        public void closeFullScreen(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
        }

        @Override
        public void onClick(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
            Bundle bundle = new Bundle();
            bundle.putString("type", "clicked");
            new u2.z(C1600m1.this.getContext()).d("mintegral_banner", bundle);
        }

        @Override
        public void onCloseBanner(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
            Bundle bundle = new Bundle();
            bundle.putString("type", "closed");
            new u2.z(C1600m1.this.getContext()).d("mintegral_banner", bundle);
        }

        @Override
        public void onLeaveApp(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
        }

        @Override
        public void onLoadFailed(MBridgeIds ids, String errorMsg) {
            kotlin.jvm.internal.m.e(ids, "ids");
            kotlin.jvm.internal.m.e(errorMsg, "errorMsg");
            C1600m1.this.Q3().f7724D.setVisibility(8);
            C1600m1.this.Q3().f7794v0.setVisibility(8);
            C1600m1.this.Q3().f7724D.release();
            Bundle bundle = new Bundle();
            bundle.putString("type", "failed");
            new u2.z(C1600m1.this.getContext()).d("mintegral_banner", bundle);
        }

        @Override
        public void onLoadSuccessed(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
            C1600m1.this.Q3().f7794v0.setTypeface(N1.k.f3913g.x());
            C1600m1.this.Q3().f7794v0.setVisibility(0);
            TextView textView = C1600m1.this.Q3().f7794v0;
            final C1600m1 c1600m1 = C1600m1.this;
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.C1620t.b(C1600m1.this, view);
                }
            });
            Bundle bundle = new Bundle();
            bundle.putString("type", "loaded");
            new u2.z(C1600m1.this.getContext()).d("mintegral_banner", bundle);
        }

        @Override
        public void onLogImpression(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
        }

        @Override
        public void showFullScreen(MBridgeIds ids) {
            kotlin.jvm.internal.m.e(ids, "ids");
        }
    }

    public static final class C1621u implements H1.b {
        C1621u() {
        }

        @Override
        public void a(Exception e5) {
            kotlin.jvm.internal.m.e(e5, "e");
        }

        @Override
        public void onSuccess() {
            C1600m1.this.Q3().f7738N.f7853b.setVisibility(0);
            if (!((Boolean) C1600m1.this.U3().F().getValue()).booleanValue()) {
                C1600m1.this.Q3().f7757d.setTitle(C1600m1.this.P3().M());
                C1600m1.this.Q3().f7753b.setExpanded(false, false);
            }
            String z4 = C1600m1.this.P3().z();
            if (z4 == null || z4.length() == 0) {
                return;
            }
            C1600m1.this.O3();
            FragmentActivity activity = C1600m1.this.getActivity();
            if (activity != null) {
                C1600m1.this.W6(activity);
            }
        }
    }

    static final class C1622v extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19767a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19769a;

            a(C1600m1 c1600m1) {
                this.f19769a = c1600m1;
            }

            @Override
            public final Object emit(u2.H h4, V2.d dVar) {
                if (!(h4 instanceof H.a)) {
                    if (h4 instanceof H.c) {
                        H.c cVar = (H.c) h4;
                        if (((C1643s1.d) cVar.a()).a()) {
                            if (((C1643s1.d) cVar.a()).b()) {
                                this.f19769a.n3();
                            }
                            this.f19769a.s6();
                        }
                    } else if (!(h4 instanceof H.b)) {
                        throw new R2.k();
                    }
                }
                return R2.s.f4667a;
            }
        }

        C1622v(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1622v(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19767a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I S4 = C1600m1.this.U3().S();
                a aVar = new a(C1600m1.this);
                this.f19767a = 1;
                if (S4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1622v) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1623w extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19770a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19772a;

            a(C1600m1 c1600m1) {
                this.f19772a = c1600m1;
            }

            @Override
            public final Object emit(ArrayList arrayList, V2.d dVar) {
                this.f19772a.s5(arrayList);
                return R2.s.f4667a;
            }
        }

        C1623w(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1623w(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19770a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I N4 = C1600m1.this.U3().N();
                a aVar = new a(C1600m1.this);
                this.f19770a = 1;
                if (N4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1623w) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1624x extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19773a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19775a;

            a(C1600m1 c1600m1) {
                this.f19775a = c1600m1;
            }

            @Override
            public final Object emit(u2.H h4, V2.d dVar) {
                if (!(h4 instanceof H.a)) {
                    if (h4 instanceof H.c) {
                        H.c cVar = (H.c) h4;
                        this.f19775a.O5(((C1643s1.a) cVar.a()).a(), ((C1643s1.a) cVar.a()).b());
                    } else if (!(h4 instanceof H.b)) {
                        throw new R2.k();
                    }
                }
                return R2.s.f4667a;
            }
        }

        C1624x(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1624x(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19773a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I E4 = C1600m1.this.U3().E();
                a aVar = new a(C1600m1.this);
                this.f19773a = 1;
                if (E4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1624x) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1625y extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19776a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19778a;

            a(C1600m1 c1600m1) {
                this.f19778a = c1600m1;
            }

            @Override
            public final Object emit(ArrayList arrayList, V2.d dVar) {
                this.f19778a.P5(arrayList, false);
                return R2.s.f4667a;
            }
        }

        C1625y(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1625y(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19776a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I f02 = C1600m1.this.U3().f0();
                a aVar = new a(C1600m1.this);
                this.f19776a = 1;
                if (f02.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1625y) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    static final class C1626z extends kotlin.coroutines.jvm.internal.l implements InterfaceC1680p {

        int f19779a;

        static final class a implements InterfaceC2325f {

            final C1600m1 f19781a;

            a(C1600m1 c1600m1) {
                this.f19781a = c1600m1;
            }

            public static final void e(C1600m1 c1600m1, C1759c c1759c, View view) {
                c1600m1.R4(c1759c);
            }

            @Override
            public final Object emit(final C1759c c1759c, V2.d dVar) {
                ArrayList a5 = c1759c.a();
                if (a5 != null && !a5.isEmpty()) {
                    this.f19781a.Q3().f7769j.setVisibility(0);
                    this.f19781a.Q3().f7802z0.setText(this.f19781a.getString(com.uptodown.R.string.best_alternatives));
                    LinearLayout linearLayout = this.f19781a.Q3().f7718A;
                    final C1600m1 c1600m1 = this.f19781a;
                    linearLayout.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view) {
                            C1600m1.C1626z.a.e(C1600m1.this, c1759c, view);
                        }
                    });
                    ArrayList a6 = c1759c.a();
                    kotlin.jvm.internal.m.b(a6);
                    if (a6.size() > 20) {
                        ArrayList a7 = c1759c.a();
                        kotlin.jvm.internal.m.b(a7);
                        this.f19781a.P5(new ArrayList(a7.subList(0, 20)), true);
                    } else {
                        this.f19781a.P5(c1759c.a(), true);
                    }
                }
                return R2.s.f4667a;
            }
        }

        C1626z(V2.d dVar) {
            super(2, dVar);
        }

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return C1600m1.this.new C1626z(dVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c5 = W2.b.c();
            int i4 = this.f19779a;
            if (i4 == 0) {
                R2.n.b(obj);
                r3.I y4 = C1600m1.this.U3().y();
                a aVar = new a(C1600m1.this);
                this.f19779a = 1;
                if (y4.collect(aVar, this) == c5) {
                    return c5;
                }
            } else {
                if (i4 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            throw new R2.d();
        }

        @Override
        public final Object mo14invoke(InterfaceC2159J interfaceC2159J, V2.d dVar) {
            return ((C1626z) create(interfaceC2159J, dVar)).invokeSuspend(R2.s.f4667a);
        }
    }

    public C1600m1() {
        ActivityResultLauncher registerForActivityResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                C1600m1.O4(C1600m1.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.m.d(registerForActivityResult, "registerForActivityResult(...)");
        this.f19658l = registerForActivityResult;
        ActivityResultLauncher registerForActivityResult2 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            @Override
            public final void onActivityResult(Object obj) {
                C1600m1.c7(C1600m1.this, (ActivityResult) obj);
            }
        });
        kotlin.jvm.internal.m.d(registerForActivityResult2, "registerForActivityResult(...)");
        this.f19659m = registerForActivityResult2;
    }

    public static final void A2(C1600m1 c1600m1, View view) {
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        c1600m1.E3(requireContext);
    }

    public static final void A3(C1600m1 c1600m1, Context context, DialogInterface dialogInterface) {
        c1600m1.b7(((Number) c1600m1.U3().Y().getValue()).intValue(), context);
    }

    public static final void A4(C1600m1 c1600m1, View view) {
        c1600m1.j5();
    }

    public static final void A5(C1600m1 c1600m1, g2.L l4, View view) {
        c1600m1.l5(l4);
    }

    public static final void A6(C1600m1 c1600m1, Context context, View view) {
        c1600m1.E3(context);
    }

    public static final void B2(C1600m1 c1600m1, View view) {
        DownloadWorker.a aVar = DownloadWorker.f19220d;
        if (!aVar.j(c1600m1.P3().e())) {
            String R4 = c1600m1.P3().R();
            kotlin.jvm.internal.m.b(R4);
            if (!aVar.m(R4)) {
                return;
            }
        }
        if (aVar.h()) {
            aVar.o();
            return;
        }
        v.a aVar2 = u2.v.f23867v;
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        u2.v a5 = aVar2.a(requireContext);
        a5.a();
        String R5 = c1600m1.P3().R();
        kotlin.jvm.internal.m.b(R5);
        C1772p g02 = a5.g0(R5, c1600m1.P3().y0());
        a5.i();
        if (g02 == null || !aVar.l(g02)) {
            return;
        }
        u2.z zVar = c1600m1.f19650d;
        if (zVar != null) {
            Bundle bundle = new Bundle();
            bundle.putString("type", "paused");
            R2.s sVar = R2.s.f4667a;
            zVar.d("download", bundle);
        }
        aVar.n();
        c1600m1.r6(null);
    }

    private final void B3() {
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
        C0970z c5 = C0970z.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        TextView textView = c5.f8419g;
        k.a aVar = N1.k.f3913g;
        textView.setTypeface(aVar.w());
        c5.f8420h.setTypeface(aVar.w());
        c5.f8418f.setTypeface(aVar.w());
        if (((Number) U3().n0().getValue()).intValue() == 1) {
            c5.f8417e.setBackground(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.ripple_blue_primary_button));
            c5.f8420h.setTextColor(ContextCompat.getColor(requireContext(), com.uptodown.R.color.white));
            c5.f8415c.setVisibility(0);
        }
        if (((Number) U3().W().getValue()).intValue() == 1) {
            c5.f8416d.setBackground(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.ripple_blue_primary_button));
            c5.f8418f.setTextColor(ContextCompat.getColor(requireContext(), com.uptodown.R.color.white));
            c5.f8414b.setVisibility(0);
        }
        c5.f8416d.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.C3(C1600m1.this, view);
            }
        });
        c5.f8417e.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.D3(C1600m1.this, view);
            }
        });
        builder.setView(c5.getRoot());
        builder.setCancelable(true);
        I6(builder);
    }

    public static final void B4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.s3(context);
    }

    public static final void B5(C1600m1 c1600m1, g2.L l4, View view) {
        c1600m1.l5(l4);
    }

    public final void B6() {
        R6();
        U3().P().setValue(4);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        String string = getString(com.uptodown.R.string.option_button_cancel);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        a6(tvDownloadCancelBad, string);
        Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.C6(C1600m1.this, view);
            }
        });
        TextView tvPauseBad = Q3().f7736L.f8051j;
        kotlin.jvm.internal.m.d(tvPauseBad, "tvPauseBad");
        String string2 = getString(com.uptodown.R.string.updates_button_resume);
        kotlin.jvm.internal.m.d(string2, "getString(...)");
        Z5(tvPauseBad, string2);
        Q3().f7732H.f7180n.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.D6(C1600m1.this, view);
            }
        });
        TextView tvStatusDownload = Q3().f7732H.f7180n;
        kotlin.jvm.internal.m.d(tvStatusDownload, "tvStatusDownload");
        String string3 = getString(com.uptodown.R.string.updates_button_resume);
        kotlin.jvm.internal.m.d(string3, "getString(...)");
        Z5(tvStatusDownload, string3);
        K6(com.uptodown.R.id.action_app_installed_details);
    }

    private final void C2(final C0918A c0918a) {
        TextView textView = c0918a.f7180n;
        k.a aVar = N1.k.f3913g;
        textView.setTypeface(aVar.w());
        c0918a.f7178l.setTypeface(aVar.x());
        c0918a.f7179m.setTypeface(aVar.x());
        c0918a.f7177k.setTypeface(aVar.x());
        c0918a.f7175i.setTypeface(aVar.x());
        c0918a.f7176j.setTypeface(aVar.w());
        c0918a.f7181o.setTypeface(aVar.w());
        c0918a.f7180n.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.D2(C1600m1.this, view);
            }
        });
        c0918a.f7180n.setFocusable(true);
        c0918a.f7168b.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.E2(C0918A.this, this, view);
            }
        });
        c0918a.f7169c.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.F2(C0918A.this, view);
            }
        });
        c0918a.f7176j.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.G2(C1600m1.this, view);
            }
        });
        c0918a.f7176j.setFocusable(true);
    }

    public static final void C3(C1600m1 c1600m1, View view) {
        c1600m1.t2();
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        ((AbstractActivityC1500a) activity).j2();
    }

    public final void C4(C1772p c1772p, Context context) {
        C1760d c1760d;
        File n4 = c1772p.n();
        if (n4 == null || !n4.exists()) {
            return;
        }
        if (n4.isDirectory()) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            if (new P1.a(requireContext).r()) {
                H4(n4);
                return;
            }
            if (getActivity() != null) {
                FragmentActivity activity = getActivity();
                kotlin.jvm.internal.m.b(activity);
                if (activity.isFinishing()) {
                    return;
                }
                C1617q c1617q = new C1617q();
                File[] listFiles = n4.listFiles();
                ArrayList arrayList = new ArrayList();
                if (listFiles != null) {
                    Iterator a5 = AbstractC2020b.a(listFiles);
                    while (a5.hasNext()) {
                        arrayList.add((File) a5.next());
                    }
                }
                FragmentActivity activity2 = getActivity();
                kotlin.jvm.internal.m.b(activity2);
                W1.C c5 = new W1.C(activity2);
                c5.x(arrayList);
                ArrayList y4 = c5.y();
                FragmentActivity requireActivity = requireActivity();
                kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
                new W1.j(requireActivity, c1617q).w(y4, false);
                if (getActivity() instanceof AbstractActivityC1500a) {
                    FragmentActivity activity3 = getActivity();
                    kotlin.jvm.internal.m.c(activity3, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                    ((AbstractActivityC1500a) activity3).A2(c1772p);
                    return;
                }
                return;
            }
            return;
        }
        String name = n4.getName();
        kotlin.jvm.internal.m.d(name, "getName(...)");
        if (!m3.m.o(name, ".apk", false, 2, null)) {
            G.a aVar = W1.G.f5249b;
            String name2 = n4.getName();
            kotlin.jvm.internal.m.d(name2, "getName(...)");
            if (aVar.a(name2)) {
                W1.G g4 = new W1.G();
                boolean f4 = g4.f(n4);
                if (!g4.c(n4) || new C0703h().e().canWrite()) {
                    r3 = f4;
                } else if (getActivity() != null) {
                    FragmentActivity activity4 = getActivity();
                    kotlin.jvm.internal.m.c(activity4, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                    if (((AbstractActivityC1500a) activity4).U()) {
                        FragmentActivity activity5 = getActivity();
                        kotlin.jvm.internal.m.c(activity5, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                        ((AbstractActivityC1500a) activity5).Y2(P3().e());
                    } else {
                        FragmentActivity activity6 = getActivity();
                        kotlin.jvm.internal.m.c(activity6, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                        ((AbstractActivityC1500a) activity6).l0();
                    }
                }
                if (!r3 || getActivity() == null) {
                    return;
                }
                I4(n4);
                return;
            }
            return;
        }
        long j4 = -1;
        try {
            PackageManager packageManager = context.getPackageManager();
            kotlin.jvm.internal.m.d(packageManager, "getPackageManager(...)");
            String absolutePath = n4.getAbsolutePath();
            kotlin.jvm.internal.m.d(absolutePath, "getAbsolutePath(...)");
            PackageInfo c6 = W1.s.c(packageManager, absolutePath, 1);
            if (c6 != null) {
                r3 = c6.versionName != null;
                j4 = new C0703h().m(c6);
                u2.v a6 = u2.v.f23867v.a(context);
                a6.a();
                String R4 = P3().R();
                kotlin.jvm.internal.m.b(R4);
                c1760d = a6.W(R4);
                try {
                    a6.i();
                } catch (Exception e5) {
                    e = e5;
                    e.printStackTrace();
                    if (r3) {
                    }
                }
            } else {
                c1760d = null;
            }
        } catch (Exception e6) {
            e = e6;
            c1760d = null;
        }
        if (r3) {
            return;
        }
        if (c1760d != null && c1760d.A() > j4) {
            String string = getString(com.uptodown.R.string.msg_root_install_failed_invalid_versioncode);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            j3(string);
        } else if (getActivity() != null) {
            g2.P p4 = (g2.P) U3().h0().getValue();
            if (!m3.m.p(p4 != null ? p4.h() : null, context.getPackageName(), true)) {
                I4(n4);
                return;
            }
            FragmentActivity activity7 = getActivity();
            kotlin.jvm.internal.m.c(activity7, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            ((AbstractActivityC1500a) activity7).T1(n4);
        }
    }

    public static final void C5(C0965w0 c0965w0, C1600m1 c1600m1, View view) {
        if (c0965w0.f8358n.getMaxLines() == Integer.MAX_VALUE) {
            c0965w0.f8358n.setMaxLines(4);
            c0965w0.f8363s.setText(c1600m1.getString(com.uptodown.R.string.read_more_desc_app_detail));
        } else {
            c0965w0.f8358n.setMaxLines(Integer.MAX_VALUE);
            c0965w0.f8363s.setText(c1600m1.getString(com.uptodown.R.string.read_less_desc_app_detail));
        }
    }

    public static final void C6(C1600m1 c1600m1, View view) {
        c1600m1.Z2();
    }

    public static final void D2(C1600m1 c1600m1, View view) {
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        c1600m1.E3(requireContext);
    }

    public static final void D3(C1600m1 c1600m1, View view) {
        c1600m1.u2();
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        ((AbstractActivityC1500a) activity).j2();
    }

    private final boolean D4() {
        return UptodownApp.f17145F.L(P3().R());
    }

    public static final void D5(C1600m1 c1600m1, g2.L l4, View view) {
        UptodownApp.a aVar = UptodownApp.f17145F;
        if (aVar.a0()) {
            Intent intent = new Intent(c1600m1.requireActivity(), (Class<?>) RepliesActivity.class);
            intent.putExtra("review", l4);
            intent.putExtra("appName", c1600m1.P3().M());
            FragmentActivity requireActivity = c1600m1.requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            c1600m1.startActivity(intent, aVar.a(requireActivity));
        }
    }

    public static final void D6(C1600m1 c1600m1, View view) {
        c1600m1.Z2();
    }

    public static final void E2(C0918A c0918a, C1600m1 c1600m1, View view) {
        if (c0918a.f7168b.getVisibility() == 0) {
            c1600m1.Z2();
        }
    }

    private final void E3(final Context context) {
        String v4;
        String X4;
        String R4 = P3().R();
        File file = null;
        if (R4 == null || R4.length() == 0 || com.uptodown.activities.preferences.a.f18568a.M(context)) {
            if (((Boolean) U3().L().getValue()).booleanValue() && P3().E0() && P3().H0()) {
                u2.v a5 = u2.v.f23867v.a(context);
                a5.a();
                String R5 = P3().R();
                kotlin.jvm.internal.m.b(R5);
                C1772p g02 = a5.g0(R5, P3().y0());
                a5.i();
                File n4 = (g02 == null || !g02.f()) ? null : g02.n();
                if (n4 == null || !n4.exists()) {
                    i6(null);
                    T2();
                    return;
                } else {
                    kotlin.jvm.internal.m.b(g02);
                    C4(g02, context);
                    return;
                }
            }
            if (!P3().I0() || (v4 = P3().v()) == null || v4.length() == 0) {
                String string = getString(com.uptodown.R.string.download_error_message);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                j3(string);
                return;
            }
            S.b bVar = g2.S.f20411m;
            FragmentActivity requireActivity = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            g2.S e5 = bVar.e(requireActivity);
            if (e5 == null || !e5.n()) {
                String v5 = P3().v();
                kotlin.jvm.internal.m.b(v5);
                X4(v5, context);
                return;
            } else {
                FragmentActivity activity = getActivity();
                kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                ((AbstractActivityC1500a) activity).e2(P3(), new InterfaceC1665a() {
                    @Override
                    public final Object invoke() {
                        R2.s F32;
                        F32 = C1600m1.F3(C1600m1.this, context);
                        return F32;
                    }
                }, new InterfaceC1665a() {
                    @Override
                    public final Object invoke() {
                        R2.s G32;
                        G32 = C1600m1.G3();
                        return G32;
                    }
                });
                return;
            }
        }
        u2.v a6 = u2.v.f23867v.a(context);
        a6.a();
        String R6 = P3().R();
        kotlin.jvm.internal.m.b(R6);
        C1772p f02 = a6.f0(R6);
        a6.i();
        if (f02 != null && f02.f()) {
            file = f02.n();
        }
        if (file != null) {
            kotlin.jvm.internal.m.b(f02);
            C4(f02, context);
            return;
        }
        String p4 = P3().p();
        if (p4 == null || p4.length() == 0) {
            String string2 = getString(com.uptodown.R.string.download_error_message);
            kotlin.jvm.internal.m.d(string2, "getString(...)");
            j3(string2);
            return;
        }
        C1772p c1772p = new C1772p();
        c1772p.c(P3());
        int R7 = c1772p.R(context);
        if (P3().L0() && (X4 = P3().X()) != null && X4.length() != 0) {
            g2.r rVar = new g2.r();
            long e6 = P3().e();
            Object value = U3().K().getValue();
            kotlin.jvm.internal.m.b(value);
            rVar.a(e6, (String) value);
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            rVar.f(requireContext);
        }
        i6(c1772p);
        DownloadApkWorker.a aVar = DownloadApkWorker.f19206i;
        String p5 = P3().p();
        kotlin.jvm.internal.m.b(p5);
        aVar.a(context, p5, R7);
    }

    public final boolean E4(g2.P p4) {
        if (DownloadWorker.f19220d.j(P3().e())) {
            return true;
        }
        return p4 != null && UptodownApp.f17145F.O(p4);
    }

    public static final void E5(C1600m1 c1600m1, C0965w0 c0965w0, g2.L l4, View view) {
        if (UptodownApp.f17145F.a0()) {
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            y2.n nVar = new y2.n(requireContext);
            ImageView ivLikesCounterReview = c0965w0.f8348d;
            kotlin.jvm.internal.m.d(ivLikesCounterReview, "ivLikesCounterReview");
            nVar.n(ivLikesCounterReview);
            if (u2.I.f23820a.i(l4.f())) {
                return;
            }
            c1600m1.J4(l4);
            c0965w0.f8360p.setText(String.valueOf(l4.g() + 1));
        }
    }

    private final void E6() {
        if (getContext() != null) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            new b2.t(requireContext, P3(), null, null, LifecycleOwnerKt.getLifecycleScope(this));
        }
    }

    public static final void F2(C0918A c0918a, View view) {
        if (c0918a.f7169c.getVisibility() == 0) {
            DownloadWorker.f19220d.o();
        }
    }

    public static final R2.s F3(C1600m1 c1600m1, Context context) {
        String v4 = c1600m1.P3().v();
        kotlin.jvm.internal.m.b(v4);
        c1600m1.X4(v4, context);
        return R2.s.f4667a;
    }

    static boolean F4(C1600m1 c1600m1, g2.P p4, int i4, Object obj) {
        if ((i4 & 1) != 0) {
            p4 = null;
        }
        return c1600m1.E4(p4);
    }

    private final View F5(LinearLayout.LayoutParams layoutParams) {
        C0965w0 c5 = C0965w0.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        c5.getRoot().setLayoutParams(layoutParams);
        c5.getRoot().setVisibility(4);
        RelativeLayout root = c5.getRoot();
        kotlin.jvm.internal.m.d(root, "getRoot(...)");
        return root;
    }

    public final void F6(final C1762f c1762f) {
        if ((getActivity() instanceof MainActivity) || (getActivity() instanceof AppDetailActivity)) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            ((AbstractActivityC1500a) activity).W2(c1762f, new InterfaceC1665a() {
                @Override
                public final Object invoke() {
                    R2.s G6;
                    G6 = C1600m1.G6(C1762f.this, this);
                    return G6;
                }
            });
        }
    }

    public static final void G2(C1600m1 c1600m1, View view) {
        c1600m1.S4();
    }

    public static final R2.s G3() {
        return R2.s.f4667a;
    }

    private final void G4(File file) {
        boolean z4;
        C1618r c1618r = new C1618r();
        if (getActivity() instanceof MainActivity) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
            z4 = ((MainActivity) activity).U();
        } else if (getActivity() instanceof AppDetailActivity) {
            FragmentActivity activity2 = getActivity();
            kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.AppDetailActivity");
            z4 = ((AppDetailActivity) activity2).U();
        } else {
            z4 = true;
        }
        G.a aVar = W1.G.f5249b;
        String name = file.getName();
        kotlin.jvm.internal.m.d(name, "getName(...)");
        if (aVar.a(name)) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            String absolutePath = file.getAbsolutePath();
            kotlin.jvm.internal.m.d(absolutePath, "getAbsolutePath(...)");
            new R1.c(requireContext, absolutePath, c1618r, z4);
            return;
        }
        UptodownApp.a aVar2 = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        aVar2.V(file, requireActivity, P3().N());
        R2.s sVar = R2.s.f4667a;
    }

    private final View G5(LinearLayout.LayoutParams layoutParams, final g2.L l4, Context context) {
        final C0969y0 c5 = C0969y0.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        c5.getRoot().setLayoutParams(layoutParams);
        c5.f8397e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on_turbo));
        c5.f8398f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off_turbo));
        c5.f8399g.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off_turbo));
        c5.f8400h.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off_turbo));
        c5.f8401i.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off_turbo));
        if (l4.h() >= 2) {
            c5.f8398f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on_turbo));
        }
        if (l4.h() >= 3) {
            c5.f8399g.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on_turbo));
        }
        if (l4.h() >= 4) {
            c5.f8400h.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on_turbo));
        }
        if (l4.h() == 5) {
            c5.f8401i.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on_turbo));
        }
        UsernameTextView usernameTextView = c5.f8412t;
        k.a aVar = N1.k.f3913g;
        usernameTextView.setTypeface(aVar.w());
        c5.f8407o.setTypeface(aVar.x());
        c5.f8406n.setTypeface(aVar.x());
        c5.f8409q.setTypeface(aVar.x());
        c5.f8410r.setTypeface(aVar.x());
        S.b bVar = g2.S.f20411m;
        if (bVar.c(l4.e()) != null) {
            com.squareup.picasso.s.h().l(bVar.c(l4.e())).n(UptodownApp.f17145F.h0(context)).i(c5.f8395c);
        }
        String l5 = l4.l();
        if (l5 != null && l5.length() != 0) {
            c5.f8395c.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.H5(C1600m1.this, l4, view);
                }
            });
            c5.f8412t.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.I5(C1600m1.this, l4, view);
                }
            });
        }
        if (l4.m() != null) {
            c5.f8412t.setText(l4.m());
            UsernameTextView.a aVar2 = UsernameTextView.f19193k;
            UsernameTextView tvUsernameReview = c5.f8412t;
            kotlin.jvm.internal.m.d(tvUsernameReview, "tvUsernameReview");
            aVar2.a(tvUsernameReview, l4.o(), l4.n());
        }
        if (l4.k() != null) {
            c5.f8407o.setText(l4.k());
        }
        if (l4.a() > 0) {
            c5.f8410r.setText(String.valueOf(l4.a()));
        }
        if (l4.i() != null) {
            c5.f8409q.setFocusable(true);
            TextView textView = c5.f8406n;
            Spanned j4 = l4.j();
            textView.setText(j4 != null ? m3.m.u0(j4) : null);
            c5.f8406n.getViewTreeObserver().addOnPreDrawListener(new J(c5));
            c5.f8411s.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.J5(C0969y0.this, this, view);
                }
            });
            c5.f8404l.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.K5(C1600m1.this, l4, view);
                }
            });
            c5.f8404l.setFocusable(true);
            c5.f8408p.setTypeface(aVar.x());
            c5.f8408p.setText(String.valueOf(l4.g()));
            if (u2.I.f23820a.i(l4.f())) {
                c5.f8396d.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_heart_red));
            }
            c5.f8403k.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.L5(C1600m1.this, c5, l4, view);
                }
            });
        } else {
            c5.f8406n.setVisibility(8);
            c5.f8404l.setVisibility(8);
            c5.f8403k.setVisibility(8);
        }
        c5.f8402j.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.M5(C1600m1.this, view);
            }
        });
        c5.f8402j.setVisibility(0);
        p.a aVar3 = u2.p.f23854a;
        ImageView ivAvatarReview = c5.f8395c;
        kotlin.jvm.internal.m.d(ivAvatarReview, "ivAvatarReview");
        aVar3.a(ivAvatarReview);
        c5.f8409q.setFocusable(true);
        RelativeLayout root = c5.getRoot();
        kotlin.jvm.internal.m.d(root, "getRoot(...)");
        return root;
    }

    public static final R2.s G6(C1762f c1762f, C1600m1 c1600m1) {
        if (c1762f.R() != null) {
            String R4 = c1762f.R();
            kotlin.jvm.internal.m.b(R4);
            c1600m1.X6(R4);
        }
        return R2.s.f4667a;
    }

    public final void H2(Context context) {
        DownloadWorker.a aVar = DownloadWorker.f19220d;
        if (aVar.j(P3().e())) {
            String R4 = P3().R();
            kotlin.jvm.internal.m.b(R4);
            aVar.c(R4);
            u2.F.f23816a.e(context);
        } else {
            String R5 = P3().R();
            kotlin.jvm.internal.m.b(R5);
            if (aVar.m(R5)) {
                String R6 = P3().R();
                kotlin.jvm.internal.m.b(R6);
                aVar.c(R6);
            } else {
                u2.v a5 = u2.v.f23867v.a(context);
                a5.a();
                C1772p d02 = a5.d0(String.valueOf(P3().A()));
                if (d02 != null) {
                    if (d02.O()) {
                        a5.x(d02);
                    } else {
                        Iterator it = d02.o().iterator();
                        kotlin.jvm.internal.m.d(it, "iterator(...)");
                        while (it.hasNext()) {
                            Object next = it.next();
                            kotlin.jvm.internal.m.d(next, "next(...)");
                            C1773q c1773q = (C1773q) next;
                            c1773q.p(0L);
                            c1773q.l(0);
                            a5.z1(c1773q);
                        }
                    }
                }
                a5.i();
            }
        }
        Q6(context);
    }

    public final void H3() {
        CharSequence charSequence;
        if (getContext() != null) {
            if (U3().Q().getValue() != null && U3().h0().getValue() != null) {
                UptodownApp.a aVar = UptodownApp.f17145F;
                Object value = U3().Q().getValue();
                kotlin.jvm.internal.m.b(value);
                if (aVar.c((C1760d) value).size() < 1 && aVar.D().size() < 1) {
                    GenerateQueueWorker.a aVar2 = GenerateQueueWorker.f19227e;
                    Context requireContext = requireContext();
                    kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                    Object value2 = U3().h0().getValue();
                    kotlin.jvm.internal.m.b(value2);
                    aVar2.a(requireContext, false, ((g2.P) value2).h());
                }
                if (DownloadWorker.f19220d.h()) {
                    p3(new InterfaceC1665a() {
                        @Override
                        public final Object invoke() {
                            R2.s I32;
                            I32 = C1600m1.I3();
                            return I32;
                        }
                    });
                    return;
                }
                return;
            }
            if (getActivity() == null || !(getActivity() instanceof AbstractActivityC1500a)) {
                return;
            }
            UptodownApp.a aVar3 = UptodownApp.f17145F;
            C1762f P32 = P3();
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            int b02 = aVar3.b0(P32, (AbstractActivityC1500a) activity);
            if (b02 < 0) {
                Context requireContext2 = requireContext();
                kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                g6(requireContext2);
                return;
            }
            if (P3().L0() && (charSequence = (CharSequence) U3().K().getValue()) != null && charSequence.length() != 0) {
                g2.r rVar = new g2.r();
                long e5 = P3().e();
                Object value3 = U3().K().getValue();
                kotlin.jvm.internal.m.b(value3);
                rVar.a(e5, (String) value3);
                Context requireContext3 = requireContext();
                kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
                rVar.f(requireContext3);
            }
            J6();
            if (D4()) {
                C1765i m4 = aVar3.m();
                kotlin.jvm.internal.m.b(m4);
                m4.g(b02);
            }
            String R4 = P3().R();
            kotlin.jvm.internal.m.b(R4);
            R2(b02, R4, P3().e());
            DownloadApkWorker.a aVar4 = DownloadApkWorker.f19206i;
            Context requireContext4 = requireContext();
            kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
            if (!aVar4.b(requireContext4, b02)) {
                TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
                kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
                String string = getString(com.uptodown.R.string.option_button_cancel);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                a6(tvDownloadCancelBad, string);
                Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        C1600m1.J3(C1600m1.this, view);
                    }
                });
                Q3().f7732H.f7168b.setVisibility(0);
                a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
                Context requireContext5 = requireContext();
                kotlin.jvm.internal.m.d(requireContext5, "requireContext(...)");
                if (!c0246a.O(requireContext5)) {
                    FragmentActivity activity2 = getActivity();
                    kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                    kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.f21884a;
                    String string2 = getString(com.uptodown.R.string.msg_added_to_downlads_queue);
                    kotlin.jvm.internal.m.d(string2, "getString(...)");
                    String format = String.format(string2, Arrays.copyOf(new Object[]{P3().M()}, 1));
                    kotlin.jvm.internal.m.d(format, "format(...)");
                    ((AbstractActivityC1500a) activity2).r0(format);
                }
            }
            if (DownloadWorker.f19220d.h()) {
                p3(new InterfaceC1665a() {
                    @Override
                    public final Object invoke() {
                        R2.s K32;
                        K32 = C1600m1.K3();
                        return K32;
                    }
                });
            }
        }
    }

    private final void H4(File file) {
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AbstractActivityC1500a.x2((AbstractActivityC1500a) activity, file, null, 2, null);
    }

    public static final void H5(C1600m1 c1600m1, g2.L l4, View view) {
        c1600m1.l5(l4);
    }

    private final void H6(Rect rect) {
        if (getContext() == null || kotlin.jvm.internal.m.a(P3().R(), requireContext().getPackageName())) {
            return;
        }
        if (Q3().f7736L.getRoot().getLocalVisibleRect(rect) && !((Boolean) U3().J().getValue()).booleanValue()) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            y2.n nVar = new y2.n(requireContext);
            RelativeLayout rlBottomBoxDownloadButtonAppDetail = Q3().f7730G;
            kotlin.jvm.internal.m.d(rlBottomBoxDownloadButtonAppDetail, "rlBottomBoxDownloadButtonAppDetail");
            nVar.i(rlBottomBoxDownloadButtonAppDetail, com.uptodown.R.anim.slide_out_bottom);
            U3().J().setValue(Boolean.valueOf(!((Boolean) U3().J().getValue()).booleanValue()));
            return;
        }
        if (Q3().f7736L.getRoot().getLocalVisibleRect(rect) || !((Boolean) U3().J().getValue()).booleanValue()) {
            return;
        }
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        y2.n nVar2 = new y2.n(requireContext2);
        RelativeLayout rlBottomBoxDownloadButtonAppDetail2 = Q3().f7730G;
        kotlin.jvm.internal.m.d(rlBottomBoxDownloadButtonAppDetail2, "rlBottomBoxDownloadButtonAppDetail");
        nVar2.h(rlBottomBoxDownloadButtonAppDetail2, com.uptodown.R.anim.slide_in_bottom);
        U3().J().setValue(Boolean.valueOf(!((Boolean) U3().J().getValue()).booleanValue()));
    }

    public final void I2(final View view) {
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                C1600m1.J2(C1600m1.this, view, view2);
            }
        });
    }

    public static final R2.s I3() {
        DownloadWorker.a aVar = DownloadWorker.f19220d;
        if (aVar.h()) {
            aVar.o();
        }
        return R2.s.f4667a;
    }

    public final void I4(File file) {
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        if (new P1.a(requireContext).r()) {
            H4(file);
        } else {
            G4(file);
        }
    }

    public static final void I5(C1600m1 c1600m1, g2.L l4, View view) {
        c1600m1.l5(l4);
    }

    private final void I6(AlertDialog.Builder builder) {
        if (UptodownApp.f17145F.M()) {
            return;
        }
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        ((AbstractActivityC1500a) activity).K2(builder.create());
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        FragmentActivity activity2 = getActivity();
        kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        if (((AbstractActivityC1500a) activity2).k2() != null) {
            FragmentActivity activity3 = getActivity();
            kotlin.jvm.internal.m.c(activity3, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity3).k2();
            kotlin.jvm.internal.m.b(k22);
            Window window = k22.getWindow();
            if (window != null) {
                window.setBackgroundDrawable(new ColorDrawable(0));
            }
            FragmentActivity activity4 = getActivity();
            kotlin.jvm.internal.m.c(activity4, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k23 = ((AbstractActivityC1500a) activity4).k2();
            kotlin.jvm.internal.m.b(k23);
            k23.show();
        }
    }

    public static final void J2(final C1600m1 c1600m1, View view, View view2) {
        if (UptodownApp.f17145F.a0()) {
            FragmentActivity activity = c1600m1.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
            if (view.getContext() != null) {
                C0958t c5 = C0958t.c(c1600m1.getLayoutInflater());
                kotlin.jvm.internal.m.d(c5, "inflate(...)");
                TextView textView = c5.f8288f;
                k.a aVar = N1.k.f3913g;
                textView.setTypeface(aVar.w());
                c5.f8288f.setText(c1600m1.getString(com.uptodown.R.string.cancel_registration));
                c5.f8286d.setTypeface(aVar.x());
                TextView textView2 = c5.f8286d;
                u2.p pVar = new u2.p();
                String string = c1600m1.getString(com.uptodown.R.string.confirm_cancel_preregister, c1600m1.P3().M());
                kotlin.jvm.internal.m.d(string, "getString(...)");
                String M4 = c1600m1.P3().M();
                kotlin.jvm.internal.m.b(M4);
                Context context = view.getContext();
                kotlin.jvm.internal.m.d(context, "getContext(...)");
                textView2.setText(pVar.d(string, M4, context));
                c5.f8285c.setTypeface(aVar.w());
                c5.f8287e.setTypeface(aVar.w());
                c5.f8287e.setText(c1600m1.getString(com.uptodown.R.string.dialog_confirmation_verify_afirmative));
                c5.f8285c.setVisibility(0);
                c5.f8285c.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        C1600m1.K2(C1600m1.this, view3);
                    }
                });
                c5.f8287e.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        C1600m1.L2(C1600m1.this, view3);
                    }
                });
                c5.f8284b.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        C1600m1.M2(C1600m1.this, view3);
                    }
                });
                AlertDialog.Builder builder = new AlertDialog.Builder(c1600m1.requireContext());
                builder.setView(c5.getRoot());
                builder.setCancelable(true);
                c1600m1.I6(builder);
            }
        }
    }

    public static final void J3(C1600m1 c1600m1, View view) {
        c1600m1.Z2();
    }

    private final void J4(g2.L l4) {
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1619s(l4, null), 2, null);
        C1643s1 U32 = U3();
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        U32.p0(requireContext, l4);
    }

    public static final void J5(C0969y0 c0969y0, C1600m1 c1600m1, View view) {
        if (c0969y0.f8406n.getMaxLines() == Integer.MAX_VALUE) {
            c0969y0.f8406n.setMaxLines(4);
            c0969y0.f8411s.setText(c1600m1.getString(com.uptodown.R.string.read_more_desc_app_detail));
        } else {
            c0969y0.f8406n.setMaxLines(Integer.MAX_VALUE);
            c0969y0.f8411s.setText(c1600m1.getString(com.uptodown.R.string.read_less_desc_app_detail));
        }
    }

    private final void J6() {
        S.b bVar = g2.S.f20411m;
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        g2.S e5 = bVar.e(requireContext);
        boolean z4 = e5 != null && e5.n();
        if (getContext() == null || P3().d() != 1 || z4) {
            return;
        }
        a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        long s4 = c0246a.s(requireContext2);
        if (s4 != 0 && System.currentTimeMillis() - s4 < 86400000) {
            return;
        }
        try {
            MBNewInterstitialHandler mBNewInterstitialHandler = new MBNewInterstitialHandler(requireContext(), "1525209", "3361225");
            mBNewInterstitialHandler.setInterstitialVideoListener(new S(mBNewInterstitialHandler));
            mBNewInterstitialHandler.playVideoMute(1);
            mBNewInterstitialHandler.load();
        } catch (Exception e6) {
            e6.printStackTrace();
            Bundle bundle = new Bundle();
            bundle.putString("type", "exception");
            new u2.z(getContext()).d("mintegral_interstitial", bundle);
        }
    }

    public static final void K2(C1600m1 c1600m1, View view) {
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public static final R2.s K3() {
        DownloadWorker.a aVar = DownloadWorker.f19220d;
        if (aVar.h()) {
            aVar.o();
        }
        return R2.s.f4667a;
    }

    private final void K4() {
        S.b bVar = g2.S.f20411m;
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        g2.S e5 = bVar.e(requireContext);
        boolean z4 = e5 != null && e5.n();
        if (P3().d() != 1 || z4) {
            Q3().f7724D.setVisibility(8);
            Q3().f7724D.release();
            return;
        }
        try {
            Q3().f7724D.init(new BannerSize(5, getResources().getDisplayMetrics().widthPixels, (int) getResources().getDimension(com.uptodown.R.dimen.mintegral_banner_height)), "1517644", "3351941");
            Q3().f7724D.setAllowShowCloseBtn(true);
            Q3().f7724D.setRefreshTime(15);
            Q3().f7724D.setBannerAdListener(new C1620t());
            Q3().f7724D.load();
        } catch (Exception e6) {
            e6.printStackTrace();
            Bundle bundle = new Bundle();
            bundle.putString("type", "exception");
            new u2.z(getContext()).d("mintegral_banner", bundle);
            Q3().f7724D.setVisibility(8);
            Q3().f7724D.release();
        }
    }

    public static final void K5(C1600m1 c1600m1, g2.L l4, View view) {
        UptodownApp.a aVar = UptodownApp.f17145F;
        if (aVar.a0()) {
            Intent intent = new Intent(c1600m1.requireActivity(), (Class<?>) RepliesActivity.class);
            intent.putExtra("review", l4);
            intent.putExtra("appName", c1600m1.P3().M());
            FragmentActivity requireActivity = c1600m1.requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            c1600m1.startActivity(intent, aVar.a(requireActivity));
        }
    }

    public final void K6(int i4) {
        Menu menu = this.f19653g;
        if (menu != null) {
            kotlin.jvm.internal.m.b(menu);
            menu.findItem(i4).setVisible(true);
        }
    }

    public static final void L2(C1600m1 c1600m1, View view) {
        C1643s1 U32 = c1600m1.U3();
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        U32.u(requireContext, c1600m1.P3().e());
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    private final void L3() {
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), null, null, new C1614n(null), 3, null);
    }

    private final void L4() {
        if (P3().z() != null) {
            com.squareup.picasso.w l4 = com.squareup.picasso.s.h().l(P3().z());
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            l4.n(new C2495d(requireContext)).j(Q3().f7738N.f7853b, new C1621u());
        }
    }

    public static final void L5(C1600m1 c1600m1, C0969y0 c0969y0, g2.L l4, View view) {
        if (UptodownApp.f17145F.a0()) {
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            y2.n nVar = new y2.n(requireContext);
            ImageView ivLikesCounterReview = c0969y0.f8396d;
            kotlin.jvm.internal.m.d(ivLikesCounterReview, "ivLikesCounterReview");
            nVar.n(ivLikesCounterReview);
            if (u2.I.f23820a.i(l4.f())) {
                return;
            }
            c1600m1.J4(l4);
            c0969y0.f8408p.setText(String.valueOf(l4.g() + 1));
        }
    }

    public final void L6(final ArrayList arrayList) {
        final C0961u0 c5 = C0961u0.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        Q3().f7761f.addView(c5.getRoot());
        Q3().f7761f.setVisibility(0);
        TextView textView = c5.f8309g;
        k.a aVar = N1.k.f3913g;
        textView.setTypeface(aVar.w());
        c5.f8308f.setTypeface(aVar.w());
        final kotlin.jvm.internal.z zVar = new kotlin.jvm.internal.z();
        final ArrayList arrayList2 = new ArrayList();
        M1.S s4 = new M1.S(arrayList, new T(arrayList, arrayList2, zVar));
        c5.f8307e.setLayoutManager(new LinearLayoutManager(requireContext(), 1, false));
        c5.f8307e.setItemAnimator(null);
        c5.f8307e.setAdapter(s4);
        c5.f8308f.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.M6(arrayList, this, arrayList2, zVar, c5, view);
            }
        });
        c5.f8304b.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.N6(C1600m1.this, c5, view);
            }
        });
        c5.f8310h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.O6(C1600m1.this, c5, view);
            }
        });
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        y2.n nVar = new y2.n(requireActivity);
        View vBackgroundRemoteInstallDevices = c5.f8310h;
        kotlin.jvm.internal.m.d(vBackgroundRemoteInstallDevices, "vBackgroundRemoteInstallDevices");
        nVar.d(vBackgroundRemoteInstallDevices, 1.0f);
        FragmentActivity requireActivity2 = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity2, "requireActivity(...)");
        y2.n nVar2 = new y2.n(requireActivity2);
        RelativeLayout rlpRemoteInstallDevices = c5.f8306d;
        kotlin.jvm.internal.m.d(rlpRemoteInstallDevices, "rlpRemoteInstallDevices");
        nVar2.h(rlpRemoteInstallDevices, com.uptodown.R.anim.slide_in_bottom);
    }

    public static final void M2(C1600m1 c1600m1, View view) {
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    private final void M3() {
        String t02;
        String k4 = P3().k();
        if (k4 == null || k4.length() == 0) {
            return;
        }
        if (Q3().f7750Z.getVisibility() != 0) {
            Q3().f7790t0.setText(com.uptodown.R.string.read_more_desc_app_detail);
            Q3().f7750Z.setVisibility(0);
            Q3().f7785r.setVisibility(8);
            Q3().f7743S.setVisibility(8);
            Q3().f7760e0.setMaxLines(6);
            Q3().f7760e0.setEllipsize(TextUtils.TruncateAt.END);
            Q3().f7737M.setVisibility(8);
            Q3().f7752a0.smoothScrollTo(0, Q3().f7739O.f7880r.getBottom(), 1000);
            return;
        }
        Q3().f7790t0.setText(com.uptodown.R.string.read_less_desc_app_detail);
        Q3().f7750Z.setVisibility(8);
        LinearLayout llFaqsContainerAppDetails = Q3().f7785r;
        kotlin.jvm.internal.m.d(llFaqsContainerAppDetails, "llFaqsContainerAppDetails");
        if (llFaqsContainerAppDetails.getChildCount() != 0) {
            Q3().f7785r.setVisibility(0);
        }
        String A02 = P3().A0();
        if ((A02 != null && A02.length() != 0) || ((t02 = P3().t0()) != null && t02.length() != 0)) {
            Q3().f7743S.setVisibility(0);
        }
        Q3().f7760e0.setMaxLines(Integer.MAX_VALUE);
        Q3().f7760e0.setEllipsize(null);
        String t4 = P3().t();
        if (t4 == null || t4.length() == 0) {
            return;
        }
        Q3().f7737M.setVisibility(0);
    }

    public final void M4(int i4) {
        if (P3().O()) {
            return;
        }
        P3().R0(true);
        Bundle bundle = new Bundle();
        bundle.putString("appId", String.valueOf(P3().e()));
        bundle.putString("type", "noCompatibleFile");
        bundle.putInt("installed", i4);
        u2.z zVar = this.f19650d;
        if (zVar != null) {
            zVar.d("app_details", bundle);
        }
    }

    public static final void M5(C1600m1 c1600m1, View view) {
        c1600m1.P6();
    }

    public static final void M6(ArrayList arrayList, C1600m1 c1600m1, ArrayList arrayList2, kotlin.jvm.internal.z zVar, C0961u0 c0961u0, View view) {
        g2.V v4;
        int size = arrayList.size();
        int i4 = 0;
        while (true) {
            if (i4 >= size) {
                v4 = 0;
                break;
            }
            v4 = arrayList.get(i4);
            i4++;
            if (((g2.V) v4).d() == 1) {
                break;
            }
        }
        g2.V v5 = v4;
        if (v5 != null) {
            C1643s1 U32 = c1600m1.U3();
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            U32.s0(requireContext, c1600m1.P3().e(), v5, arrayList2);
        }
        if (zVar.f21898a && c1600m1.P3().H0() && c1600m1.P3().E0()) {
            Context requireContext2 = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
            c1600m1.E3(requireContext2);
        }
        c1600m1.Y2(c0961u0);
    }

    public final Object N2(V2.d dVar) {
        C1605e c1605e;
        int i4;
        C1600m1 c1600m1;
        if (dVar instanceof C1605e) {
            c1605e = (C1605e) dVar;
            int i5 = c1605e.f19732d;
            if ((i5 & Integer.MIN_VALUE) != 0) {
                c1605e.f19732d = i5 - Integer.MIN_VALUE;
                Object obj = c1605e.f19730b;
                Object c5 = W2.b.c();
                i4 = c1605e.f19732d;
                if (i4 != 0) {
                    R2.n.b(obj);
                    AbstractC2156G b5 = o3.Y.b();
                    C1606f c1606f = new C1606f(null);
                    c1605e.f19729a = this;
                    c1605e.f19732d = 1;
                    if (AbstractC2172g.g(b5, c1606f, c1605e) != c5) {
                        c1600m1 = this;
                    }
                    return c5;
                }
                if (i4 != 1) {
                    if (i4 != 2) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    R2.n.b(obj);
                    return R2.s.f4667a;
                }
                c1600m1 = (C1600m1) c1605e.f19729a;
                R2.n.b(obj);
                o3.E0 c6 = o3.Y.c();
                C1607g c1607g = c1600m1.new C1607g(null);
                c1605e.f19729a = null;
                c1605e.f19732d = 2;
            }
        }
        c1605e = new C1605e(dVar);
        Object obj2 = c1605e.f19730b;
        Object c52 = W2.b.c();
        i4 = c1605e.f19732d;
        if (i4 != 0) {
        }
        o3.E0 c62 = o3.Y.c();
        C1607g c1607g2 = c1600m1.new C1607g(null);
        c1605e.f19729a = null;
        c1605e.f19732d = 2;
    }

    private final void N3() {
        String N4 = P3().N();
        if (N4 == null || N4.length() == 0) {
            return;
        }
        if (Q3().f7744T.f8058e.getVisibility() == 0) {
            Q3().f7744T.f8055b.setText(com.uptodown.R.string.read_less_desc_app_detail);
            Q3().f7744T.f8058e.setVisibility(8);
            Q3().f7744T.f8057d.setMaxLines(Integer.MAX_VALUE);
            Q3().f7744T.f8057d.setEllipsize(null);
            return;
        }
        Q3().f7744T.f8055b.setText(com.uptodown.R.string.read_more_desc_app_detail);
        Q3().f7744T.f8058e.setVisibility(0);
        Q3().f7744T.f8057d.setMaxLines(6);
        Q3().f7744T.f8057d.setEllipsize(TextUtils.TruncateAt.END);
        Q3().f7752a0.smoothScrollTo(0, Q3().f7744T.f8056c.getTop(), 1000);
    }

    private final void N4(String str) {
        Bundle bundle = new Bundle();
        bundle.putString("type", str);
        bundle.putString("packagename", P3().R());
        if (P3().e() >= 0) {
            bundle.putString("appId", String.valueOf(P3().e()));
        }
        if (P3().A() >= 0) {
            bundle.putString("fileId", String.valueOf(P3().A()));
        }
        if (D4()) {
            bundle.putInt("deeplink", 1);
        } else {
            bundle.putInt("deeplink", 0);
        }
        u2.z zVar = this.f19650d;
        if (zVar != null) {
            zVar.d("warning", bundle);
        }
    }

    public final void N5(ArrayList arrayList) {
        LinearLayout llReviewListContainer = Q3().f7799y;
        kotlin.jvm.internal.m.d(llReviewListContainer, "llReviewListContainer");
        if (llReviewListContainer.getChildCount() != 0 || getContext() == null) {
            return;
        }
        if (arrayList == null || arrayList.isEmpty()) {
            Q3().f7799y.setVisibility(8);
            Q3().f7735K.setVisibility(8);
            return;
        }
        int dimension = (int) getResources().getDimension(com.uptodown.R.dimen.margin_m);
        if (m3.m.p(getString(com.uptodown.R.string.screen_type), "phone", true)) {
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
            layoutParams.setMargins(dimension, dimension, dimension, dimension);
            Iterator it = arrayList.iterator();
            kotlin.jvm.internal.m.d(it, "iterator(...)");
            while (it.hasNext()) {
                Object next = it.next();
                kotlin.jvm.internal.m.d(next, "next(...)");
                g2.L l4 = (g2.L) next;
                if (l4.o()) {
                    LinearLayout linearLayout = Q3().f7799y;
                    Context requireContext = requireContext();
                    kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                    linearLayout.addView(G5(layoutParams, l4, requireContext));
                } else {
                    LinearLayout linearLayout2 = Q3().f7799y;
                    Context requireContext2 = requireContext();
                    kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                    linearLayout2.addView(z5(layoutParams, l4, requireContext2));
                }
            }
            return;
        }
        LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
        layoutParams2.setMargins(dimension, dimension, dimension, dimension);
        for (int i4 = 0; i4 < arrayList.size(); i4 += 2) {
            LinearLayout linearLayout3 = new LinearLayout(getContext());
            linearLayout3.setOrientation(0);
            linearLayout3.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
            LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -2);
            layoutParams3.setMargins(dimension, dimension, dimension, dimension);
            layoutParams3.weight = 1.0f;
            if (((g2.L) arrayList.get(i4)).o()) {
                Object obj = arrayList.get(i4);
                kotlin.jvm.internal.m.d(obj, "get(...)");
                Context requireContext3 = requireContext();
                kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
                linearLayout3.addView(G5(layoutParams2, (g2.L) obj, requireContext3));
            } else {
                Object obj2 = arrayList.get(i4);
                kotlin.jvm.internal.m.d(obj2, "get(...)");
                Context requireContext4 = requireContext();
                kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
                linearLayout3.addView(z5(layoutParams3, (g2.L) obj2, requireContext4));
            }
            int i5 = i4 + 1;
            if (i5 < arrayList.size()) {
                LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-1, -2);
                layoutParams4.setMargins(dimension, dimension, 0, dimension);
                layoutParams4.weight = 1.0f;
                if (!((g2.L) arrayList.get(i5)).o()) {
                    Object obj3 = arrayList.get(i5);
                    kotlin.jvm.internal.m.d(obj3, "get(...)");
                    Context requireContext5 = requireContext();
                    kotlin.jvm.internal.m.d(requireContext5, "requireContext(...)");
                    linearLayout3.addView(z5(layoutParams4, (g2.L) obj3, requireContext5));
                }
            } else {
                linearLayout3.addView(F5(layoutParams3));
            }
            Q3().f7799y.addView(linearLayout3);
        }
    }

    public static final void N6(C1600m1 c1600m1, C0961u0 c0961u0, View view) {
        c1600m1.Y2(c0961u0);
    }

    public final void O3() {
        if (getContext() != null) {
            UptodownApp.a aVar = UptodownApp.f17145F;
            if (aVar.v() > 0) {
                Q3().f7738N.f7853b.setLayoutParams(new RelativeLayout.LayoutParams(-1, aVar.v()));
                Q3().f7757d.setScrimVisibleHeightTrigger((int) (aVar.v() * 0.4d));
            }
        }
    }

    public static final void O4(C1600m1 c1600m1, ActivityResult activityResult) {
        if (activityResult.getResultCode() == 1) {
            S.b bVar = g2.S.f20411m;
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            g2.S e5 = bVar.e(requireContext);
            if ((e5 != null ? e5.g() : null) != null) {
                Context requireContext2 = c1600m1.requireContext();
                kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                if (e5.m(requireContext2)) {
                    UptodownApp.a aVar = UptodownApp.f17145F;
                    Context requireContext3 = c1600m1.requireContext();
                    kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
                    aVar.m0(requireContext3);
                    Context requireContext4 = c1600m1.requireContext();
                    kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
                    aVar.l0(requireContext4);
                    c1600m1.X5();
                    c1600m1.U2();
                }
            }
        }
    }

    public final void O5(ArrayList arrayList, ArrayList arrayList2) {
        if (arrayList.isEmpty()) {
            Q3().f7747W.setVisibility(8);
            return;
        }
        ArrayList arrayList3 = new ArrayList();
        if (!arrayList2.isEmpty()) {
            int size = arrayList2.size();
            int i4 = 0;
            while (i4 < size) {
                Object obj = arrayList2.get(i4);
                i4++;
                g2.X x4 = (g2.X) obj;
                String b5 = x4.b();
                if (b5 != null && b5.length() != 0) {
                    arrayList3.add(x4);
                }
            }
        }
        ArrayList arrayList4 = new ArrayList();
        int size2 = arrayList.size();
        for (int i5 = 0; i5 < size2; i5++) {
            Object obj2 = arrayList.get(i5);
            kotlin.jvm.internal.m.d(obj2, "get(...)");
            g2.M m4 = (g2.M) obj2;
            if (m4.a() == 0) {
                arrayList4.add(m4);
            }
        }
        kotlin.jvm.internal.C c5 = new kotlin.jvm.internal.C();
        K k4 = new K(arrayList4, c5, arrayList3);
        ArrayList arrayList5 = new ArrayList();
        arrayList5.addAll(arrayList3);
        arrayList5.addAll(arrayList4);
        c5.f21881a = new M1.B(arrayList5, k4);
        Q3().f7747W.setAdapter((RecyclerView.Adapter) c5.f21881a);
        Q3().f7747W.setVisibility(0);
    }

    public static final void O6(C1600m1 c1600m1, C0961u0 c0961u0, View view) {
        c1600m1.Y2(c0961u0);
    }

    private final void P2() {
        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public final void run() {
                C1600m1.Q2(C1600m1.this);
            }
        }, 5000L);
    }

    public final void P4() {
        S.b bVar = g2.S.f20411m;
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        bVar.a(requireContext);
        Z4();
    }

    public final void P5(ArrayList arrayList, boolean z4) {
        if (getContext() == null || arrayList == null || arrayList.isEmpty()) {
            Q3().f7742R.setVisibility(8);
            return;
        }
        M1.I i4 = new M1.I(new L(), new M(), z4 ? 25 : 20);
        this.f19654h = i4;
        kotlin.jvm.internal.m.b(i4);
        i4.d(arrayList);
        Q3().f7748X.setAdapter(this.f19654h);
        Q3().f7748X.setNestedScrollingEnabled(false);
        Q3().f7748X.setItemAnimator(null);
        Q3().f7748X.setLayoutManager(new LinearLayoutManager(getContext(), 0, false));
        Q3().f7742R.setVisibility(0);
    }

    public final void P6() {
        if (getContext() != null) {
            CustomTabsIntent build = new CustomTabsIntent.Builder().build();
            kotlin.jvm.internal.m.d(build, "build(...)");
            O.a aVar = u2.O.f23832b;
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            build.intent.setData(Uri.parse(new u2.p().c(aVar.c(requireContext))));
            ActivityResultLauncher activityResultLauncher = this.f19659m;
            Intent intent = build.intent;
            UptodownApp.a aVar2 = UptodownApp.f17145F;
            FragmentActivity requireActivity = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            activityResultLauncher.launch(intent, aVar2.b(requireActivity));
        }
    }

    public static final void Q2(C1600m1 c1600m1) {
        if (c1600m1.getContext() != null) {
            a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            if (!c0246a.M(requireContext)) {
                c1600m1.b6();
            } else if (c1600m1.Q3().f7759e.getChildCount() > 0) {
                c1600m1.Q3().f7759e.removeAllViews();
            }
        }
    }

    public final C0923b Q3() {
        C0923b c0923b = this.f19648b;
        kotlin.jvm.internal.m.b(c0923b);
        return c0923b;
    }

    private final void Q4() {
        String o02;
        int i4;
        M1.I i5;
        M1.I i6;
        int size;
        String o4;
        try {
            if (!((Boolean) U3().O().getValue()).booleanValue()) {
                Rect rect = new Rect();
                Q3().f7752a0.getHitRect(rect);
                H6(rect);
            }
        } catch (Exception e5) {
            e5.printStackTrace();
        }
        if (!((Boolean) U3().O().getValue()).booleanValue() && (o4 = P3().o()) != null && o4.length() != 0) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            Q6(requireContext);
            o02 = P3().o0();
            i4 = 0;
            if (o02 != null && o02.length() != 0 && !V3()) {
                Q3().f7731G0.getRoot().setVisibility(0);
                L3();
                if (Q3().f7752a0.getScrollY() > 0) {
                    Context requireContext2 = requireContext();
                    kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                    V6(requireContext2);
                    String z4 = P3().z();
                    if (z4 == null || z4.length() == 0) {
                        Q3().f7757d.setTitle("");
                    }
                }
                i5 = this.f19654h;
                if (i5 != null) {
                    i5.notifyDataSetChanged();
                }
                i6 = this.f19655i;
                if (i6 != null) {
                    i6.notifyDataSetChanged();
                }
                ArrayList arrayList = this.f19656j;
                size = arrayList.size();
                while (i4 < size) {
                    Object obj = arrayList.get(i4);
                    i4++;
                    ((M1.I) obj).notifyDataSetChanged();
                }
                MBBannerView mbBannerView = Q3().f7724D;
                kotlin.jvm.internal.m.d(mbBannerView, "mbBannerView");
                mbBannerView.onResume();
            }
            Q3().f7731G0.getRoot().setVisibility(8);
            L3();
            if (Q3().f7752a0.getScrollY() > 0) {
            }
            i5 = this.f19654h;
            if (i5 != null) {
            }
            i6 = this.f19655i;
            if (i6 != null) {
            }
            ArrayList arrayList2 = this.f19656j;
            size = arrayList2.size();
            while (i4 < size) {
            }
            MBBannerView mbBannerView2 = Q3().f7724D;
            kotlin.jvm.internal.m.d(mbBannerView2, "mbBannerView");
            mbBannerView2.onResume();
        }
        U3().O().setValue(Boolean.FALSE);
        o02 = P3().o0();
        i4 = 0;
        if (o02 != null) {
            Q3().f7731G0.getRoot().setVisibility(0);
            L3();
            if (Q3().f7752a0.getScrollY() > 0) {
            }
            i5 = this.f19654h;
            if (i5 != null) {
            }
            i6 = this.f19655i;
            if (i6 != null) {
            }
            ArrayList arrayList22 = this.f19656j;
            size = arrayList22.size();
            while (i4 < size) {
            }
            MBBannerView mbBannerView22 = Q3().f7724D;
            kotlin.jvm.internal.m.d(mbBannerView22, "mbBannerView");
            mbBannerView22.onResume();
        }
        Q3().f7731G0.getRoot().setVisibility(8);
        L3();
        if (Q3().f7752a0.getScrollY() > 0) {
        }
        i5 = this.f19654h;
        if (i5 != null) {
        }
        i6 = this.f19655i;
        if (i6 != null) {
        }
        ArrayList arrayList222 = this.f19656j;
        size = arrayList222.size();
        while (i4 < size) {
        }
        MBBannerView mbBannerView222 = Q3().f7724D;
        kotlin.jvm.internal.m.d(mbBannerView222, "mbBannerView");
        mbBannerView222.onResume();
    }

    public final void Q5(ArrayList arrayList) {
        LinearLayout llFloatingCategoriesAppDetail = Q3().f7787s;
        kotlin.jvm.internal.m.d(llFloatingCategoriesAppDetail, "llFloatingCategoriesAppDetail");
        if (llFloatingCategoriesAppDetail.getChildCount() == 0) {
            Q3().f7772k0.setVisibility(8);
            if (getActivity() != null) {
                Iterator it = arrayList.iterator();
                int i4 = 0;
                while (it.hasNext()) {
                    int i5 = i4 + 1;
                    final g2.O o4 = (g2.O) it.next();
                    c2.K c5 = c2.K.c(getLayoutInflater());
                    kotlin.jvm.internal.m.d(c5, "inflate(...)");
                    if (i4 > 0) {
                        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
                        layoutParams.setMargins(0, (int) getResources().getDimension(com.uptodown.R.dimen.margin_l), 0, 0);
                        c5.getRoot().setLayoutParams(layoutParams);
                    }
                    M1.I i6 = new M1.I(new N(), new O(), 20);
                    i6.d(o4.a());
                    c5.f7302e.setTypeface(N1.k.f3913g.w());
                    c5.f7302e.setText(o4.b().d());
                    c5.f7300c.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view) {
                            C1600m1.R5(C1600m1.this, o4, view);
                        }
                    });
                    c5.f7301d.setAdapter(i6);
                    c5.f7301d.setNestedScrollingEnabled(false);
                    c5.f7301d.setLayoutManager(new LinearLayoutManager(getContext(), 0, false));
                    DefaultItemAnimator defaultItemAnimator = new DefaultItemAnimator();
                    defaultItemAnimator.setSupportsChangeAnimations(false);
                    c5.f7301d.setItemAnimator(defaultItemAnimator);
                    Q3().f7787s.addView(c5.getRoot());
                    this.f19656j.add(i6);
                    i4 = i5;
                }
            }
            Q3().f7789t.setVisibility(0);
        }
    }

    public final void Q6(Context context) {
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), null, null, new W(context, null), 3, null);
    }

    private final void R2(int i4, String str, long j4) {
        if (getContext() == null || i4 < 0) {
            return;
        }
        C1780y.a aVar = C1780y.f20717f;
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        C1780y b5 = aVar.b(requireContext);
        if (b5 != null && b5.c() == -1 && kotlin.jvm.internal.m.a(b5.d(), str) && b5.b() == j4) {
            Context requireContext2 = requireContext();
            kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
            b5.l(requireContext2, i4);
        }
    }

    private final void R3() {
        if (P3().e() > 0) {
            w5();
            x2();
            R2.s sVar = R2.s.f4667a;
        } else {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            new C0892i(requireContext, ((Number) U3().C().getValue()).longValue(), new C1615o(), LifecycleOwnerKt.getLifecycleScope(this));
        }
    }

    public final void R4(C1759c c1759c) {
        if (getActivity() != null && (getActivity() instanceof MainActivity)) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
            ((MainActivity) activity).a8(c1759c);
        } else {
            if (getActivity() == null || !(getActivity() instanceof AppDetailActivity)) {
                return;
            }
            FragmentActivity activity2 = getActivity();
            kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.AppDetailActivity");
            ((AppDetailActivity) activity2).t3(c1759c);
        }
    }

    public static final void R5(C1600m1 c1600m1, g2.O o4, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.V4(o4.b());
        }
    }

    private final void R6() {
        Q3().f7739O.f7867e.setVisibility(0);
        Q3().f7739O.f7865c.setVisibility(8);
        Q3().f7736L.f8047f.setVisibility(0);
        Q3().f7736L.f8049h.setVisibility(0);
        Q3().f7736L.f8050i.setVisibility(8);
        Q3().f7736L.f8051j.setVisibility(8);
        Q3().f7732H.f7180n.setVisibility(0);
        Q3().f7732H.f7172f.setVisibility(8);
        Q3().f7732H.f7176j.setVisibility(8);
    }

    public final Object S2(Context context, V2.d dVar) {
        kotlin.jvm.internal.C c5 = new kotlin.jvm.internal.C();
        kotlin.jvm.internal.z zVar = new kotlin.jvm.internal.z();
        kotlin.jvm.internal.z zVar2 = new kotlin.jvm.internal.z();
        String R4 = P3().R();
        if (R4 == null || R4.length() == 0) {
            Object g4 = AbstractC2172g.g(o3.Y.c(), new C1609i(null), dVar);
            return g4 == W2.b.c() ? g4 : R2.s.f4667a;
        }
        U3().Q().setValue(new C2445m().D(context, P3().R()));
        u2.v a5 = u2.v.f23867v.a(context);
        a5.a();
        if (U3().Q().getValue() != null) {
            r3.t h02 = U3().h0();
            String R5 = P3().R();
            kotlin.jvm.internal.m.b(R5);
            h02.setValue(a5.C0(R5));
            g2.P p4 = (g2.P) U3().h0().getValue();
            c5.f21881a = p4 != null ? p4.b(context) : null;
        } else {
            c5.f21881a = a5.d0(String.valueOf(P3().A()));
        }
        C1772p c1772p = (C1772p) c5.f21881a;
        zVar.f21898a = c1772p != null && c1772p.L();
        a5.i();
        C1772p c1772p2 = (C1772p) c5.f21881a;
        zVar2.f21898a = c1772p2 != null && c1772p2.E() == P3().I();
        Object g5 = AbstractC2172g.g(o3.Y.c(), new C1608h(context, c5, zVar, zVar2, null), dVar);
        return g5 == W2.b.c() ? g5 : R2.s.f4667a;
    }

    public final void S3() {
        if (getContext() != null) {
            AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1616p(null), 2, null);
            C1643s1 U32 = U3();
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            U32.U(requireContext, P3().e());
        }
    }

    private final void S4() {
        String R4;
        if (getActivity() == null || requireActivity().isFinishing() || (R4 = P3().R()) == null || R4.length() == 0 || m3.m.p(P3().R(), requireActivity().getPackageName(), true)) {
            return;
        }
        PackageManager packageManager = requireActivity().getPackageManager();
        String R5 = P3().R();
        kotlin.jvm.internal.m.b(R5);
        Intent launchIntentForPackage = packageManager.getLaunchIntentForPackage(R5);
        if (launchIntentForPackage != null) {
            startActivity(launchIntentForPackage);
        }
    }

    private final void S5() {
        boolean z4;
        boolean z5;
        boolean z6;
        String X4;
        if (!P3().E0()) {
            N4("no_file_id");
            String string = getString(com.uptodown.R.string.msg_app_no_compatible_files);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            j3(string);
            return;
        }
        C1772p c1772p = new C1772p();
        c1772p.c(P3());
        if (P3().L0() && (X4 = P3().X()) != null && X4.length() != 0) {
            g2.r rVar = new g2.r();
            long e5 = P3().e();
            String X5 = P3().X();
            kotlin.jvm.internal.m.b(X5);
            rVar.a(e5, X5);
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            rVar.f(requireContext);
        }
        C1771o c1771o = new C1771o();
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        c1771o.k(requireContext2);
        a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
        Context requireContext3 = requireContext();
        kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
        boolean n12 = c0246a.n1(requireContext3);
        boolean z7 = true;
        if (n12) {
            boolean i4 = c1771o.i(c1772p);
            z6 = c1771o.g(c1772p);
            z4 = c1771o.h(c1772p);
            if (P3().i0() != null) {
                ArrayList i02 = P3().i0();
                kotlin.jvm.internal.m.b(i02);
                Context requireContext4 = requireContext();
                kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
                z5 = c1771o.f(i02, requireContext4);
                z7 = i4;
            } else {
                z7 = i4;
                z5 = true;
            }
        } else {
            z4 = true;
            z5 = true;
            z6 = true;
        }
        if (z7 && z6 && z4 && z5) {
            V2();
            return;
        }
        if (!z7) {
            N4("sdk");
            String string2 = getString(com.uptodown.R.string.msg_warning_incompatible_sdk);
            kotlin.jvm.internal.m.d(string2, "getString(...)");
            c3(string2);
            return;
        }
        if (!z6) {
            N4("abi");
            String string3 = getString(com.uptodown.R.string.msg_warning_incompatible_abi);
            kotlin.jvm.internal.m.d(string3, "getString(...)");
            c3(string3);
            return;
        }
        if (z4) {
            N4("required_feature");
            String string4 = getString(com.uptodown.R.string.msg_warning_incompatible_required_features);
            kotlin.jvm.internal.m.d(string4, "getString(...)");
            c3(string4);
            return;
        }
        N4("density");
        String string5 = getString(com.uptodown.R.string.msg_warning_incompatible_density);
        kotlin.jvm.internal.m.d(string5, "getString(...)");
        c3(string5);
    }

    private final void S6() {
        Q3().f7739O.f7867e.setVisibility(8);
        Q3().f7739O.f7865c.setVisibility(0);
        Q3().f7736L.f8047f.setVisibility(0);
        Q3().f7736L.f8049h.setVisibility(0);
        Q3().f7736L.f8043b.setVisibility(8);
        Q3().f7736L.f8050i.setVisibility(8);
        Q3().f7732H.f7173g.setVisibility(8);
        Q3().f7732H.f7180n.setVisibility(8);
        Q3().f7732H.f7172f.setVisibility(0);
        Q3().f7732H.f7176j.setVisibility(8);
    }

    private final void T2() {
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        if (!((AbstractActivityC1500a) activity).S()) {
            FragmentActivity activity2 = getActivity();
            kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            ((AbstractActivityC1500a) activity2).m0();
            return;
        }
        a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        if (c0246a.Y(requireContext)) {
            k6();
        } else {
            e7();
        }
    }

    private final long T3() {
        try {
            String o02 = P3().o0();
            if (o02 != null && o02.length() != 0) {
                String o03 = P3().o0();
                kotlin.jvm.internal.m.b(o03);
                return Long.parseLong(o03);
            }
            return 0L;
        } catch (NumberFormatException e5) {
            e5.printStackTrace();
            return 0L;
        }
    }

    private final void T4() {
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
        intent.setData(Uri.fromParts("package", P3().R(), null));
        intent.addFlags(268435456);
        intent.addFlags(8388608);
        try {
            startActivity(intent);
        } catch (ActivityNotFoundException e5) {
            e5.printStackTrace();
        }
    }

    private final void T5() {
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new P(null), 2, null);
    }

    private final void T6() {
        Q3().f7739O.f7867e.setVisibility(0);
        Q3().f7739O.f7865c.setVisibility(8);
        Q3().f7736L.f8047f.setVisibility(8);
        Q3().f7736L.f8049h.setVisibility(8);
        Q3().f7736L.f8043b.setVisibility(8);
        Q3().f7736L.f8050i.setVisibility(0);
        Q3().f7736L.f8051j.setVisibility(8);
        Q3().f7732H.f7180n.setVisibility(8);
        Q3().f7732H.f7172f.setVisibility(8);
        Q3().f7732H.f7176j.setVisibility(0);
    }

    private final void U2() {
        if (P3().K0()) {
            AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1610j(null), 2, null);
            C1643s1 U32 = U3();
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            U32.v(requireContext, P3().e());
        }
    }

    public final C1643s1 U3() {
        return (C1643s1) this.f19649c.getValue();
    }

    private final void U4() {
        if (getContext() != null) {
            v.a aVar = u2.v.f23867v;
            FragmentActivity requireActivity = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            u2.v a5 = aVar.a(requireActivity);
            a5.a();
            String R4 = P3().R();
            kotlin.jvm.internal.m.b(R4);
            C1760d W4 = a5.W(R4);
            a5.i();
            Intent intent = new Intent(requireActivity(), (Class<?>) AppInstalledDetailsActivity.class);
            intent.putExtra("appInstalled", W4);
            intent.putExtra("appInfo", P3());
            UptodownApp.a aVar2 = UptodownApp.f17145F;
            FragmentActivity requireActivity2 = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity2, "requireActivity(...)");
            startActivity(intent, aVar2.a(requireActivity2));
        }
    }

    private final void U6() {
        Q3().f7739O.f7867e.setVisibility(0);
        Q3().f7739O.f7865c.setVisibility(8);
        Q3().f7736L.f8047f.setVisibility(0);
        Q3().f7736L.f8049h.setVisibility(0);
        Q3().f7736L.f8043b.setVisibility(8);
        Q3().f7736L.f8050i.setVisibility(8);
        Q3().f7736L.f8051j.setVisibility(8);
        Q3().f7732H.f7174h.setVisibility(0);
        Q3().f7732H.f7180n.setVisibility(8);
        Q3().f7732H.f7173g.setVisibility(8);
        Q3().f7732H.f7172f.setVisibility(8);
        Q3().f7732H.f7176j.setVisibility(8);
    }

    private final void V2() {
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        S.b bVar = g2.S.f20411m;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        g2.S e5 = bVar.e(requireActivity);
        if (e5 == null || !e5.n()) {
            H3();
            R2.s sVar = R2.s.f4667a;
            return;
        }
        if (P3().h0() == null) {
            FragmentActivity requireActivity2 = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity2, "requireActivity(...)");
            new b2.m(requireActivity2, String.valueOf(P3().A()), P3().l0(), new C1611k(), LifecycleOwnerKt.getLifecycleScope(this));
            return;
        }
        C1755I h02 = P3().h0();
        kotlin.jvm.internal.m.b(h02);
        if (h02.d() > 0) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            ((AbstractActivityC1500a) activity).e2(P3(), new InterfaceC1665a() {
                @Override
                public final Object invoke() {
                    R2.s W22;
                    W22 = C1600m1.W2(C1600m1.this);
                    return W22;
                }
            }, new InterfaceC1665a() {
                @Override
                public final Object invoke() {
                    R2.s X22;
                    X22 = C1600m1.X2(C1600m1.this);
                    return X22;
                }
            });
        } else {
            H3();
        }
        R2.s sVar2 = R2.s.f4667a;
    }

    public final boolean V3() {
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        if (!((AbstractActivityC1500a) activity).S() || getContext() == null) {
            return true;
        }
        u2.y yVar = new u2.y();
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        File e5 = yVar.e(requireContext);
        C2433a c2433a = new C2433a();
        u2.y yVar2 = new u2.y();
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        return c2433a.a(yVar2.j(requireContext2, e5), T3());
    }

    public final void V4(C1764h c1764h) {
        if (getActivity() != null && (getActivity() instanceof MainActivity)) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
            ((MainActivity) activity).c8(c1764h);
        } else {
            if (getActivity() == null || !(getActivity() instanceof AppDetailActivity)) {
                return;
            }
            FragmentActivity activity2 = getActivity();
            kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.AppDetailActivity");
            ((AppDetailActivity) activity2).u3(c1764h);
        }
    }

    public final void V5(View view, Context context) {
        ViewTreeObserver viewTreeObserver;
        if (!com.uptodown.activities.preferences.a.f18568a.K(context) || view == null || (viewTreeObserver = view.getViewTreeObserver()) == null) {
            return;
        }
        viewTreeObserver.addOnPreDrawListener(new Q(view, this));
    }

    private final void V6(Context context) {
        Q3().f7729F0.setVisibility(8);
        Q3().f7754b0.setBackgroundColor(ContextCompat.getColor(context, com.uptodown.R.color.transparent));
        if (new u2.p().o(context)) {
            d6(ContextCompat.getColor(context, com.uptodown.R.color.main_blue));
            Drawable drawable = ContextCompat.getDrawable(context, com.uptodown.R.drawable.core_vector_back);
            if (drawable != null) {
                Q3().f7754b0.setNavigationIcon(drawable);
            }
            Drawable drawable2 = ContextCompat.getDrawable(context, com.uptodown.R.drawable.core_vector_menu_dots_blue);
            if (drawable2 != null) {
                Q3().f7754b0.setOverflowIcon(drawable2);
            }
        }
    }

    public static final R2.s W2(C1600m1 c1600m1) {
        c1600m1.H3();
        return R2.s.f4667a;
    }

    public final void W3(int i4) {
        Menu menu = this.f19653g;
        if (menu != null) {
            kotlin.jvm.internal.m.b(menu);
            menu.findItem(i4).setVisible(false);
        }
    }

    private final void W4() {
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        String string = getString(com.uptodown.R.string.dmca_title);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        String string2 = getString(com.uptodown.R.string.url_dmca);
        kotlin.jvm.internal.m.d(string2, "getString(...)");
        u2.p pVar = new u2.p();
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        pVar.p(requireActivity, string2, string);
    }

    private final void W5(String str) {
        int intValue = ((Number) U3().Y().getValue()).intValue();
        if (1 > intValue || intValue >= 6) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            String string = getString(com.uptodown.R.string.error_review_no_valoration);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            ((AbstractActivityC1500a) activity).r0(string);
            return;
        }
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new R(null), 2, null);
        C1643s1 U32 = U3();
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        U32.t0(requireContext, str, ((Number) U3().Y().getValue()).intValue(), P3().e());
    }

    public final void W6(Context context) {
        Q3().f7729F0.setVisibility(0);
        Q3().f7754b0.setBackgroundColor(ContextCompat.getColor(context, com.uptodown.R.color.transparent));
        d6(ContextCompat.getColor(context, com.uptodown.R.color.white));
        Drawable drawable = ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_arrow_left_white);
        if (drawable != null) {
            Q3().f7754b0.setNavigationIcon(drawable);
        }
        Drawable drawable2 = ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_menu_dots);
        if (drawable2 != null) {
            Q3().f7754b0.setOverflowIcon(drawable2);
        }
    }

    public static final R2.s X2(C1600m1 c1600m1) {
        FragmentActivity requireActivity = c1600m1.requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        c1600m1.H2(requireActivity);
        return R2.s.f4667a;
    }

    private final void X3() {
        S6();
        C2494c c2494c = C2494c.f24034a;
        ProgressBar pbProgressAppDetail = Q3().f7739O.f7870h;
        kotlin.jvm.internal.m.d(pbProgressAppDetail, "pbProgressAppDetail");
        ImageView ivLogoAppDetail = Q3().f7739O.f7864b;
        kotlin.jvm.internal.m.d(ivLogoAppDetail, "ivLogoAppDetail");
        c2494c.e(pbProgressAppDetail, ivLogoAppDetail);
        U3().P().setValue(-1);
        Q3().f7736L.f8050i.setVisibility(8);
        Q3().f7736L.f8051j.setVisibility(8);
        Q3().f7736L.f8047f.setVisibility(8);
        Q3().f7736L.f8048g.setVisibility(0);
        Q3().f7739O.f7870h.setIndeterminate(true);
        Q3().f7739O.f7882t.setText(getString(com.uptodown.R.string.status_download_update_pending));
        Q3().f7732H.f7176j.setVisibility(8);
        Q3().f7732H.f7168b.setVisibility(4);
        Q3().f7732H.f7179m.setText("");
        Q3().f7732H.f7171e.setIndeterminate(true);
        Q3().f7732H.f7177k.setText("");
    }

    private final void X4(String str, Context context) {
        u2.p pVar = new u2.p();
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        u2.p.q(pVar, (AbstractActivityC1500a) activity, str, null, 4, null);
        U3().o0(context, P3().e());
    }

    private final void X5() {
        if (((CharSequence) U3().a0().getValue()).length() > 0) {
            W5((String) U3().a0().getValue());
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
        }
    }

    private final void Y2(C0961u0 c0961u0) {
        if (U3().z().compareAndSet(false, true)) {
            FragmentActivity requireActivity = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            y2.n nVar = new y2.n(requireActivity);
            View vBackgroundRemoteInstallDevices = c0961u0.f8310h;
            kotlin.jvm.internal.m.d(vBackgroundRemoteInstallDevices, "vBackgroundRemoteInstallDevices");
            nVar.d(vBackgroundRemoteInstallDevices, 0.0f);
            FragmentActivity requireActivity2 = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity2, "requireActivity(...)");
            y2.n nVar2 = new y2.n(requireActivity2);
            RelativeLayout rlpRemoteInstallDevices = c0961u0.f8306d;
            kotlin.jvm.internal.m.d(rlpRemoteInstallDevices, "rlpRemoteInstallDevices");
            nVar2.g(rlpRemoteInstallDevices, com.uptodown.R.anim.slide_out_bottom, new AnimationAnimationListenerC1612l());
        }
    }

    private final void Y3(final Context context) {
        if (new u2.p().o(context)) {
            Q3().f7754b0.setTitleTextColor(ContextCompat.getColor(requireActivity(), com.uptodown.R.color.main_blue));
        }
        Q3().f7754b0.setNavigationIcon(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_arrow_left_white));
        Q3().f7754b0.setNavigationContentDescription(getString(com.uptodown.R.string.back));
        Q3().f7754b0.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.Z3(C1600m1.this, view);
            }
        });
        Q3().f7754b0.inflateMenu(com.uptodown.R.menu.toolbar_menu_app_detail);
        this.f19653g = Q3().f7754b0.getMenu();
        Q3().f7754b0.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
            @Override
            public final boolean onMenuItemClick(MenuItem menuItem) {
                boolean k4;
                k4 = C1600m1.k4(C1600m1.this, menuItem);
                return k4;
            }
        });
        CollapsingToolbarLayout collapsingToolbarLayout = Q3().f7757d;
        k.a aVar = N1.k.f3913g;
        collapsingToolbarLayout.setCollapsedTitleTypeface(aVar.w());
        Q3().f7753b.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
            @Override
            public final void onOffsetChanged(AppBarLayout appBarLayout, int i4) {
                C1600m1.v4(C1600m1.this, context, appBarLayout, i4);
            }
        });
        Q3().f7752a0.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
            @Override
            public final void onScrollChange(NestedScrollView nestedScrollView, int i4, int i5, int i6, int i7) {
                C1600m1.w4(C1600m1.this, nestedScrollView, i4, i5, i6, i7);
            }
        });
        if (((Number) U3().C().getValue()).longValue() == -1) {
            if (getActivity() == null || !(getActivity() instanceof MainActivity)) {
                return;
            }
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
            ((MainActivity) activity).getOnBackPressedDispatcher().onBackPressed();
            return;
        }
        O3();
        a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
        if (c0246a.K(context)) {
            ImageView imageView = Q3().f7739O.f7864b;
            kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.f21884a;
            String format = String.format("%s%s", Arrays.copyOf(new Object[]{getString(com.uptodown.R.string.transition_name_logo_card), U3().C().getValue()}, 2));
            kotlin.jvm.internal.m.d(format, "format(...)");
            imageView.setTransitionName(format);
        }
        Q3().f7739O.f7874l.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.x4(C1600m1.this, view);
            }
        });
        Q3().f7790t0.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.y4(C1600m1.this, view);
            }
        });
        Q3().f7739O.f7884v.setTypeface(aVar.w());
        Q3().f7739O.f7883u.setTypeface(aVar.x());
        Q3().f7739O.f7876n.setTypeface(aVar.x());
        Q3().f7739O.f7882t.setTypeface(aVar.x());
        Q3().f7739O.f7885w.setTypeface(aVar.x());
        Q3().f7736L.f8050i.setTypeface(aVar.w());
        Q3().f7736L.f8051j.setTypeface(aVar.w());
        Q3().f7739O.f7876n.setTypeface(aVar.w());
        Q3().f7739O.f7877o.setTypeface(aVar.x());
        Q3().f7739O.f7878p.setTypeface(aVar.w());
        Q3().f7739O.f7879q.setTypeface(aVar.x());
        Q3().f7758d0.setTypeface(aVar.x());
        Q3().f7744T.f8056c.setTypeface(aVar.w());
        Q3().f7744T.f8057d.setTypeface(aVar.x());
        Q3().f7744T.f8055b.setTypeface(aVar.w());
        Q3().f7744T.f8055b.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.z4(C1600m1.this, view);
            }
        });
        Q3().f7796w0.setTypeface(aVar.x());
        Q3().f7739O.f7873k.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.A4(C1600m1.this, view);
            }
        });
        Q3().f7739O.f7873k.setFocusable(true);
        if (!c0246a.M(context)) {
            b6();
        }
        Q3().f7739O.f7869g.setFocusable(true);
        Q3().f7739O.f7869g.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.B4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7850i.setTypeface(aVar.w());
        Q3().f7722C.f7850i.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.a4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7849h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.b4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7851j.setTypeface(aVar.w());
        Q3().f7747W.setLayoutManager(new LinearLayoutManager(context, 0, false));
        Q3().f7747W.addItemDecoration(new w2.p((int) getResources().getDimension(com.uptodown.R.dimen.margin_m)));
        Q3().f7723C0.setTypeface(aVar.w());
        Q3().f7725D0.setTypeface(aVar.x());
        Q3().f7721B0.setTypeface(aVar.x());
        Q3().f7770j0.setTypeface(aVar.w());
        Q3().f7788s0.setTypeface(aVar.w());
        Q3().f7731G0.getRoot().setVisibility(8);
        Q3().f7756c0.setTypeface(aVar.w());
        Q3().f7733I.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.c4(C1600m1.this, view);
            }
        });
        Q3().f7776m0.setTypeface(aVar.x());
        Q3().f7774l0.setTypeface(aVar.w());
        Q3().f7784q0.setTypeface(aVar.x());
        Q3().f7782p0.setTypeface(aVar.w());
        Q3().f7780o0.setTypeface(aVar.x());
        Q3().f7778n0.setTypeface(aVar.w());
        Q3().f7786r0.setTypeface(aVar.w());
        Q3().f7797x.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.d4(C1600m1.this, view);
            }
        });
        Q3().f7797x.setFocusable(true);
        Q3().f7762f0.setTypeface(aVar.w());
        Q3().f7783q.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.e4(C1600m1.this, view);
            }
        });
        Q3().f7783q.setFocusable(true);
        Q3().f7801z.f8066h.post(new Runnable() {
            @Override
            public final void run() {
                C1600m1.f4(C1600m1.this);
            }
        });
        Q3().f7802z0.setTypeface(aVar.w());
        Q3().f7722C.f7843b.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.g4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7843b.setFocusable(true);
        Q3().f7722C.f7844c.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.h4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7844c.setFocusable(true);
        Q3().f7722C.f7845d.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.i4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7845d.setFocusable(true);
        Q3().f7722C.f7846e.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.j4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7846e.setFocusable(true);
        Q3().f7722C.f7847f.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.l4(C1600m1.this, context, view);
            }
        });
        Q3().f7722C.f7847f.setFocusable(true);
        Q3().f7735K.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.m4(C1600m1.this, view);
            }
        });
        Q3().f7798x0.setTypeface(aVar.w());
        Q3().f7739O.f7880r.setTypeface(aVar.w());
        Q3().f7739O.f7886x.setTypeface(aVar.x());
        Q3().f7739O.f7881s.setTypeface(aVar.x());
        Q3().f7739O.f7874l.setTypeface(aVar.x());
        Q3().f7739O.f7875m.setTypeface(aVar.x());
        Q3().f7739O.f7875m.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.n4(C1600m1.this, view);
            }
        });
        Q3().f7800y0.setTypeface(aVar.w());
        Q3().f7790t0.setTypeface(aVar.w());
        Q3().f7760e0.setTypeface(aVar.x());
        Q3().f7768i0.setTypeface(aVar.x());
        Q3().f7766h0.setTypeface(aVar.w());
        Q3().f7764g0.setTypeface(aVar.x());
        Q3().f7801z.f8073o.setTypeface(aVar.w());
        Q3().f7801z.f8075q.setTypeface(aVar.w());
        Q3().f7801z.f8074p.setTypeface(aVar.x());
        Q3().f7792u0.setTypeface(aVar.w());
        Q3().f7727E0.setTypeface(aVar.w());
        C0935h rlDownloadButtonRootAppDetail = Q3().f7736L;
        kotlin.jvm.internal.m.d(rlDownloadButtonRootAppDetail, "rlDownloadButtonRootAppDetail");
        y2(rlDownloadButtonRootAppDetail);
        C0918A rlBottomDownloadButtonAppDetail = Q3().f7732H;
        kotlin.jvm.internal.m.d(rlBottomDownloadButtonAppDetail, "rlBottomDownloadButtonAppDetail");
        C2(rlBottomDownloadButtonAppDetail);
        String R4 = P3().R();
        if (R4 == null || R4.length() == 0 || !new C2445m().v(P3().R(), context)) {
            Q3().f7736L.f8050i.setVisibility(8);
        } else {
            TextView tvOpenBad = Q3().f7736L.f8050i;
            kotlin.jvm.internal.m.d(tvOpenBad, "tvOpenBad");
            String string = getString(com.uptodown.R.string.open);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            a6(tvOpenBad, string);
            Q3().f7736L.f8050i.setVisibility(0);
        }
        if (((Number) U3().P().getValue()).intValue() > -1) {
            int intValue = ((Number) U3().P().getValue()).intValue();
            if (intValue == 0) {
                q6(context);
            } else if (intValue == 1) {
                g6(context);
            } else if (intValue == 2) {
                z6(context);
            } else if (intValue == 3) {
                m6();
            } else if (intValue == 4) {
                u6();
            } else if (intValue == 5) {
                i6(null);
            }
        }
        Q3().f7736L.f8044c.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.o4(C1600m1.this, view);
            }
        });
        Q3().f7736L.f8046e.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.p4(C1600m1.this, view);
            }
        });
        Q3().f7736L.f8045d.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.q4(C1600m1.this, view);
            }
        });
        Q3().f7740P.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.r4(C1600m1.this, view);
            }
        });
        Q3().f7745U.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.s4(C1600m1.this, view);
            }
        });
        Q3().f7728F.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.t4(view);
            }
        });
        L4();
        n5(context);
        U3().L().setValue(Boolean.FALSE);
        Q3().f7749Y.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z4) {
                C1600m1.u4(C1600m1.this, compoundButton, z4);
            }
        });
        R3();
        K4();
    }

    private final void Y4() {
        if (requireActivity().isFinishing()) {
            return;
        }
        Intent intent = new Intent(requireActivity(), (Class<?>) InformationActivity.class);
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        startActivity(intent, aVar.a(requireActivity));
    }

    public final void Y6(g2.L l4, int i4) {
        int dimension = (int) getResources().getDimension(com.uptodown.R.dimen.margin_m);
        LinearLayout llReviewListContainer = Q3().f7799y;
        kotlin.jvm.internal.m.d(llReviewListContainer, "llReviewListContainer");
        if (llReviewListContainer.getChildCount() > i4) {
            Q3().f7799y.removeViewAt(i4);
        }
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
        layoutParams.setMargins(dimension, dimension, dimension, dimension);
        if (l4.o()) {
            LinearLayout linearLayout = Q3().f7799y;
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            linearLayout.addView(G5(layoutParams, l4, requireContext), i4);
            return;
        }
        LinearLayout linearLayout2 = Q3().f7799y;
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        linearLayout2.addView(z5(layoutParams, l4, requireContext2), i4);
    }

    private final void Z2() {
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
        final kotlin.jvm.internal.z zVar = new kotlin.jvm.internal.z();
        if (F4(this, null, 1, null)) {
            DownloadWorker.a aVar = DownloadWorker.f19220d;
            zVar.f21898a = aVar.h();
            aVar.n();
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
        C0951p c5 = C0951p.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        if (getActivity() != null && !requireActivity().isFinishing()) {
            TextView textView = c5.f8219d;
            k.a aVar2 = N1.k.f3913g;
            textView.setTypeface(aVar2.x());
            c5.f8219d.setText(requireContext().getString(com.uptodown.R.string.download_cancel_confimation_title));
            c5.f8218c.setTypeface(aVar2.w());
            c5.f8218c.setText(requireContext().getString(com.uptodown.R.string.dialog_confirmation_verify_negative));
            c5.f8218c.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.a3(kotlin.jvm.internal.z.this, this, view);
                }
            });
            c5.f8220e.setTypeface(aVar2.w());
            c5.f8220e.setText(requireContext().getString(com.uptodown.R.string.dialog_confirmation_verify_afirmative));
            c5.f8220e.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.b3(C1600m1.this, view);
                }
            });
        }
        builder.setView(c5.getRoot());
        builder.setCancelable(false);
        I6(builder);
    }

    public static final void Z3(C1600m1 c1600m1, View view) {
        if (c1600m1.getActivity() != null) {
            if (c1600m1.getActivity() instanceof MainActivity) {
                FragmentActivity activity = c1600m1.getActivity();
                kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
                ((MainActivity) activity).Q6();
            } else if (c1600m1.getActivity() instanceof AppDetailActivity) {
                FragmentActivity activity2 = c1600m1.getActivity();
                kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.AppDetailActivity");
                ((AppDetailActivity) activity2).finish();
            }
        }
    }

    private final void Z4() {
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        Intent intent = new Intent(requireActivity(), (Class<?>) LoginActivity.class);
        ActivityResultLauncher activityResultLauncher = this.f19658l;
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        activityResultLauncher.launch(intent, aVar.b(requireActivity));
    }

    public final void Z5(TextView textView, String str) {
        textView.setText(str);
        w2.v.a(textView);
    }

    public static final void a3(kotlin.jvm.internal.z zVar, C1600m1 c1600m1, View view) {
        if (!zVar.f21898a) {
            DownloadWorker.f19220d.o();
        }
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public static final void a4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.s3(context);
    }

    private final void a5(final View view) {
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                C1600m1.b5(C1600m1.this, view, view2);
            }
        });
    }

    public final void a6(TextView textView, String str) {
        textView.setText(str);
        w2.v.b(textView);
    }

    public static final void b3(C1600m1 c1600m1, View view) {
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        c1600m1.H2(requireContext);
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public static final void b4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.s3(context);
    }

    public static final void b5(final C1600m1 c1600m1, View view, View view2) {
        if (UptodownApp.f17145F.a0()) {
            FragmentActivity activity = c1600m1.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
            if (view.getContext() != null) {
                C0958t c5 = C0958t.c(c1600m1.getLayoutInflater());
                kotlin.jvm.internal.m.d(c5, "inflate(...)");
                TextView textView = c5.f8288f;
                k.a aVar = N1.k.f3913g;
                textView.setTypeface(aVar.w());
                c5.f8286d.setTypeface(aVar.x());
                c5.f8287e.setTypeface(aVar.w());
                c5.f8287e.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        C1600m1.c5(C1600m1.this, view3);
                    }
                });
                c5.f8284b.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view3) {
                        C1600m1.d5(C1600m1.this, view3);
                    }
                });
                AlertDialog.Builder builder = new AlertDialog.Builder(c1600m1.requireContext());
                builder.setView(c5.getRoot());
                builder.setCancelable(true);
                c1600m1.I6(builder);
            }
        }
    }

    public final void b6() {
        if (Q3().f7759e.getChildCount() == 0) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            g6(requireContext);
            C0939j c5 = C0939j.c(getLayoutInflater());
            kotlin.jvm.internal.m.d(c5, "inflate(...)");
            c5.f8089b.setTypeface(N1.k.f3913g.x());
            Q3().f7759e.addView(c5.getRoot());
        }
        P2();
    }

    private final void b7(int i4, Context context) {
        g2.S e5 = g2.S.f20411m.e(context);
        if ((e5 != null ? e5.g() : null) != null) {
            String g4 = e5.g();
            kotlin.jvm.internal.m.b(g4);
            if (g4.length() > 0) {
                U3().Y().setValue(Integer.valueOf(i4));
                if (i4 == 1) {
                    Q3().f7722C.f7843b.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7844c.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7845d.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7846e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7847f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    return;
                }
                if (i4 == 2) {
                    Q3().f7722C.f7843b.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7844c.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7845d.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7846e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7847f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    return;
                }
                if (i4 == 3) {
                    Q3().f7722C.f7843b.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7844c.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7845d.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7846e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7847f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    return;
                }
                if (i4 == 4) {
                    Q3().f7722C.f7843b.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7844c.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7845d.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7846e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                    Q3().f7722C.f7847f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    return;
                }
                if (i4 != 5) {
                    Q3().f7722C.f7843b.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7844c.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7845d.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7846e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    Q3().f7722C.f7847f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
                    return;
                }
                Q3().f7722C.f7843b.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                Q3().f7722C.f7844c.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                Q3().f7722C.f7845d.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                Q3().f7722C.f7846e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
                Q3().f7722C.f7847f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
            }
        }
    }

    private final void c3(String str) {
        ArrayList i02;
        if (getActivity() != null) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
        }
        if (getContext() != null) {
            ArrayList arrayList = new ArrayList();
            String R4 = P3().R();
            if (R4 != null && R4.length() != 0 && (i02 = P3().i0()) != null && !i02.isEmpty()) {
                C1771o c1771o = new C1771o();
                ArrayList i03 = P3().i0();
                kotlin.jvm.internal.m.b(i03);
                Context requireContext = requireContext();
                kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                arrayList = c1771o.e(i03, requireContext);
            }
            if (!arrayList.isEmpty()) {
                Iterator it = arrayList.iterator();
                kotlin.jvm.internal.m.d(it, "iterator(...)");
                String str2 = "";
                while (it.hasNext()) {
                    Object next = it.next();
                    kotlin.jvm.internal.m.d(next, "next(...)");
                    String str3 = (String) next;
                    if (kotlin.jvm.internal.m.a(str3, AbstractC0692o.P(arrayList))) {
                        str2 = str2 + "- " + str3;
                    } else {
                        str2 = str2 + "- " + str3 + '\n';
                    }
                }
                str = str + "\n\n" + str2;
            }
            final C0951p c5 = C0951p.c(getLayoutInflater());
            kotlin.jvm.internal.m.d(c5, "inflate(...)");
            TextView textView = c5.f8219d;
            k.a aVar = N1.k.f3913g;
            textView.setTypeface(aVar.x());
            c5.f8219d.setText(str);
            c5.f8217b.setVisibility(0);
            c5.f8217b.setTypeface(aVar.x());
            c5.f8217b.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override
                public final void onCheckedChanged(CompoundButton compoundButton, boolean z4) {
                    C1600m1.d3(C1600m1.this, compoundButton, z4);
                }
            });
            c5.f8220e.setTypeface(aVar.w());
            c5.f8220e.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.e3(C1600m1.this, view);
                }
            });
            c5.f8218c.setTypeface(aVar.w());
            c5.f8218c.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.f3(C0951p.this, this, view);
                }
            });
            AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
            builder.setView(c5.getRoot());
            builder.setCancelable(false);
            I6(builder);
        }
    }

    public static final void c4(C1600m1 c1600m1, View view) {
        c1600m1.e5();
    }

    public static final void c5(C1600m1 c1600m1, View view) {
        c1600m1.Z4();
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public final void c6(int i4, String str) {
        Menu menu = this.f19653g;
        if (menu != null) {
            kotlin.jvm.internal.m.b(menu);
            menu.findItem(i4).setTitle(str);
        }
    }

    public static final void c7(C1600m1 c1600m1, ActivityResult activityResult) {
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(c1600m1), o3.Y.b(), null, c1600m1.new Z(c1600m1.new a0(), null), 2, null);
    }

    public static final void d3(C1600m1 c1600m1, CompoundButton compoundButton, boolean z4) {
        a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        c0246a.a1(requireContext, !z4);
    }

    public static final void d4(C1600m1 c1600m1, View view) {
        c1600m1.f5();
    }

    public static final void d5(C1600m1 c1600m1, View view) {
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    private final void d6(int i4) {
        Menu menu = this.f19653g;
        kotlin.jvm.internal.m.b(menu);
        Drawable icon = menu.findItem(com.uptodown.R.id.action_search).getIcon();
        if (icon != null) {
            DrawableCompat.setTint(icon, i4);
        }
    }

    private final void d7() {
        try {
            if (P3().Z() <= 0 || ((Number) U3().l0().getValue()).intValue() <= 0) {
                Q3().f7801z.getRoot().setVisibility(8);
                Q3().f7801z.f8075q.setVisibility(8);
                return;
            }
            int dimension = (int) getResources().getDimension(com.uptodown.R.dimen.margin_m);
            Q3().f7801z.f8066h.setLayoutParams(new RelativeLayout.LayoutParams((((Number) U3().l0().getValue()).intValue() * P3().e0()) / P3().Z(), dimension));
            Q3().f7801z.f8065g.setLayoutParams(new RelativeLayout.LayoutParams((((Number) U3().l0().getValue()).intValue() * P3().d0()) / P3().Z(), dimension));
            Q3().f7801z.f8064f.setLayoutParams(new RelativeLayout.LayoutParams((((Number) U3().l0().getValue()).intValue() * P3().c0()) / P3().Z(), dimension));
            Q3().f7801z.f8063e.setLayoutParams(new RelativeLayout.LayoutParams((((Number) U3().l0().getValue()).intValue() * P3().b0()) / P3().Z(), dimension));
            Q3().f7801z.f8062d.setLayoutParams(new RelativeLayout.LayoutParams((((Number) U3().l0().getValue()).intValue() * P3().a0()) / P3().Z(), dimension));
        } catch (Exception e5) {
            e5.printStackTrace();
        }
    }

    public static final void e3(C1600m1 c1600m1, View view) {
        c1600m1.H3();
        if (c1600m1.getActivity() != null) {
            FragmentActivity activity = c1600m1.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
        }
    }

    public static final void e4(C1600m1 c1600m1, View view) {
        c1600m1.W4();
    }

    private final void e5() {
        if (requireActivity().isFinishing()) {
            return;
        }
        Intent intent = new Intent(requireActivity(), (Class<?>) MoreInfo.class);
        intent.putExtra("appInfo", P3());
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        startActivity(intent, aVar.a(requireActivity));
    }

    public final void e6() {
        Q3().f7739O.f7886x.setVisibility(8);
        Q3().f7739O.f7866d.setVisibility(8);
        String string = getString(com.uptodown.R.string.download_not_available_in_this_country);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        f6(string);
        Q3().f7736L.f8045d.setVisibility(8);
        W3(com.uptodown.R.id.action_antivirus_report);
    }

    private final void e7() {
        W1.E e5 = new W1.E();
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        ArrayList c5 = e5.c(requireContext);
        this.f19652f = c5;
        kotlin.jvm.internal.m.b(c5);
        if (c5.size() > 0) {
            U3().b0().setValue(0);
            g3();
            return;
        }
        a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        c0246a.W0(requireContext2, false);
        k6();
    }

    public static final void f3(C0951p c0951p, C1600m1 c1600m1, View view) {
        if (c0951p.f8217b.isChecked()) {
            a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            c0246a.a1(requireContext, true);
        }
        Context requireContext2 = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        c1600m1.g6(requireContext2);
        if (c1600m1.getActivity() != null) {
            FragmentActivity activity = c1600m1.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
        }
    }

    public static final void f4(C1600m1 c1600m1) {
        c1600m1.U3().l0().setValue(Integer.valueOf(c1600m1.Q3().f7801z.f8067i.getMeasuredWidth()));
        if (((Boolean) c1600m1.U3().x().getValue()).booleanValue()) {
            c1600m1.d7();
        }
    }

    private final void f5() {
        if (requireActivity().isFinishing() || !P3().H0()) {
            return;
        }
        Intent intent = new Intent(requireActivity(), (Class<?>) OldVersionsActivity.class);
        intent.putExtra("appInfo", P3());
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        startActivity(intent, aVar.a(requireActivity));
    }

    public final void f6(String str) {
        R6();
        U3().P().setValue(-1);
        Q3().f7739O.f7867e.setVisibility(0);
        Q3().f7739O.f7865c.setVisibility(8);
        Q3().f7736L.f8049h.setText(str);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        w2.v.c(tvDownloadCancelBad);
        Q3().f7736L.f8049h.setOnClickListener(null);
        Q3().f7732H.f7180n.setText(str);
        TextView tvStatusDownload = Q3().f7732H.f7180n;
        kotlin.jvm.internal.m.d(tvStatusDownload, "tvStatusDownload");
        w2.v.c(tvStatusDownload);
        Q3().f7732H.f7180n.setOnClickListener(null);
    }

    private final void f7() {
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new b0(null), 2, null);
    }

    private final void g3() {
        ArrayList arrayList;
        int i4;
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
        if (getActivity() == null || (arrayList = this.f19652f) == null || arrayList.isEmpty()) {
            return;
        }
        a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        if (c0246a.Y(requireActivity)) {
            FragmentActivity requireActivity2 = requireActivity();
            kotlin.jvm.internal.m.d(requireActivity2, "requireActivity(...)");
            if (c0246a.X(requireActivity2)) {
                i4 = 1;
                HashMap hashMap = new HashMap();
                kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.f21884a;
                String string = getString(com.uptodown.R.string.internal_memory_free);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                W1.i iVar = new W1.i();
                u2.y yVar = new u2.y();
                FragmentActivity requireActivity3 = requireActivity();
                kotlin.jvm.internal.m.d(requireActivity3, "requireActivity(...)");
                String format = String.format(string, Arrays.copyOf(new Object[]{iVar.c(yVar.e(requireActivity3).getFreeSpace())}, 1));
                kotlin.jvm.internal.m.d(format, "format(...)");
                hashMap.put(0, format);
                String string2 = getString(com.uptodown.R.string.sd_card_free);
                kotlin.jvm.internal.m.d(string2, "getString(...)");
                W1.i iVar2 = new W1.i();
                ArrayList arrayList2 = this.f19652f;
                kotlin.jvm.internal.m.b(arrayList2);
                String format2 = String.format(string2, Arrays.copyOf(new Object[]{iVar2.c(((T1.g) AbstractC0692o.H(arrayList2)).a())}, 1));
                kotlin.jvm.internal.m.d(format2, "format(...)");
                hashMap.put(1, format2);
                C0966x c5 = C0966x.c(getLayoutInflater());
                kotlin.jvm.internal.m.d(c5, "inflate(...)");
                c5.f8368d.setTypeface(N1.k.f3913g.w());
                c5.f8368d.setText(getString(com.uptodown.R.string.select_downloads_path));
                for (final Map.Entry entry : hashMap.entrySet()) {
                    c2.E0 c6 = c2.E0.c(getLayoutInflater());
                    kotlin.jvm.internal.m.d(c6, "inflate(...)");
                    c6.getRoot().setId(((Number) entry.getKey()).intValue());
                    c6.f7227b.setTypeface(N1.k.f3913g.x());
                    c6.f7227b.setText((CharSequence) entry.getValue());
                    c6.getRoot().setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view) {
                            C1600m1.h3(C1600m1.this, entry, view);
                        }
                    });
                    if (((Number) entry.getKey()).intValue() == i4) {
                        c6.f7227b.setChecked(true);
                    }
                    c5.f8366b.addView(c6.getRoot());
                }
                c5.f8367c.setTypeface(N1.k.f3913g.w());
                c5.f8367c.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        C1600m1.i3(C1600m1.this, view);
                    }
                });
                AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
                builder.setView(c5.getRoot());
                builder.setCancelable(true);
                I6(builder);
            }
        }
        i4 = 0;
        HashMap hashMap2 = new HashMap();
        kotlin.jvm.internal.F f42 = kotlin.jvm.internal.F.f21884a;
        String string3 = getString(com.uptodown.R.string.internal_memory_free);
        kotlin.jvm.internal.m.d(string3, "getString(...)");
        W1.i iVar3 = new W1.i();
        u2.y yVar2 = new u2.y();
        FragmentActivity requireActivity32 = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity32, "requireActivity(...)");
        String format3 = String.format(string3, Arrays.copyOf(new Object[]{iVar3.c(yVar2.e(requireActivity32).getFreeSpace())}, 1));
        kotlin.jvm.internal.m.d(format3, "format(...)");
        hashMap2.put(0, format3);
        String string22 = getString(com.uptodown.R.string.sd_card_free);
        kotlin.jvm.internal.m.d(string22, "getString(...)");
        W1.i iVar22 = new W1.i();
        ArrayList arrayList22 = this.f19652f;
        kotlin.jvm.internal.m.b(arrayList22);
        String format22 = String.format(string22, Arrays.copyOf(new Object[]{iVar22.c(((T1.g) AbstractC0692o.H(arrayList22)).a())}, 1));
        kotlin.jvm.internal.m.d(format22, "format(...)");
        hashMap2.put(1, format22);
        C0966x c52 = C0966x.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c52, "inflate(...)");
        c52.f8368d.setTypeface(N1.k.f3913g.w());
        c52.f8368d.setText(getString(com.uptodown.R.string.select_downloads_path));
        while (r1.hasNext()) {
        }
        c52.f8367c.setTypeface(N1.k.f3913g.w());
        c52.f8367c.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.i3(C1600m1.this, view);
            }
        });
        AlertDialog.Builder builder2 = new AlertDialog.Builder(getContext());
        builder2.setView(c52.getRoot());
        builder2.setCancelable(true);
        I6(builder2);
    }

    public static final void g4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.U3().Y().setValue(1);
        c1600m1.s3(context);
    }

    private final void g5() {
        if (requireActivity().isFinishing()) {
            return;
        }
        Intent intent = new Intent(requireActivity(), (Class<?>) OrganizationActivity.class);
        intent.putExtra("organizationID", P3().Q());
        intent.putExtra("organizationName", P3().g());
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        startActivity(intent, aVar.a(requireActivity));
    }

    public final void g6(Context context) {
        String string;
        R6();
        C2494c c2494c = C2494c.f24034a;
        ProgressBar pbProgressAppDetail = Q3().f7739O.f7870h;
        kotlin.jvm.internal.m.d(pbProgressAppDetail, "pbProgressAppDetail");
        ImageView ivLogoAppDetail = Q3().f7739O.f7864b;
        kotlin.jvm.internal.m.d(ivLogoAppDetail, "ivLogoAppDetail");
        c2494c.c(pbProgressAppDetail, ivLogoAppDetail);
        U3().P().setValue(-1);
        if (new P1.a(context).m()) {
            string = context.getString(com.uptodown.R.string.option_button_install);
        } else {
            String U4 = P3().U();
            if (U4 == null || U4.length() == 0) {
                string = context.getString(com.uptodown.R.string.option_button_install);
            } else {
                String v02 = P3().v0("try");
                string = (v02 == null || v02.length() == 0) ? context.getString(com.uptodown.R.string.option_button_install) : v02;
            }
        }
        if (((Boolean) U3().d0().getValue()).booleanValue() && P3().H0()) {
            Q3().f7736L.f8043b.setVisibility(0);
        } else {
            Q3().f7736L.f8043b.setVisibility(8);
        }
        Q3().f7736L.f8050i.setVisibility(8);
        Q3().f7739O.f7867e.setVisibility(0);
        Q3().f7739O.f7865c.setVisibility(8);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        Z5(tvDownloadCancelBad, string);
        Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.h6(C1600m1.this, view);
            }
        });
        Q3().f7732H.f7168b.setVisibility(4);
        TextView tvStatusDownload = Q3().f7732H.f7180n;
        kotlin.jvm.internal.m.d(tvStatusDownload, "tvStatusDownload");
        Z5(tvStatusDownload, string);
        if (U3().Q().getValue() == null) {
            W3(com.uptodown.R.id.action_uninstall);
            W3(com.uptodown.R.id.action_app_installed_details);
        }
    }

    public static final void h3(C1600m1 c1600m1, Map.Entry entry, View view) {
        c1600m1.U3().b0().setValue(entry.getKey());
    }

    public static final void h4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.U3().Y().setValue(2);
        c1600m1.s3(context);
    }

    public final void h5(long j4) {
        if (getActivity() != null && (getActivity() instanceof MainActivity)) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
            ((MainActivity) activity).D2(j4);
        } else {
            if (getActivity() == null || !(getActivity() instanceof AppDetailActivity)) {
                return;
            }
            FragmentActivity activity2 = getActivity();
            kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.AppDetailActivity");
            ((AppDetailActivity) activity2).D2(j4);
        }
    }

    public static final void h6(C1600m1 c1600m1, View view) {
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        c1600m1.E3(requireContext);
    }

    public static final void i3(C1600m1 c1600m1, View view) {
        if (((Number) c1600m1.U3().b0().getValue()).intValue() >= 0) {
            a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            c0246a.W0(requireContext, ((Number) c1600m1.U3().b0().getValue()).intValue() > 0);
            FragmentActivity activity = c1600m1.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
            c1600m1.k6();
        }
    }

    public static final void i4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.U3().Y().setValue(3);
        c1600m1.s3(context);
    }

    public final void i5(C1762f c1762f) {
        if (getActivity() != null && (getActivity() instanceof MainActivity)) {
            FragmentActivity activity = getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
            ((MainActivity) activity).D2(c1762f.e());
        } else {
            if (getActivity() == null || !(getActivity() instanceof AppDetailActivity)) {
                return;
            }
            FragmentActivity activity2 = getActivity();
            kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.AppDetailActivity");
            ((AppDetailActivity) activity2).D2(c1762f.e());
        }
    }

    public final void i6(C1772p c1772p) {
        S6();
        C2494c c2494c = C2494c.f24034a;
        ProgressBar pbProgressAppDetail = Q3().f7739O.f7870h;
        kotlin.jvm.internal.m.d(pbProgressAppDetail, "pbProgressAppDetail");
        ImageView ivLogoAppDetail = Q3().f7739O.f7864b;
        kotlin.jvm.internal.m.d(ivLogoAppDetail, "ivLogoAppDetail");
        c2494c.e(pbProgressAppDetail, ivLogoAppDetail);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        String string = getString(com.uptodown.R.string.option_button_cancel);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        a6(tvDownloadCancelBad, string);
        Q3().f7736L.f8050i.setVisibility(8);
        Q3().f7732H.f7169c.setVisibility(8);
        U3().P().setValue(5);
        if (c1772p == null && getContext() != null) {
            v.a aVar = u2.v.f23867v;
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            u2.v a5 = aVar.a(requireContext);
            a5.a();
            String R4 = P3().R();
            kotlin.jvm.internal.m.b(R4);
            C1772p g02 = a5.g0(R4, P3().y0());
            a5.i();
            c1772p = g02;
        }
        if (c1772p == null) {
            Q3().f7739O.f7870h.setIndeterminate(true);
            Q3().f7732H.f7171e.setIndeterminate(true);
            return;
        }
        Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.j6(C1600m1.this, view);
            }
        });
        Q3().f7732H.f7168b.setVisibility(0);
        if (F4(this, null, 1, null)) {
            TextView tvPauseBad = Q3().f7736L.f8051j;
            kotlin.jvm.internal.m.d(tvPauseBad, "tvPauseBad");
            String string2 = getString(com.uptodown.R.string.action_pause);
            kotlin.jvm.internal.m.d(string2, "getString(...)");
            a6(tvPauseBad, string2);
            String valueOf = String.valueOf(c1772p.x());
            if (isAdded() && getContext() != null) {
                valueOf = valueOf + requireContext().getString(com.uptodown.R.string.percent);
            }
            Q3().f7739O.f7870h.setIndeterminate(false);
            Q3().f7739O.f7870h.setProgress(c1772p.x());
            if (c1772p.z() > 0) {
                TextView textView = Q3().f7739O.f7882t;
                Integer valueOf2 = Integer.valueOf(c1772p.x());
                W1.i iVar = new W1.i();
                long z4 = c1772p.z();
                Context requireContext2 = requireContext();
                kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                textView.setText(getString(com.uptodown.R.string.percent_of_total_size, valueOf2, iVar.d(z4, requireContext2)));
            }
            Q3().f7732H.f7171e.setIndeterminate(false);
            Q3().f7732H.f7177k.setVisibility(0);
            Q3().f7732H.f7175i.setVisibility(8);
            Q3().f7732H.f7177k.setText(valueOf);
            TextView textView2 = Q3().f7732H.f7178l;
            W1.i iVar2 = new W1.i();
            long y4 = c1772p.y();
            Context requireContext3 = requireContext();
            kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
            textView2.setText(iVar2.d(y4, requireContext3));
            Q3().f7732H.f7171e.setProgress(c1772p.x());
        } else {
            Q3().f7739O.f7882t.setText(getString(com.uptodown.R.string.status_download_update_pending));
            Q3().f7739O.f7870h.setIndeterminate(true);
            Q3().f7732H.f7171e.setIndeterminate(true);
            Q3().f7732H.f7175i.setVisibility(0);
            Q3().f7732H.f7177k.setVisibility(8);
        }
        TextView textView3 = Q3().f7732H.f7179m;
        kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.f21884a;
        W1.i iVar3 = new W1.i();
        long z5 = c1772p.z();
        Context requireContext4 = requireContext();
        kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
        String format = String.format("/%s", Arrays.copyOf(new Object[]{iVar3.d(z5, requireContext4)}, 1));
        kotlin.jvm.internal.m.d(format, "format(...)");
        textView3.setText(format);
    }

    public final void j3(String str) {
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
        C0951p c5 = C0951p.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        TextView textView = c5.f8219d;
        k.a aVar = N1.k.f3913g;
        textView.setTypeface(aVar.x());
        c5.f8219d.setText(str);
        c5.f8218c.setVisibility(8);
        c5.f8220e.setTypeface(aVar.w());
        c5.f8220e.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.k3(C1600m1.this, view);
            }
        });
        builder.setView(c5.getRoot());
        builder.setCancelable(false);
        I6(builder);
    }

    public static final void j4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.U3().Y().setValue(4);
        c1600m1.s3(context);
    }

    private final void j5() {
        if (requireActivity().isFinishing()) {
            return;
        }
        Intent intent = new Intent(requireActivity(), (Class<?>) ReviewsActivity.class);
        intent.putExtra("appInfo", P3());
        intent.putExtra("myReview", (Parcelable) U3().R().getValue());
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        startActivity(intent, aVar.a(requireActivity));
    }

    public static final void j6(C1600m1 c1600m1, View view) {
        c1600m1.Z2();
    }

    public static final void k3(C1600m1 c1600m1, View view) {
        if (c1600m1.getActivity() == null || c1600m1.requireActivity().isFinishing()) {
            return;
        }
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public static final boolean k4(C1600m1 c1600m1, MenuItem item) {
        FragmentActivity activity;
        kotlin.jvm.internal.m.e(item, "item");
        if (!UptodownApp.f17145F.a0()) {
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_search) {
            c1600m1.k5();
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_share) {
            c1600m1.E6();
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_antivirus_report) {
            c1600m1.m5();
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_uninstall) {
            String R4 = c1600m1.P3().R();
            if (R4 == null || R4.length() == 0 || (activity = c1600m1.getActivity()) == null) {
                return true;
            }
            N1.j jVar = new N1.j(activity);
            String R5 = c1600m1.P3().R();
            kotlin.jvm.internal.m.b(R5);
            jVar.h(R5);
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_wishlist) {
            c1600m1.u2();
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_recommended) {
            c1600m1.t2();
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_exclude) {
            c1600m1.s2();
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_app_details_settings) {
            c1600m1.T4();
            return true;
        }
        if (item.getItemId() == com.uptodown.R.id.action_app_installed_details) {
            c1600m1.U4();
            return true;
        }
        if (item.getItemId() != com.uptodown.R.id.action_remote_install) {
            return false;
        }
        if (!(c1600m1.U3().j0().getValue() instanceof H.c)) {
            return true;
        }
        Object value = c1600m1.U3().j0().getValue();
        kotlin.jvm.internal.m.c(value, "null cannot be cast to non-null type com.uptodown.util.Result.Success<java.util.ArrayList<com.uptodown.models.UserRemoteDevice>>");
        c1600m1.L6((ArrayList) ((H.c) value).a());
        return true;
    }

    private final void k5() {
        Intent intent = new Intent(getContext(), (Class<?>) SearchActivity.class);
        intent.setFlags(603979776);
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        startActivity(intent, aVar.a(requireActivity));
    }

    private final void k6() {
        i6(null);
        U3().P().setValue(5);
        long T32 = T3();
        u2.y yVar = new u2.y();
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        File e5 = yVar.e(requireContext);
        if (!e5.exists() && !e5.mkdirs()) {
            String string = getString(com.uptodown.R.string.error_cant_create_dir);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            j3(string);
            return;
        }
        if (!V3()) {
            Context requireContext2 = requireContext();
            kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
            o6(requireContext2, null);
            l3();
            return;
        }
        u2.p pVar = new u2.p();
        Q3().f7739O.f7882t.setVisibility(0);
        Q3().f7739O.f7882t.setText(getString(com.uptodown.R.string.status_download_update_pending));
        Q3().f7739O.f7870h.setProgress(0);
        Q3().f7732H.f7175i.setVisibility(0);
        Q3().f7732H.f7177k.setVisibility(8);
        Q3().f7732H.f7178l.setText(com.uptodown.R.string.zero_mb);
        TextView textView = Q3().f7732H.f7179m;
        kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.f21884a;
        W1.i iVar = new W1.i();
        Context requireContext3 = requireContext();
        kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
        String format = String.format("/%s", Arrays.copyOf(new Object[]{iVar.d(T32, requireContext3), requireContext()}, 2));
        kotlin.jvm.internal.m.d(format, "format(...)");
        textView.setText(format);
        Q3().f7732H.f7171e.setProgress(0);
        AlertDialog alertDialog = this.f19651e;
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        AlertDialog e6 = pVar.e(alertDialog, requireActivity);
        this.f19651e = e6;
        if (e6 == null) {
            S5();
            i6(null);
        }
    }

    private final void l3() {
        u2.y yVar = new u2.y();
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        File e5 = yVar.e(requireContext);
        u2.y yVar2 = new u2.y();
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        long j4 = yVar2.j(requireContext2, e5);
        long totalSpace = e5.getTotalSpace();
        Context requireContext3 = requireContext();
        kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
        String d5 = new W1.i().d((long) (T3() * 2.25d), requireContext3);
        long j5 = ((totalSpace - j4) * 100) / totalSpace;
        AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
        c2.g1 c5 = c2.g1.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        TextView textView = c5.f8039e;
        k.a aVar = N1.k.f3913g;
        textView.setTypeface(aVar.x());
        c5.f8036b.setProgress((int) j5);
        c5.f8040f.setTypeface(aVar.x());
        c5.f8040f.setText(getString(com.uptodown.R.string.no_storage_text, d5));
        c5.f8038d.setTypeface(aVar.w());
        c5.f8038d.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.m3(C1600m1.this, view);
            }
        });
        builder.setView(c5.getRoot());
        I6(builder);
    }

    public static final void l4(C1600m1 c1600m1, Context context, View view) {
        c1600m1.U3().Y().setValue(5);
        c1600m1.s3(context);
    }

    private final void l5(g2.L l4) {
        if (UptodownApp.f17145F.a0()) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            C0895l c0895l = new C0895l(requireContext, LifecycleOwnerKt.getLifecycleScope(this));
            String l5 = l4.l();
            kotlin.jvm.internal.m.b(l5);
            c0895l.c(l5, new D());
        }
    }

    public final void l6(String str) {
        X3();
        Q3().f7739O.f7882t.setText(str);
        Q3().f7732H.f7178l.setText(str);
    }

    public static final void m3(C1600m1 c1600m1, View view) {
        Intent intent = new Intent(c1600m1.requireActivity(), (Class<?>) FreeUpSpaceActivity.class);
        intent.putExtra("appInfo", c1600m1.P3());
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = c1600m1.requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        c1600m1.startActivity(intent, aVar.a(requireActivity));
    }

    public static final void m4(C1600m1 c1600m1, View view) {
        c1600m1.j5();
    }

    private final void m5() {
        if (getActivity() == null || requireActivity().isFinishing()) {
            return;
        }
        U3().k0().setValue(Boolean.TRUE);
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        new b2.m(requireActivity, String.valueOf(P3().A()), P3().l0(), new E(), LifecycleOwnerKt.getLifecycleScope(this));
    }

    public final void m6() {
        R6();
        C2494c c2494c = C2494c.f24034a;
        ProgressBar pbProgressAppDetail = Q3().f7739O.f7870h;
        kotlin.jvm.internal.m.d(pbProgressAppDetail, "pbProgressAppDetail");
        ImageView ivLogoAppDetail = Q3().f7739O.f7864b;
        kotlin.jvm.internal.m.d(ivLogoAppDetail, "ivLogoAppDetail");
        c2494c.c(pbProgressAppDetail, ivLogoAppDetail);
        Q3().f7739O.f7867e.setVisibility(0);
        Q3().f7739O.f7865c.setVisibility(8);
        Q3().f7736L.f8043b.setVisibility(8);
        Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.n6(C1600m1.this, view);
            }
        });
        U3().P().setValue(3);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        String string = getString(com.uptodown.R.string.option_button_install);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        Z5(tvDownloadCancelBad, string);
        TextView tvStatusDownload = Q3().f7732H.f7180n;
        kotlin.jvm.internal.m.d(tvStatusDownload, "tvStatusDownload");
        String string2 = getString(com.uptodown.R.string.option_button_install);
        kotlin.jvm.internal.m.d(string2, "getString(...)");
        Z5(tvStatusDownload, string2);
        W3(com.uptodown.R.id.action_app_installed_details);
        W3(com.uptodown.R.id.action_uninstall);
    }

    public final void n3() {
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
        if (getContext() != null) {
            C0945m c5 = C0945m.c(getLayoutInflater());
            kotlin.jvm.internal.m.d(c5, "inflate(...)");
            TextView textView = c5.f8146d;
            k.a aVar = N1.k.f3913g;
            textView.setTypeface(aVar.w());
            c5.f8145c.setTypeface(aVar.x());
            TextView textView2 = c5.f8145c;
            u2.p pVar = new u2.p();
            String string = getString(com.uptodown.R.string.pre_register_success, P3().M());
            kotlin.jvm.internal.m.d(string, "getString(...)");
            String M4 = P3().M();
            kotlin.jvm.internal.m.b(M4);
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            textView2.setText(pVar.d(string, M4, requireContext));
            c5.f8144b.setTypeface(aVar.w());
            c5.f8144b.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.o3(C1600m1.this, view);
                }
            });
            AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
            builder.setView(c5.getRoot());
            builder.setCancelable(true);
            I6(builder);
        }
    }

    public static final void n4(C1600m1 c1600m1, View view) {
        c1600m1.Y4();
    }

    private final void n5(Context context) {
        String w4;
        String V4;
        if (new C2445m().v(P3().R(), context)) {
            Drawable k4 = u2.I.f23820a.k(context, P3().R());
            Q3().f7739O.f7864b.setImageDrawable(k4);
            Q3().f7722C.f7848g.setImageDrawable(k4);
        } else {
            String D4 = P3().D();
            if (D4 == null || D4.length() == 0) {
                Q3().f7739O.f7864b.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_app_icon_placeholder));
                Q3().f7722C.f7848g.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_app_icon_placeholder));
            } else {
                com.squareup.picasso.w l4 = com.squareup.picasso.s.h().l(P3().F()).l(com.uptodown.R.drawable.shape_bg_placeholder);
                UptodownApp.a aVar = UptodownApp.f17145F;
                l4.n(aVar.h0(context)).j(Q3().f7739O.f7864b, new F(context));
                com.squareup.picasso.s.h().l(P3().G()).l(com.uptodown.R.drawable.shape_bg_placeholder).n(aVar.h0(context)).i(Q3().f7722C.f7848g);
            }
        }
        String D5 = P3().D();
        if ((D5 == null || D5.length() == 0) && ((w4 = P3().w()) == null || w4.length() == 0)) {
            V6(context);
        }
        String M4 = P3().M();
        if (M4 != null && M4.length() != 0) {
            Q3().f7739O.f7880r.setText(P3().M());
            Q3().f7802z0.setText(context.getString(com.uptodown.R.string.similar_to_x, P3().M()));
        }
        String z02 = P3().z0();
        if (z02 != null && z02.length() != 0) {
            Q3().f7739O.f7886x.setText(P3().z0());
            Q3().f7739O.f7886x.setVisibility(0);
        }
        String U4 = P3().U();
        if (U4 != null && U4.length() != 0) {
            Q3().f7739O.f7881s.setText(P3().U());
            Q3().f7739O.f7881s.setVisibility(0);
        }
        String g4 = P3().g();
        if (g4 != null && g4.length() != 0) {
            Q3().f7739O.f7874l.setText(P3().g());
        }
        if (P3().l() == 1) {
            Q3().f7739O.f7875m.setVisibility(0);
        }
        String m02 = P3().m0();
        if (m02 == null || m02.length() == 0) {
            Q3().f7800y0.setVisibility(8);
        } else {
            Q3().f7800y0.setVisibility(0);
            k.a aVar2 = w2.k.f24048a;
            TextView tvShortDescAppDetail = Q3().f7800y0;
            kotlin.jvm.internal.m.d(tvShortDescAppDetail, "tvShortDescAppDetail");
            aVar2.a(tvShortDescAppDetail);
            TextView textView = Q3().f7800y0;
            C1770n.a aVar3 = C1770n.f20624f;
            String m03 = P3().m0();
            kotlin.jvm.internal.m.b(m03);
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            textView.setText(aVar3.m(m03, requireContext, this.f19657k));
        }
        String k5 = P3().k();
        if (k5 == null || k5.length() == 0) {
            Q3().f7734J.setVisibility(8);
        } else {
            k.a aVar4 = w2.k.f24048a;
            TextView tvDescAppDetail = Q3().f7760e0;
            kotlin.jvm.internal.m.d(tvDescAppDetail, "tvDescAppDetail");
            aVar4.a(tvDescAppDetail);
            if (getResources().getConfiguration().getLayoutDirection() == 1) {
                Q3().f7760e0.setTextDirection(2);
            }
            TextView textView2 = Q3().f7760e0;
            C1770n.a aVar5 = C1770n.f20624f;
            String k6 = P3().k();
            kotlin.jvm.internal.m.b(k6);
            Context requireContext2 = requireContext();
            kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
            textView2.setText(aVar5.m(k6, requireContext2, this.f19657k));
            Q3().f7734J.setVisibility(0);
            String n4 = P3().n();
            if (n4 == null || n4.length() == 0) {
                String t4 = P3().t();
                if (t4 != null && t4.length() != 0) {
                    TextView textView3 = Q3().f7766h0;
                    String t5 = P3().t();
                    kotlin.jvm.internal.m.b(t5);
                    Context requireContext3 = requireContext();
                    kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
                    textView3.setText(aVar5.m(t5, requireContext3, this.f19657k));
                    String s4 = P3().s();
                    if (s4 == null || s4.length() == 0) {
                        Q3().f7764g0.setVisibility(8);
                    } else {
                        Q3().f7764g0.setText(P3().s());
                    }
                    String r4 = P3().r();
                    if (r4 == null || r4.length() == 0) {
                        Q3().f7765h.setVisibility(8);
                    } else {
                        com.squareup.picasso.w l5 = com.squareup.picasso.s.h().l(P3().r()).l(com.uptodown.R.drawable.shape_bg_placeholder);
                        UptodownApp.a aVar6 = UptodownApp.f17145F;
                        Context requireContext4 = requireContext();
                        kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
                        l5.n(aVar6.h0(requireContext4)).i(Q3().f7765h);
                    }
                    if (P3().n0() == 1) {
                        Q3().f7768i0.setVisibility(0);
                    } else {
                        Q3().f7768i0.setVisibility(8);
                    }
                }
            } else {
                Q3().f7766h0.setText(P3().n());
                Q3().f7768i0.setVisibility(8);
                Q3().f7765h.setVisibility(8);
            }
        }
        String w02 = P3().w0();
        if (w02 == null || w02.length() == 0) {
            W3(com.uptodown.R.id.action_share);
        } else {
            K6(com.uptodown.R.id.action_share);
        }
        String o02 = P3().o0();
        if (o02 == null || o02.length() == 0) {
            W3(com.uptodown.R.id.action_antivirus_report);
            Q3().f7736L.f8045d.setVisibility(8);
        } else {
            K6(com.uptodown.R.id.action_antivirus_report);
            Q3().f7736L.f8045d.setVisibility(0);
        }
        String j02 = P3().j0();
        if (j02 == null || j02.length() == 0) {
            Q3().f7741Q.setVisibility(8);
        } else {
            Q3().f7741Q.setVisibility(0);
            Q3().f7796w0.setText(P3().j0());
        }
        if (P3().Y() == 0) {
            Q3().f7739O.f7873k.setVisibility(8);
            Q3().f7739O.f7887y.setVisibility(8);
        } else {
            Q3().f7739O.f7884v.setVisibility(0);
            Q3().f7739O.f7884v.setText(String.valueOf(P3().Y() / 10.0d));
            if (P3().Z() == 1) {
                Q3().f7739O.f7883u.setText(getString(com.uptodown.R.string.reviews_counter_single));
            } else {
                TextView textView4 = Q3().f7739O.f7883u;
                kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.f21884a;
                String string = getString(com.uptodown.R.string.reviews_counter_multiple);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                String format = String.format(string, Arrays.copyOf(new Object[]{new W1.i().b(P3().Z())}, 1));
                kotlin.jvm.internal.m.d(format, "format(...)");
                textView4.setText(format);
            }
        }
        if (!P3().K0() || (V4 = P3().V()) == null || V4.length() == 0) {
            Q3().f7739O.f7876n.setText(new W1.i().b(P3().q()));
            Q3().f7739O.f7877o.setText(getString(com.uptodown.R.string.more_info_downloads_label));
            String R4 = P3().R();
            if (R4 == null || R4.length() == 0) {
                Q3().f7793v.setVisibility(8);
            } else {
                Q3().f7778n0.setText(P3().R());
            }
            ArrayList p02 = P3().p0();
            if (p02 == null || p02.isEmpty()) {
                Q3().f7791u.setVisibility(8);
            } else {
                TextView textView5 = Q3().f7774l0;
                ArrayList p03 = P3().p0();
                kotlin.jvm.internal.m.b(p03);
                textView5.setText((CharSequence) AbstractC0692o.H(p03));
            }
            String S4 = P3().S();
            if (S4 == null || S4.length() == 0) {
                Q3().f7795w.setVisibility(8);
            } else {
                Q3().f7782p0.setText(getString(com.uptodown.R.string.pegi_plus, P3().S()));
            }
        } else {
            Q3().f7739O.f7876n.setText(P3().V());
            Q3().f7733I.setVisibility(8);
        }
        String H4 = P3().H();
        if (H4 == null || H4.length() == 0 || P3().K0()) {
            Q3().f7739O.f7868f.setVisibility(8);
        } else {
            Q3().f7739O.f7878p.setText(P3().H());
        }
        Q3().f7801z.f8073o.setText(String.valueOf(P3().Y() / 10.0d));
        if (P3().Z() == 1) {
            Q3().f7801z.f8074p.setText(getString(com.uptodown.R.string.comment_counter_single));
        } else {
            TextView textView6 = Q3().f7801z.f8074p;
            kotlin.jvm.internal.F f5 = kotlin.jvm.internal.F.f21884a;
            String string2 = getString(com.uptodown.R.string.reviews_counter_multiple);
            kotlin.jvm.internal.m.d(string2, "getString(...)");
            String format2 = String.format(string2, Arrays.copyOf(new Object[]{new W1.i().b(P3().Z())}, 1));
            kotlin.jvm.internal.m.d(format2, "format(...)");
            textView6.setText(format2);
        }
        Q3().f7801z.f8074p.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.o5(C1600m1.this, view);
            }
        });
        String N4 = P3().N();
        if (N4 == null || N4.length() == 0) {
            Q3().f7744T.getRoot().setVisibility(8);
        } else {
            Q3().f7744T.f8057d.setText(P3().N());
            Q3().f7744T.f8057d.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                @Override
                public final void onGlobalLayout() {
                    C1600m1.p5(C1600m1.this);
                }
            });
            Q3().f7744T.getRoot().setVisibility(0);
        }
        String t02 = P3().t0();
        if (t02 == null || t02.length() == 0) {
            String A02 = P3().A0();
            if (A02 != null && A02.length() != 0) {
                Q3().f7721B0.setText(P3().A0());
            }
        } else {
            Q3().f7721B0.setText(P3().t0());
        }
        C1780y b5 = C1780y.f20717f.b(context);
        if (b5 != null && b5.b() == P3().e() && !b5.g()) {
            b5.p(context);
        }
        if (kotlin.jvm.internal.m.a(P3().R(), requireContext().getPackageName()) || kotlin.jvm.internal.m.a(P3().R(), "com.uptodown.installer")) {
            Q3().f7783q.setVisibility(8);
        }
        ArrayList x02 = P3().x0();
        if (x02 == null || x02.isEmpty() || Q3().f7720B.getVisibility() != 8) {
            return;
        }
        Q3().f7720B.setVisibility(0);
        Q3().f7719A0.setTypeface(N1.k.f3913g.w());
        ArrayList x03 = P3().x0();
        kotlin.jvm.internal.m.b(x03);
        Iterator it = x03.iterator();
        kotlin.jvm.internal.m.d(it, "iterator(...)");
        while (it.hasNext()) {
            Object next = it.next();
            kotlin.jvm.internal.m.d(next, "next(...)");
            String str = (String) next;
            if (str.length() > 0) {
                c2.J0 c5 = c2.J0.c(getLayoutInflater());
                kotlin.jvm.internal.m.d(c5, "inflate(...)");
                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
                layoutParams.setMargins(0, (int) getResources().getDimension(com.uptodown.R.dimen.margin_m), 0, 0);
                c5.getRoot().setLayoutParams(layoutParams);
                c5.f7297c.setTypeface(N1.k.f3913g.x());
                c5.f7297c.setText(str);
                Q3().f7720B.addView(c5.getRoot());
            }
        }
    }

    public static final void n6(C1600m1 c1600m1, View view) {
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        c1600m1.E3(requireContext);
    }

    public static final void o3(C1600m1 c1600m1, View view) {
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public static final void o4(C1600m1 c1600m1, View view) {
        if (!UptodownApp.f17145F.a0() || c1600m1.U3().Q().getValue() == null) {
            return;
        }
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        N1.j jVar = new N1.j(requireContext);
        Object value = c1600m1.U3().Q().getValue();
        kotlin.jvm.internal.m.b(value);
        String o4 = ((C1760d) value).o();
        kotlin.jvm.internal.m.b(o4);
        jVar.h(o4);
    }

    public static final void o5(C1600m1 c1600m1, View view) {
        c1600m1.j5();
    }

    public final void o6(Context context, C1772p c1772p) {
        long j4;
        u2.y yVar = new u2.y();
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        File e5 = yVar.e(requireContext);
        u2.y yVar2 = new u2.y();
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        long j5 = yVar2.j(requireContext2, e5);
        try {
            j4 = e5.getTotalSpace();
        } catch (SecurityException unused) {
            j4 = 0;
        }
        if (j4 > 0) {
            Context requireContext3 = requireContext();
            kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
            String d5 = new W1.i().d(((long) (T3() * 2.25d)) - j5, requireContext3);
            long j6 = ((j4 - j5) * 100) / j4;
            TextView textView = Q3().f7731G0.f7955g;
            k.a aVar = N1.k.f3913g;
            textView.setTypeface(aVar.x());
            Q3().f7731G0.f7952d.setProgress((int) j6);
            Q3().f7731G0.f7956h.setTypeface(aVar.x());
            Q3().f7731G0.f7956h.setText(context.getString(com.uptodown.R.string.no_storage_text, d5));
            Q3().f7731G0.f7954f.setTypeface(aVar.w());
            Q3().f7731G0.f7954f.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.p6(C1600m1.this, view);
                }
            });
            Q3().f7731G0.getRoot().setVisibility(0);
        }
        if (c1772p == null || !c1772p.f()) {
            g6(context);
        } else {
            m6();
        }
    }

    private final void p3(final InterfaceC1665a interfaceC1665a) {
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
        if (getContext() != null) {
            C0951p c5 = C0951p.c(getLayoutInflater());
            kotlin.jvm.internal.m.d(c5, "inflate(...)");
            TextView textView = c5.f8219d;
            k.a aVar = N1.k.f3913g;
            textView.setTypeface(aVar.x());
            c5.f8219d.setText(getString(com.uptodown.R.string.resume_downloads_queue_dialog, P3().M()));
            c5.f8220e.setTypeface(aVar.w());
            c5.f8220e.setText(getString(com.uptodown.R.string.updates_button_resume));
            c5.f8220e.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.q3(InterfaceC1665a.this, this, view);
                }
            });
            c5.f8218c.setTypeface(aVar.w());
            TextView tvCancel = c5.f8218c;
            kotlin.jvm.internal.m.d(tvCancel, "tvCancel");
            w2.v.b(tvCancel);
            c5.f8218c.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.r3(C1600m1.this, view);
                }
            });
            AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
            builder.setView(c5.getRoot());
            builder.setCancelable(false);
            I6(builder);
        }
    }

    public static final void p4(C1600m1 c1600m1, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.B3();
        }
    }

    public static final void p5(C1600m1 c1600m1) {
        TextView tvWhatsNewContent = c1600m1.Q3().f7744T.f8057d;
        kotlin.jvm.internal.m.d(tvWhatsNewContent, "tvWhatsNewContent");
        if (w2.s.a(tvWhatsNewContent) || c1600m1.Q3().f7744T.f8057d.getMaxLines() > 6) {
            return;
        }
        c1600m1.Q3().f7744T.f8055b.setVisibility(8);
        c1600m1.Q3().f7744T.f8058e.setVisibility(8);
    }

    public static final void p6(C1600m1 c1600m1, View view) {
        Intent intent = new Intent(c1600m1.requireActivity(), (Class<?>) FreeUpSpaceActivity.class);
        intent.putExtra("appInfo", c1600m1.P3());
        UptodownApp.a aVar = UptodownApp.f17145F;
        FragmentActivity requireActivity = c1600m1.requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        c1600m1.startActivity(intent, aVar.a(requireActivity));
    }

    public static final void q3(InterfaceC1665a interfaceC1665a, C1600m1 c1600m1, View view) {
        interfaceC1665a.invoke();
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public static final void q4(C1600m1 c1600m1, View view) {
        if (!UptodownApp.f17145F.a0() || ((Boolean) c1600m1.U3().k0().getValue()).booleanValue()) {
            return;
        }
        c1600m1.m5();
    }

    private final View q5(C1775t c1775t, LinearLayout.LayoutParams layoutParams) {
        c2.D c5 = c2.D.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        c5.getRoot().setLayoutParams(layoutParams);
        TextView textView = c5.f7209c;
        k.a aVar = N1.k.f3913g;
        textView.setTypeface(aVar.w());
        c5.f7208b.setTypeface(aVar.x());
        c5.f7209c.setText(c1775t.b());
        c5.f7208b.setText(c1775t.a());
        c5.getRoot().setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.r5(view);
            }
        });
        LinearLayout root = c5.getRoot();
        kotlin.jvm.internal.m.d(root, "getRoot(...)");
        return root;
    }

    public final void q6(Context context) {
        T6();
        C2494c c2494c = C2494c.f24034a;
        ProgressBar pbProgressAppDetail = Q3().f7739O.f7870h;
        kotlin.jvm.internal.m.d(pbProgressAppDetail, "pbProgressAppDetail");
        ImageView ivLogoAppDetail = Q3().f7739O.f7864b;
        kotlin.jvm.internal.m.d(ivLogoAppDetail, "ivLogoAppDetail");
        c2494c.c(pbProgressAppDetail, ivLogoAppDetail);
        U3().P().setValue(0);
        C1764h h4 = P3().h();
        String string = (h4 == null || h4.i() != 1) ? context.getString(com.uptodown.R.string.open) : context.getString(com.uptodown.R.string.app_detail_play_button);
        Q3().f7732H.f7176j.setText(string);
        TextView tvOpenBad = Q3().f7736L.f8050i;
        kotlin.jvm.internal.m.d(tvOpenBad, "tvOpenBad");
        Z5(tvOpenBad, string);
        K6(com.uptodown.R.id.action_uninstall);
        K6(com.uptodown.R.id.action_app_installed_details);
        String R4 = P3().R();
        if (R4 == null || R4.length() == 0 || !m3.m.p(requireActivity().getPackageName(), P3().R(), true)) {
            return;
        }
        Q3().f7736L.f8044c.setVisibility(8);
        Q3().f7736L.f8050i.setVisibility(8);
        Q3().f7736L.f8045d.setVisibility(8);
        Q3().f7736L.f8046e.setVisibility(8);
        Q3().f7732H.f7176j.setVisibility(8);
        if (680 < P3().I()) {
            g2.P p4 = (g2.P) U3().h0().getValue();
            C1772p b5 = p4 != null ? p4.b(context) : null;
            if (b5 == null && P3().A() > 0) {
                u2.v a5 = u2.v.f23867v.a(context);
                a5.a();
                C1772p d02 = a5.d0(String.valueOf(P3().A()));
                a5.i();
                b5 = d02;
            }
            if (b5 != null && b5.f()) {
                z6(context);
                return;
            }
            r3.t h02 = U3().h0();
            String packageName = requireActivity().getPackageName();
            kotlin.jvm.internal.m.d(packageName, "getPackageName(...)");
            h02.setValue(new g2.P(packageName));
            g6(context);
        }
    }

    public static final void r3(C1600m1 c1600m1, View view) {
        FragmentActivity activity = c1600m1.getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
    }

    public static final void r4(C1600m1 c1600m1, View view) {
        c1600m1.t2();
    }

    public final void r6(C1772p c1772p) {
        i6(c1772p);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        String string = getString(com.uptodown.R.string.option_button_cancel);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        a6(tvDownloadCancelBad, string);
        TextView tvPauseBad = Q3().f7736L.f8051j;
        kotlin.jvm.internal.m.d(tvPauseBad, "tvPauseBad");
        String string2 = getString(com.uptodown.R.string.updates_button_resume);
        kotlin.jvm.internal.m.d(string2, "getString(...)");
        Z5(tvPauseBad, string2);
        Q3().f7732H.f7168b.setVisibility(8);
        Q3().f7732H.f7169c.setVisibility(0);
    }

    private final void s2() {
        String R4 = P3().R();
        if (R4 == null || R4.length() == 0 || getContext() == null) {
            return;
        }
        v.a aVar = u2.v.f23867v;
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        u2.v a5 = aVar.a(requireContext);
        a5.a();
        String R5 = P3().R();
        kotlin.jvm.internal.m.b(R5);
        C1760d W4 = a5.W(R5);
        if (W4 != null) {
            if (W4.e() == 0) {
                W4.N(1);
                C1760d.c w4 = W4.w();
                C1760d.c cVar = C1760d.c.f20520b;
                if (w4 != cVar) {
                    W4.c0(cVar);
                    String o4 = W4.o();
                    kotlin.jvm.internal.m.b(o4);
                    a5.P(o4);
                    u2.y yVar = new u2.y();
                    Context requireContext2 = requireContext();
                    kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                    yVar.b(requireContext2);
                }
            } else {
                W4.N(0);
            }
            a5.t1(W4);
            U3().Q().setValue(W4);
            C2445m c2445m = new C2445m();
            Context requireContext3 = requireContext();
            kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
            c2445m.E(requireContext3);
        }
        a5.i();
        L3();
    }

    private final void s3(final Context context) {
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
        if (k22 != null) {
            k22.dismiss();
        }
        final Drawable drawable = ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on);
        final Drawable drawable2 = ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off);
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        final C0964w c5 = C0964w.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        String G4 = P3().G();
        if (G4 == null || G4.length() == 0) {
            c5.f8336d.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_app_icon_placeholder));
        } else {
            com.squareup.picasso.s.h().l(P3().G()).n(UptodownApp.f17145F.h0(context)).i(c5.f8336d);
        }
        TextView textView = c5.f8342j;
        k.a aVar = N1.k.f3913g;
        textView.setTypeface(aVar.w());
        c5.f8342j.setText(P3().M());
        c5.f8335c.setText((CharSequence) U3().a0().getValue());
        int intValue = ((Number) U3().Y().getValue()).intValue();
        if (intValue == 1) {
            c5.f8337e.setImageDrawable(drawable);
            c5.f8338f.setImageDrawable(drawable2);
            c5.f8339g.setImageDrawable(drawable2);
            c5.f8340h.setImageDrawable(drawable2);
            c5.f8341i.setImageDrawable(drawable2);
        } else if (intValue == 2) {
            c5.f8337e.setImageDrawable(drawable);
            c5.f8338f.setImageDrawable(drawable);
            c5.f8339g.setImageDrawable(drawable2);
            c5.f8340h.setImageDrawable(drawable2);
            c5.f8341i.setImageDrawable(drawable2);
        } else if (intValue == 3) {
            c5.f8337e.setImageDrawable(drawable);
            c5.f8338f.setImageDrawable(drawable);
            c5.f8339g.setImageDrawable(drawable);
            c5.f8340h.setImageDrawable(drawable2);
            c5.f8341i.setImageDrawable(drawable2);
        } else if (intValue == 4) {
            c5.f8337e.setImageDrawable(drawable);
            c5.f8338f.setImageDrawable(drawable);
            c5.f8339g.setImageDrawable(drawable);
            c5.f8340h.setImageDrawable(drawable);
            c5.f8341i.setImageDrawable(drawable2);
        } else if (intValue != 5) {
            c5.f8337e.setImageDrawable(drawable2);
            c5.f8338f.setImageDrawable(drawable2);
            c5.f8339g.setImageDrawable(drawable2);
            c5.f8340h.setImageDrawable(drawable2);
            c5.f8341i.setImageDrawable(drawable2);
        } else {
            c5.f8337e.setImageDrawable(drawable);
            c5.f8338f.setImageDrawable(drawable);
            c5.f8339g.setImageDrawable(drawable);
            c5.f8340h.setImageDrawable(drawable);
            c5.f8341i.setImageDrawable(drawable);
        }
        c5.f8337e.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.t3(C1600m1.this, c5, drawable, drawable2, view);
            }
        });
        c5.f8338f.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.u3(C1600m1.this, c5, drawable, drawable2, view);
            }
        });
        c5.f8339g.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.v3(C1600m1.this, c5, drawable, drawable2, view);
            }
        });
        c5.f8340h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.w3(C1600m1.this, c5, drawable, drawable2, view);
            }
        });
        c5.f8341i.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.x3(C1600m1.this, c5, drawable, view);
            }
        });
        c5.f8335c.setTypeface(aVar.x());
        if (U3().R().getValue() != null) {
            Object value = U3().R().getValue();
            kotlin.jvm.internal.m.b(value);
            String i4 = ((g2.L) value).i();
            if (i4 != null && i4.length() != 0) {
                EditText editText = c5.f8335c;
                Object value2 = U3().R().getValue();
                kotlin.jvm.internal.m.b(value2);
                editText.setText(String.valueOf(((g2.L) value2).i()));
            }
            Object value3 = U3().R().getValue();
            kotlin.jvm.internal.m.b(value3);
            if (((g2.L) value3).h() >= 1) {
                c5.f8337e.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
            }
            Object value4 = U3().R().getValue();
            kotlin.jvm.internal.m.b(value4);
            if (((g2.L) value4).h() >= 2) {
                c5.f8338f.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
            }
            Object value5 = U3().R().getValue();
            kotlin.jvm.internal.m.b(value5);
            if (((g2.L) value5).h() >= 3) {
                c5.f8339g.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
            }
            Object value6 = U3().R().getValue();
            kotlin.jvm.internal.m.b(value6);
            if (((g2.L) value6).h() >= 4) {
                c5.f8340h.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
            }
            Object value7 = U3().R().getValue();
            kotlin.jvm.internal.m.b(value7);
            if (((g2.L) value7).h() == 5) {
                c5.f8341i.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
            }
        }
        c5.f8344l.setTypeface(aVar.w());
        c5.f8344l.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.y3(context, this, c5, view);
            }
        });
        c5.f8343k.setTypeface(aVar.w());
        c5.f8343k.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.z3(C1600m1.this, c5, view);
            }
        });
        builder.setView(c5.getRoot());
        FragmentActivity activity2 = getActivity();
        kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        AlertDialog k23 = ((AbstractActivityC1500a) activity2).k2();
        if (k23 != null) {
            k23.setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public final void onDismiss(DialogInterface dialogInterface) {
                    C1600m1.A3(C1600m1.this, context, dialogInterface);
                }
            });
        }
        I6(builder);
    }

    public static final void s4(C1600m1 c1600m1, View view) {
        c1600m1.u2();
    }

    public final void s5(ArrayList arrayList) {
        if (arrayList.isEmpty()) {
            return;
        }
        int dimension = (int) getResources().getDimension(com.uptodown.R.dimen.margin_m);
        int dimension2 = (int) getResources().getDimension(com.uptodown.R.dimen.margin_l);
        Q3().f7770j0.setVisibility(0);
        int size = arrayList.size();
        for (int i4 = 0; i4 < size; i4++) {
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
            if (i4 == AbstractC0692o.j(arrayList)) {
                layoutParams.setMargins(0, dimension, 0, dimension2);
            } else {
                layoutParams.setMargins(0, dimension, 0, dimension);
            }
            LinearLayout linearLayout = Q3().f7785r;
            Object obj = arrayList.get(i4);
            kotlin.jvm.internal.m.d(obj, "get(...)");
            linearLayout.addView(q5((C1775t) obj, layoutParams));
        }
    }

    public final void s6() {
        U6();
        S.b bVar = g2.S.f20411m;
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        if (bVar.e(requireContext) == null) {
            TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
            kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
            String string = getString(com.uptodown.R.string.pre_registration_title);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            Z5(tvDownloadCancelBad, string);
            Q3().f7732H.f7181o.setText(getString(com.uptodown.R.string.pre_registration_title));
            Q3().f7732H.f7170d.setVisibility(0);
            TextView tvDownloadCancelBad2 = Q3().f7736L.f8049h;
            kotlin.jvm.internal.m.d(tvDownloadCancelBad2, "tvDownloadCancelBad");
            a5(tvDownloadCancelBad2);
            RelativeLayout rlStatusPreRegister = Q3().f7732H.f7174h;
            kotlin.jvm.internal.m.d(rlStatusPreRegister, "rlStatusPreRegister");
            a5(rlStatusPreRegister);
        } else {
            U2();
        }
        Q3().f7739O.f7867e.setVisibility(0);
        Q3().f7739O.f7865c.setVisibility(8);
        Q3().f7739O.f7877o.setVisibility(8);
        Q3().f7736L.f8045d.setVisibility(8);
        Q3().f7797x.setVisibility(8);
        W3(com.uptodown.R.id.action_antivirus_report);
        W3(com.uptodown.R.id.action_uninstall);
    }

    private final void t2() {
        if (getContext() != null) {
            S.b bVar = g2.S.f20411m;
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            if (bVar.e(requireContext) == null) {
                Z4();
                return;
            }
            if (P3().g0() == 1) {
                C1643s1 U32 = U3();
                Context requireContext2 = requireContext();
                kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                U32.r0(requireContext2, P3().e());
                return;
            }
            C1643s1 U33 = U3();
            Context requireContext3 = requireContext();
            kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
            U33.q0(requireContext3, P3().e());
        }
    }

    public static final void t3(C1600m1 c1600m1, C0964w c0964w, Drawable drawable, Drawable drawable2, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.U3().Y().setValue(1);
            c0964w.f8337e.setImageDrawable(drawable);
            c0964w.f8338f.setImageDrawable(drawable2);
            c0964w.f8339g.setImageDrawable(drawable2);
            c0964w.f8340h.setImageDrawable(drawable2);
            c0964w.f8341i.setImageDrawable(drawable2);
        }
    }

    public final void t5(ArrayList arrayList) {
        LinearLayout llFloatingCategoriesAppDetail = Q3().f7787s;
        kotlin.jvm.internal.m.d(llFloatingCategoriesAppDetail, "llFloatingCategoriesAppDetail");
        if (llFloatingCategoriesAppDetail.getChildCount() == 0) {
            Q3().f7772k0.setTypeface(N1.k.f3913g.w());
            if (getActivity() != null) {
                HorizontalScrollView horizontalScrollView = new HorizontalScrollView(requireContext());
                horizontalScrollView.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
                horizontalScrollView.setHorizontalScrollBarEnabled(false);
                LinearLayout linearLayout = new LinearLayout(requireContext());
                linearLayout.setOrientation(0);
                linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
                horizontalScrollView.addView(linearLayout);
                Q3().f7787s.addView(horizontalScrollView);
                Iterator it = arrayList.iterator();
                kotlin.jvm.internal.m.d(it, "iterator(...)");
                while (it.hasNext()) {
                    Object next = it.next();
                    kotlin.jvm.internal.m.d(next, "next(...)");
                    C1764h c1764h = (C1764h) next;
                    int dimension = (int) getResources().getDimension(com.uptodown.R.dimen.margin_m);
                    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
                    if (kotlin.jvm.internal.m.a(c1764h, AbstractC0692o.P(arrayList))) {
                        layoutParams.setMargins(dimension, 0, dimension, 0);
                    } else {
                        layoutParams.setMargins(dimension, 0, 0, 0);
                    }
                    linearLayout.addView(u5(c1764h, layoutParams));
                }
            }
            Q3().f7789t.setVisibility(0);
        }
    }

    public final void t6(Context context) {
        Q3().f7739O.f7886x.setVisibility(8);
        Q3().f7739O.f7866d.setVisibility(8);
        if (U3().Q().getValue() != null) {
            q6(context);
        } else {
            String f02 = P3().f0();
            if (f02 == null || f02.length() == 0) {
                String string = getString(com.uptodown.R.string.app_detail_not_available);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                f6(string);
            } else {
                String f03 = P3().f0();
                kotlin.jvm.internal.m.b(f03);
                f6(f03);
            }
        }
        Q3().f7736L.f8045d.setVisibility(8);
        W3(com.uptodown.R.id.action_antivirus_report);
    }

    private final void u2() {
        if (getContext() != null) {
            S.b bVar = g2.S.f20411m;
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            if (bVar.e(requireContext) == null) {
                Z4();
                return;
            }
            if (P3().D0() == 1) {
                C1643s1 U32 = U3();
                Context requireContext2 = requireContext();
                kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                U32.y0(requireContext2, P3().e());
                return;
            }
            C1643s1 U33 = U3();
            Context requireContext3 = requireContext();
            kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
            U33.x0(requireContext3, P3().e());
        }
    }

    public static final void u3(C1600m1 c1600m1, C0964w c0964w, Drawable drawable, Drawable drawable2, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.U3().Y().setValue(2);
            c0964w.f8337e.setImageDrawable(drawable);
            c0964w.f8338f.setImageDrawable(drawable);
            c0964w.f8339g.setImageDrawable(drawable2);
            c0964w.f8340h.setImageDrawable(drawable2);
            c0964w.f8341i.setImageDrawable(drawable2);
        }
    }

    public static final void u4(C1600m1 c1600m1, CompoundButton compoundButton, boolean z4) {
        C1643s1 U32 = c1600m1.U3();
        Context requireContext = c1600m1.requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        U32.w0(requireContext, c1600m1.P3().e(), z4);
    }

    private final View u5(final C1764h c1764h, LinearLayout.LayoutParams layoutParams) {
        C0925c c5 = C0925c.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        c5.getRoot().setLayoutParams(layoutParams);
        c5.getRoot().setTypeface(N1.k.f3913g.w());
        c5.getRoot().setText(String.valueOf(c1764h.d()));
        c5.getRoot().setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.v5(C1600m1.this, c1764h, view);
            }
        });
        TextView root = c5.getRoot();
        kotlin.jvm.internal.m.d(root, "getRoot(...)");
        return root;
    }

    private final void u6() {
        R6();
        U3().P().setValue(4);
        Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.v6(C1600m1.this, view);
            }
        });
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        String string = getString(com.uptodown.R.string.option_button_cancel);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        a6(tvDownloadCancelBad, string);
        TextView tvPauseBad = Q3().f7736L.f8051j;
        kotlin.jvm.internal.m.d(tvPauseBad, "tvPauseBad");
        String string2 = getString(com.uptodown.R.string.updates_button_resume);
        kotlin.jvm.internal.m.d(string2, "getString(...)");
        Z5(tvPauseBad, string2);
        TextView tvStatusDownload = Q3().f7732H.f7180n;
        kotlin.jvm.internal.m.d(tvStatusDownload, "tvStatusDownload");
        String string3 = getString(com.uptodown.R.string.updates_button_resume);
        kotlin.jvm.internal.m.d(string3, "getString(...)");
        Z5(tvStatusDownload, string3);
    }

    public final void v2(View view) {
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view2) {
                C1600m1.w2(C1600m1.this, view2);
            }
        });
    }

    public static final void v3(C1600m1 c1600m1, C0964w c0964w, Drawable drawable, Drawable drawable2, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.U3().Y().setValue(3);
            c0964w.f8337e.setImageDrawable(drawable);
            c0964w.f8338f.setImageDrawable(drawable);
            c0964w.f8339g.setImageDrawable(drawable);
            c0964w.f8340h.setImageDrawable(drawable2);
            c0964w.f8341i.setImageDrawable(drawable2);
        }
    }

    public static final void v4(C1600m1 c1600m1, Context context, AppBarLayout appBarLayout, int i4) {
        kotlin.jvm.internal.m.e(appBarLayout, "appBarLayout");
        if (Math.abs(i4) == appBarLayout.getTotalScrollRange()) {
            c1600m1.U3().g0().setValue(Boolean.TRUE);
        } else if (i4 == 0) {
            c1600m1.U3().g0().setValue(Boolean.FALSE);
            c1600m1.W6(context);
        } else {
            c1600m1.U3().g0().setValue(Boolean.FALSE);
            c1600m1.V6(context);
        }
    }

    public static final void v5(C1600m1 c1600m1, C1764h c1764h, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.V4(c1764h);
        }
    }

    public static final void v6(C1600m1 c1600m1, View view) {
        c1600m1.Z2();
    }

    public static final void w2(C1600m1 c1600m1, View view) {
        if (UptodownApp.f17145F.a0()) {
            C1643s1 U32 = c1600m1.U3();
            Context requireContext = c1600m1.requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            long e5 = c1600m1.P3().e();
            String M4 = c1600m1.P3().M();
            kotlin.jvm.internal.m.b(M4);
            U32.t(requireContext, e5, M4, c1600m1.P3().G(), System.currentTimeMillis(), c1600m1.Q3().f7749Y.isChecked());
        }
    }

    public static final void w3(C1600m1 c1600m1, C0964w c0964w, Drawable drawable, Drawable drawable2, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.U3().Y().setValue(4);
            c0964w.f8337e.setImageDrawable(drawable);
            c0964w.f8338f.setImageDrawable(drawable);
            c0964w.f8339g.setImageDrawable(drawable);
            c0964w.f8340h.setImageDrawable(drawable);
            c0964w.f8341i.setImageDrawable(drawable2);
        }
    }

    public static final void w4(C1600m1 c1600m1, NestedScrollView nestedScrollView, int i4, int i5, int i6, int i7) {
        boolean z4;
        Rect rect = new Rect();
        c1600m1.Q3().f7752a0.getHitRect(rect);
        c1600m1.H6(rect);
        if (c1600m1.Q3().f7739O.f7880r.getLocalVisibleRect(rect)) {
            c1600m1.Q3().f7757d.setTitle("");
            c1600m1.U3().F().setValue(Boolean.TRUE);
            return;
        }
        boolean booleanValue = ((Boolean) c1600m1.U3().F().getValue()).booleanValue();
        c1600m1.U3().F().setValue(Boolean.FALSE);
        String M4 = c1600m1.P3().M();
        if (M4 == null || M4.length() == 0) {
            return;
        }
        ArrayList B02 = c1600m1.P3().B0();
        if (B02 == null || B02.isEmpty()) {
            String z5 = c1600m1.P3().z();
            if (z5 == null || z5.length() == 0) {
                c1600m1.Q3().f7757d.setTitleEnabled(false);
                z4 = true;
            } else {
                z4 = ((Boolean) c1600m1.U3().g0().getValue()).booleanValue();
            }
        } else {
            z4 = ((Boolean) c1600m1.U3().g0().getValue()).booleanValue();
        }
        if (booleanValue && z4) {
            if (c1600m1.getResources().getConfiguration().getLayoutDirection() == 1) {
                String M5 = c1600m1.P3().M();
                kotlin.jvm.internal.m.b(M5);
                int length = M5.length() - 1;
                int i8 = 0;
                for (int i9 = 0; i9 < length; i9++) {
                    String M6 = c1600m1.P3().M();
                    kotlin.jvm.internal.m.b(M6);
                    char charAt = M6.charAt(i9);
                    if (charAt != ' ' && !u2.I.f23820a.j(charAt)) {
                        i8++;
                    }
                }
                if (i8 > 0) {
                    c1600m1.Q3().f7757d.setRtlTextDirectionHeuristicsEnabled(false);
                    c1600m1.Q3().f7757d.setLayoutDirection(0);
                }
            }
            CollapsingToolbarLayout collapsingToolbarLayout = c1600m1.Q3().f7757d;
            String M7 = c1600m1.P3().M();
            kotlin.jvm.internal.m.b(M7);
            collapsingToolbarLayout.setTitle(M7);
        }
    }

    public final void w5() {
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        n5(requireContext);
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        Q6(requireContext2);
        f7();
        T5();
        U3().x().setValue(Boolean.TRUE);
        if (((Number) U3().l0().getValue()).intValue() > 0) {
            d7();
        }
        L3();
    }

    public final void w6(int i4) {
        X3();
        Q3().f7739O.f7882t.setText(getString(com.uptodown.R.string.unzipping_status, Integer.valueOf(i4)));
        Q3().f7732H.f7178l.setText(getString(com.uptodown.R.string.unzipping_status, Integer.valueOf(i4)));
    }

    public final void x2() {
        if (D4()) {
            C1765i m4 = UptodownApp.f17145F.m();
            kotlin.jvm.internal.m.b(m4);
            if (m4.b() != -1 || getContext() == null) {
                return;
            }
            a.C0246a c0246a = com.uptodown.activities.preferences.a.f18568a;
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            if (c0246a.M(requireContext)) {
                Context requireContext2 = requireContext();
                kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
                if (!c0246a.Y(requireContext2)) {
                    Context requireContext3 = requireContext();
                    kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
                    c0246a.W0(requireContext3, false);
                }
                Context requireContext4 = requireContext();
                kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
                E3(requireContext4);
            }
        }
    }

    public static final void x3(C1600m1 c1600m1, C0964w c0964w, Drawable drawable, View view) {
        if (UptodownApp.f17145F.a0()) {
            c1600m1.U3().Y().setValue(5);
            c0964w.f8337e.setImageDrawable(drawable);
            c0964w.f8338f.setImageDrawable(drawable);
            c0964w.f8339g.setImageDrawable(drawable);
            c0964w.f8340h.setImageDrawable(drawable);
            c0964w.f8341i.setImageDrawable(drawable);
        }
    }

    public static final void x4(C1600m1 c1600m1, View view) {
        c1600m1.g5();
    }

    public final void x5(g2.L l4) {
        if (getActivity() == null || requireActivity().isFinishing() || l4 == null) {
            return;
        }
        if (l4.h() >= 1) {
            Q3().f7722C.f7843b.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
        }
        if (l4.h() >= 2) {
            Q3().f7722C.f7844c.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
        }
        if (l4.h() >= 3) {
            Q3().f7722C.f7845d.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
        }
        if (l4.h() >= 4) {
            Q3().f7722C.f7846e.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
        }
        if (l4.h() == 5) {
            Q3().f7722C.f7847f.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_star_on));
        }
        Q3().f7722C.f7850i.setText(getString(com.uptodown.R.string.edit_your_review));
    }

    public final void x6(g2.P p4) {
        C1772p c1772p;
        S6();
        C2494c c2494c = C2494c.f24034a;
        ProgressBar pbProgressAppDetail = Q3().f7739O.f7870h;
        kotlin.jvm.internal.m.d(pbProgressAppDetail, "pbProgressAppDetail");
        ImageView ivLogoAppDetail = Q3().f7739O.f7864b;
        kotlin.jvm.internal.m.d(ivLogoAppDetail, "ivLogoAppDetail");
        c2494c.e(pbProgressAppDetail, ivLogoAppDetail);
        U3().P().setValue(5);
        if (p4 != null) {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            c1772p = p4.b(requireContext);
        } else {
            c1772p = null;
        }
        if (c1772p == null) {
            Q3().f7739O.f7870h.setIndeterminate(true);
            Q3().f7732H.f7171e.setIndeterminate(true);
            return;
        }
        Q3().f7739O.f7867e.setVisibility(8);
        Q3().f7739O.f7865c.setVisibility(0);
        Q3().f7736L.f8050i.setVisibility(8);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        String string = getString(com.uptodown.R.string.option_button_cancel);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        a6(tvDownloadCancelBad, string);
        Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.y6(C1600m1.this, view);
            }
        });
        if (DownloadWorker.f19220d.h()) {
            TextView tvPauseBad = Q3().f7736L.f8051j;
            kotlin.jvm.internal.m.d(tvPauseBad, "tvPauseBad");
            String string2 = getString(com.uptodown.R.string.updates_button_resume);
            kotlin.jvm.internal.m.d(string2, "getString(...)");
            Z5(tvPauseBad, string2);
        } else {
            TextView tvPauseBad2 = Q3().f7736L.f8051j;
            kotlin.jvm.internal.m.d(tvPauseBad2, "tvPauseBad");
            String string3 = getString(com.uptodown.R.string.action_pause);
            kotlin.jvm.internal.m.d(string3, "getString(...)");
            a6(tvPauseBad2, string3);
        }
        if (c1772p.x() > 0) {
            Q3().f7739O.f7870h.setIndeterminate(false);
            Q3().f7739O.f7870h.setProgress(c1772p.x());
            Q3().f7732H.f7171e.setIndeterminate(false);
        } else {
            Q3().f7739O.f7870h.setIndeterminate(true);
            Q3().f7732H.f7171e.setIndeterminate(true);
        }
        TextView textView = Q3().f7739O.f7882t;
        Integer valueOf = Integer.valueOf(c1772p.x());
        W1.i iVar = new W1.i();
        long z4 = c1772p.z();
        Context requireContext2 = requireContext();
        kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
        textView.setText(getString(com.uptodown.R.string.percent_of_total_size, valueOf, iVar.d(z4, requireContext2)));
        Q3().f7732H.f7168b.setVisibility(0);
        TextView textView2 = Q3().f7732H.f7178l;
        W1.i iVar2 = new W1.i();
        long z5 = (c1772p.z() * c1772p.x()) / 100;
        Context requireContext3 = requireContext();
        kotlin.jvm.internal.m.d(requireContext3, "requireContext(...)");
        textView2.setText(iVar2.d(z5, requireContext3));
        Q3().f7732H.f7171e.setProgress(c1772p.x());
        Q3().f7732H.f7175i.setVisibility(8);
        Q3().f7732H.f7177k.setVisibility(0);
        Q3().f7732H.f7177k.setText(c1772p.x() + getString(com.uptodown.R.string.percent));
        TextView textView3 = Q3().f7732H.f7179m;
        kotlin.jvm.internal.F f4 = kotlin.jvm.internal.F.f21884a;
        W1.i iVar3 = new W1.i();
        long z6 = c1772p.z();
        Context requireContext4 = requireContext();
        kotlin.jvm.internal.m.d(requireContext4, "requireContext(...)");
        String format = String.format("/%s", Arrays.copyOf(new Object[]{iVar3.d(z6, requireContext4)}, 1));
        kotlin.jvm.internal.m.d(format, "format(...)");
        textView3.setText(format);
    }

    private final void y2(C0935h c0935h) {
        c0935h.f8049h.setTypeface(N1.k.f3913g.w());
        c0935h.f8050i.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.z2(C1600m1.this, view);
            }
        });
        c0935h.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.A2(C1600m1.this, view);
            }
        });
        c0935h.f8050i.setFocusable(true);
        c0935h.f8051j.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.B2(C1600m1.this, view);
            }
        });
    }

    public static final void y3(Context context, C1600m1 c1600m1, C0964w c0964w, View view) {
        if (UptodownApp.f17145F.a0()) {
            g2.S e5 = g2.S.f20411m.e(context);
            r3.t a02 = c1600m1.U3().a0();
            Editable text = c0964w.f8335c.getText();
            kotlin.jvm.internal.m.d(text, "getText(...)");
            a02.setValue(m3.m.u0(text).toString());
            if ((e5 != null ? e5.g() : null) != null) {
                String g4 = e5.g();
                kotlin.jvm.internal.m.b(g4);
                if (g4.length() > 0) {
                    c1600m1.W5((String) c1600m1.U3().a0().getValue());
                    FragmentActivity activity = c1600m1.getActivity();
                    kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                    AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
                    if (k22 != null) {
                        k22.dismiss();
                        return;
                    }
                    return;
                }
            }
            c1600m1.Z4();
        }
    }

    public static final void y4(C1600m1 c1600m1, View view) {
        c1600m1.M3();
    }

    public final void y5(ArrayList arrayList) {
        if (Q3().f7781p.getVisibility() != 8 || arrayList.isEmpty()) {
            return;
        }
        M1.I i4 = new M1.I(new G(), new H(), 8);
        this.f19655i = i4;
        kotlin.jvm.internal.m.b(i4);
        i4.d(arrayList);
        Q3().f7746V.setAdapter(this.f19655i);
        Q3().f7746V.setNestedScrollingEnabled(false);
        Q3().f7746V.setLayoutManager(new LinearLayoutManager(getContext(), 0, false));
        DefaultItemAnimator defaultItemAnimator = new DefaultItemAnimator();
        defaultItemAnimator.setSupportsChangeAnimations(false);
        Q3().f7746V.setItemAnimator(defaultItemAnimator);
        Q3().f7781p.setVisibility(0);
    }

    public static final void y6(C1600m1 c1600m1, View view) {
        c1600m1.Z2();
    }

    public static final void z2(C1600m1 c1600m1, View view) {
        c1600m1.S4();
    }

    public static final void z3(C1600m1 c1600m1, C0964w c0964w, View view) {
        if (UptodownApp.f17145F.a0()) {
            r3.t a02 = c1600m1.U3().a0();
            Editable text = c0964w.f8335c.getText();
            kotlin.jvm.internal.m.d(text, "getText(...)");
            a02.setValue(m3.m.u0(text).toString());
            c0964w.f8335c.setText((CharSequence) c1600m1.U3().a0().getValue());
            FragmentActivity activity = c1600m1.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            AlertDialog k22 = ((AbstractActivityC1500a) activity).k2();
            if (k22 != null) {
                k22.dismiss();
            }
        }
    }

    public static final void z4(C1600m1 c1600m1, View view) {
        c1600m1.N3();
    }

    private final View z5(LinearLayout.LayoutParams layoutParams, final g2.L l4, Context context) {
        final C0965w0 c5 = C0965w0.c(getLayoutInflater());
        kotlin.jvm.internal.m.d(c5, "inflate(...)");
        c5.getRoot().setLayoutParams(layoutParams);
        c5.f8349e.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
        c5.f8350f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
        c5.f8351g.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
        c5.f8352h.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
        c5.f8353i.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_off));
        if (l4.h() >= 2) {
            c5.f8350f.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
        }
        if (l4.h() >= 3) {
            c5.f8351g.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
        }
        if (l4.h() >= 4) {
            c5.f8352h.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
        }
        if (l4.h() == 5) {
            c5.f8353i.setImageDrawable(ContextCompat.getDrawable(context, com.uptodown.R.drawable.vector_star_on));
        }
        UsernameTextView usernameTextView = c5.f8364t;
        k.a aVar = N1.k.f3913g;
        usernameTextView.setTypeface(aVar.w());
        c5.f8359o.setTypeface(aVar.x());
        c5.f8358n.setTypeface(aVar.x());
        c5.f8361q.setTypeface(aVar.x());
        c5.f8362r.setTypeface(aVar.x());
        S.b bVar = g2.S.f20411m;
        String c6 = bVar.c(l4.e());
        if (c6 != null && c6.length() != 0) {
            com.squareup.picasso.s.h().l(bVar.c(l4.e())).n(UptodownApp.f17145F.h0(context)).i(c5.f8347c);
        }
        String l5 = l4.l();
        if (l5 != null && l5.length() != 0) {
            c5.f8347c.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.A5(C1600m1.this, l4, view);
                }
            });
            c5.f8364t.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.B5(C1600m1.this, l4, view);
                }
            });
        }
        String m4 = l4.m();
        if (m4 != null && m4.length() != 0) {
            c5.f8364t.setText(l4.m());
            UsernameTextView.a aVar2 = UsernameTextView.f19193k;
            UsernameTextView tvUsernameReview = c5.f8364t;
            kotlin.jvm.internal.m.d(tvUsernameReview, "tvUsernameReview");
            aVar2.a(tvUsernameReview, l4.o(), l4.n());
        }
        String k4 = l4.k();
        if (k4 != null && k4.length() != 0) {
            c5.f8359o.setText(l4.k());
        }
        if (l4.a() > 0) {
            c5.f8362r.setText(String.valueOf(l4.a()));
        }
        String i4 = l4.i();
        if (i4 == null || i4.length() == 0) {
            c5.f8358n.setVisibility(8);
            c5.f8356l.setVisibility(8);
            c5.f8355k.setVisibility(8);
        } else {
            c5.f8361q.setFocusable(true);
            TextView textView = c5.f8358n;
            Spanned j4 = l4.j();
            textView.setText(j4 != null ? m3.m.u0(j4) : null);
            c5.f8358n.getViewTreeObserver().addOnPreDrawListener(new I(c5));
            c5.f8363s.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.C5(C0965w0.this, this, view);
                }
            });
            c5.f8356l.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.D5(C1600m1.this, l4, view);
                }
            });
            c5.f8356l.setFocusable(true);
            c5.f8360p.setTypeface(aVar.x());
            c5.f8360p.setText(String.valueOf(l4.g()));
            if (u2.I.f23820a.i(l4.f())) {
                c5.f8348d.setImageDrawable(ContextCompat.getDrawable(requireContext(), com.uptodown.R.drawable.vector_heart_red));
            }
            c5.f8355k.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    C1600m1.E5(C1600m1.this, c5, l4, view);
                }
            });
        }
        c5.f8361q.setFocusable(true);
        RelativeLayout root = c5.getRoot();
        kotlin.jvm.internal.m.d(root, "getRoot(...)");
        return root;
    }

    public final void z6(final Context context) {
        R6();
        C2494c c2494c = C2494c.f24034a;
        ProgressBar pbProgressAppDetail = Q3().f7739O.f7870h;
        kotlin.jvm.internal.m.d(pbProgressAppDetail, "pbProgressAppDetail");
        ImageView ivLogoAppDetail = Q3().f7739O.f7864b;
        kotlin.jvm.internal.m.d(ivLogoAppDetail, "ivLogoAppDetail");
        c2494c.c(pbProgressAppDetail, ivLogoAppDetail);
        U3().P().setValue(2);
        TextView tvDownloadCancelBad = Q3().f7736L.f8049h;
        kotlin.jvm.internal.m.d(tvDownloadCancelBad, "tvDownloadCancelBad");
        String string = getString(com.uptodown.R.string.updates_button_update_app);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        Z5(tvDownloadCancelBad, string);
        Q3().f7736L.f8049h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                C1600m1.A6(C1600m1.this, context, view);
            }
        });
        Q3().f7732H.f7180n.setText(getString(com.uptodown.R.string.updates_button_update_app));
        TextView tvStatusDownload = Q3().f7732H.f7180n;
        kotlin.jvm.internal.m.d(tvStatusDownload, "tvStatusDownload");
        String string2 = getString(com.uptodown.R.string.updates_button_update_app);
        kotlin.jvm.internal.m.d(string2, "getString(...)");
        Z5(tvStatusDownload, string2);
        K6(com.uptodown.R.id.action_app_installed_details);
    }

    public final void O2(Context context) {
        kotlin.jvm.internal.m.e(context, "context");
        Q6(context);
    }

    public final C1762f P3() {
        C1762f c1762f = this.f19647a;
        if (c1762f != null) {
            return c1762f;
        }
        kotlin.jvm.internal.m.u("appInfo");
        return null;
    }

    public final void U5() {
        R3();
    }

    public final void X6(String str) {
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new X(str, this, null), 2, null);
    }

    public final void Y5(C1762f c1762f) {
        kotlin.jvm.internal.m.e(c1762f, "<set-?>");
        this.f19647a = c1762f;
    }

    public final void Z6(String packagename) {
        kotlin.jvm.internal.m.e(packagename, "packagename");
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new Y(packagename, this, null), 2, null);
    }

    public final void a7(String packagename) {
        kotlin.jvm.internal.m.e(packagename, "packagename");
        if (getContext() == null || P3().R() == null || m3.m.p(P3().R(), packagename, true)) {
            return;
        }
        Context requireContext = requireContext();
        kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
        Q6(requireContext);
        if (getActivity() == null || requireActivity().isFinishing() || !(getActivity() instanceof AbstractActivityC1500a)) {
            return;
        }
        FragmentActivity activity = getActivity();
        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
        String string = getString(com.uptodown.R.string.install_compatibility_error, P3().M());
        kotlin.jvm.internal.m.d(string, "getString(...)");
        ((AbstractActivityC1500a) activity).r0(string);
    }

    @Override
    public void onCreate(Bundle bundle) {
        C1762f c1762f;
        Parcelable parcelable;
        Object parcelable2;
        super.onCreate(bundle);
        U3().x().setValue(Boolean.FALSE);
        this.f19650d = new u2.z(requireActivity());
        UptodownApp.a aVar = UptodownApp.f17145F;
        C1.e k4 = aVar.k();
        if (k4 != null) {
            k4.pause();
        }
        C1.e l4 = aVar.l();
        if (l4 != null) {
            l4.pause();
        }
        Bundle arguments = getArguments();
        if (arguments != null) {
            U3().C().setValue(Long.valueOf(arguments.getLong("appId")));
            if (arguments.containsKey("appInfo")) {
                if (Build.VERSION.SDK_INT >= 33) {
                    parcelable2 = arguments.getParcelable("appInfo", C1762f.class);
                    parcelable = (Parcelable) parcelable2;
                } else {
                    parcelable = arguments.getParcelable("appInfo");
                }
                c1762f = (C1762f) parcelable;
                if (c1762f == null) {
                    Y5(c1762f);
                    C1643s1 U32 = U3();
                    Context requireContext = requireContext();
                    kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
                    U32.w(requireContext, P3());
                } else if (getActivity() != null) {
                    if (getActivity() instanceof MainActivity) {
                        FragmentActivity activity = getActivity();
                        kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.MainActivity");
                        ((MainActivity) activity).Q6();
                    } else if (getActivity() instanceof AppDetailActivity) {
                        FragmentActivity activity2 = getActivity();
                        kotlin.jvm.internal.m.c(activity2, "null cannot be cast to non-null type com.uptodown.activities.AppDetailActivity");
                        ((AppDetailActivity) activity2).finish();
                    }
                }
                if (P3().K0()) {
                    return;
                }
                AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1622v(null), 2, null);
                return;
            }
        }
        c1762f = null;
        if (c1762f == null) {
        }
        if (P3().K0()) {
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
        kotlin.jvm.internal.m.e(inflater, "inflater");
        if (getActivity() == null) {
            return super.onCreateView(inflater, viewGroup, bundle);
        }
        this.f19648b = C0923b.c(inflater, viewGroup, false);
        FragmentActivity requireActivity = requireActivity();
        kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
        Y3(requireActivity);
        return Q3().getRoot();
    }

    @Override
    public void onDestroy() {
        try {
            MBBannerView mbBannerView = Q3().f7724D;
            kotlin.jvm.internal.m.d(mbBannerView, "mbBannerView");
            mbBannerView.release();
        } catch (Exception unused) {
        }
        super.onDestroy();
    }

    @Override
    public void onPause() {
        super.onPause();
        U3().J().setValue(Boolean.valueOf(!((Boolean) U3().J().getValue()).booleanValue()));
        MBBannerView mbBannerView = Q3().f7724D;
        kotlin.jvm.internal.m.d(mbBannerView, "mbBannerView");
        mbBannerView.onPause();
    }

    @Override
    public void onResume() {
        String o4;
        super.onResume();
        u2.z zVar = this.f19650d;
        if (zVar != null) {
            zVar.e("AppDetailsFragment");
        }
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1623w(null), 2, null);
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1624x(null), 2, null);
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1625y(null), 2, null);
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C1626z(null), 2, null);
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new A(null), 2, null);
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new B(null), 2, null);
        if (!((Boolean) U3().O().getValue()).booleanValue()) {
            Rect rect = new Rect();
            Q3().f7752a0.getHitRect(rect);
            H6(rect);
        }
        if (((Boolean) U3().O().getValue()).booleanValue() || (o4 = P3().o()) == null || o4.length() == 0) {
            U3().O().setValue(Boolean.FALSE);
        } else {
            Context requireContext = requireContext();
            kotlin.jvm.internal.m.d(requireContext, "requireContext(...)");
            Q6(requireContext);
        }
        String o02 = P3().o0();
        int i4 = 0;
        if (o02 == null || o02.length() == 0 || V3()) {
            Q3().f7731G0.getRoot().setVisibility(8);
        } else {
            Q3().f7731G0.getRoot().setVisibility(0);
        }
        L3();
        if (Q3().f7752a0.getScrollY() > 0) {
            Context requireContext2 = requireContext();
            kotlin.jvm.internal.m.d(requireContext2, "requireContext(...)");
            V6(requireContext2);
            String z4 = P3().z();
            if (z4 == null || z4.length() == 0) {
                Q3().f7757d.setTitle("");
            }
        }
        M1.I i5 = this.f19654h;
        if (i5 != null) {
            i5.notifyDataSetChanged();
        }
        M1.I i6 = this.f19655i;
        if (i6 != null) {
            i6.notifyDataSetChanged();
        }
        ArrayList arrayList = this.f19656j;
        int size = arrayList.size();
        while (i4 < size) {
            Object obj = arrayList.get(i4);
            i4++;
            ((M1.I) obj).notifyDataSetChanged();
        }
        AbstractC2176i.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), null, new C(null), 2, null);
        Q4();
        MBBannerView mbBannerView = Q3().f7724D;
        kotlin.jvm.internal.m.d(mbBannerView, "mbBannerView");
        mbBannerView.onResume();
    }

    public static final class D implements f2.J {
        D() {
        }

        @Override
        public void a(g2.S user) {
            kotlin.jvm.internal.m.e(user, "user");
            Intent intent = new Intent(C1600m1.this.requireContext(), (Class<?>) PublicProfileActivity.class);
            intent.putExtra("user", user);
            C1600m1 c1600m1 = C1600m1.this;
            UptodownApp.a aVar = UptodownApp.f17145F;
            FragmentActivity requireActivity = c1600m1.requireActivity();
            kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
            c1600m1.startActivity(intent, aVar.a(requireActivity));
        }

        @Override
        public void b() {
        }
    }

    public static final class AnimationAnimationListenerC1612l implements Animation.AnimationListener {
        AnimationAnimationListenerC1612l() {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            C1600m1.this.Q3().f7761f.removeAllViews();
            C1600m1.this.U3().z().set(false);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationStart(Animation animation) {
        }
    }

    public static final class C1618r implements S1.m {

        public static final class a implements S1.h {

            final C1600m1 f19759a;

            a(C1600m1 c1600m1) {
                this.f19759a = c1600m1;
            }

            @Override
            public void a() {
                C1600m1 c1600m1 = this.f19759a;
                String string = c1600m1.getString(com.uptodown.R.string.installing);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                c1600m1.l6(string);
            }

            @Override
            public void b(String str) {
                if (str != null) {
                    this.f19759a.j3(str);
                    return;
                }
                C1600m1 c1600m1 = this.f19759a;
                String string = c1600m1.getString(com.uptodown.R.string.error_generico);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                c1600m1.j3(string);
            }
        }

        C1618r() {
        }

        @Override
        public void a(File fileZipped, ArrayList files) {
            kotlin.jvm.internal.m.e(fileZipped, "fileZipped");
            kotlin.jvm.internal.m.e(files, "files");
            a aVar = new a(C1600m1.this);
            if (C1600m1.this.getActivity() != null) {
                FragmentActivity activity = C1600m1.this.getActivity();
                kotlin.jvm.internal.m.b(activity);
                if (activity.isFinishing()) {
                    return;
                }
                FragmentActivity activity2 = C1600m1.this.getActivity();
                kotlin.jvm.internal.m.b(activity2);
                W1.C c5 = new W1.C(activity2);
                c5.x(files);
                ArrayList y4 = c5.y();
                FragmentActivity requireActivity = C1600m1.this.requireActivity();
                kotlin.jvm.internal.m.d(requireActivity, "requireActivity(...)");
                new W1.j(requireActivity, aVar).w(y4, false);
                if (C1600m1.this.getActivity() instanceof AbstractActivityC1500a) {
                    v.a aVar2 = u2.v.f23867v;
                    FragmentActivity activity3 = C1600m1.this.getActivity();
                    kotlin.jvm.internal.m.b(activity3);
                    u2.v a5 = aVar2.a(activity3);
                    a5.a();
                    String name = fileZipped.getName();
                    kotlin.jvm.internal.m.d(name, "getName(...)");
                    C1772p b02 = a5.b0(name);
                    a5.i();
                    if (b02 != null) {
                        FragmentActivity activity4 = C1600m1.this.getActivity();
                        kotlin.jvm.internal.m.c(activity4, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
                        ((AbstractActivityC1500a) activity4).A2(b02);
                    }
                }
            }
        }

        @Override
        public void b(int i4) {
            C1600m1.this.w6(i4);
        }

        @Override
        public void e() {
            if (C1600m1.this.getContext() != null) {
                C1600m1 c1600m1 = C1600m1.this;
                String string = c1600m1.getString(com.uptodown.R.string.msg_install_from_unknown_source, c1600m1.getString(com.uptodown.R.string.app_name));
                kotlin.jvm.internal.m.d(string, "getString(...)");
                C1600m1.this.j3(string);
            }
        }

        @Override
        public void f() {
            if (C1600m1.this.getContext() != null) {
                C1600m1 c1600m1 = C1600m1.this;
                String string = c1600m1.getString(com.uptodown.R.string.core_kill_this_app, c1600m1.getString(com.uptodown.R.string.app_name));
                kotlin.jvm.internal.m.d(string, "getString(...)");
                C1600m1.this.j3(string);
            }
        }

        @Override
        public void g() {
            C1600m1.this.w6(0);
        }

        @Override
        public void h() {
            if (C1600m1.this.getContext() != null) {
                String string = C1600m1.this.getString(com.uptodown.R.string.error_unzipping);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                C1600m1.this.j3(string);
            }
        }

        @Override
        public void i() {
            if (C1600m1.this.getActivity() == null || !(C1600m1.this.getActivity() instanceof AbstractActivityC1500a)) {
                return;
            }
            FragmentActivity activity = C1600m1.this.getActivity();
            kotlin.jvm.internal.m.c(activity, "null cannot be cast to non-null type com.uptodown.activities.BaseActivity");
            ((AbstractActivityC1500a) activity).K();
        }

        @Override
        public void c(File file) {
        }

        @Override
        public void d(File file) {
        }
    }

    public static final void r5(View view) {
    }

    public static final void t4(View view) {
    }
}