导航菜单

页面标题

页面副标题

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

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

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


package com.fancyclean.boost.toolbar.service;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.widget.RemoteViews;
import androidx.activity.d;
import androidx.annotation.NonNull;
import androidx.browser.trusted.b;
import androidx.core.app.NotificationCompat;
import androidx.core.view.j;
import dg.e;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import ml.i;
import n7.c;
import nb.f;
import org.greenrobot.eventbus.ThreadMode;
import vj.h;
import vj.l;

public class ToolbarService extends i {
    public static final h k = new h("ToolbarService");
    public static boolean l = false;
    public static volatile long m = 0;
    public static volatile long n = 0;
    public NotificationManager e;
    public Notification f;
    public String g = "";
    public long h = -1;
    public final ExecutorService i = Executors.newSingleThreadExecutor();
    public final a j = new a();

    public class a extends i.a {
        public a() {
        }

        public final ToolbarService a() {
            return ToolbarService.this;
        }
    }

    @NonNull
    public final a a() {
        return this.j;
    }

    public final void b(RemoteViews remoteViews, RemoteViews remoteViews2) {
        NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "toolbar");
        builder.setCustomContentView(remoteViews).setCustomBigContentView(remoteViews2).setSmallIcon(2131231213).setVisibility(-1).setPriority(2).setGroup("toolbar").setOngoing(true).setWhen(this.h);
        if (!e.x() || Build.VERSION.SDK_INT != 23) {
            builder.setSound((Uri) null);
        }
        this.f = builder.build();
    }

    public final NotificationManager c() {
        if (this.e == null) {
            this.e = (NotificationManager) getSystemService("notification");
        }
        return this.e;
    }

    public final void d() {
        bc.a b = bc.a.b(this);
        RemoteViews a10 = b.a(2131558831, l);
        b.b = a10;
        bc.a b10 = bc.a.b(this);
        RemoteViews a11 = b10.a(2131558830, l);
        b10.c = a11;
        b(a10, a11);
        try {
            startForeground(180702, this.f);
            this.i.execute(new d(this, 23));
        } catch (Exception e) {
            k.d((String) null, e);
            l.a().b(e);
        }
    }

    public final void e() {
        boolean z10 = m > n;
        bc.a b = bc.a.b(this);
        RemoteViews a10 = b.a(2131558831, l);
        b.b = a10;
        bc.a b10 = bc.a.b(this);
        RemoteViews a11 = b10.a(2131558830, l);
        b10.c = a11;
        b(a10, a11);
        bc.a b11 = bc.a.b(this);
        boolean z11 = l;
        long j = z10 ? m : n;
        String str = this.g;
        if (b11.b == null) {
            b11.b = b11.a(2131558831, z11);
        }
        if (b11.c == null) {
            b11.c = b11.a(2131558830, z11);
        }
        boolean z12 = z10;
        b11.c(b11.b, z11, z12, j, str);
        b11.c(b11.c, z11, z12, j, str);
        this.i.execute(new f(this, 2));
    }

    public final void onCreate() {
        NotificationManager c;
        super/*android.app.Service*/.onCreate();
        k.c("==> onCreate");
        this.h = System.currentTimeMillis();
        if (Build.VERSION.SDK_INT >= 26 && (c = c()) != null) {
            b.a();
            NotificationChannel e = j.e(getString(2131886284));
            j.A(e);
            androidx.core.view.i.n(e);
            b.b(c, e);
        }
        if (!ap.b.b().e(this)) {
            ap.b.b().j(this);
        }
        d();
    }

    public final void onDestroy() {
        stopForeground(true);
        if (ap.b.b().e(this)) {
            ap.b.b().l(this);
        }
        super/*android.app.Service*/.onDestroy();
    }

    @ap.j(threadMode = ThreadMode.MAIN)
    public void onFlashlightStateUpdate(dc.a aVar) {
        l = aVar.a;
        e();
    }

    @ap.j(threadMode = ThreadMode.MAIN)
    public void onNetworkStateUpdate(c cVar) {
        m = cVar.a;
        n = cVar.b;
        this.g = cVar.c;
        e();
    }

    public final int onStartCommand(Intent intent, int i, int i10) {
        super.onStartCommand(intent, i, i10);
        d();
        return 1;
    }
}