导航菜单

页面标题

页面副标题

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

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

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


package com.uptodown.activities;

import M1.C0459n;
import N1.k;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
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 b2.C0560i;
import com.uptodown.UptodownApp;
import com.uptodown.activities.C0758t;
import com.uptodown.activities.NotificationsRegistryActivity;
import f2.InterfaceC0934q;
import f2.InterfaceC0937u;
import g2.C0955f;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import u2.H;

public final class NotificationsRegistryActivity extends AbstractC0740a {
    private boolean L;
    private C0459n N;
    private final R2.g J = R2.h.a(new d3.a() {
        @Override
        public final Object invoke() {
            c2.W p3;
            p3 = NotificationsRegistryActivity.p3(NotificationsRegistryActivity.this);
            return p3;
        }
    });
    private final R2.g K = new ViewModelLazy(kotlin.jvm.internal.D.b(C0758t.class), new f(this), new e(this), new g(null, this));
    private boolean M = true;
    private c O = new c();

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

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

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

        @Override
        public final Object invokeSuspend(Object obj) {
            Object c = W2.b.c();
            int i = this.a;
            if (i == 0) {
                R2.n.b(obj);
                NotificationsRegistryActivity notificationsRegistryActivity = NotificationsRegistryActivity.this;
                int i4 = this.c;
                this.a = 1;
                if (notificationsRegistryActivity.D3(i4, this) == c) {
                    return c;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                R2.n.b(obj);
            }
            return R2.s.a;
        }

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

    public static final class b implements InterfaceC0934q {
        b() {
        }

        @Override
        public void c(int i) {
            ?? r3 = NotificationsRegistryActivity.this;
            String string = r3.getString(2131951688);
            kotlin.jvm.internal.m.d(string, "getString(...)");
            r3.r0(string);
        }

        @Override
        public void d(C0955f appInfo) {
            kotlin.jvm.internal.m.e(appInfo, "appInfo");
            Intent intent = new Intent((Context) NotificationsRegistryActivity.this, (Class<?>) AppDetailActivity.class);
            intent.putExtra("appInfo", appInfo);
            AppCompatActivity appCompatActivity = NotificationsRegistryActivity.this;
            appCompatActivity.startActivity(intent, UptodownApp.F.a(appCompatActivity));
        }
    }

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

        @Override
        public void a(int i) {
            NotificationsRegistryActivity.this.B3(i, 1);
        }

        @Override
        public void b(int i) {
            NotificationsRegistryActivity.this.q3(i);
        }

        @Override
        public void c(int i) {
            NotificationsRegistryActivity.this.B3(i, 0);
        }
    }

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

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

            a(NotificationsRegistryActivity notificationsRegistryActivity) {
                this.a = notificationsRegistryActivity;
            }

