鑫垚影视 v20.42版本的 MD5 值为:e3822d25ef47121f1770bb4806abacfe

以下内容为反编译后的 a.java 源代码,内容仅作参考


package e.j.a.q0;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import android.os.IInterface;
import android.os.RemoteException;
import e.j.a.k0.c;
import e.j.a.y;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

public abstract class a<CALLBACK extends Binder, INTERFACE extends IInterface> implements y, ServiceConnection {

    private volatile INTERFACE f13375b;

    private final Class<?> f13376c;

    public boolean f13377d = false;

    private final HashMap<String, Object> f13378e = new HashMap<>();

    private final List<Context> f13379f = new ArrayList();

    private final ArrayList<Runnable> f13380g = new ArrayList<>();

    private final CALLBACK f13374a = b();

    public a(Class<?> cls) {
        this.f13376c = cls;
    }

    private void h(boolean z) {
        if (!z && this.f13375b != null) {
            try {
                i(this.f13375b, this.f13374a);
            } catch (RemoteException e2) {
                e2.printStackTrace();
            }
        }
        if (e.j.a.s0.e.f13429a) {
            e.j.a.s0.e.a(this, "release connect resources %s", this.f13375b);
        }
        this.f13375b = null;
        e.j.a.g.f().a(new e.j.a.k0.c(z ? c.a.lost : c.a.disconnected, this.f13376c));
    }

    @Override
    public boolean F() {
        return this.f13377d;
    }

    @Override
    public void G(Context context, Runnable runnable) {
        if (!e.j.a.s0.h.N(context)) {
            if (e.j.a.s0.e.f13429a) {
                e.j.a.s0.e.a(this, "bindStartByContext %s", context.getClass().getSimpleName());
            }
            Intent intent = new Intent(context, this.f13376c);
            if (runnable != null && !this.f13380g.contains(runnable)) {
                this.f13380g.add(runnable);
            }
            if (!this.f13379f.contains(context)) {
                this.f13379f.add(context);
            }
            boolean U = e.j.a.s0.h.U(context);
            this.f13377d = U;
            intent.putExtra(e.j.a.s0.b.f13422a, U);
            context.bindService(intent, this, 1);
            if (this.f13377d) {
                if (e.j.a.s0.e.f13429a) {
                    e.j.a.s0.e.a(this, "start foreground service", new Object[0]);
                }
                if (Build.VERSION.SDK_INT >= 26) {
                    context.startForegroundService(intent);
                    return;
                }
                return;
            }
            context.startService(intent);
            return;
        }
        throw new IllegalStateException("Fatal-Exception: You can't bind the FileDownloadService in :filedownloader process.\n It's the invalid operation and is likely to cause unexpected problems.\n Maybe you want to use non-separate process mode for FileDownloader, More detail about non-separate mode, please move to wiki manually: https://github.com/lingochamp/FileDownloader/wiki/filedownloader.properties");
    }

    @Override
    public void H(Context context) {
        if (this.f13379f.contains(context)) {
            if (e.j.a.s0.e.f13429a) {
                e.j.a.s0.e.a(this, "unbindByContext %s", context);
            }
            this.f13379f.remove(context);
            if (this.f13379f.isEmpty()) {
                h(false);
            }
            Intent intent = new Intent(context, this.f13376c);
            context.unbindService(this);
            context.stopService(intent);
        }
    }

    @Override
    public void I(Context context) {
        G(context, null);
    }

    public abstract INTERFACE a(IBinder iBinder);

    public abstract CALLBACK b();

    public CALLBACK c() {
        return this.f13374a;
    }

    public INTERFACE d() {
        return this.f13375b;
    }

    public Object e(String str) {
        return this.f13378e.remove(str);
    }

    public String f(Object obj) {
        if (obj == null) {
            return null;
        }
        String obj2 = obj.toString();
        this.f13378e.put(obj2, obj);
        return obj2;
    }

    public abstract void g(INTERFACE r1, CALLBACK callback) throws RemoteException;

    public abstract void i(INTERFACE r1, CALLBACK callback) throws RemoteException;

    @Override
    public boolean isConnected() {
        return d() != null;
    }

    @Override
    public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        this.f13375b = a(iBinder);
        if (e.j.a.s0.e.f13429a) {
            e.j.a.s0.e.a(this, "onServiceConnected %s %s", componentName, this.f13375b);
        }
        try {
            g(this.f13375b, this.f13374a);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
        List list = (List) this.f13380g.clone();
        this.f13380g.clear();
        Iterator it = list.iterator();
        while (it.hasNext()) {
            ((Runnable) it.next()).run();
        }
        e.j.a.g.f().a(new e.j.a.k0.c(c.a.connected, this.f13376c));
    }

    @Override
    public void onServiceDisconnected(ComponentName componentName) {
        if (e.j.a.s0.e.f13429a) {
            e.j.a.s0.e.a(this, "onServiceDisconnected %s %s", componentName, this.f13375b);
        }
        h(true);
    }
}