导航菜单

页面标题

页面副标题

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

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

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


package g9;

import android.annotation.SuppressLint;
import android.app.NotificationManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.TextUtils;
import com.mbridge.msdk.playercommon.exoplayer2.DefaultLoadControl;
import h9.g;
import h9.j;
import h9.k;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Random;
import java.util.concurrent.ExecutionException;
import vj.h;

public final class f {
    public static final h c = h.f(f.class);

    @SuppressLint({"StaticFieldLeak"})
    public static volatile f d;
    public final Context a;
    public final LinkedList b = new LinkedList();

    public f(Context context) {
        this.a = context.getApplicationContext();
    }

    public static f b(Context context) {
        if (d == null) {
            synchronized (f.class) {
                if (d == null) {
                    d = new f(context);
                }
            }
        }
        return d;
    }

    public static String c(int i) {
        if (i == 0) {
            return "JunkClean";
        }
        if (i == 21) {
            return "News";
        }
        if (i == 4) {
            return "AppLock";
        }
        if (i == 5) {
            return "GameAssistant";
        }
        switch (i) {
            case 7:
                return "Clipboard";
            case 8:
                return "AppDiary";
            case 9:
                return "Antivirus";
            case 10:
                return "VirusDBUpdate";
            case 11:
                return "ChristmasSale";
            case 12:
                return "PackageClean";
            case 13:
                return "RealtimeScanAntivirus";
            case 14:
                return "BigFiles";
            case 15:
                return "SimilarPhotos";
            case 16:
                return "WifiSecurityScan";
            case 17:
                return "PermissionManager";
            case 18:
                return "NetworkTraffic";
            case 19:
                return "ScreenshotClean";
            default:
                return "";
        }
    }

    public static void j(int i) {
        tk.b a = tk.b.a();
        HashMap hashMap = new HashMap();
        hashMap.put("content_type", c(i));
        a.b("notification_reminder", hashMap);
    }

    public final h9.b a(int i) {
        Context context = this.a;
        if (i == 0) {
            return new h9.e(context);
        }
        if (i == 4) {
            return new h9.a(context);
        }
        switch (i) {
            case 14:
                return new h9.d(context);
            case 15:
                return new j(context);
            case 16:
                return new k(context);
            case 17:
                return new h9.h(context);
            case 18:
                return new h9.f(context);
            default:
                return null;
        }
    }

    public final boolean d() {
        SharedPreferences sharedPreferences = this.a.getSharedPreferences("notification_reminder", 0);
        if (sharedPreferences == null) {
            return true;
        }
        return sharedPreferences.getBoolean("apk_install_reminder_enabled", true);
    }

    public final void e(int i) {
        c.c(android.support.v4.media.b.i("==> sendBatteryInfoNotification, type = ", i));
        Context context = this.a;
        NotificationManager notificationManager = (NotificationManager) context.getApplicationContext().getSystemService("notification");
        if (notificationManager != null) {
            notificationManager.cancel(230613);
        }
        h9.c cVar = new h9.c(context, i);
        if (cVar.b() && cVar.c()) {
            j(20);
        }
    }

    public final void f(final s4.c cVar, final boolean z10) {
        c.c("==> sendNewsNotification, isDelayed: " + z10);
        final i9.b bVar = new i9.b((String) cVar.e, (String) cVar.f);
        bVar.j = false;
        bVar.h = 2131231213;
        bVar.a = "news";
        Bundle bundle = new Bundle();
        bundle.putString("news://news_title", (String) cVar.e);
        bundle.putString("news://contnet_url", (String) cVar.c);
        bundle.putString("news://tracking_id", (String) cVar.d);
        bundle.putBoolean("news://is_delayed", z10);
        bVar.i = bundle;
        new Thread(new Runnable() {
            @Override
            public final void run() {
                f fVar = f.this;
                fVar.getClass();
                s4.c cVar2 = cVar;
                String str = (String) cVar2.g;
                i9.b bVar2 = bVar;
                Context context = fVar.a;
                if (str != null) {
                    try {
                        k7.h<Bitmap> h = k7.f.b(context).h();
                        h.H = (String) cVar2.g;
                        h.J = true;
                        k7.h hVar = (k7.h) h.r(h0.a.b, Integer.valueOf(DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS));
                        hVar.getClass();
                        s0.d dVar = new s0.d(Integer.MIN_VALUE, Integer.MIN_VALUE);
                        hVar.F(dVar, dVar, hVar, w0.e.b);
                        Bitmap bitmap = (Bitmap) dVar.get();
                        if (bitmap != null) {
                            bVar2.f = bitmap;
                        }
                    } catch (InterruptedException | ExecutionException e) {
                        f.c.d((String) null, e);
                    }
                }
                if (d.a(context, bVar2, 230531)) {
                    tk.b a = tk.b.a();
                    HashMap hashMap = new HashMap();
                    hashMap.put("content_type", f.c(21));
                    hashMap.put("is_delayed", Boolean.valueOf(z10));
                    a.b("notification_reminder", hashMap);
                }
            }
        }).start();
    }

