package d.c.a;

import android.os.RemoteException;
import com.codezjx.andlinker.Request;
import com.codezjx.andlinker.Response;

/* JADX INFO: compiled from: RemoteCall.java */
/* JADX INFO: loaded from: classes.dex */
public final class p {
    public final i a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final r f2434b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object[] f2435c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public volatile boolean f2436d;

    public p(i iVar, r rVar, Object[] objArr, g gVar) {
        this.a = iVar;
        this.f2434b = rVar;
        this.f2435c = objArr;
    }

    public final Object a() throws RemoteException {
        if (this.a == null) {
            l.b("RemoteCall", "TransferService null when execute, this may occur if the client is not already bind to the service.");
            return null;
        }
        r rVar = this.f2434b;
        o<?>[] oVarArr = rVar.f2443e;
        Object[] objArr = this.f2435c;
        int length = objArr != null ? objArr.length : 0;
        if (length != oVarArr.length) {
            throw new IllegalArgumentException(d.b.a.a.a.s(d.b.a.a.a.C("Argument count (", length, ") doesn't match expected count ("), oVarArr.length, ")"));
        }
        q qVar = new q(rVar.f2440b, rVar.f2441c, length, rVar.f2442d);
        for (int i2 = 0; i2 < length; i2++) {
            oVarArr[i2].a(qVar, this.f2435c[i2], i2);
        }
        Response responseG = this.a.g(new Request(qVar.a, qVar.f2437b, qVar.f2438c, qVar.f2439d));
        if (responseG == null) {
            return null;
        }
        if (responseG.f1950b != 200) {
            StringBuilder sbB = d.b.a.a.a.B("Execute remote call fail: ");
            sbB.append(responseG.toString());
            l.b("RemoteCall", sbB.toString());
        }
        return responseG.f1952f;
    }
}
