CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f

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


package i.m.a.i0;

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 com.liulishuo.filedownloader.event.DownloadServiceConnectChangedEvent;
import i.m.a.f;
import i.m.a.f0.b;
import i.m.a.n;
import i.m.a.s;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public abstract class a<CALLBACK extends Binder, INTERFACE extends IInterface> implements s, ServiceConnection {
    public final CALLBACK a;
    public volatile INTERFACE b;
    public final Class<?> c;
    public boolean f13171d = false;
    public final List<Context> f13172e;
    public final ArrayList<Runnable> f13173f;

    public a(Class<?> cls) {
        new HashMap();
        this.f13172e = new ArrayList();
        this.f13173f = new ArrayList<>();
        this.c = cls;
        this.a = new n.a();
    }

    @Override
    public boolean isConnected() {
        return this.b != null;
    }

    @Override
    public void k(Context context) {
        if (!i.m.a.k0.i.m(context)) {
            Intent intent = new Intent(context, this.c);
            if (!this.f13172e.contains(context)) {
                this.f13172e.add(context);
            }
            boolean p2 = i.m.a.k0.i.p(context);
            this.f13171d = p2;
            intent.putExtra("is_foreground", p2);
            context.bindService(intent, this, 1);
            if (this.f13171d) {
                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 boolean m() {
        return this.f13171d;
    }

    @Override
    public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        INTERFACE c0206a;
        int i2 = b.a.a;
        if (iBinder == null) {
            c0206a = null;
        } else {
            IInterface queryLocalInterface = iBinder.queryLocalInterface("com.liulishuo.filedownloader.i.IFileDownloadIPCService");
            if (queryLocalInterface != null && (queryLocalInterface instanceof i.m.a.f0.b)) {
                c0206a = (i.m.a.f0.b) queryLocalInterface;
            } else {
                c0206a = new b.a.C0206a(iBinder);
            }
        }
        this.b = c0206a;
        try {
            ((i.m.a.f0.b) this.b).m((n.a) this.a);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
        this.f13173f.clear();
        for (Runnable runnable : (List) this.f13173f.clone()) {
            runnable.run();
        }
        f.b.a.a(new DownloadServiceConnectChangedEvent(DownloadServiceConnectChangedEvent.ConnectStatus.connected, this.c));
    }

    @Override
    public void onServiceDisconnected(ComponentName componentName) {
        this.b = null;
        f.b.a.a(new DownloadServiceConnectChangedEvent(DownloadServiceConnectChangedEvent.ConnectStatus.lost, this.c));
    }
}