package d.c.a;

import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.IInterface;
import android.os.RemoteException;
import d.c.a.d;
import d.c.a.i;

/* JADX INFO: compiled from: AndLinker.java */
/* JADX INFO: loaded from: classes.dex */
public class b implements ServiceConnection {
    public final /* synthetic */ d a;

    public b(d dVar) {
        this.a = dVar;
    }

    @Override // android.content.ServiceConnection
    public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        i c0034a;
        l.a("AndLinker", "onServiceConnected:" + componentName + " service:" + iBinder);
        d dVar = this.a;
        int i2 = i.a.a;
        if (iBinder == null) {
            c0034a = null;
        } else {
            IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface("com.codezjx.alinker.ITransfer");
            c0034a = (iInterfaceQueryLocalInterface == null || !(iInterfaceQueryLocalInterface instanceof i)) ? new i.a.C0034a(iBinder) : (i) iInterfaceQueryLocalInterface;
        }
        dVar.f2424j = c0034a;
        try {
            d dVar2 = this.a;
            dVar2.f2424j.e(dVar2.f2425k);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
        d.a aVar = this.a.f2426l;
        if (aVar != null) {
            aVar.a();
        }
    }

    @Override // android.content.ServiceConnection
    public void onServiceDisconnected(ComponentName componentName) {
        l.a("AndLinker", "onServiceDisconnected:" + componentName);
        this.a.b(false);
    }
}
