导航菜单

页面标题

页面副标题

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

正在查看: All File Recovery v1.0.2 应用的 AbstractServiceC1308w.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 AbstractServiceC1308w extends Service {

    public static final String f27078h = "JobIntentService";

    public static final boolean f27079i = false;

    public static final Object f27080j = new Object();

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

    public b f27082a;

    public h f27083b;

    public a f27084c;

    public boolean f27085d = false;

    public boolean f27086e = false;

    public boolean f27087f = false;

    public final ArrayList<d> f27088g;

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

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

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

        @Override
        public void onPostExecute(Void r12) {
            AbstractServiceC1308w.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 f27090d;

        public final PowerManager.WakeLock f27091e;

        public final PowerManager.WakeLock f27092f;

        public boolean f27093g;

        public boolean f27094h;

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

        @Override
        public void a(Intent intent) {
            Intent intent2 = new Intent(intent);
            intent2.setComponent(this.f27107a);
            if (this.f27090d.startService(intent2) != null) {
                synchronized (this) {
                    try {
                        if (!this.f27093g) {
                            this.f27093g = true;
                            if (!this.f27094h) {
                                this.f27091e.acquire(60000L);
                            }
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
            }
        }

        @Override
        public void c() {
            synchronized (this) {
                try {
                    if (this.f27094h) {
                        if (this.f27093g) {
                            this.f27091e.acquire(60000L);
                        }
                        this.f27094h = false;
                        this.f27092f.release();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

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

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

    public final class d implements e {

        public final Intent f27095a;

        public final int f27096b;

        public d(Intent intent, int i4) {
            this.f27095a = intent;
            this.f27096b = i4;
        }

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

        @Override
        public void k() {
            AbstractServiceC1308w.this.stopSelf(this.f27096b);
        }
    }

    public interface e {
        Intent getIntent();

        void k();
    }

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

        public static final String f27098d = "JobServiceEngineImpl";

        public static final boolean f27099e = false;

        public final AbstractServiceC1308w f27100a;

        public final Object f27101b;

        public JobParameters f27102c;

        public final class a implements e {

            public final JobWorkItem f27103a;

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

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

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

        public f(AbstractServiceC1308w abstractServiceC1308w) {
            super(abstractServiceC1308w);
            this.f27101b = new Object();
            this.f27100a = abstractServiceC1308w;
        }

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

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

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

        public boolean onStopJob(JobParameters jobParameters) {
            boolean b4 = this.f27100a.b();
            synchronized (this.f27101b) {
                this.f27102c = null;
            }
            return b4;
        }
    }

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

        public final JobInfo f27105d;

        public final JobScheduler f27106e;

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

        @Override
        public void a(Intent intent) {
            this.f27106e.enqueue(this.f27105d, C1263C.a(intent));
        }
    }

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

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

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

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

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

    public boolean b() {
        a aVar = this.f27084c;
        if (aVar != null) {
            aVar.cancel(this.f27085d);
        }
        this.f27086e = true;
        return true;
    }

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

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

    public abstract void h(Intent intent);

    public boolean i() {
        return true;
    }

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

    public void k(boolean z3) {
        this.f27085d = z3;
    }

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

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

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

    @Override
    public int onStartCommand(Intent intent, int i4, int i5) {
        if (this.f27088g == null) {
            return 2;
        }
        this.f27083b.e();
        synchronized (this.f27088g) {
            ArrayList<d> arrayList = this.f27088g;
            if (intent == null) {
                intent = new Intent();
            }
            arrayList.add(new d(intent, i5));
            e(true);
        }
        return 3;
    }

    public static abstract class h {

        public final ComponentName f27107a;

        public boolean f27108b;

        public int f27109c;

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

        public abstract void a(Intent intent);

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

        public void c() {
        }

        public void d() {
        }

        public void e() {
        }
    }
}