导航菜单

页面标题

页面副标题

All File Recovery v1.0.2 - AbstractServiceC5796w.java 源代码

正在查看: All File Recovery v1.0.2 应用的 AbstractServiceC5796w.java JAVA 源代码文件

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


package j0;

import android.app.Service;
import android.app.job.JobInfo;
import android.app.job.JobParameters;
import android.app.job.JobScheduler;
import android.app.job.JobServiceEngine;
import android.app.job.JobWorkItem;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.os.IBinder;
import android.os.PowerManager;
import java.util.ArrayList;
import java.util.HashMap;

@Deprecated
public abstract class AbstractServiceC5796w extends Service {

    public static final String f78084h = "JobIntentService";

    public static final boolean f78085i = false;

    public static final Object f78086j = new Object();

    public static final HashMap<ComponentName, h> f78087k = new HashMap<>();

    public b f78088a;

    public h f78089b;

    public a f78090c;

    public boolean f78091d = false;

    public boolean f78092e = false;

    public boolean f78093f = false;

    public final ArrayList<d> f78094g;

    public final class a extends AsyncTask<Void, Void, Void> {
        public a() {
        }

        public Void a(Void... voidArr) {
            while (true) {
                e a10 = AbstractServiceC5796w.this.a();
                if (a10 == null) {
                    return null;
                }
                AbstractServiceC5796w.this.h(a10.getIntent());
                a10.k();
            }
        }

        @Override
        public void onCancelled(Void r12) {
            AbstractServiceC5796w.this.j();
        }

        @Override
        public void onPostExecute(Void r12) {
            AbstractServiceC5796w.this.j();
        }

        @Override
        public Void doInBackground(Void[] voidArr) {
            a(voidArr);
            return null;
        }
    }

    public interface b {
        IBinder a();

        e b();
    }

    public static final class c extends h {

        public final Context f78096d;

        public final PowerManager.WakeLock f78097e;

        public final PowerManager.WakeLock f78098f;

        public boolean f78099g;

        public boolean f78100h;

        public c(Context context, ComponentName componentName) {
            super(componentName);
            this.f78096d = context.getApplicationContext();
            PowerManager powerManager = (PowerManager) context.getSystemService("power");
            PowerManager.WakeLock newWakeLock = powerManager.newWakeLock(1, componentName.getClassName() + ":launch");
            this.f78097e = newWakeLock;
            newWakeLock.setReferenceCounted(false);
            PowerManager.WakeLock newWakeLock2 = powerManager.newWakeLock(1, componentName.getClassName() + ":run");
            this.f78098f = newWakeLock2;
            newWakeLock2.setReferenceCounted(false);
        }

