what-the-bank/sources/o/igD.java

63 lines
2.0 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.os.SystemClock;
import com.scb.phone.domain.errors.RetrofitException;
import io.beid.beidk.definitions.SCBHeader;
import java.io.IOException;
import java.util.UUID;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
/* loaded from: classes.dex */
public final class igD implements Interceptor {
private KTN b;
@InterfaceC13391fZD
public igD(KTN ktn) {
this.b = ktn;
}
@Override // okhttp3.Interceptor
public final Response intercept(Interceptor.Chain chain) throws IOException {
Request request = chain.request();
RetrofitException.a();
KTN ktn = this.b;
ZBS zbs = SystemClock.elapsedRealtime() - ktn.a > 600000 ? null : ktn.d;
Request.Builder newBuilder = request.newBuilder();
String str = this.b.b;
String str2 = this.b.c;
if (str2 != null) {
newBuilder.addHeader("Api-Auth", str2);
}
String e = Pzh.e();
if (e != null) {
newBuilder.addHeader("user-agent", e);
}
String str3 = this.b.e;
if (str3 != null) {
newBuilder.addHeader(SCBHeader.SCB_REQ_HEADER_SESSION_ID, str3);
}
String obj = UUID.randomUUID().toString();
if (this.b.g.getBoolean("com.scb.phone.pref.key.WIREMOCK", false)) {
obj = "wiremock-".concat(obj.substring(9));
}
if (obj != null) {
newBuilder.addHeader(SCBHeader.SCB_REQ_HEADER_REQUEST_ID, obj);
}
String valueOf = zbs != null ? String.valueOf(zbs.b) : null;
if (valueOf != null) {
newBuilder.addHeader("latitude", valueOf);
}
String valueOf2 = zbs != null ? String.valueOf(zbs.c) : null;
if (valueOf2 != null) {
newBuilder.addHeader("longitude", valueOf2);
}
String valueOf3 = zbs != null ? String.valueOf(zbs.e) : null;
if (valueOf3 != null) {
newBuilder.addHeader("accuracy", valueOf3);
}
return chain.proceed(newBuilder.build());
}
}