Add Discord community version (64-bit only)

- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
This commit is contained in:
2026-02-18 15:48:36 -08:00
parent c19eb3d7ff
commit c080f0d97f
26930 changed files with 2529574 additions and 0 deletions

View File

@@ -0,0 +1,190 @@
package com.unity3d.ads.gatewayclient;
import com.google.protobuf.InvalidProtocolBufferException;
import com.unity3d.ads.core.data.model.OperationType;
import com.unity3d.ads.core.data.model.exception.UnityAdsNetworkException;
import com.unity3d.ads.core.data.repository.SessionRepository;
import com.unity3d.ads.core.domain.HandleGatewayUniversalResponse;
import com.unity3d.ads.core.domain.SendDiagnosticEvent;
import com.unity3d.ads.core.extensions.TimeExtensionsKt;
import com.unity3d.services.core.log.DeviceLog;
import com.unity3d.services.core.network.core.HttpClient;
import com.unity3d.services.core.network.model.HttpResponse;
import gatewayprotocol.v1.ErrorKt;
import gatewayprotocol.v1.ErrorOuterClass;
import gatewayprotocol.v1.UniversalResponseKt;
import gatewayprotocol.v1.UniversalResponseOuterClass;
import java.util.Map;
import kotlin.TuplesKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.random.Random;
import kotlin.text.Charsets;
import kotlin.time.TimeMark;
@SourceDebugExtension({"SMAP\nCommonGatewayClient.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CommonGatewayClient.kt\ncom/unity3d/ads/gatewayclient/CommonGatewayClient\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 UniversalResponseKt.kt\ngatewayprotocol/v1/UniversalResponseKtKt\n+ 4 ErrorKt.kt\ngatewayprotocol/v1/ErrorKtKt\n*L\n1#1,201:1\n1#2:202\n1#2:204\n1#2:206\n8#3:203\n8#4:205\n*S KotlinDebug\n*F\n+ 1 CommonGatewayClient.kt\ncom/unity3d/ads/gatewayclient/CommonGatewayClient\n*L\n178#1:204\n179#1:206\n178#1:203\n179#1:205\n*E\n"})
/* loaded from: classes4.dex */
public final class CommonGatewayClient implements GatewayClient {
public static final int CODE_400 = 400;
public static final int CODE_599 = 599;
public static final Companion Companion = new Companion(null);
public static final String RETRY_ATTEMPT_HEADER = "X-RETRY-ATTEMPT";
private final HandleGatewayUniversalResponse handleGatewayUniversalResponse;
private final HttpClient httpClient;
private final SendDiagnosticEvent sendDiagnosticEvent;
private final SessionRepository sessionRepository;
private final boolean shouldRetry(int i) {
return 400 <= i && i < 600;
}
public CommonGatewayClient(HttpClient httpClient, HandleGatewayUniversalResponse handleGatewayUniversalResponse, SendDiagnosticEvent sendDiagnosticEvent, SessionRepository sessionRepository) {
Intrinsics.checkNotNullParameter(httpClient, "httpClient");
Intrinsics.checkNotNullParameter(handleGatewayUniversalResponse, "handleGatewayUniversalResponse");
Intrinsics.checkNotNullParameter(sendDiagnosticEvent, "sendDiagnosticEvent");
Intrinsics.checkNotNullParameter(sessionRepository, "sessionRepository");
this.httpClient = httpClient;
this.handleGatewayUniversalResponse = handleGatewayUniversalResponse;
this.sendDiagnosticEvent = sendDiagnosticEvent;
this.sessionRepository = sessionRepository;
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
/* JADX WARN: Can't wrap try/catch for region: R(10:14|15|(1:17)|18|19|20|21|22|23|(1:25)(9:27|28|29|30|31|32|33|34|(2:36|(2:38|(1:40)(2:41|42))(2:43|44))(2:45|(1:47)(3:48|12|(2:62|63)(0))))) */
/* JADX WARN: Can't wrap try/catch for region: R(9:27|28|29|30|31|32|33|34|(2:36|(2:38|(1:40)(2:41|42))(2:43|44))(2:45|(1:47)(3:48|12|(2:62|63)(0)))) */
/* JADX WARN: Code restructure failed: missing block: B:50:0x0178, code lost:
r0 = e;
*/
/* JADX WARN: Code restructure failed: missing block: B:51:0x0179, code lost:
r1 = r0;
r0 = r40;
*/
/* JADX WARN: Code restructure failed: missing block: B:57:0x0181, code lost:
r0 = e;
*/
/* JADX WARN: Code restructure failed: missing block: B:58:0x0182, code lost:
r1 = r0;
r2 = r8;
r0 = r40;
r5 = r3;
r3 = r9;
r8 = r5;
r38 = r14;
r14 = r4;
r4 = r11;
r11 = r12;
r13 = r38;
*/
/* JADX WARN: Code restructure failed: missing block: B:60:0x0194, code lost:
r0 = e;
*/
/* JADX WARN: Code restructure failed: missing block: B:61:0x0195, code lost:
r40 = r2;
*/
/* JADX WARN: Removed duplicated region for block: B:14:0x0244 */
/* JADX WARN: Removed duplicated region for block: B:17:0x00eb */
/* JADX WARN: Removed duplicated region for block: B:25:0x0156 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:27:0x0157 */
/* JADX WARN: Removed duplicated region for block: B:36:0x01b5 */
/* JADX WARN: Removed duplicated region for block: B:45:0x0207 */
/* JADX WARN: Removed duplicated region for block: B:62:0x024c */
/* JADX WARN: Removed duplicated region for block: B:75:0x00ad */
/* JADX WARN: Removed duplicated region for block: B:8:0x002f */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:48:0x022c -> B:12:0x0233). Please report as a decompilation issue!!! */
@Override // com.unity3d.ads.gatewayclient.GatewayClient
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.lang.Object request(java.lang.String r40, gatewayprotocol.v1.UniversalRequestOuterClass.UniversalRequest r41, com.unity3d.ads.gatewayclient.RequestPolicy r42, com.unity3d.ads.core.data.model.OperationType r43, kotlin.coroutines.Continuation r44) {
/*
Method dump skipped, instructions count: 640
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.unity3d.ads.gatewayclient.CommonGatewayClient.request(java.lang.String, gatewayprotocol.v1.UniversalRequestOuterClass$UniversalRequest, com.unity3d.ads.gatewayclient.RequestPolicy, com.unity3d.ads.core.data.model.OperationType, kotlin.coroutines.Continuation):java.lang.Object");
}
private final void sendNetworkErrorDiagnosticEvent(UnityAdsNetworkException unityAdsNetworkException, int i, OperationType operationType, TimeMark timeMark) {
Map mutableMapOf;
if (operationType == OperationType.UNIVERSAL_EVENT) {
return;
}
mutableMapOf = MapsKt__MapsKt.mutableMapOf(TuplesKt.to("operation", operationType.toString()), TuplesKt.to("retries", String.valueOf(i)), TuplesKt.to("protocol", String.valueOf(unityAdsNetworkException.getProtocol())), TuplesKt.to("network_client", String.valueOf(unityAdsNetworkException.getClient())), TuplesKt.to("reason_code", String.valueOf(unityAdsNetworkException.getCode())), TuplesKt.to("reason_debug", unityAdsNetworkException.getMessage()));
SendDiagnosticEvent.DefaultImpls.invoke$default(this.sendDiagnosticEvent, "native_network_failure_time", Double.valueOf(TimeExtensionsKt.elapsedMillis(timeMark)), mutableMapOf, null, null, 24, null);
}
private final void sendNetworkSuccessDiagnosticEvent(HttpResponse httpResponse, int i, OperationType operationType, TimeMark timeMark) {
Map mutableMapOf;
if (operationType == OperationType.UNIVERSAL_EVENT) {
return;
}
mutableMapOf = MapsKt__MapsKt.mutableMapOf(TuplesKt.to("operation", operationType.toString()), TuplesKt.to("retries", String.valueOf(i)), TuplesKt.to("protocol", httpResponse.getProtocol()), TuplesKt.to("network_client", httpResponse.getClient()), TuplesKt.to("reason_code", String.valueOf(httpResponse.getStatusCode())));
SendDiagnosticEvent.DefaultImpls.invoke$default(this.sendDiagnosticEvent, "native_network_success_time", Double.valueOf(TimeExtensionsKt.elapsedMillis(timeMark)), mutableMapOf, null, null, 24, null);
}
private final UniversalResponseOuterClass.UniversalResponse getUniversalResponse(HttpResponse httpResponse, OperationType operationType) {
Map mapOf;
try {
Object body = httpResponse.getBody();
if (body instanceof byte[]) {
UniversalResponseOuterClass.UniversalResponse parseFrom = UniversalResponseOuterClass.UniversalResponse.parseFrom((byte[]) body);
Intrinsics.checkNotNullExpressionValue(parseFrom, "parseFrom(responseBody)");
return parseFrom;
}
if (!(body instanceof String)) {
throw new InvalidProtocolBufferException("Could not parse response from gateway service");
}
byte[] bytes = ((String) body).getBytes(Charsets.ISO_8859_1);
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
UniversalResponseOuterClass.UniversalResponse parseFrom2 = UniversalResponseOuterClass.UniversalResponse.parseFrom(bytes);
Intrinsics.checkNotNullExpressionValue(parseFrom2, "parseFrom(\n …8859_1)\n )");
return parseFrom2;
} catch (InvalidProtocolBufferException e) {
DeviceLog.debug("Failed to parse response from gateway service with exception: %s", e.getLocalizedMessage());
SendDiagnosticEvent sendDiagnosticEvent = this.sendDiagnosticEvent;
mapOf = MapsKt__MapsKt.mapOf(TuplesKt.to("operation", operationType.toString()), TuplesKt.to("reason", "protobuf_parsing"), TuplesKt.to("reason_debug", httpResponse.getBody().toString()));
SendDiagnosticEvent.DefaultImpls.invoke$default(sendDiagnosticEvent, "native_network_parse_failure", null, mapOf, null, null, 26, null);
UniversalResponseKt.Dsl.Companion companion = UniversalResponseKt.Dsl.Companion;
UniversalResponseOuterClass.UniversalResponse.Builder newBuilder = UniversalResponseOuterClass.UniversalResponse.newBuilder();
Intrinsics.checkNotNullExpressionValue(newBuilder, "newBuilder()");
UniversalResponseKt.Dsl _create = companion._create(newBuilder);
ErrorKt.Dsl.Companion companion2 = ErrorKt.Dsl.Companion;
ErrorOuterClass.Error.Builder newBuilder2 = ErrorOuterClass.Error.newBuilder();
Intrinsics.checkNotNullExpressionValue(newBuilder2, "newBuilder()");
ErrorKt.Dsl _create2 = companion2._create(newBuilder2);
_create2.setErrorText("ERROR: Could not parse response from gateway service");
_create.setError(_create2._build());
return _create._build();
}
}
private final long calculateDelayTime(RequestPolicy requestPolicy, int i) {
long calculateExponentialBackoff = calculateExponentialBackoff(requestPolicy.getRetryWaitBase(), i);
return calculateExponentialBackoff + calculateJitter(calculateExponentialBackoff, requestPolicy.getRetryJitterPct());
}
private final long calculateExponentialBackoff(int i, int i2) {
return i * ((long) Math.pow(2.0d, i2));
}
private final long calculateJitter(long j, float f) {
long j2 = (long) (j * f);
return Random.Default.nextLong(-j2, j2 + 1);
}
}