VMOS Pro v2.9.9版本的 MD5 值为:ee40072a1f57adb79e77200d03a8337d

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


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 defpackage.zq0;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public abstract class AbstractServiceConnectionC7546<CALLBACK extends Binder, INTERFACE extends IInterface> implements a12, ServiceConnection {
    public volatile INTERFACE f45834;
    public final Class<?> f45835;
    public boolean f45836 = false;
    public final HashMap<String, Object> f45837 = new HashMap<>();
    public final List<Context> f45838 = new ArrayList();
    public final ArrayList<Runnable> f45839 = new ArrayList<>();
    public final CALLBACK f45833 = mo34076();

    public AbstractServiceConnectionC7546(Class<?> cls) {
        this.f45835 = cls;
    }

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

    @Override
    public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        this.f45834 = mo34078(iBinder);
        if (w91.f39125) {
            w91.m48187(this, "onServiceConnected %s %s", componentName, this.f45834);
        }
        try {
            mo34077(this.f45834, this.f45833);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        this.f45839.clear();
        for (Runnable runnable : (List) this.f45839.clone()) {
            runnable.run();
        }
        m91.m30875().mo20911(new zq0(zq0.EnumC6898.connected, this.f45835));
    }

    @Override
    public void onServiceDisconnected(ComponentName componentName) {
        if (w91.f39125) {
            w91.m48187(this, "onServiceDisconnected %s %s", componentName, this.f45834);
        }
        m55924(true);
    }

    @Override
    public void mo64(Context context) {
        if (this.f45838.contains(context)) {
            if (w91.f39125) {
                w91.m48187(this, "unbindByContext %s", context);
            }
            this.f45838.remove(context);
            if (this.f45838.isEmpty()) {
                m55924(false);
            }
            Intent intent = new Intent(context, this.f45835);
            context.unbindService(this);
            context.stopService(intent);
        }
    }

    @Override
    public void mo65(Context context) {
        mo78(context, null);
    }

    public CALLBACK m55920() {
        return this.f45833;
    }

    public INTERFACE m55921() {
        return this.f45834;
    }

    @Override
    public boolean mo74() {
        return this.f45836;
    }

    public Object m55922(String str) {
        return this.f45837.remove(str);
    }

    public abstract CALLBACK mo34076();

    @Override
    public void mo78(Context context, Runnable runnable) {
        if (!ua1.m44397(context)) {
            if (w91.f39125) {
                w91.m48187(this, "bindStartByContext %s", context.getClass().getSimpleName());
            }
            Intent intent = new Intent(context, this.f45835);
            if (runnable != null && !this.f45839.contains(runnable)) {
                this.f45839.add(runnable);
            }
            if (!this.f45838.contains(context)) {
                this.f45838.add(context);
            }
            boolean m44411 = ua1.m44411(context);
            this.f45836 = m44411;
            intent.putExtra(v71.f37743, m44411);
            context.bindService(intent, this, 1);
            if (this.f45836) {
                if (w91.f39125) {
                    w91.m48187(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");
    }

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

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

    public abstract INTERFACE mo34078(IBinder iBinder);

    public final void m55924(boolean z) {
        if (!z && this.f45834 != null) {
            try {
                mo34079(this.f45834, this.f45833);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
        if (w91.f39125) {
            w91.m48187(this, "release connect resources %s", this.f45834);
        }
        this.f45834 = null;
        m91.m30875().mo20911(new zq0(z ? zq0.EnumC6898.lost : zq0.EnumC6898.disconnected, this.f45835));
    }

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