钱能钱包 v3.10.2版本的 MD5 值为:339a4b585ef2aa3bfaf7e4baeb254647
以下内容为反编译后的 a.java 源代码,内容仅作参考
package e.d.a.k0;
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 e.d.a.u;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public abstract class a<CALLBACK extends Binder, INTERFACE extends IInterface> implements u, ServiceConnection {
public volatile INTERFACE f7921b;
public final Class<?> f7922c;
public boolean f7923d = false;
public final HashMap<String, Object> f7924e = new HashMap<>();
public final List<Context> f7925f = new ArrayList();
public final ArrayList<Runnable> f7926g = new ArrayList<>();
public final CALLBACK a = k();
public a(Class<?> cls) {
this.f7922c = cls;
}
public abstract INTERFACE d(IBinder iBinder);
@Override
public boolean h() {
return this.f7923d;
}
@Override
public void i(Context context) {
j(context, null);
}
@Override
public boolean isConnected() {
return l() != null;
}
public void j(Context context, Runnable runnable) {
if (!e.d.a.m0.f.J(context)) {
if (e.d.a.m0.d.a) {
e.d.a.m0.d.a(this, "bindStartByContext %s", context.getClass().getSimpleName());
}
Intent intent = new Intent(context, this.f7922c);
if (runnable != null && !this.f7926g.contains(runnable)) {
this.f7926g.add(runnable);
}
if (!this.f7925f.contains(context)) {
this.f7925f.add(context);
}
boolean P = e.d.a.m0.f.P(context);
this.f7923d = P;
intent.putExtra("is_foreground", P);
context.bindService(intent, this, 1);
if (this.f7923d) {
if (e.d.a.m0.d.a) {
e.d.a.m0.d.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");
}
public abstract CALLBACK k();
public INTERFACE l() {
return this.f7921b;
}
public abstract void m(INTERFACE r1, CALLBACK callback);
public final void n(boolean z) {
if (!z && this.f7921b != null) {
try {
o(this.f7921b, this.a);
} catch (RemoteException e2) {
e2.printStackTrace();
}
}
if (e.d.a.m0.d.a) {
e.d.a.m0.d.a(this, "release connect resources %s", this.f7921b);
}
this.f7921b = null;
e.d.a.f.e().b(new DownloadServiceConnectChangedEvent(z ? DownloadServiceConnectChangedEvent.ConnectStatus.lost : DownloadServiceConnectChangedEvent.ConnectStatus.disconnected, this.f7922c));
}
public abstract void o(INTERFACE r1, CALLBACK callback);
@Override
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
this.f7921b = d(iBinder);
if (e.d.a.m0.d.a) {
e.d.a.m0.d.a(this, "onServiceConnected %s %s", componentName, this.f7921b);
}
try {
m(this.f7921b, this.a);
} catch (RemoteException e2) {
e2.printStackTrace();
}
this.f7926g.clear();
for (Runnable runnable : (List) this.f7926g.clone()) {
runnable.run();
}
e.d.a.f.e().b(new DownloadServiceConnectChangedEvent(DownloadServiceConnectChangedEvent.ConnectStatus.connected, this.f7922c));
}
@Override
public void onServiceDisconnected(ComponentName componentName) {
if (e.d.a.m0.d.a) {
e.d.a.m0.d.a(this, "onServiceDisconnected %s %s", componentName, this.f7921b);
}
n(true);
}
}