        @Override
        public void a(Intent intent) {
            Intent intent2 = new Intent(intent);
            intent2.setComponent(this.f78113a);
            if (this.f78096d.startService(intent2) != null) {
                synchronized (this) {
                    try {
                        if (!this.f78099g) {
                            this.f78099g = true;
                            if (!this.f78100h) {
                                this.f78097e.acquire(60000L);
                            }
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
        }

        @Override
        public void c() {
            synchronized (this) {
                try {
                    if (this.f78100h) {
                        if (this.f78099g) {
                            this.f78097e.acquire(60000L);
                        }
                        this.f78100h = false;
                        this.f78098f.release();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        @Override
        public void d() {
            synchronized (this) {
                try {
                    if (!this.f78100h) {
                        this.f78100h = true;
                        this.f78098f.acquire(600000L);
                        this.f78097e.release();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        @Override
        public void e() {
            synchronized (this) {
                this.f78099g = false;
            }
        }
    }

    public final class d implements e {

        public final Intent f78101a;

        public final int f78102b;

        public d(Intent intent, int i10) {
            this.f78101a = intent;
            this.f78102b = i10;
        }

        @Override
        public Intent getIntent() {
            return this.f78101a;
        }

        @Override
        public void k() {
            AbstractServiceC5796w.this.stopSelf(this.f78102b);
        }
    }

    public interface e {
        Intent getIntent();

        void k();
    }

    @l.U(26)
    public static final class f extends JobServiceEngine implements b {

        public static final String f78104d = "JobServiceEngineImpl";

        public static final boolean f78105e = false;

        public final AbstractServiceC5796w f78106a;

        public final Object f78107b;

        public JobParameters f78108c;

        public final class a implements e {

            public final JobWorkItem f78109a;

            public a(JobWorkItem jobWorkItem) {
                this.f78109a = jobWorkItem;
            }

            @Override
            public Intent getIntent() {
                Intent intent;
                intent = this.f78109a.getIntent();
                return intent;
            }

            @Override
            public void k() {
                synchronized (f.this.f78107b) {
                    try {
                        JobParameters jobParameters = f.this.f78108c;
                        if (jobParameters != null) {
                            jobParameters.completeWork(this.f78109a);
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
        }

        public f(AbstractServiceC5796w abstractServiceC5796w) {
            super(abstractServiceC5796w);
            this.f78107b = new Object();
            this.f78106a = abstractServiceC5796w;
        }

        @Override
        public IBinder a() {
            IBinder binder;
            binder = getBinder();
            return binder;
        }

        @Override
        public e b() {
            JobWorkItem dequeueWork;
            Intent intent;
            synchronized (this.f78107b) {
                try {
                    JobParameters jobParameters = this.f78108c;
                    if (jobParameters == null) {
                        return null;
                    }
                    dequeueWork = jobParameters.dequeueWork();
                    if (dequeueWork == null) {
                        return null;
                    }
                    intent = dequeueWork.getIntent();
                    intent.setExtrasClassLoader(this.f78106a.getClassLoader());
                    return new a(dequeueWork);
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        public boolean onStartJob(JobParameters jobParameters) {
            this.f78108c = jobParameters;
            this.f78106a.e(false);
            return true;
        }

        public boolean onStopJob(JobParameters jobParameters) {
            boolean b10 = this.f78106a.b();
            synchronized (this.f78107b) {
                this.f78108c = null;
            }
            return b10;
        }
    }

    @l.U(26)
    public static final class g extends h {

        public final JobInfo f78111d;

        public final JobScheduler f78112e;

        public g(Context context, ComponentName componentName, int i10) {
            super(componentName);
            b(i10);
            this.f78111d = new JobInfo.Builder(i10, componentName).setOverrideDeadline(0L).build();
            this.f78112e = (JobScheduler) context.getApplicationContext().getSystemService("jobscheduler");
        }

        @Override
        public void a(Intent intent) {
            this.f78112e.enqueue(this.f78111d, C5751C.a(intent));
        }
    }

    public AbstractServiceC5796w() {
        if (Build.VERSION.SDK_INT >= 26) {
            this.f78094g = null;
        } else {
            this.f78094g = new ArrayList<>();
        }
    }

    public static void c(Context context, ComponentName componentName, int i10, Intent intent) {
        if (intent == null) {
            throw new IllegalArgumentException("work must not be null");
        }
        synchronized (f78086j) {
            h f10 = f(context, componentName, true, i10);
            f10.b(i10);
            f10.a(intent);
        }
    }

    public static void d(Context context, Class<?> cls, int i10, Intent intent) {
        c(context, new ComponentName(context, cls), i10, intent);
    }

    public static h f(Context context, ComponentName componentName, boolean z10, int i10) {
        h cVar;
        HashMap<ComponentName, h> hashMap = f78087k;
        h hVar = hashMap.get(componentName);
        if (hVar != null) {
            return hVar;
        }
        if (Build.VERSION.SDK_INT < 26) {
            cVar = new c(context, componentName);
        } else {
            if (!z10) {
                throw new IllegalArgumentException("Can't be here without a job id");
            }
            cVar = new g(context, componentName, i10);
        }
        hashMap.put(componentName, cVar);
        return cVar;
    }

    public e a() {
        b bVar = this.f78088a;
        if (bVar != null) {
            return bVar.b();
        }
        synchronized (this.f78094g) {
            try {
                if (this.f78094g.size() <= 0) {
                    return null;
                }
                return this.f78094g.remove(0);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public boolean b() {
        a aVar = this.f78090c;
        if (aVar != null) {
            aVar.cancel(this.f78091d);
        }
        this.f78092e = true;
        return true;
    }

    public void e(boolean z10) {
        if (this.f78090c == null) {
            this.f78090c = new a();
            h hVar = this.f78089b;
            if (hVar != null && z10) {
                hVar.d();
            }
            this.f78090c.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
        }
    }

    public boolean g() {
        return this.f78092e;
    }

    public abstract void h(Intent intent);

    public boolean i() {
        return true;
    }

    public void j() {
        ArrayList<d> arrayList = this.f78094g;
        if (arrayList != null) {
            synchronized (arrayList) {
                try {
                    this.f78090c = null;
                    ArrayList<d> arrayList2 = this.f78094g;
                    if (arrayList2 != null && arrayList2.size() > 0) {
                        e(false);
                    } else if (!this.f78093f) {
                        this.f78089b.c();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
    }

    public void k(boolean z10) {
        this.f78091d = z10;
    }

    @Override
    public IBinder onBind(Intent intent) {
        b bVar = this.f78088a;
        if (bVar != null) {
            return bVar.a();
        }
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        if (Build.VERSION.SDK_INT >= 26) {
            this.f78088a = new f(this);
            this.f78089b = null;
        } else {
            this.f78088a = null;
            this.f78089b = f(this, new ComponentName(this, getClass()), false, 0);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        ArrayList<d> arrayList = this.f78094g;
        if (arrayList != null) {
            synchronized (arrayList) {
                this.f78093f = true;
                this.f78089b.c();
            }
        }
    }

    @Override
    public int onStartCommand(Intent intent, int i10, int i11) {
        if (this.f78094g == null) {
            return 2;
        }
        this.f78089b.e();
        synchronized (this.f78094g) {
            ArrayList<d> arrayList = this.f78094g;
            if (intent == null) {
                intent = new Intent();
            }
            arrayList.add(new d(intent, i11));
            e(true);
        }
        return 3;
    }

    public static abstract class h {

        public final ComponentName f78113a;

        public boolean f78114b;

        public int f78115c;

        public h(ComponentName componentName) {
            this.f78113a = componentName;
        }

        public abstract void a(Intent intent);

        public void b(int i10) {
            if (!this.f78114b) {
                this.f78114b = true;
                this.f78115c = i10;
            } else {
                if (this.f78115c == i10) {
                    return;
                }
                StringBuilder a10 = android.support.v4.media.a.a("Given job ID ", i10, " is different than previous ");
                a10.append(this.f78115c);
                throw new IllegalArgumentException(a10.toString());
            }
        }

        public void c() {
        }

        public void d() {
        }

        public void e() {
        }
    }
}