            public final Object emit(u2.H h, V2.d dVar) {
                if (h instanceof H.a) {
                    this.a.u3().b.setVisibility(0);
                } else if (h instanceof H.c) {
                    this.a.C3(((C0758t.a) ((H.c) h).a()).a());
                    this.a.M = false;
                    this.a.L = false;
                    this.a.u3().b.setVisibility(8);
                } else if (!(h instanceof H.b)) {
                    throw new R2.k();
                }
                return R2.s.a;
            }
        }

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

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return NotificationsRegistryActivity.this.new d(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 = NotificationsRegistryActivity.this.w3().e();
                a aVar = new a(NotificationsRegistryActivity.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 ((d) create(j, dVar)).invokeSuspend(R2.s.a);
        }
    }

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

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

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

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

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

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

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

        public g(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;
        }
    }

    static final class h extends kotlin.coroutines.jvm.internal.d {
        Object a;
        int b;
        Object c;
        int e;

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

        @Override
        public final Object invokeSuspend(Object obj) {
            this.c = obj;
            this.e |= Integer.MIN_VALUE;
            return NotificationsRegistryActivity.this.D3(0, this);
        }
    }

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

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

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return NotificationsRegistryActivity.this.new i(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);
            String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault()).format(kotlin.coroutines.jvm.internal.b.c(System.currentTimeMillis()));
            kotlin.jvm.internal.m.d(format, "format(...)");
            C0758t w3 = NotificationsRegistryActivity.this.w3();
            ?? r12 = NotificationsRegistryActivity.this;
            C0459n c0459n = ((NotificationsRegistryActivity) r12).N;
            kotlin.jvm.internal.m.b(c0459n);
            Object obj2 = c0459n.a().get(this.c);
            kotlin.jvm.internal.m.d(obj2, "get(...)");
            w3.f(r12, (g2.z) obj2, format);
            C0459n c0459n2 = NotificationsRegistryActivity.this.N;
            kotlin.jvm.internal.m.b(c0459n2);
            ((g2.z) c0459n2.a().get(this.c)).k(NotificationsRegistryActivity.this.getString(2131952040, format));
            C0459n c0459n3 = NotificationsRegistryActivity.this.N;
            kotlin.jvm.internal.m.b(c0459n3);
            ((g2.z) c0459n3.a().get(this.c)).i("no_action");
            return R2.s.a;
        }

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

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

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

        @Override
        public final V2.d create(Object obj, V2.d dVar) {
            return NotificationsRegistryActivity.this.new j(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);
            C0459n c0459n = NotificationsRegistryActivity.this.N;
            kotlin.jvm.internal.m.b(c0459n);
            c0459n.notifyItemChanged(this.c);
            return R2.s.a;
        }

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

    public static final void A3(View view) {
    }

    public final void B3(int i4, int i5) {
        C0459n c0459n = this.N;
        if (c0459n != null) {
            kotlin.jvm.internal.m.b(c0459n);
            if (c0459n.getItemCount() > i4) {
                C0459n c0459n2 = this.N;
                kotlin.jvm.internal.m.b(c0459n2);
                Object obj = c0459n2.a().get(i4);
                kotlin.jvm.internal.m.d(obj, "get(...)");
                g2.z zVar = (g2.z) obj;
                if (zVar.a() != null) {
                    String a4 = zVar.a();
                    kotlin.jvm.internal.m.b(a4);
                    List j0 = m3.m.j0(a4, new String[]{";"}, false, 0, 6, null);
                    if (j0.size() > i5) {
                        t3((String) j0.get(i5), zVar.b(), i4);
                    }
                }
            }
        }
    }

    public final void C3(ArrayList arrayList) {
        if (arrayList.isEmpty()) {
            C0459n c0459n = this.N;
            if (c0459n != null) {
                c0459n.d(new ArrayList());
            }
            C0459n c0459n2 = this.N;
            if (c0459n2 != null) {
                c0459n2.notifyDataSetChanged();
            }
            u3().e.setVisibility(0);
            return;
        }
        C0459n c0459n3 = this.N;
        if (c0459n3 == null) {
            this.N = new C0459n(arrayList, this, this.O);
            u3().c.setAdapter(this.N);
        } else {
            if (c0459n3 != null) {
                c0459n3.d(arrayList);
            }
            C0459n c0459n4 = this.N;
            if (c0459n4 != null) {
                c0459n4.notifyDataSetChanged();
            }
        }
        u3().e.setVisibility(8);
    }

    public final java.lang.Object D3(int r7, V2.d r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.uptodown.activities.NotificationsRegistryActivity.D3(int, V2.d):java.lang.Object");
    }

    public static final c2.W p3(NotificationsRegistryActivity notificationsRegistryActivity) {
        return c2.W.c(notificationsRegistryActivity.getLayoutInflater());
    }

    public final void q3(int i4) {
        C0459n c0459n = this.N;
        if (c0459n != null) {
            kotlin.jvm.internal.m.b(c0459n);
            if (c0459n.getItemCount() > i4) {
                C0758t w3 = w3();
                C0459n c0459n2 = this.N;
                kotlin.jvm.internal.m.b(c0459n2);
                w3.c(this, ((g2.z) c0459n2.a().get(i4)).c());
                C0459n c0459n3 = this.N;
                kotlin.jvm.internal.m.b(c0459n3);
                c0459n3.a().remove(i4);
                C0459n c0459n4 = this.N;
                kotlin.jvm.internal.m.b(c0459n4);
                c0459n4.notifyItemRemoved(i4);
            }
        }
    }

    private final void r3(final File file, final int i4) {
        String string = getString(N1.i.D, file.getName());
        kotlin.jvm.internal.m.d(string, "getString(...)");
        P1(string, new d3.a() {
            @Override
            public final Object invoke() {
                R2.s s3;
                s3 = NotificationsRegistryActivity.s3(file, this, i4);
                return s3;
            }
        });
    }

    public static final R2.s s3(File file, NotificationsRegistryActivity notificationsRegistryActivity, int i4) {
        if (file.delete()) {
            String string = notificationsRegistryActivity.getString(2131952644, file.getName());
            kotlin.jvm.internal.m.d(string, "getString(...)");
            notificationsRegistryActivity.r0(string);
            o3.g.d(o3.K.a(o3.Y.b()), (V2.g) null, (o3.L) null, notificationsRegistryActivity.new a(i4, null), 3, (Object) null);
        }
        return R2.s.a;
    }

    private final void t3(String str, String str2, int i4) {
        switch (str.hashCode()) {
            case -1569440520:
                if (str.equals("positive_apps")) {
                    startActivity(new Intent((Context) this, (Class<?>) SecurityActivity.class), UptodownApp.F.a(this));
                    R2.s sVar = R2.s.a;
                    return;
                }
                break;
            case -1335458389:
                if (str.equals("delete")) {
                    if (str2 != null) {
                        r3(new File(str2), i4);
                    } else {
                        String string = getString(2131952303);
                        kotlin.jvm.internal.m.d(string, "getString(...)");
                        r0(string);
                    }
                    R2.s sVar2 = R2.s.a;
                    return;
                }
                break;
            case -504325460:
                if (str.equals("open_app")) {
                    if (str2 != null) {
                        try {
                            Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage(str2);
                            if (launchIntentForPackage != null) {
                                startActivity(launchIntentForPackage);
                            } else {
                                String string2 = getString(2131951688);
                                kotlin.jvm.internal.m.d(string2, "getString(...)");
                                r0(string2);
                            }
                        } catch (Exception e4) {
                            e4.printStackTrace();
                            String string3 = getString(2131951688);
                            kotlin.jvm.internal.m.d(string3, "getString(...)");
                            r0(string3);
                        }
                    } else {
                        String string4 = getString(2131952303);
                        kotlin.jvm.internal.m.d(string4, "getString(...)");
                        r0(string4);
                    }
                    R2.s sVar3 = R2.s.a;
                    return;
                }
                break;
            case -234430262:
                if (str.equals("updates")) {
                    startActivity(new Intent((Context) this, (Class<?>) Updates.class), UptodownApp.F.a(this));
                    R2.s sVar4 = R2.s.a;
                    return;
                }
                break;
            case 1085191854:
                if (str.equals("update_uptodown")) {
                    if (str2 != null) {
                        File file = new File(str2);
                        if (file.exists()) {
                            UptodownApp.a.Y(UptodownApp.F, file, this, null, 4, null);
                        } else {
                            String string5 = getString(N1.i.M);
                            kotlin.jvm.internal.m.d(string5, "getString(...)");
                            r0(string5);
                        }
                    } else {
                        String string6 = getString(2131952303);
                        kotlin.jvm.internal.m.d(string6, "getString(...)");
                        r0(string6);
                    }
                    R2.s sVar5 = R2.s.a;
                    return;
                }
                break;
            case 1117687366:
                if (str.equals("preregister")) {
                    if (str2 != null) {
                        new C0560i(this, Long.parseLong(str2), new b(), LifecycleOwnerKt.getLifecycleScope(this));
                        return;
                    }
                    String string7 = getString(2131952303);
                    kotlin.jvm.internal.m.d(string7, "getString(...)");
                    r0(string7);
                    R2.s sVar6 = R2.s.a;
                    return;
                }
                break;
            case 1312704747:
                if (str.equals("downloads")) {
                    startActivity(new Intent((Context) this, (Class<?>) MyDownloads.class), UptodownApp.F.a(this));
                    R2.s sVar7 = R2.s.a;
                    return;
                }
                break;
            case 1957569947:
                if (str.equals("install")) {
                    if (str2 != null) {
                        File file2 = new File(str2);
                        if (file2.exists()) {
                            UptodownApp.a.Y(UptodownApp.F, file2, this, null, 4, null);
                        } else {
                            String string8 = getString(N1.i.M);
                            kotlin.jvm.internal.m.d(string8, "getString(...)");
                            r0(string8);
                        }
                    } else {
                        String string9 = getString(2131952303);
                        kotlin.jvm.internal.m.d(string9, "getString(...)");
                        r0(string9);
                    }
                    R2.s sVar8 = R2.s.a;
                    return;
                }
                break;
        }
        String string10 = getString(2131952303);
        kotlin.jvm.internal.m.d(string10, "getString(...)");
        r0(string10);
        R2.s sVar9 = R2.s.a;
    }

    public final c2.W u3() {
        return (c2.W) this.J.getValue();
    }

    private final void v3() {
        w3().d(this);
    }

    public final C0758t w3() {
        return (C0758t) this.K.getValue();
    }

    private final void x3() {
        Drawable drawable = ContextCompat.getDrawable(this, N1.e.c);
        if (drawable != null) {
            u3().d.setNavigationIcon(drawable);
            u3().d.setNavigationContentDescription(getString(2131951721));
        }
        u3().d.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NotificationsRegistryActivity.y3(NotificationsRegistryActivity.this, view);
            }
        });
        u3().d.inflateMenu(2131689474);
        u3().d.setOverflowIcon(ContextCompat.getDrawable(this, 2131231448));
        u3().d.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
            public final boolean onMenuItemClick(MenuItem menuItem) {
                boolean z3;
                z3 = NotificationsRegistryActivity.z3(NotificationsRegistryActivity.this, menuItem);
                return z3;
            }
        });
        TextView textView = u3().f;
        k.a aVar = N1.k.g;
        textView.setTypeface(aVar.w());
        u3().e.setTypeface(aVar.x());
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, 1, false);
        int dimension = (int) getResources().getDimension(2131166020);
        u3().c.addItemDecoration(new w2.l(dimension, dimension));
        u3().c.setLayoutManager(linearLayoutManager);
        u3().c.setItemAnimator(new DefaultItemAnimator());
        u3().b.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NotificationsRegistryActivity.A3(view);
            }
        });
    }

    public static final void y3(NotificationsRegistryActivity notificationsRegistryActivity, View view) {
        notificationsRegistryActivity.getOnBackPressedDispatcher().onBackPressed();
    }

    public static final boolean z3(NotificationsRegistryActivity notificationsRegistryActivity, MenuItem item) {
        kotlin.jvm.internal.m.e(item, "item");
        if (item.getItemId() != 2131361871) {
            return true;
        }
        notificationsRegistryActivity.w3().b(notificationsRegistryActivity);
        return true;
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(u3().getRoot());
        x3();
        o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new d(null), 2, (Object) null);
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (this.M) {
            v3();
        }
    }
}