package s;

import android.text.TextUtils;
import b0.D;
import com.mstar.android.samba.NanoHTTPD;
import java.util.Collections;
import java.util.Map;
import java.util.UUID;
import u.d;
import u.h;

/* JADX INFO: loaded from: classes.dex */
public class g implements h {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private static final Map f6385b = Collections.singletonMap("Content-Type", NanoHTTPD.MIME_DEFAULT_BINARY);

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final String f6386a;

    public g(String str, String str2) {
        if (str.startsWith("http")) {
            this.f6386a = str + str2;
            return;
        }
        this.f6386a = "https://proxy.uat.widevine.com/proxy" + ("?video_id=" + str + "&provider=" + str2);
    }

    @Override // u.h
    public byte[] a(UUID uuid, d.c cVar) {
        return D.k(cVar.a() + "&signedRequest=" + new String(cVar.b()), null, null);
    }

    @Override // u.h
    public byte[] b(UUID uuid, d.a aVar) {
        String strA = aVar.a();
        if (TextUtils.isEmpty(strA)) {
            strA = this.f6386a;
        }
        return D.k(strA, aVar.b(), f6385b);
    }
}
