导航菜单

页面标题

页面副标题

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

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

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


package com.uptodown.activities;

import J1.AbstractC0355q2;
import M1.C0458m;
import M1.J;
import N1.k;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.SimpleItemAnimator;
import b2.C0552a;
import c2.C0601q;
import com.google.android.material.R;
import com.uptodown.UptodownApp;
import com.uptodown.activities.MyApps;
import com.uptodown.activities.preferences.PreferencesActivity;
import com.uptodown.activities.preferences.a;
import com.uptodown.activities.r;
import com.uptodown.workers.GenerateQueueWorker;
import f2.InterfaceC0915F;
import f2.InterfaceC0919b;
import f2.InterfaceC0924g;
import f2.InterfaceC0935s;
import g2.C0953d;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import u2.H;

public final class MyApps extends AbstractC0355q2 {
    private C0458m X;
    private final R2.g V = R2.h.a(new d3.a() {
        @Override
        public final Object invoke() {
            c2.S U4;
            U4 = MyApps.U4(MyApps.this);
            return U4;
        }
    });
    private final R2.g W = new ViewModelLazy(kotlin.jvm.internal.D.b(r.class), new h(this), new g(this), new i(null, this));
    private final a Y = new a();
    private final j Z = new j();

    private final c f257m0 = new c();

    public static final class a implements InterfaceC0919b {
        a() {
        }

