导航菜单

页面标题

页面副标题

Fancy Optimizer v4.6.3 - AppManagerActivity.java 源代码

正在查看: Fancy Optimizer v4.6.3 应用的 AppManagerActivity.java JAVA 源代码文件

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


package com.fancyclean.boost.appmanager.ui.activity;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.widget.ViewPager2;
import c.p;
import com.adtiny.core.d;
import com.applovin.exoplayer2.a.q;
import com.facebook.internal.i0;
import com.fancyclean.boost.appmanager.ui.activity.AppManagerActivity;
import com.fancyclean.boost.appmanager.ui.presenter.AppManagerPresenter;
import com.fancyclean.boost.permissionmanager.ui.activity.AppPermissionsActivity;
import com.google.android.gms.ads.mediation.MediationConfiguration;
import com.google.android.material.tabs.TabLayout;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.thinkyeah.common.ui.dialog.ProgressDialogFragment;
import com.thinkyeah.common.ui.dialog.c;
import com.thinkyeah.common.ui.view.TitleBar;
import d6.d;
import d6.d.a;
import ek.m;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import ml.o;

@gl.d(AppManagerPresenter.class)
public class AppManagerActivity extends v7.a<e6.b> implements e6.c, h6.a {
    public static final vj.h B = new vj.h("AppManagerActivity");
    public d6.e p;
    public ok.a q;
    public h r;
    public TitleBar s;
    public TabLayout t;
    public ViewPager2 u;
    public Button v;
    public Button w;

    public View f158x;
    public boolean l = false;
    public final String[] m = {"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"};
    public HashSet n = new HashSet();
    public final i o = new i();

    public final a f159y = new a();

    public final b f160z = new b();
    public final c A = new c();

    public class a implements TitleBar.d {
        public a() {
        }

        public final void a(TitleBar.j jVar) {
            TitleBar.j jVar2 = TitleBar.j.c;
            AppManagerActivity appManagerActivity = AppManagerActivity.this;
            if (jVar == jVar2) {
                appManagerActivity.s.setSearchText((String) null);
                AppManagerActivity.X2(appManagerActivity, null);
            } else if (jVar == TitleBar.j.e) {
                AppManagerActivity.B.c("onTitle Mode changed to search");
            } else {
                appManagerActivity.finish();
            }
        }
    }

    public class b extends ViewPager2.OnPageChangeCallback {
        public b() {
        }

        public final void onPageSelected(int r8) {
            throw new UnsupportedOperationException("Method not decompiled: com.fancyclean.boost.appmanager.ui.activity.AppManagerActivity.b.onPageSelected(int):void");
        }
    }

    public class c implements d.InterfaceC0183d {
        public c() {
        }
    }

    public static class d extends com.thinkyeah.common.ui.dialog.c<AppManagerActivity> {
        public static final int c = 0;

        @NonNull
        public final Dialog onCreateDialog(Bundle bundle) {
            Bundle arguments = getArguments();
            if (getActivity() == null || arguments == null) {
                return d0();
            }
            String string = getString(2131886649, new Object[]{Integer.valueOf(arguments.getInt("BACKUP_APPS_COUNT"))});
            c.a aVar = new c.a(getActivity());
            aVar.g(2131886208);
            aVar.k = string;
            aVar.e(2131886208, new com.facebook.login.g(this, 3));
            aVar.d(2131886274, (DialogInterface.OnClickListener) null);
            int color = ((AppManagerActivity) getActivity()).getColor(2131100607);
            aVar.r = true;
            aVar.s = color;
            return aVar.a();
        }
    }

    public static class e extends com.thinkyeah.common.ui.dialog.c<AppManagerActivity> {
        public static final int c = 0;