    public final void g(String str, CharSequence charSequence) {
        Bitmap decodeResource;
        Context context = this.a;
        NotificationManager notificationManager = (NotificationManager) context.getApplicationContext().getSystemService("notification");
        if (notificationManager != null) {
            notificationManager.cancel(211109);
        }
        i9.b bVar = new i9.b(charSequence, "");
        bVar.d = context.getString(2131886305);
        if (TextUtils.isEmpty(str)) {
            bVar.e = 2131231540;
        } else {
            PackageManager packageManager = context.getPackageManager();
            if (packageManager == null || str == null) {
                decodeResource = BitmapFactory.decodeResource(context.getResources(), 2131231368);
            } else {
                PackageInfo packageArchiveInfo = packageManager.getPackageArchiveInfo(str, 1);
                if (packageArchiveInfo != null) {
                    ApplicationInfo applicationInfo = packageArchiveInfo.applicationInfo;
                    applicationInfo.sourceDir = str;
                    applicationInfo.publicSourceDir = str;
                    Drawable applicationIcon = packageManager.getApplicationIcon(applicationInfo);
                    if (applicationIcon instanceof BitmapDrawable) {
                        decodeResource = ((BitmapDrawable) applicationIcon).getBitmap();
                    } else {
                        Bitmap createBitmap = Bitmap.createBitmap(applicationIcon.getIntrinsicWidth(), applicationIcon.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
                        Canvas canvas = new Canvas(createBitmap);
                        applicationIcon.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
                        applicationIcon.draw(canvas);
                        decodeResource = createBitmap;
                    }
                } else {
                    decodeResource = BitmapFactory.decodeResource(context.getResources(), 2131231368);
                }
            }
            bVar.f = decodeResource;
        }
        bVar.h = 2131231236;
        bVar.a = "junk_clean";
        if (d.a(context, bVar, 211109)) {
            j(12);
        }
    }

    public final void h() {
        g gVar;
        int intValue;
        h9.b a;
        Context context = this.a;
        SharedPreferences sharedPreferences = context.getSharedPreferences("main", 0);
        if (sharedPreferences == null ? false : sharedPreferences.getBoolean("is_agreement_agreed", false)) {
            long currentTimeMillis = System.currentTimeMillis();
            SharedPreferences sharedPreferences2 = context.getSharedPreferences("notification_reminder", 0);
            long j = currentTimeMillis - (sharedPreferences2 != null ? sharedPreferences2.getLong("last_remind_time", -1L) : -1L);
            long e = nk.b.v().e(7200000L, "NotificationRemindInterval");
            h hVar = c;
            if (j > 0 && j < e) {
                SharedPreferences sharedPreferences3 = context.getSharedPreferences("main", 0);
                if (!(sharedPreferences3 == null ? false : sharedPreferences3.getBoolean("always_notify_remind", false))) {
                    hVar.c("Less than interval since last notification remind, interval: " + e);
                    return;
                }
            }
            int[] iArr = {0, 4, 14, 15, 18, 16, 15};
            ArrayList arrayList = new ArrayList(7);
            ArrayList arrayList2 = new ArrayList();
            for (int i = 0; i < 7; i++) {
                h9.b a10 = a(iArr[i]);
                if (a10 != null) {
                    arrayList.add(a10);
                }
            }
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                g gVar2 = (g) it.next();
                if (gVar2.b()) {
                    hVar.c("Should remind for type: " + gVar2.a());
                    arrayList2.add(gVar2);
                } else {
                    hVar.c("Should not remind for type: " + gVar2.a());
                }
            }
            if (arrayList2.isEmpty()) {
                SharedPreferences sharedPreferences4 = context.getSharedPreferences("main", 0);
                if (sharedPreferences4 == null ? false : sharedPreferences4.getBoolean("always_notify_remind", false)) {
                    hVar.c("Always show remind, pick one");
                    arrayList2.add((g) arrayList.get(new Random().nextInt(arrayList.size())));
                }
            }
            int size = arrayList2.size();
            if (size == 0) {
                return;
            }
            if (size == 1) {
                gVar = (g) arrayList2.get(0);
            } else {
                gVar = (g) arrayList2.get(new Random().nextInt(size));
                hVar.c("Random choose type: " + gVar.a());
            }
            if (gVar.c()) {
                hVar.c("Send notification remind, type: " + gVar);
                j(gVar.a());
                long currentTimeMillis2 = System.currentTimeMillis();
                SharedPreferences sharedPreferences5 = context.getSharedPreferences("notification_reminder", 0);
                SharedPreferences.Editor edit = sharedPreferences5 == null ? null : sharedPreferences5.edit();
                if (edit != null) {
                    edit.putLong("last_remind_time", currentTimeMillis2);
                    edit.apply();
                }
                int a11 = gVar.a();
                LinkedList linkedList = this.b;
                if (linkedList.size() >= 2 && a11 != (intValue = ((Integer) linkedList.poll()).intValue()) && (a = a(intValue)) != null) {
                    hVar.c("Dismiss notification for type: " + intValue);
                    NotificationManager notificationManager = (NotificationManager) a.b.getApplicationContext().getSystemService("notification");
                    if (notificationManager != null) {
                        notificationManager.cancel(a.g());
                    }
                }
                linkedList.remove(Integer.valueOf(gVar.a()));
                linkedList.add(Integer.valueOf(gVar.a()));
            }
        }
    }

    public final void i(int i) {
        SharedPreferences sharedPreferences = this.a.getSharedPreferences("notification_reminder", 0);
        SharedPreferences.Editor edit = sharedPreferences == null ? null : sharedPreferences.edit();
        if (edit == null) {
            return;
        }
        edit.putInt("frequency_junk_clean_reminder", i);
        edit.apply();
    }
}