        @Override
        public void a(int i) {
            if (UptodownApp.F.a0()) {
                if (MyApps.this.i5(i)) {
                    C0458m c0458m = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m);
                    Object obj = c0458m.b().get(i);
                    kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.models.App");
                    MyApps.this.Q3((C0953d) obj, i);
                    return;
                }
                if (MyApps.this.j5(i)) {
                    C0458m c0458m2 = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m2);
                    Object obj2 = c0458m2.b().get(i);
                    kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                    MyApps.this.Q3(((J.a) obj2).a(), i);
                }
            }
        }

        @Override
        public void b(int i) {
            C0953d c0953d;
            if (UptodownApp.F.a0()) {
                if (MyApps.this.i5(i)) {
                    C0458m c0458m = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m);
                    Object obj = c0458m.b().get(i);
                    kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.models.App");
                    c0953d = (C0953d) obj;
                } else if (MyApps.this.j5(i)) {
                    C0458m c0458m2 = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m2);
                    Object obj2 = c0458m2.b().get(i);
                    kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                    c0953d = ((J.a) obj2).a();
                } else {
                    c0953d = null;
                }
                if (c0953d == null || c0953d.b() <= 0) {
                    return;
                }
                MyApps.this.D2(c0953d.b());
            }
        }
    }

    static final class b extends kotlin.coroutines.jvm.internal.l implements d3.p {
        int a;
        final String c;
        final String d;

        b(String str, String str2, V2.d dVar) {
            super(2, dVar);
            this.c = str;
            this.d = str2;
        }

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

        @Override
        public final java.lang.Object invokeSuspend(java.lang.Object r4) {
            throw new UnsupportedOperationException("Method not decompiled: com.uptodown.activities.MyApps.b.invokeSuspend(java.lang.Object):java.lang.Object");
        }

        @Override
        public final Object invoke(o3.J j, V2.d dVar) {
            return ((b) create(j, dVar)).invokeSuspend(R2.s.a);
        }
    }

    public static final class c implements InterfaceC0935s {
        c() {
        }

        @Override
        public void a() {
            if (UptodownApp.F.a0()) {
                ?? r02 = MyApps.this;
                String string = r02.getString(2131951944);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                r02.V1(string);
            }
        }
    }

    public static final class d implements SearchView.OnQueryTextListener {
        d() {
        }

        public boolean onQueryTextChange(String newText) {
            kotlin.jvm.internal.m.e(newText, "newText");
            MyApps.this.T4(newText);
            return false;
        }

        public boolean onQueryTextSubmit(String query) {
            kotlin.jvm.internal.m.e(query, "query");
            MyApps.this.T4(query);
            return true;
        }
    }

    static final class e extends kotlin.coroutines.jvm.internal.l implements d3.p {
        int a;

        static final class a implements r3.f {
            final MyApps a;

            static final class C0174a extends kotlin.coroutines.jvm.internal.l implements d3.p {
                int a;
                final MyApps b;

                C0174a(MyApps myApps, V2.d dVar) {
                    super(2, dVar);
                    this.b = myApps;
                }

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

                @Override
                public final Object invokeSuspend(Object obj) {
                    W2.b.c();
                    if (this.a != 0) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    R2.n.b(obj);
                    this.b.W4().c.setVisibility(0);
                    return R2.s.a;
                }

                @Override
                public final Object invoke(o3.J j, V2.d dVar) {
                    return ((C0174a) create(j, dVar)).invokeSuspend(R2.s.a);
                }
            }

            static final class b extends kotlin.coroutines.jvm.internal.l implements d3.p {
                int a;
                final MyApps b;
                final u2.H c;

                public static final class C0175a implements InterfaceC0924g {
                    final MyApps a;

                    static final class C0176a extends kotlin.coroutines.jvm.internal.l implements d3.p {
                        int a;
                        final MyApps b;
                        final String c;
                        final long d;

                        C0176a(MyApps myApps, String str, long j, V2.d dVar) {
                            super(2, dVar);
                            this.b = myApps;
                            this.c = str;
                            this.d = j;
                        }

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

                        @Override
                        public final Object invokeSuspend(Object obj) {
                            W2.b.c();
                            if (this.a != 0) {
                                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                            }
                            R2.n.b(obj);
                            int X4 = this.b.X4(this.c);
                            if (X4 >= 0 && this.b.X != null) {
                                C0458m c0458m = this.b.X;
                                kotlin.jvm.internal.m.b(c0458m);
                                if (c0458m.b().get(X4) instanceof C0953d) {
                                    C0458m c0458m2 = this.b.X;
                                    ArrayList b = c0458m2 != null ? c0458m2.b() : null;
                                    kotlin.jvm.internal.m.b(b);
                                    Object obj2 = b.get(X4);
                                    kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.models.App");
                                    ((C0953d) obj2).b0(this.d);
                                    C0458m c0458m3 = this.b.X;
                                    if (c0458m3 != null) {
                                        c0458m3.notifyItemChanged(this.b.X4(this.c));
                                    }
                                }
                            }
                            return R2.s.a;
                        }

                        @Override
                        public final Object invoke(o3.J j, V2.d dVar) {
                            return ((C0176a) create(j, dVar)).invokeSuspend(R2.s.a);
                        }
                    }

                    C0175a(MyApps myApps) {
                        this.a = myApps;
                    }

                    @Override
                    public void a(String packageName, long j) {
                        kotlin.jvm.internal.m.e(packageName, "packageName");
                        o3.g.d(LifecycleOwnerKt.getLifecycleScope(this.a), o3.Y.c(), (o3.L) null, new C0176a(this.a, packageName, j, null), 2, (Object) null);
                    }
                }

                b(MyApps myApps, u2.H h, V2.d dVar) {
                    super(2, dVar);
                    this.b = myApps;
                    this.c = h;
                }

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

                @Override
                public final Object invokeSuspend(Object obj) {
                    W2.b.c();
                    if (this.a != 0) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    R2.n.b(obj);
                    this.b.W4().c.setVisibility(8);
                    this.b.W4().b.getRoot().setVisibility(0);
                    this.b.l5(((r.a) ((H.c) this.c).a()).d(), ((r.a) ((H.c) this.c).a()).b(), ((r.a) ((H.c) this.c).a()).a(), ((r.a) ((H.c) this.c).a()).c());
                    if (!((Boolean) this.b.Y4().d().getValue()).booleanValue()) {
                        new C0552a(new C0175a(this.b), LifecycleOwnerKt.getLifecycleScope(this.b), this.b);
                        this.b.Y4().d().setValue(kotlin.coroutines.jvm.internal.b.a(true));
                    }
                    return R2.s.a;
                }

                @Override
                public final Object invoke(o3.J j, V2.d dVar) {
                    return ((b) create(j, dVar)).invokeSuspend(R2.s.a);
                }
            }

            a(MyApps myApps) {
                this.a = myApps;
            }

            public final Object emit(u2.H h, V2.d dVar) {
                if (h instanceof H.a) {
                    Object g = o3.g.g(o3.Y.c(), new C0174a(this.a, null), dVar);
                    return g == W2.b.c() ? g : R2.s.a;
                }
                if (h instanceof H.c) {
                    Object g4 = o3.g.g(o3.Y.c(), new b(this.a, h, null), dVar);
                    return g4 == W2.b.c() ? g4 : R2.s.a;
                }
                if (h instanceof H.b) {
                    return R2.s.a;
                }
                throw new R2.k();
            }
        }

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

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

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

        @Override
        public final Object invoke(o3.J j, V2.d dVar) {
            return ((e) create(j, dVar)).invokeSuspend(R2.s.a);
        }
    }

    static final class f extends kotlin.coroutines.jvm.internal.l implements d3.p {
        int a;
        final ArrayList c;

        f(ArrayList arrayList, V2.d dVar) {
            super(2, dVar);
            this.c = arrayList;
        }

        public static final void l(MyApps myApps, View view) {
            UptodownApp.a aVar = UptodownApp.F;
            if (aVar.a0()) {
                myApps.startActivity(new Intent(myApps.getApplicationContext(), (Class<?>) PreferencesActivity.class), aVar.a(myApps));
                AlertDialog k22 = myApps.k2();
                if (k22 != null) {
                    k22.dismiss();
                }
            }
        }

        public static final void m(MyApps myApps, View view) {
            AlertDialog k22 = myApps.k2();
            if (k22 != null) {
                k22.dismiss();
            }
        }

        public static final void n(ArrayList arrayList, MyApps myApps, View view) {
            if (arrayList != null && arrayList.size() > 0) {
                GenerateQueueWorker.e.a(myApps, true, ((C0953d) arrayList.get(0)).o());
            }
            AlertDialog k22 = myApps.k2();
            if (k22 != null) {
                k22.dismiss();
            }
        }

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

        @Override
        public final Object invokeSuspend(Object obj) {
            W2.b.c();
            if (this.a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            AlertDialog k22 = MyApps.this.k2();
            if (k22 != null) {
                k22.dismiss();
            }
            AlertDialog.Builder builder = new AlertDialog.Builder(MyApps.this);
            C0601q c = C0601q.c(MyApps.this.getLayoutInflater());
            kotlin.jvm.internal.m.d(c, "inflate(...)");
            final MyApps myApps = MyApps.this;
            final ArrayList arrayList = this.c;
            TextView textView = c.f;
            k.a aVar = N1.k.g;
            textView.setTypeface(aVar.w());
            c.c.setTypeface(aVar.x());
            c.e.setTypeface(aVar.w());
            c.b.setTypeface(aVar.w());
            c.d.setTypeface(aVar.w());
            c.e.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    MyApps.f.l(MyApps.this, view);
                }
            });
            c.b.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    MyApps.f.m(MyApps.this, view);
                }
            });
            c.d.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    MyApps.f.n(arrayList, myApps, view);
                }
            });
            builder.setView(c.getRoot());
            MyApps.this.K2(builder.create());
            if (!MyApps.this.isFinishing() && MyApps.this.k2() != null) {
                MyApps.this.X2();
            }
            return R2.s.a;
        }

        @Override
        public final Object invoke(o3.J j, V2.d dVar) {
            return ((f) create(j, dVar)).invokeSuspend(R2.s.a);
        }
    }

    public static final class g extends kotlin.jvm.internal.n implements d3.a {
        final ComponentActivity a;

        public g(ComponentActivity componentActivity) {
            super(0);
            this.a = componentActivity;
        }

        @Override
        public final ViewModelProvider.Factory invoke() {
            return this.a.getDefaultViewModelProviderFactory();
        }
    }

    public static final class h extends kotlin.jvm.internal.n implements d3.a {
        final ComponentActivity a;

        public h(ComponentActivity componentActivity) {
            super(0);
            this.a = componentActivity;
        }

        @Override
        public final ViewModelStore invoke() {
            return this.a.getViewModelStore();
        }
    }

    public static final class i extends kotlin.jvm.internal.n implements d3.a {
        final d3.a a;
        final ComponentActivity b;

        public i(d3.a aVar, ComponentActivity componentActivity) {
            super(0);
            this.a = aVar;
            this.b = componentActivity;
        }

        @Override
        public final CreationExtras invoke() {
            CreationExtras creationExtras;
            d3.a aVar = this.a;
            return (aVar == null || (creationExtras = (CreationExtras) aVar.invoke()) == null) ? this.b.getDefaultViewModelCreationExtras() : creationExtras;
        }
    }

    public static final class j implements InterfaceC0915F {
        j() {
        }

        @Override
        public void a(int i) {
            if (UptodownApp.F.a0()) {
                if (MyApps.this.i5(i)) {
                    C0458m c0458m = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m);
                    Object obj = c0458m.b().get(i);
                    kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.models.App");
                    MyApps.this.Q3((C0953d) obj, i);
                    return;
                }
                if (MyApps.this.j5(i)) {
                    C0458m c0458m2 = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m2);
                    Object obj2 = c0458m2.b().get(i);
                    kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                    MyApps.this.Q3(((J.a) obj2).a(), i);
                }
            }
        }

        @Override
        public void b(int i) {
            ArrayList b;
            ArrayList b4;
            if (UptodownApp.F.a0()) {
                C0458m c0458m = MyApps.this.X;
                C0953d c0953d = null;
                if (((c0458m == null || (b4 = c0458m.b()) == null) ? null : b4.get(i)) instanceof J.a) {
                    C0458m c0458m2 = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m2);
                    Object obj = c0458m2.b().get(i);
                    kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                    c0953d = ((J.a) obj).a();
                } else {
                    C0458m c0458m3 = MyApps.this.X;
                    if (((c0458m3 == null || (b = c0458m3.b()) == null) ? null : b.get(i)) instanceof C0953d) {
                        C0458m c0458m4 = MyApps.this.X;
                        kotlin.jvm.internal.m.b(c0458m4);
                        Object obj2 = c0458m4.b().get(i);
                        kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.models.App");
                        c0953d = (C0953d) obj2;
                    }
                }
                if (c0953d == null || c0953d.b() <= 0) {
                    return;
                }
                MyApps.this.D2(c0953d.b());
            }
        }

        @Override
        public void c(int i) {
            if (MyApps.this.i5(i)) {
                C0458m c0458m = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m);
                Object obj = c0458m.b().get(i);
                kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.models.App");
                ((C0953d) obj).a0(true);
                C0458m c0458m2 = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m2);
                c0458m2.notifyItemChanged(i);
                return;
            }
            if (MyApps.this.j5(i)) {
                C0458m c0458m3 = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m3);
                Object obj2 = c0458m3.b().get(i);
                kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                ((J.a) obj2).a().a0(true);
                C0458m c0458m4 = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m4);
                c0458m4.notifyItemChanged(i);
            }
        }

        @Override
        public void d(int i) {
            if (UptodownApp.F.a0()) {
                if (!MyApps.this.i5(i)) {
                    if (MyApps.this.j5(i)) {
                        C0458m c0458m = MyApps.this.X;
                        kotlin.jvm.internal.m.b(c0458m);
                        Object obj = c0458m.b().get(i);
                        kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                        MyApps.this.t4(((J.a) obj).a());
                        return;
                    }
                    return;
                }
                C0458m c0458m2 = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m2);
                Object obj2 = c0458m2.b().get(i);
                kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.models.App");
                C0953d c0953d = (C0953d) obj2;
                if (c0953d.w() == C0953d.c.a) {
                    MyApps.this.t4(c0953d);
                }
            }
        }

        @Override
        public void e(int i) {
            if (UptodownApp.F.a0()) {
                if (MyApps.this.i5(i)) {
                    C0458m c0458m = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m);
                    Object obj = c0458m.b().get(i);
                    kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.models.App");
                    MyApps.this.s4((C0953d) obj);
                } else if (MyApps.this.j5(i)) {
                    C0458m c0458m2 = MyApps.this.X;
                    kotlin.jvm.internal.m.b(c0458m2);
                    Object obj2 = c0458m2.b().get(i);
                    kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                    MyApps.this.s4(((J.a) obj2).a());
                }
                C0458m c0458m3 = MyApps.this.X;
                if (c0458m3 != null) {
                    c0458m3.notifyItemChanged(i);
                }
            }
        }

        @Override
        public void f(int i) {
            if (MyApps.this.i5(i)) {
                C0458m c0458m = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m);
                Object obj = c0458m.b().get(i);
                kotlin.jvm.internal.m.c(obj, "null cannot be cast to non-null type com.uptodown.models.App");
                ((C0953d) obj).a0(false);
                C0458m c0458m2 = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m2);
                c0458m2.notifyItemChanged(i);
                return;
            }
            if (MyApps.this.j5(i)) {
                C0458m c0458m3 = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m3);
                Object obj2 = c0458m3.b().get(i);
                kotlin.jvm.internal.m.c(obj2, "null cannot be cast to non-null type com.uptodown.adapters.UpdatesAdapter.AppUpdateData");
                ((J.a) obj2).a().a0(false);
                C0458m c0458m4 = MyApps.this.X;
                kotlin.jvm.internal.m.b(c0458m4);
                c0458m4.notifyItemChanged(i);
            }
        }
    }

    static final class k extends kotlin.coroutines.jvm.internal.l implements d3.p {
        int a;
        final String c;
        final int d;

        k(String str, int i, V2.d dVar) {
            super(2, dVar);
            this.c = str;
            this.d = i;
        }

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

        @Override
        public final java.lang.Object invokeSuspend(java.lang.Object r7) {
            throw new UnsupportedOperationException("Method not decompiled: com.uptodown.activities.MyApps.k.invokeSuspend(java.lang.Object):java.lang.Object");
        }

        @Override
        public final Object invoke(o3.J j, V2.d dVar) {
            return ((k) create(j, dVar)).invokeSuspend(R2.s.a);
        }
    }

    static final class l extends kotlin.coroutines.jvm.internal.l implements d3.p {
        int a;
        final int b;
        final MyApps c;
        final String d;

        l(int i, MyApps myApps, String str, V2.d dVar) {
            super(2, dVar);
            this.b = i;
            this.c = myApps;
            this.d = str;
        }

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

        @Override
        public final Object invokeSuspend(Object obj) {
            W2.b.c();
            if (this.a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            R2.n.b(obj);
            int i = this.b;
            if (i == 102) {
                ?? r3 = this.c;
                String string = r3.getString(2131951904);
                kotlin.jvm.internal.m.d(string, "getString(...)");
                r3.r0(string);
            } else if (i == 104) {
                ?? r32 = this.c;
                String string2 = r32.getString(2131952403);
                kotlin.jvm.internal.m.d(string2, "getString(...)");
                r32.r0(string2);
            } else if (i == 106) {
                ?? r33 = this.c;
                String string3 = r33.getString(2131951958);
                kotlin.jvm.internal.m.d(string3, "getString(...)");
                r33.r0(string3);
            }
            int X4 = this.c.X4(this.d);
            if (X4 > -1) {
                C0458m c0458m = this.c.X;
                kotlin.jvm.internal.m.b(c0458m);
                c0458m.notifyItemChanged(X4);
            }
            return R2.s.a;
        }

        @Override
        public final Object invoke(o3.J j, V2.d dVar) {
            return ((l) create(j, dVar)).invokeSuspend(R2.s.a);
        }
    }

    public final void T4(String str) {
        Y4().i(str);
        k5(true);
    }

    public static final c2.S U4(MyApps myApps) {
        return c2.S.c(myApps.getLayoutInflater());
    }

    public final c2.S W4() {
        return (c2.S) this.V.getValue();
    }

    public final int X4(String str) {
        C0458m c0458m = this.X;
        ArrayList b4 = c0458m != null ? c0458m.b() : null;
        if (b4 == null || b4.isEmpty()) {
            return -1;
        }
        C0458m c0458m2 = this.X;
        ArrayList b5 = c0458m2 != null ? c0458m2.b() : null;
        kotlin.jvm.internal.m.b(b5);
        int i4 = 0;
        for (Object obj : b5) {
            int i5 = i4 + 1;
            if (((obj instanceof g2.P) && m3.m.p(((g2.P) obj).h(), str, true)) || ((obj instanceof C0953d) && m3.m.p(((C0953d) obj).o(), str, true))) {
                return i4;
            }
            i4 = i5;
        }
        return -1;
    }

    public final r Y4() {
        return (r) this.W.getValue();
    }

    private final void Z4() {
        setContentView(W4().getRoot());
        Drawable drawable = ContextCompat.getDrawable(this, N1.e.c);
        if (drawable != null) {
            W4().g.setNavigationIcon(drawable);
            W4().g.setNavigationContentDescription(getString(2131951721));
        }
        W4().g.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyApps.a5(MyApps.this, view);
            }
        });
        W4().g.inflateMenu(2131689478);
        TextView textView = W4().i;
        k.a aVar = N1.k.g;
        textView.setTypeface(aVar.w());
        W4().h.setTypeface(aVar.x());
        a.C0191a c0191a = com.uptodown.activities.preferences.a.a;
        boolean b0 = c0191a.b0(this);
        W4().g.getMenu().findItem(2131361889).setChecked(b0);
        W4().g.getMenu().findItem(2131361890).setChecked(c0191a.c0(this));
        Toolbar toolbarMyApps = W4().g;
        kotlin.jvm.internal.m.d(toolbarMyApps, "toolbarMyApps");
        k4(2131361890, b0, toolbarMyApps);
        W4().g.setOverflowIcon(ContextCompat.getDrawable(this, 2131231448));
        W4().g.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
            public final boolean onMenuItemClick(MenuItem menuItem) {
                boolean b5;
                b5 = MyApps.b5(MyApps.this, menuItem);
                return b5;
            }
        });
        W4().b.c.setTypeface(aVar.x());
        W4().b.d.setTypeface(aVar.w());
        W4().b.d.setText(getString(2131952461));
        final HashMap hashMap = new HashMap();
        hashMap.put(0, getString(2131952461));
        hashMap.put(1, getString(2131952460));
        hashMap.put(2, getString(2131952463));
        W4().b.getRoot().setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyApps.c5(MyApps.this, hashMap, view);
            }
        });
        int dimension = (int) getResources().getDimension(2131166020);
        W4().e.addItemDecoration(new w2.l(dimension, dimension));
        W4().e.setLayoutManager(new LinearLayoutManager(this, 1, false));
        W4().e.setItemAnimator(new DefaultItemAnimator());
        NestedScrollView nsvMyApps = W4().d;
        kotlin.jvm.internal.m.d(nsvMyApps, "nsvMyApps");
        hideKeyboardOnScroll(nsvMyApps);
        SimpleItemAnimator itemAnimator = W4().e.getItemAnimator();
        kotlin.jvm.internal.m.b(itemAnimator);
        itemAnimator.setSupportsChangeAnimations(false);
        W4().f.setOnQueryTextListener(new d());
        EditText editText = (EditText) W4().f.findViewById(R.id.search_src_text);
        editText.setTypeface(aVar.x());
        editText.setTextColor(ContextCompat.getColor(this, N1.c.b));
        editText.setHintTextColor(ContextCompat.getColor(this, N1.c.a));
        W4().f.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyApps.e5(MyApps.this, view);
            }
        });
        W4().c.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyApps.f5(view);
            }
        });
    }

    public static final void a5(MyApps myApps, View view) {
        myApps.finish();
    }

    public static final boolean b5(MyApps myApps, MenuItem item) {
        kotlin.jvm.internal.m.e(item, "item");
        if (item.getItemId() == 2131361889) {
            boolean isChecked = item.isChecked();
            item.setChecked(!isChecked);
            a.C0191a c0191a = com.uptodown.activities.preferences.a.a;
            Context applicationContext = myApps.getApplicationContext();
            kotlin.jvm.internal.m.d(applicationContext, "getApplicationContext(...)");
            c0191a.Y0(applicationContext, !isChecked);
            if (isChecked) {
                Context applicationContext2 = myApps.getApplicationContext();
                kotlin.jvm.internal.m.d(applicationContext2, "getApplicationContext(...)");
                c0191a.Z0(applicationContext2, false);
                Toolbar toolbarMyApps = myApps.W4().g;
                kotlin.jvm.internal.m.d(toolbarMyApps, "toolbarMyApps");
                myApps.k4(2131361890, false, toolbarMyApps);
                Toolbar toolbarMyApps2 = myApps.W4().g;
                kotlin.jvm.internal.m.d(toolbarMyApps2, "toolbarMyApps");
                myApps.F3(2131361890, false, toolbarMyApps2);
            } else {
                Toolbar toolbarMyApps3 = myApps.W4().g;
                kotlin.jvm.internal.m.d(toolbarMyApps3, "toolbarMyApps");
                myApps.k4(2131361890, true, toolbarMyApps3);
            }
            myApps.k5(true);
        } else if (item.getItemId() == 2131361890) {
            boolean isChecked2 = item.isChecked();
            item.setChecked(!isChecked2);
            a.C0191a c0191a2 = com.uptodown.activities.preferences.a.a;
            Context applicationContext3 = myApps.getApplicationContext();
            kotlin.jvm.internal.m.d(applicationContext3, "getApplicationContext(...)");
            c0191a2.Z0(applicationContext3, !isChecked2);
            myApps.k5(true);
        } else if (item.getItemId() == 2131361887) {
            if (myApps.W4().f.getVisibility() == 0) {
                myApps.W4().f.setVisibility(8);
                myApps.W4().f.clearFocus();
            } else {
                myApps.W4().f.setVisibility(0);
                myApps.W4().f.requestFocus();
                SearchView searchViewMyApps = myApps.W4().f;
                kotlin.jvm.internal.m.d(searchViewMyApps, "searchViewMyApps");
                myApps.showKeyboard(searchViewMyApps);
            }
        }
        return true;
    }

    public static final void c5(final MyApps myApps, HashMap hashMap, View view) {
        kotlin.jvm.internal.m.b(view);
        new y2.q(myApps, view, hashMap, new d3.p() {
            @Override
            public final Object invoke(Object obj, Object obj2) {
                R2.s d5;
                d5 = MyApps.d5(MyApps.this, ((Integer) obj).intValue(), (String) obj2);
                return d5;
            }
        }).c();
    }

    public static final R2.s d5(MyApps myApps, int i4, String selectedOption) {
        kotlin.jvm.internal.m.e(selectedOption, "selectedOption");
        if (((Number) myApps.Y4().f().getValue()).intValue() != i4) {
            myApps.Y4().f().setValue(Integer.valueOf(i4));
            myApps.W4().b.d.setText(selectedOption);
            myApps.T4(myApps.W4().f.getQuery().toString());
        }
        return R2.s.a;
    }

    public static final void e5(MyApps myApps, View view) {
        myApps.W4().f.setIconified(false);
    }

    public static final void f5(View view) {
    }

    public final boolean i5(int i4) {
        C0458m c0458m = this.X;
        if (c0458m == null) {
            return false;
        }
        ArrayList b4 = c0458m != null ? c0458m.b() : null;
        if (b4 == null || b4.isEmpty()) {
            return false;
        }
        C0458m c0458m2 = this.X;
        ArrayList b5 = c0458m2 != null ? c0458m2.b() : null;
        kotlin.jvm.internal.m.b(b5);
        if (b5.size() <= i4) {
            return false;
        }
        C0458m c0458m3 = this.X;
        ArrayList b6 = c0458m3 != null ? c0458m3.b() : null;
        kotlin.jvm.internal.m.b(b6);
        return b6.get(i4) instanceof C0953d;
    }

    public final boolean j5(int i4) {
        C0458m c0458m = this.X;
        if (c0458m == null) {
            return false;
        }
        ArrayList b4 = c0458m != null ? c0458m.b() : null;
        if (b4 == null || b4.isEmpty()) {
            return false;
        }
        C0458m c0458m2 = this.X;
        ArrayList b5 = c0458m2 != null ? c0458m2.b() : null;
        kotlin.jvm.internal.m.b(b5);
        if (b5.size() <= i4) {
            return false;
        }
        C0458m c0458m3 = this.X;
        ArrayList b6 = c0458m3 != null ? c0458m3.b() : null;
        kotlin.jvm.internal.m.b(b6);
        return b6.get(i4) instanceof J.a;
    }

    public final void l5(ArrayList arrayList, ArrayList arrayList2, ArrayList arrayList3, ArrayList arrayList4) {
        if (this.X == null) {
            this.X = new C0458m(this.Y, this.Z, this.f257m0);
            W4().e.setAdapter(this.X);
        }
        String g4 = Y4().g();
        if (g4 != null && g4.length() != 0 && arrayList.isEmpty() && arrayList2.isEmpty() && arrayList3.isEmpty() && arrayList4.isEmpty()) {
            W4().h.setText(getString(2131952411, Y4().g()));
            W4().h.setVisibility(0);
        } else {
            W4().h.setVisibility(8);
        }
        C0458m c0458m = this.X;
        kotlin.jvm.internal.m.b(c0458m);
        c0458m.f(arrayList, arrayList2, arrayList3, arrayList4);
    }

    @Override
    public void I2() {
        C0458m c0458m = this.X;
        if (c0458m != null) {
            c0458m.e();
        }
    }

    @Override
    public void R2(File xapkFile) {
        kotlin.jvm.internal.m.e(xapkFile, "xapkFile");
        C0458m c0458m = this.X;
        if (c0458m != null) {
            c0458m.e();
        }
        C0458m c0458m2 = this.X;
        if (c0458m2 != null) {
            c0458m2.d(xapkFile, this);
        }
    }

    @Override
    public void S2(File file, int i4) {
        kotlin.jvm.internal.m.e(file, "file");
        C0458m c0458m = this.X;
        if (c0458m != null) {
            c0458m.d(file, this);
        }
    }

    @Override
    public void V2(File xapkFile) {
        kotlin.jvm.internal.m.e(xapkFile, "xapkFile");
        C0458m c0458m = this.X;
        if (c0458m != null) {
            c0458m.g(xapkFile, this);
        }
    }

    public final Object V4(String str, String str2, V2.d dVar) {
        Object g4 = o3.g.g(o3.Y.c(), new b(str2, str, null), dVar);
        return g4 == W2.b.c() ? g4 : R2.s.a;
    }

    public final void g5() {
        C0458m c0458m = this.X;
        if (c0458m != null) {
            c0458m.e();
        }
    }

    public final void h5(String str) {
        C0458m c0458m = this.X;
        if (c0458m != null) {
            c0458m.e();
        }
        if (str == null || str.length() == 0) {
            return;
        }
        String string = getString(2131952082, str);
        kotlin.jvm.internal.m.d(string, "getString(...)");
        r0(string);
    }

    public final void k5(boolean z) {
        Y4().c(this, z);
    }

    public final void m5(ArrayList arrayList) {
        o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new f(arrayList, null), 2, (Object) null);
    }

    public final void n5(int i4, String packageName) {
        kotlin.jvm.internal.m.e(packageName, "packageName");
        o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new k(packageName, i4, null), 2, (Object) null);
    }

    public final void o5(int i4, String str) {
        o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new l(i4, this, str, null), 2, (Object) null);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Z4();
        o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), (V2.g) null, (o3.L) null, new e(null), 3, (Object) null);
    }

    public boolean onKeyDown(int i4, KeyEvent event) {
        kotlin.jvm.internal.m.e(event, "event");
        if (i4 != 82) {
            return super.onKeyDown(i4, event);
        }
        W4().g.showOverflowMenu();
        return true;
    }

    @Override
    protected void onResume() {
        super.onResume();
        k5(true);
        u2.F.a.h(this);
    }

    @Override
    public void u4(int i4, int i5) {
        k5(false);
    }

    @Override
    public void v4(int i4, int i5) {
        k5(false);
    }

    @Override
    protected void y4() {
        k5(false);
    }
}