        @NonNull
        public final Dialog onCreateDialog(Bundle bundle) {
            Bundle arguments = getArguments();
            FragmentActivity activity = getActivity();
            if (arguments == null) {
                return d0();
            }
            boolean z10 = arguments.getBoolean("RESULT");
            int i = arguments.getInt("SUCCESS_COUNT");
            int i10 = arguments.getInt("TOTAL_COUNT");
            View inflate = View.inflate(activity, 2131558583, null);
            ((TextView) inflate.findViewById(2131363522)).setText(z10 ? getString(2131886212, new Object[]{Integer.valueOf(i)}) : getString(2131886209, new Object[]{Integer.valueOf(i10 - i)}));
            c.a aVar = new c.a(getActivity());
            aVar.g(2131886208);
            aVar.x = inflate;
            aVar.d(2131887306, (DialogInterface.OnClickListener) null);
            int color = ((AppManagerActivity) getActivity()).getColor(2131100607);
            aVar.r = true;
            aVar.s = color;
            aVar.e(2131886296, new t4.g(this, 2));
            return aVar.a();
        }
    }

    public static class f extends zk.b {
        public static final int c = 0;

        @NonNull
        public final Dialog onCreateDialog(Bundle bundle) {
            Date date;
            Bundle arguments = getArguments();
            FragmentActivity activity = getActivity();
            final ?? r32 = (AppManagerActivity) activity;
            final String string = arguments.getString("APP_PKG_NAME");
            long j = arguments.getLong("APP_DATE");
            final String string2 = arguments.getString("APP_NAME");
            String string3 = arguments.getString("APP_VERSION");
            b6.a aVar = new b6.a(string);
            View inflate = View.inflate(getActivity(), 2131558855, null);
            ImageView imageView = (ImageView) inflate.findViewById(2131362397);
            TextView textView = (TextView) inflate.findViewById(2131363517);
            TextView textView2 = (TextView) inflate.findViewById(2131363629);
            TextView textView3 = (TextView) inflate.findViewById(2131363519);
            TextView textView4 = (TextView) inflate.findViewById(2131363590);
            TextView textView5 = (TextView) inflate.findViewById(2131363520);
            k7.f.c(activity).o(aVar).D(imageView);
            textView.setText(string2);
            textView2.setText(string);
            try {
                date = new SimpleDateFormat("dd-MM-yyyy", Locale.US).parse("01-01-2000");
            } catch (ParseException unused) {
                date = null;
            }
            if (j > date.getTime()) {
                textView4.setText(u7.a.c(activity, j));
            } else {
                textView4.setText(getString(2131887348));
            }
            textView5.setText(string3);
            long a = z5.e.b().a(aVar.c);
            final int i = 1;
            if (a != -2) {
                textView3.setText(o.a(1, a));
            } else if (r32.o.c) {
                textView3.setText(2131887241);
            } else {
                textView3.setText(2131886268);
            }
            final int i10 = 0;
            inflate.findViewById(2131363743).setOnClickListener(new View.OnClickListener(this) {
                public final AppManagerActivity.f d;

                {
                    this.d = this;
                }

                @Override
                public final void onClick(View view) {
                    int i11 = i10;
                    String str = string;
                    il.b bVar = r32;
                    AppManagerActivity.f fVar = this.d;
                    switch (i11) {
                        case 0:
                            int i12 = AppManagerActivity.f.c;
                            fVar.getClass();
                            vj.h hVar = AppManagerActivity.B;
                            bVar.getClass();
                            bVar.r = new AppManagerActivity.h(str, null);
                            if (Build.VERSION.SDK_INT < 30) {
                                ok.a aVar2 = bVar.q;
                                String[] strArr = bVar.m;
                                if (aVar2.a(strArr)) {
                                    ((e6.b) bVar.W2()).l0(str);
                                } else {
                                    bVar.q.e(strArr, new q(4, bVar, str), false);
                                }
                            } else if (androidx.work.impl.utils.a.d()) {
                                ((e6.b) bVar.W2()).l0(str);
                            } else {
                                ek.d.h(bVar, 1647, true);
                                com.adtiny.core.d.b().getClass();
                                com.adtiny.core.d.f();
                            }
                            fVar.dismiss();
                            break;
                        default:
                            int i13 = AppManagerActivity.f.c;
                            fVar.getClass();
                            bVar.Z1(str);
                            fVar.dismiss();
                            break;
                    }
                }
            });
            inflate.findViewById(2131363833).setOnClickListener(new c6.h(this, r32, string, 0));
            inflate.findViewById(2131363832).setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    int i11 = AppManagerActivity.f.c;
                    AppManagerActivity.f fVar = AppManagerActivity.f.this;
                    fVar.getClass();
                    ((e6.b) r32.W2()).N(string);
                    fVar.dismiss();
                }
            });
            inflate.findViewById(2131363737).setOnClickListener(new c6.b(this, r32, string, 1));
            inflate.findViewById(2131363762).setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    int i11 = AppManagerActivity.f.c;
                    AppManagerActivity.f fVar = AppManagerActivity.f.this;
                    fVar.getClass();
                    il.e eVar = r32;
                    eVar.getClass();
                    tk.b a10 = tk.b.a();
                    HashMap hashMap = new HashMap();
                    String str = string;
                    hashMap.put(CampaignEx.JSON_KEY_PACKAGE_NAME, str);
                    a10.b("CLK_AM_CheckPermission", hashMap);
                    AppPermissionsActivity.X2(eVar, string2, str);
                    fVar.dismiss();
                }
            });
            inflate.findViewById(2131363849).setOnClickListener(new View.OnClickListener(this) {
                public final AppManagerActivity.f d;

                {
                    this.d = this;
                }

                @Override
                public final void onClick(View view) {
                    int i11 = i;
                    String str = string;
                    il.b bVar = r32;
                    AppManagerActivity.f fVar = this.d;
                    switch (i11) {
                        case 0:
                            int i12 = AppManagerActivity.f.c;
                            fVar.getClass();
                            vj.h hVar = AppManagerActivity.B;
                            bVar.getClass();
                            bVar.r = new AppManagerActivity.h(str, null);
                            if (Build.VERSION.SDK_INT < 30) {
                                ok.a aVar2 = bVar.q;
                                String[] strArr = bVar.m;
                                if (aVar2.a(strArr)) {
                                    ((e6.b) bVar.W2()).l0(str);
                                } else {
                                    bVar.q.e(strArr, new q(4, bVar, str), false);
                                }
                            } else if (androidx.work.impl.utils.a.d()) {
                                ((e6.b) bVar.W2()).l0(str);
                            } else {
                                ek.d.h(bVar, 1647, true);
                                com.adtiny.core.d.b().getClass();
                                com.adtiny.core.d.f();
                            }
                            fVar.dismiss();
                            break;
                        default:
                            int i13 = AppManagerActivity.f.c;
                            fVar.getClass();
                            bVar.Z1(str);
                            fVar.dismiss();
                            break;
                    }
                }
            });
            Dialog onCreateDialog = super/*com.google.android.material.bottomsheet.c*/.onCreateDialog(bundle);
            onCreateDialog.setContentView(inflate);
            return onCreateDialog;
        }
    }

    public static class g extends com.thinkyeah.common.ui.dialog.c<AppManagerActivity> {
        public static final int c = 0;

        @NonNull
        public final Dialog onCreateDialog(Bundle bundle) {
            CharSequence string;
            Bundle arguments = getArguments();
            if (getActivity() == null || arguments == null) {
                return d0();
            }
            int i = arguments.getInt("UNINSTALL_APPS_COUNT");
            long j = arguments.getLong("FREE_UP_SPACE_SIZE");
            if (j > 0) {
                StringBuilder p = android.support.v4.media.b.p(getString(2131886700, new Object[]{Integer.valueOf(i)}), " ");
                p.append(getString(2131887753, new Object[]{o.a(1, j)}));
                string = Html.fromHtml(p.toString());
            } else {
                string = getString(2131886700, new Object[]{Integer.valueOf(i)});
            }
            c.a aVar = new c.a(getActivity());
            aVar.g(2131888151);
            aVar.k = string;
            aVar.e(2131888151, new t4.e(this, 2));
            aVar.d(2131886274, (DialogInterface.OnClickListener) null);
            int color = ((AppManagerActivity) getActivity()).getColor(2131100607);
            aVar.r = true;
            aVar.s = color;
            return aVar.a();
        }
    }

    public static class h {
        public final Set<String> a;
        public final String b;

        public h(String str, HashSet hashSet) {
            this.a = hashSet;
            this.b = str;
        }
    }

    public static class i {
        public List<b6.a> b;
        public boolean a = false;
        public boolean c = false;
    }

    public static void X2(AppManagerActivity appManagerActivity, String str) {
        Iterator it = appManagerActivity.p.d().iterator();
        while (it.hasNext()) {
            f6.b bVar = (f6.b) it.next();
            bVar.i = str;
            d6.d dVar = bVar.c;
            dVar.getClass();
            dVar.new a().filter(bVar.i);
        }
    }

    @Override
    public final void A() {
        Z2(true);
    }

    @Override
    public final void E2() {
        f6.b c10 = this.p.c(this.t.getSelectedTabPosition());
        if (c10 != null) {
            a3();
            Iterator it = this.p.d().iterator();
            while (it.hasNext()) {
                f6.b bVar = (f6.b) it.next();
                if (bVar != c10) {
                    bVar.c.notifyDataSetChanged();
                }
            }
        }
    }

    @Override
    public final void L2(String str) {
        Intent intent = new Intent("android.intent.action.SEND");
        intent.setType("text/plain");
        intent.putExtra("android.intent.extra.TEXT", str);
        startActivity(intent);
    }

    @Override
    public final void Q(int i10, String str) {
        String string = i10 > 1 ? getString(2131886206, 1, Integer.valueOf(i10)) : getString(2131886207);
        getApplicationContext();
        Parcelable parameter = new ProgressDialogFragment.Parameter();
        ((ProgressDialogFragment.Parameter) parameter).d = string;
        ((ProgressDialogFragment.Parameter) parameter).g = false;
        ((ProgressDialogFragment.Parameter) parameter).c = str;
        ProgressDialogFragment progressDialogFragment = new ProgressDialogFragment();
        Bundle bundle = new Bundle();
        bundle.putParcelable(MediationConfiguration.CUSTOM_EVENT_SERVER_PARAMETER_FIELD, parameter);
        progressDialogFragment.setArguments(bundle);
        progressDialogFragment.u = null;
        progressDialogFragment.j0(this, "backup_apk_progress_dialog");
    }

    @Override
    public final void Q1() {
        Iterator it = this.p.d().iterator();
        while (it.hasNext()) {
            f6.b bVar = (f6.b) it.next();
            bVar.getClass();
            f6.b.l.c("==> notifyLoadAppSizeCompleted");
            if (bVar.f == 2) {
                bVar.G(bVar.h == null ? new ArrayList() : new ArrayList(bVar.h));
            } else {
                bVar.c.notifyDataSetChanged();
            }
        }
    }

    @Override
    public final void U() {
        this.o.a = false;
        this.p.e();
    }

    @Override
    public final boolean U1() {
        return this.o.c;
    }

    public final void Y2() {
        this.n.clear();
        a3();
        Iterator it = this.p.d().iterator();
        while (it.hasNext()) {
            ((f6.b) it.next()).O();
        }
    }

    @Override
    public final void Z1(String str) {
        startActivityForResult(new Intent("android.intent.action.DELETE", Uri.parse("package:" + str)), 1);
    }

    public final void Z2(boolean z10) {
        this.o.c = z10;
        Iterator it = this.p.d().iterator();
        while (it.hasNext()) {
            ((f6.b) it.next()).R();
        }
    }

    public final void a3() {
        HashSet hashSet = this.n;
        if (hashSet == null || hashSet.size() <= 0) {
            this.v.setText(getString(2131888151));
            this.v.setEnabled(false);
            this.w.setEnabled(false);
        } else {
            this.v.setText(getString(2131888152, Integer.valueOf(this.n.size())));
            this.v.setEnabled(true);
            this.w.setEnabled(true);
        }
    }

    @Override
    public final void b() {
        this.o.a = true;
        this.p.e();
    }

    @Override
    public final boolean b1() {
        return this.o.a;
    }

    @Override
    public final void d(List<b6.a> list) {
        this.o.b = list;
        Y2();
    }

    @Override
    public final List<b6.a> d0() {
        return this.o.b;
    }

    @Override
    public final void d2() {
        Iterator it = this.p.d().iterator();
        while (it.hasNext()) {
            f6.b bVar = (f6.b) it.next();
            bVar.getClass();
            f6.b.l.c("==> showLoadAppLastUsedTimeCompleted");
            if (bVar.f == 3) {
                bVar.G(bVar.h == null ? new ArrayList() : new ArrayList(bVar.h));
            } else {
                bVar.c.notifyDataSetChanged();
            }
        }
    }

    public final void finish() {
        com.adtiny.core.d.b().h(this, "I_AppManager", (d.l) null);
        super/*android.app.Activity*/.finish();
    }

    @Override
    public final c j0() {
        return this.A;
    }

    @Override
    public final void j2() {
        Z2(false);
    }

    public final void onActivityResult(int i10, int i11, Intent intent) {
        h hVar;
        if (i10 == 1) {
            ((e6.b) W2()).y0();
            return;
        }
        if (i10 != 1647) {
            super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(i10, i11, intent);
            return;
        }
        if (Build.VERSION.SDK_INT < 30 || !androidx.work.impl.utils.a.d() || (hVar = this.r) == null) {
            return;
        }
        if (hVar.a != null) {
            ((e6.b) W2()).f1(this.n);
        } else {
            if (TextUtils.isEmpty(hVar.b)) {
                return;
            }
            ((e6.b) W2()).l0(this.r.b);
        }
    }

    public final void onBackPressed() {
        if (this.s.getTitleMode() == TitleBar.j.e) {
            this.s.g(TitleBar.j.c);
        } else {
            super/*androidx.activity.ComponentActivity*/.onBackPressed();
        }
    }

    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(2131558442);
        long currentTimeMillis = System.currentTimeMillis();
        SharedPreferences sharedPreferences = getSharedPreferences("app_manager", 0);
        SharedPreferences.Editor edit = sharedPreferences == null ? null : sharedPreferences.edit();
        if (edit != null) {
            edit.putLong("last_enter_app_manager_time", currentTimeMillis);
            edit.apply();
        }
        ok.a aVar = new ok.a(this, 2131887868);
        this.q = aVar;
        aVar.c();
        this.n = new HashSet();
        ArrayList arrayList = new ArrayList();
        TitleBar.i iVar = new TitleBar.i(new TitleBar.b(2131232021), new TitleBar.e(2131887438), new c.e(this, 9));
        arrayList.add(new TitleBar.i(new TitleBar.b(2131231478), new TitleBar.e(2131887457), new p(this, 8)));
        arrayList.add(iVar);
        TitleBar findViewById = findViewById(2131363196);
        this.s = findViewById;
        TitleBar.a configure = findViewById.getConfigure();
        configure.e(2131887868);
        TitleBar titleBar = configure.a;
        titleBar.h = arrayList;
        titleBar.x = new c6.e(this);
        titleBar.w = new t4.a(this, 4);
        configure.g(new i0(this, 7));
        titleBar.y = this.f159y;
        configure.a();
        ViewPager2 findViewById2 = findViewById(2131363869);
        this.u = findViewById2;
        findViewById2.setOffscreenPageLimit(4);
        d6.e eVar = new d6.e(this);
        this.p = eVar;
        this.u.setAdapter(eVar);
        TabLayout findViewById3 = findViewById(2131363205);
        this.t = findViewById3;
        findViewById3.a(new c6.f(this));
        new com.google.android.material.tabs.e(this.t, this.u, new androidx.constraintlayout.core.state.e(17)).a();
        this.p.getClass();
        int i10 = 0;
        while (i10 < 4) {
            TabLayout.g h10 = this.t.h(i10);
            if (h10 != null) {
                h10.e = LayoutInflater.from(h10.h.getContext()).inflate(2131558857, (ViewGroup) h10.h, false);
                TabLayout.i iVar2 = h10.h;
                if (iVar2 != null) {
                    iVar2.e();
                }
                View view = h10.e;
                ((TextView) view.findViewById(2131363694)).setText(i10 == 0 ? getString(2131887235) : i10 == 1 ? getString(2131887005) : i10 == 2 ? getString(2131887463) : getString(2131887057));
                ((ImageView) view.findViewById(2131362509)).setImageResource(d6.e.j[i10] == 0 ? 2131231548 : 2131231549);
                if (i10 == 0) {
                    view.setAlpha(1.0f);
                } else {
                    view.setAlpha(0.5f);
                }
            }
            i10++;
        }
        this.u.registerOnPageChangeCallback(this.f160z);
        this.f158x = findViewById(2131362571);
        Button button = (Button) findViewById(2131362035);
        this.v = button;
        button.setOnClickListener(new t4.d(this, 5));
        this.v.setEnabled(false);
        Button button2 = (Button) findViewById(2131361989);
        this.w = button2;
        button2.setOnClickListener(new com.facebook.login.d(this, 6));
        this.w.setEnabled(false);
        Y2();
        ((e6.b) W2()).b();
    }

    public final void onDestroy() {
        this.q.f();
        if (this.l) {
            m.a(this);
        }
        this.u.unregisterOnPageChangeCallback(this.f160z);
        super/*il.b*/.onDestroy();
    }

    public final void onResume() {
        super/*wk.a*/.onResume();
        if (this.l) {
            m.a(this);
        }
    }

    @Override
    public final void s0(int i10, int i11, boolean z10) {
        vj.h hVar = u7.a.a;
        com.thinkyeah.common.ui.dialog.c cVar = (DialogFragment) getSupportFragmentManager().findFragmentByTag("backup_apk_progress_dialog");
        if (cVar != null) {
            if (cVar instanceof com.thinkyeah.common.ui.dialog.c) {
                cVar.O(this);
            } else {
                try {
                    cVar.dismiss();
                } catch (Exception unused) {
                }
            }
        }
        e eVar = new e();
        Bundle bundle = new Bundle();
        bundle.putBoolean("RESULT", z10);
        bundle.putInt("SUCCESS_COUNT", i10);
        bundle.putInt("TOTAL_COUNT", i11);
        eVar.setArguments(bundle);
        eVar.j0(this, "backup_apk_result_dialog");
    }

    @Override
    public final void x1(int i10, int i11) {
        ProgressDialogFragment progressDialogFragment = (DialogFragment) getSupportFragmentManager().findFragmentByTag("backup_apk_progress_dialog");
        if (progressDialogFragment instanceof ProgressDialogFragment) {
            ProgressDialogFragment progressDialogFragment2 = progressDialogFragment;
            String string = i11 > 1 ? getString(2131886206, Integer.valueOf(i10), Integer.valueOf(i11)) : getString(2131886207);
            progressDialogFragment2.s.d = string;
            progressDialogFragment2.e.setText(string);
        }
    }

    @Override
    public final Context getContext() {
        return this;
    }
}