Initial import of ADIF API reverse-engineering toolkit

This commit is contained in:
2025-12-16 08:37:56 +01:00
commit 60388529c1
11486 changed files with 1086536 additions and 0 deletions

View File

@@ -0,0 +1,178 @@
package s3;
import kotlin.UByte;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
import r3.C0576h;
import r3.D;
import r3.x;
/* loaded from: classes3.dex */
public abstract class a {
/* renamed from: a, reason: collision with root package name */
public static final byte[] f8472a;
static {
Intrinsics.checkNotNullParameter("0123456789abcdef", "<this>");
byte[] bytes = "0123456789abcdef".getBytes(Charsets.UTF_8);
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
f8472a = bytes;
}
public static final boolean a(D segment, int i, byte[] bytes, int i4) {
Intrinsics.checkNotNullParameter(segment, "segment");
Intrinsics.checkNotNullParameter(bytes, "bytes");
int i5 = segment.f8250c;
byte[] bArr = segment.f8248a;
for (int i6 = 1; i6 < i4; i6++) {
if (i == i5) {
segment = segment.f8253f;
Intrinsics.checkNotNull(segment);
bArr = segment.f8248a;
i = segment.f8249b;
i5 = segment.f8250c;
}
if (bArr[i] != bytes[i6]) {
return false;
}
i++;
}
return true;
}
public static final String b(C0576h c0576h, long j4) {
Intrinsics.checkNotNullParameter(c0576h, "<this>");
if (j4 > 0) {
long j5 = j4 - 1;
if (c0576h.O(j5) == 13) {
String d02 = c0576h.d0(j5, Charsets.UTF_8);
c0576h.l(2L);
return d02;
}
}
c0576h.getClass();
String d03 = c0576h.d0(j4, Charsets.UTF_8);
c0576h.l(1L);
return d03;
}
public static final int c(C0576h c0576h, x options, boolean z3) {
int i;
byte[] bArr;
int i4;
int i5;
D d4;
byte[] bArr2;
int i6;
Intrinsics.checkNotNullParameter(c0576h, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
D d5 = c0576h.f8283a;
if (d5 == null) {
return z3 ? -2 : -1;
}
int i7 = d5.f8249b;
int i8 = d5.f8250c;
int[] iArr = options.f8318b;
byte[] bArr3 = d5.f8248a;
D d6 = d5;
int i9 = -1;
int i10 = 0;
loop0: while (true) {
int i11 = i10 + 1;
int i12 = iArr[i10];
int i13 = i10 + 2;
int i14 = iArr[i11];
if (i14 != -1) {
i9 = i14;
}
if (d6 == null) {
break;
}
if (i12 >= 0) {
int i15 = i7 + 1;
int i16 = bArr3[i7] & UByte.MAX_VALUE;
int i17 = i13 + i12;
while (i13 != i17) {
if (i16 == iArr[i13]) {
i = iArr[i13 + i12];
if (i15 == i8) {
d6 = d6.f8253f;
Intrinsics.checkNotNull(d6);
i5 = d6.f8249b;
i4 = d6.f8250c;
bArr = d6.f8248a;
if (d6 == d5) {
d6 = null;
}
} else {
bArr = bArr3;
i4 = i8;
i5 = i15;
}
if (i >= 0) {
return i;
}
byte[] bArr4 = bArr;
i10 = -i;
i7 = i5;
i8 = i4;
bArr3 = bArr4;
} else {
i13++;
}
}
break loop0;
}
int i18 = (i12 * (-1)) + i13;
while (true) {
int i19 = i7 + 1;
int i20 = i13 + 1;
if ((bArr3[i7] & UByte.MAX_VALUE) != iArr[i13]) {
break loop0;
}
boolean z4 = i20 == i18;
if (i19 == i8) {
Intrinsics.checkNotNull(d6);
D d7 = d6.f8253f;
Intrinsics.checkNotNull(d7);
i6 = d7.f8249b;
int i21 = d7.f8250c;
bArr2 = d7.f8248a;
if (d7 != d5) {
d4 = d7;
i8 = i21;
} else {
if (!z4) {
break loop0;
}
i8 = i21;
d4 = null;
}
} else {
d4 = d6;
bArr2 = bArr3;
i6 = i19;
}
if (z4) {
i = iArr[i20];
int i22 = i6;
i4 = i8;
i5 = i22;
byte[] bArr5 = bArr2;
d6 = d4;
bArr = bArr5;
break;
}
i7 = i6;
bArr3 = bArr2;
d6 = d4;
i13 = i20;
}
}
if (z3) {
return -2;
}
return i9;
}
}

View File

@@ -0,0 +1,21 @@
package s3;
/* loaded from: classes3.dex */
public abstract class b {
/* renamed from: a, reason: collision with root package name */
public static final char[] f8473a = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
public static final int a(char c4) {
if ('0' <= c4 && c4 < ':') {
return c4 - '0';
}
if ('a' <= c4 && c4 < 'g') {
return c4 - 'W';
}
if ('A' <= c4 && c4 < 'G') {
return c4 - '7';
}
throw new IllegalArgumentException("Unexpected hex digit: " + c4);
}
}

View File

@@ -0,0 +1,218 @@
package s3;
import C.w;
import com.google.firebase.sessions.settings.RemoteSettings;
import f0.C0338b;
import java.util.ArrayList;
import java.util.List;
import kotlin.collections.CollectionsKt;
import kotlin.collections.CollectionsKt__MutableCollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import r3.C0576h;
import r3.C0579k;
import r3.z;
/* loaded from: classes3.dex */
public abstract class c {
/* renamed from: a, reason: collision with root package name */
public static final C0579k f8474a;
/* renamed from: b, reason: collision with root package name */
public static final C0579k f8475b;
/* renamed from: c, reason: collision with root package name */
public static final C0579k f8476c;
/* renamed from: d, reason: collision with root package name */
public static final C0579k f8477d;
/* renamed from: e, reason: collision with root package name */
public static final C0579k f8478e;
static {
C0579k c0579k = C0579k.f8285d;
f8474a = C0338b.n(RemoteSettings.FORWARD_SLASH_STRING);
f8475b = C0338b.n("\\");
f8476c = C0338b.n("/\\");
f8477d = C0338b.n(".");
f8478e = C0338b.n("..");
}
public static final int a(z zVar) {
if (zVar.f8322a.d() != 0) {
C0579k c0579k = zVar.f8322a;
if (c0579k.i(0) != 47) {
if (c0579k.i(0) == 92) {
if (c0579k.d() > 2 && c0579k.i(1) == 92) {
C0579k other = f8475b;
Intrinsics.checkNotNullParameter(other, "other");
int f2 = c0579k.f(2, other.f8286a);
return f2 == -1 ? c0579k.d() : f2;
}
} else if (c0579k.d() > 2 && c0579k.i(1) == 58 && c0579k.i(2) == 92) {
char i = (char) c0579k.i(0);
if ('a' <= i && i < '{') {
return 3;
}
if ('A' <= i && i < '[') {
return 3;
}
}
}
return 1;
}
return -1;
}
/* JADX WARN: Type inference failed for: r1v1, types: [java.lang.Object, r3.h] */
public static final z b(z zVar, z child, boolean z3) {
Intrinsics.checkNotNullParameter(zVar, "<this>");
Intrinsics.checkNotNullParameter(child, "child");
child.getClass();
if (a(child) != -1 || child.g() != null) {
return child;
}
C0579k c4 = c(zVar);
if (c4 == null && (c4 = c(child)) == null) {
c4 = f(z.f8321b);
}
?? obj = new Object();
obj.h0(zVar.f8322a);
if (obj.f8284b > 0) {
obj.h0(c4);
}
obj.h0(child.f8322a);
return d(obj, z3);
}
public static final C0579k c(z zVar) {
C0579k c0579k = zVar.f8322a;
C0579k c0579k2 = f8474a;
if (C0579k.g(c0579k, c0579k2) != -1) {
return c0579k2;
}
C0579k c0579k3 = f8475b;
if (C0579k.g(zVar.f8322a, c0579k3) != -1) {
return c0579k3;
}
return null;
}
/* JADX WARN: Type inference failed for: r1v1, types: [java.lang.Object, r3.h] */
public static final z d(C0576h c0576h, boolean z3) {
C0579k c0579k;
C0579k c0579k2;
char O2;
C0579k c0579k3;
C0579k h;
Intrinsics.checkNotNullParameter(c0576h, "<this>");
?? obj = new Object();
C0579k c0579k4 = null;
int i = 0;
while (true) {
if (!c0576h.H(f8474a)) {
c0579k = f8475b;
if (!c0576h.H(c0579k)) {
break;
}
}
byte readByte = c0576h.readByte();
if (c0579k4 == null) {
c0579k4 = e(readByte);
}
i++;
}
boolean z4 = i >= 2 && Intrinsics.areEqual(c0579k4, c0579k);
C0579k c0579k5 = f8476c;
long j4 = 0;
if (z4) {
Intrinsics.checkNotNull(c0579k4);
obj.h0(c0579k4);
obj.h0(c0579k4);
} else if (i > 0) {
Intrinsics.checkNotNull(c0579k4);
obj.h0(c0579k4);
} else {
long A3 = c0576h.A(c0579k5);
if (c0579k4 == null) {
c0579k4 = A3 == -1 ? f(z.f8321b) : e(c0576h.O(A3));
}
if (Intrinsics.areEqual(c0579k4, c0579k)) {
c0579k2 = c0579k4;
if (c0576h.f8284b >= 2 && c0576h.O(1L) == 58 && (('a' <= (O2 = (char) c0576h.O(0L)) && O2 < '{') || ('A' <= O2 && O2 < '['))) {
if (A3 == 2) {
obj.z(c0576h, 3L);
} else {
obj.z(c0576h, 2L);
}
}
} else {
c0579k2 = c0579k4;
}
c0579k4 = c0579k2;
}
boolean z5 = obj.f8284b > 0;
ArrayList arrayList = new ArrayList();
while (true) {
boolean x3 = c0576h.x();
c0579k3 = f8477d;
if (x3) {
break;
}
long j5 = j4;
long A4 = c0576h.A(c0579k5);
if (A4 == -1) {
h = c0576h.h(c0576h.f8284b);
} else {
h = c0576h.h(A4);
c0576h.readByte();
}
C0579k c0579k6 = f8478e;
if (Intrinsics.areEqual(h, c0579k6)) {
if (!z5 || !arrayList.isEmpty()) {
if (!z3 || (!z5 && (arrayList.isEmpty() || Intrinsics.areEqual(CollectionsKt.last((List) arrayList), c0579k6)))) {
arrayList.add(h);
} else if (!z4 || arrayList.size() != 1) {
CollectionsKt__MutableCollectionsKt.removeLastOrNull(arrayList);
}
}
} else if (!Intrinsics.areEqual(h, c0579k3) && !Intrinsics.areEqual(h, C0579k.f8285d)) {
arrayList.add(h);
}
j4 = j5;
}
long j6 = j4;
int size = arrayList.size();
for (int i4 = 0; i4 < size; i4++) {
if (i4 > 0) {
obj.h0(c0579k4);
}
obj.h0((C0579k) arrayList.get(i4));
}
if (obj.f8284b == j6) {
obj.h0(c0579k3);
}
return new z(obj.h(obj.f8284b));
}
public static final C0579k e(byte b4) {
if (b4 == 47) {
return f8474a;
}
if (b4 == 92) {
return f8475b;
}
throw new IllegalArgumentException(com.google.android.gms.measurement.internal.a.l(b4, "not a directory separator: "));
}
public static final C0579k f(String str) {
if (Intrinsics.areEqual(str, RemoteSettings.FORWARD_SLASH_STRING)) {
return f8474a;
}
if (Intrinsics.areEqual(str, "\\")) {
return f8475b;
}
throw new IllegalArgumentException(w.z("not a directory separator: ", str));
}
}

View File

@@ -0,0 +1,36 @@
package s3;
import kotlin.jvm.internal.Intrinsics;
import r3.F;
/* loaded from: classes3.dex */
public abstract class d {
public static final int a(F f2, int i) {
int i4;
Intrinsics.checkNotNullParameter(f2, "<this>");
int[] iArr = f2.f8259f;
int i5 = i + 1;
int length = f2.f8258e.length;
Intrinsics.checkNotNullParameter(iArr, "<this>");
int i6 = length - 1;
int i7 = 0;
while (true) {
if (i7 <= i6) {
i4 = (i7 + i6) >>> 1;
int i8 = iArr[i4];
if (i8 >= i5) {
if (i8 <= i5) {
break;
}
i6 = i4 - 1;
} else {
i7 = i4 + 1;
}
} else {
i4 = (-i7) - 1;
break;
}
}
return i4 >= 0 ? i4 : ~i4;
}
}

View File

@@ -0,0 +1,16 @@
package s3;
/* loaded from: classes3.dex */
public final class e {
/* renamed from: a, reason: collision with root package name */
public final long f8479a;
/* renamed from: b, reason: collision with root package name */
public final long f8480b;
public e(long j4, long j5, int i) {
this.f8479a = j4;
this.f8480b = j5;
}
}

View File

@@ -0,0 +1,62 @@
package s3;
import java.io.IOException;
import kotlin.jvm.internal.Intrinsics;
import r3.C0576h;
import r3.I;
import r3.p;
/* loaded from: classes3.dex */
public final class f extends p {
/* renamed from: a, reason: collision with root package name */
public final long f8481a;
/* renamed from: b, reason: collision with root package name */
public final boolean f8482b;
/* renamed from: c, reason: collision with root package name */
public long f8483c;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public f(I delegate, long j4, boolean z3) {
super(delegate);
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.f8481a = j4;
this.f8482b = z3;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v5, types: [java.lang.Object, r3.h] */
@Override // r3.p, r3.I
public final long read(C0576h sink, long j4) {
Intrinsics.checkNotNullParameter(sink, "sink");
long j5 = this.f8483c;
long j6 = this.f8481a;
if (j5 > j6) {
j4 = 0;
} else if (this.f8482b) {
long j7 = j6 - j5;
if (j7 == 0) {
return -1L;
}
j4 = Math.min(j4, j7);
}
long read = super.read(sink, j4);
if (read != -1) {
this.f8483c += read;
}
long j8 = this.f8483c;
if ((j8 >= j6 || read != -1) && j8 <= j6) {
return read;
}
if (read > 0 && j8 > j6) {
long j9 = sink.f8284b - (j8 - j6);
?? obj = new Object();
obj.D(sink);
sink.z(obj, j9);
obj.d();
}
throw new IOException("expected " + j6 + " bytes but got " + this.f8483c);
}
}

View File

@@ -0,0 +1,22 @@
package s3;
import f0.C0338b;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import r3.z;
/* loaded from: classes3.dex */
public final class g extends Lambda implements Function1 {
/* renamed from: a, reason: collision with root package name */
public static final g f8484a = new Lambda(1);
@Override // kotlin.jvm.functions.Function1
public final Object invoke(Object obj) {
i entry = (i) obj;
Intrinsics.checkNotNullParameter(entry, "entry");
z zVar = h.f8485e;
return Boolean.valueOf(C0338b.e(entry.f8489a));
}
}

View File

@@ -0,0 +1,149 @@
package s3;
import a.AbstractC0105a;
import com.google.firebase.sessions.settings.RemoteSettings;
import f0.C0338b;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Pair;
import kotlin.collections.CollectionsKt;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.collections.CollectionsKt__MutableCollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
import r3.G;
import r3.I;
import r3.m;
import r3.n;
import r3.u;
import r3.z;
/* loaded from: classes3.dex */
public final class h extends n {
/* renamed from: e, reason: collision with root package name */
public static final z f8485e;
/* renamed from: b, reason: collision with root package name */
public final ClassLoader f8486b;
/* renamed from: c, reason: collision with root package name */
public final u f8487c;
/* renamed from: d, reason: collision with root package name */
public final Lazy f8488d;
static {
String str = z.f8321b;
f8485e = C0338b.o(RemoteSettings.FORWARD_SLASH_STRING);
}
public h(ClassLoader classLoader) {
Intrinsics.checkNotNullParameter(classLoader, "classLoader");
u systemFileSystem = n.f8299a;
Intrinsics.checkNotNullParameter(systemFileSystem, "systemFileSystem");
this.f8486b = classLoader;
this.f8487c = systemFileSystem;
this.f8488d = LazyKt.lazy(new J0.e(this, 12));
}
@Override // r3.n
public final void a(z path) {
Intrinsics.checkNotNullParameter(path, "path");
throw new IOException(this + " is read-only");
}
@Override // r3.n
public final List d(z child) {
int collectionSizeOrDefault;
String removePrefix;
String replace$default;
Intrinsics.checkNotNullParameter(child, "dir");
z zVar = f8485e;
zVar.getClass();
Intrinsics.checkNotNullParameter(child, "child");
String q4 = c.b(zVar, child, true).c(zVar).f8322a.q();
LinkedHashSet linkedHashSet = new LinkedHashSet();
boolean z3 = false;
for (Pair pair : (List) this.f8488d.getValue()) {
n nVar = (n) pair.component1();
z base = (z) pair.component2();
try {
List d4 = nVar.d(base.d(q4));
ArrayList arrayList = new ArrayList();
for (Object obj : d4) {
if (C0338b.e((z) obj)) {
arrayList.add(obj);
}
}
collectionSizeOrDefault = CollectionsKt__IterablesKt.collectionSizeOrDefault(arrayList, 10);
ArrayList arrayList2 = new ArrayList(collectionSizeOrDefault);
Iterator it = arrayList.iterator();
while (it.hasNext()) {
z zVar2 = (z) it.next();
Intrinsics.checkNotNullParameter(zVar2, "<this>");
Intrinsics.checkNotNullParameter(base, "base");
removePrefix = StringsKt__StringsKt.removePrefix(zVar2.f8322a.q(), (CharSequence) base.f8322a.q());
replace$default = StringsKt__StringsJVMKt.replace$default(removePrefix, '\\', '/', false, 4, (Object) null);
arrayList2.add(zVar.d(replace$default));
}
CollectionsKt__MutableCollectionsKt.addAll(linkedHashSet, arrayList2);
z3 = true;
} catch (IOException unused) {
}
}
if (z3) {
return CollectionsKt.toList(linkedHashSet);
}
throw new FileNotFoundException("file not found: " + child);
}
@Override // r3.n
public final m f(z child) {
Intrinsics.checkNotNullParameter(child, "path");
if (!C0338b.e(child)) {
return null;
}
z zVar = f8485e;
zVar.getClass();
Intrinsics.checkNotNullParameter(child, "child");
String q4 = c.b(zVar, child, true).c(zVar).f8322a.q();
for (Pair pair : (List) this.f8488d.getValue()) {
m f2 = ((n) pair.component1()).f(((z) pair.component2()).d(q4));
if (f2 != null) {
return f2;
}
}
return null;
}
@Override // r3.n
public final G g(z file) {
Intrinsics.checkNotNullParameter(file, "file");
throw new IOException(this + " is read-only");
}
@Override // r3.n
public final I h(z child) {
Intrinsics.checkNotNullParameter(child, "file");
if (!C0338b.e(child)) {
throw new FileNotFoundException("file not found: " + child);
}
z zVar = f8485e;
zVar.getClass();
Intrinsics.checkNotNullParameter(child, "child");
InputStream resourceAsStream = this.f8486b.getResourceAsStream(c.b(zVar, child, false).c(zVar).f8322a.q());
if (resourceAsStream != null) {
return AbstractC0105a.R(resourceAsStream);
}
throw new FileNotFoundException("file not found: " + child);
}
}

View File

@@ -0,0 +1,48 @@
package s3;
import java.util.ArrayList;
import kotlin.jvm.internal.Intrinsics;
import r3.z;
/* loaded from: classes3.dex */
public final class i {
/* renamed from: a, reason: collision with root package name */
public final z f8489a;
/* renamed from: b, reason: collision with root package name */
public final boolean f8490b;
/* renamed from: c, reason: collision with root package name */
public final long f8491c;
/* renamed from: d, reason: collision with root package name */
public final long f8492d;
/* renamed from: e, reason: collision with root package name */
public final int f8493e;
/* renamed from: f, reason: collision with root package name */
public final Long f8494f;
/* renamed from: g, reason: collision with root package name */
public final long f8495g;
public final ArrayList h;
public /* synthetic */ i(z zVar) {
this(zVar, true, "", -1L, -1L, -1, null, -1L);
}
public i(z canonicalPath, boolean z3, String comment, long j4, long j5, int i, Long l4, long j6) {
Intrinsics.checkNotNullParameter(canonicalPath, "canonicalPath");
Intrinsics.checkNotNullParameter(comment, "comment");
this.f8489a = canonicalPath;
this.f8490b = z3;
this.f8491c = j4;
this.f8492d = j5;
this.f8493e = i;
this.f8494f = l4;
this.f8495g = j6;
this.h = new ArrayList();
}
}

View File

@@ -0,0 +1,69 @@
package s3;
import java.io.IOException;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.Ref;
import r3.C;
/* loaded from: classes3.dex */
public final class j extends Lambda implements Function2 {
/* renamed from: a, reason: collision with root package name */
public final /* synthetic */ Ref.BooleanRef f8496a;
/* renamed from: b, reason: collision with root package name */
public final /* synthetic */ long f8497b;
/* renamed from: c, reason: collision with root package name */
public final /* synthetic */ Ref.LongRef f8498c;
/* renamed from: d, reason: collision with root package name */
public final /* synthetic */ C f8499d;
/* renamed from: e, reason: collision with root package name */
public final /* synthetic */ Ref.LongRef f8500e;
/* renamed from: f, reason: collision with root package name */
public final /* synthetic */ Ref.LongRef f8501f;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public j(Ref.BooleanRef booleanRef, long j4, Ref.LongRef longRef, C c4, Ref.LongRef longRef2, Ref.LongRef longRef3) {
super(2);
this.f8496a = booleanRef;
this.f8497b = j4;
this.f8498c = longRef;
this.f8499d = c4;
this.f8500e = longRef2;
this.f8501f = longRef3;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(Object obj, Object obj2) {
int intValue = ((Number) obj).intValue();
long longValue = ((Number) obj2).longValue();
if (intValue == 1) {
Ref.BooleanRef booleanRef = this.f8496a;
if (booleanRef.element) {
throw new IOException("bad zip: zip64 extra repeated");
}
booleanRef.element = true;
if (longValue < this.f8497b) {
throw new IOException("bad zip: zip64 extra too short");
}
Ref.LongRef longRef = this.f8498c;
long j4 = longRef.element;
C c4 = this.f8499d;
if (j4 == 4294967295L) {
j4 = c4.O();
}
longRef.element = j4;
Ref.LongRef longRef2 = this.f8500e;
longRef2.element = longRef2.element == 4294967295L ? c4.O() : 0L;
Ref.LongRef longRef3 = this.f8501f;
longRef3.element = longRef3.element == 4294967295L ? c4.O() : 0L;
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,71 @@
package s3;
import java.io.IOException;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.Ref;
import r3.C;
/* loaded from: classes3.dex */
public final class k extends Lambda implements Function2 {
/* renamed from: a, reason: collision with root package name */
public final /* synthetic */ C f8502a;
/* renamed from: b, reason: collision with root package name */
public final /* synthetic */ Ref.ObjectRef f8503b;
/* renamed from: c, reason: collision with root package name */
public final /* synthetic */ Ref.ObjectRef f8504c;
/* renamed from: d, reason: collision with root package name */
public final /* synthetic */ Ref.ObjectRef f8505d;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public k(C c4, Ref.ObjectRef objectRef, Ref.ObjectRef objectRef2, Ref.ObjectRef objectRef3) {
super(2);
this.f8502a = c4;
this.f8503b = objectRef;
this.f8504c = objectRef2;
this.f8505d = objectRef3;
}
/* JADX WARN: Type inference failed for: r0v11, types: [T, java.lang.Long] */
/* JADX WARN: Type inference failed for: r0v7, types: [T, java.lang.Long] */
/* JADX WARN: Type inference failed for: r12v9, types: [T, java.lang.Long] */
@Override // kotlin.jvm.functions.Function2
public final Object invoke(Object obj, Object obj2) {
int intValue = ((Number) obj).intValue();
long longValue = ((Number) obj2).longValue();
if (intValue == 21589) {
if (longValue < 1) {
throw new IOException("bad zip: extended timestamp extra too short");
}
byte readByte = this.f8502a.readByte();
boolean z3 = (readByte & 1) == 1;
boolean z4 = (readByte & 2) == 2;
boolean z5 = (readByte & 4) == 4;
long j4 = z3 ? 5L : 1L;
if (z4) {
j4 += 4;
}
if (z5) {
j4 += 4;
}
if (longValue < j4) {
throw new IOException("bad zip: extended timestamp extra too short");
}
if (z3) {
this.f8503b.element = Long.valueOf(r2.x() * 1000);
}
if (z4) {
this.f8504c.element = Long.valueOf(r2.x() * 1000);
}
if (z5) {
this.f8505d.element = Long.valueOf(r2.x() * 1000);
}
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,179 @@
package s3;
import com.google.firebase.sessions.settings.RemoteSettings;
import f0.C0338b;
import java.io.IOException;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.Map;
import kotlin.TuplesKt;
import kotlin.UShort;
import kotlin.collections.CollectionsKt;
import kotlin.collections.MapsKt;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.text.CharsKt;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
import kotlinx.coroutines.scheduling.WorkQueueKt;
import r3.C;
import r3.C0576h;
import r3.m;
import r3.z;
/* loaded from: classes3.dex */
public abstract class l {
public static final Map a(ArrayList arrayList) {
String str = z.f8321b;
z o4 = C0338b.o(RemoteSettings.FORWARD_SLASH_STRING);
Map mutableMapOf = MapsKt.mutableMapOf(TuplesKt.to(o4, new i(o4)));
for (i iVar : CollectionsKt.sortedWith(arrayList, new A.i(5))) {
if (((i) mutableMapOf.put(iVar.f8489a, iVar)) == null) {
while (true) {
z zVar = iVar.f8489a;
z b4 = zVar.b();
if (b4 != null) {
i iVar2 = (i) mutableMapOf.get(b4);
if (iVar2 != null) {
iVar2.h.add(zVar);
break;
}
i iVar3 = new i(b4);
mutableMapOf.put(b4, iVar3);
iVar3.h.add(zVar);
iVar = iVar3;
}
}
}
}
return mutableMapOf;
}
public static final String b(int i) {
StringBuilder sb = new StringBuilder("0x");
String num = Integer.toString(i, CharsKt.checkRadix(16));
Intrinsics.checkNotNullExpressionValue(num, "toString(this, checkRadix(radix))");
sb.append(num);
return sb.toString();
}
public static final i c(C c4) {
Long valueOf;
boolean contains$default;
boolean endsWith$default;
Intrinsics.checkNotNullParameter(c4, "<this>");
int x3 = c4.x();
if (x3 != 33639248) {
throw new IOException("bad zip: expected " + b(33639248) + " but was " + b(x3));
}
c4.l(4L);
short Y3 = c4.Y();
int i = Y3 & UShort.MAX_VALUE;
if ((Y3 & 1) != 0) {
throw new IOException("unsupported zip: general purpose bit flag=" + b(i));
}
int Y4 = c4.Y() & UShort.MAX_VALUE;
short Y5 = c4.Y();
int i4 = Y5 & UShort.MAX_VALUE;
short Y6 = c4.Y();
int i5 = Y6 & UShort.MAX_VALUE;
if (i4 == -1) {
valueOf = null;
} else {
GregorianCalendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.set(14, 0);
gregorianCalendar.set(((i5 >> 9) & WorkQueueKt.MASK) + 1980, ((i5 >> 5) & 15) - 1, Y6 & 31, (i4 >> 11) & 31, (i4 >> 5) & 63, (Y5 & 31) << 1);
valueOf = Long.valueOf(gregorianCalendar.getTime().getTime());
}
Long l4 = valueOf;
c4.x();
Ref.LongRef longRef = new Ref.LongRef();
longRef.element = c4.x() & 4294967295L;
Ref.LongRef longRef2 = new Ref.LongRef();
longRef2.element = c4.x() & 4294967295L;
int Y7 = c4.Y() & UShort.MAX_VALUE;
int Y8 = c4.Y() & UShort.MAX_VALUE;
int Y9 = c4.Y() & UShort.MAX_VALUE;
c4.l(8L);
Ref.LongRef longRef3 = new Ref.LongRef();
longRef3.element = c4.x() & 4294967295L;
String Z = c4.Z(Y7);
contains$default = StringsKt__StringsKt.contains$default((CharSequence) Z, (char) 0, false, 2, (Object) null);
if (contains$default) {
throw new IOException("bad zip: filename contains 0x00");
}
long j4 = longRef2.element == 4294967295L ? 8 : 0L;
if (longRef.element == 4294967295L) {
j4 += 8;
}
if (longRef3.element == 4294967295L) {
j4 += 8;
}
long j5 = j4;
Ref.BooleanRef booleanRef = new Ref.BooleanRef();
d(c4, Y8, new j(booleanRef, j5, longRef2, c4, longRef, longRef3));
if (j5 > 0 && !booleanRef.element) {
throw new IOException("bad zip: zip64 extra required but absent");
}
String Z3 = c4.Z(Y9);
String str = z.f8321b;
z d4 = C0338b.o(RemoteSettings.FORWARD_SLASH_STRING).d(Z);
endsWith$default = StringsKt__StringsJVMKt.endsWith$default(Z, RemoteSettings.FORWARD_SLASH_STRING, false, 2, null);
return new i(d4, endsWith$default, Z3, longRef.element, longRef2.element, Y4, l4, longRef3.element);
}
public static final void d(C c4, int i, Function2 function2) {
long j4 = i;
while (j4 != 0) {
if (j4 < 4) {
throw new IOException("bad zip: truncated header in extra field");
}
int Y3 = c4.Y() & UShort.MAX_VALUE;
long Y4 = c4.Y() & 65535;
long j5 = j4 - 4;
if (j5 < Y4) {
throw new IOException("bad zip: truncated value in extra field");
}
c4.P(Y4);
C0576h c0576h = c4.f8246b;
long j6 = c0576h.f8284b;
function2.invoke(Integer.valueOf(Y3), Long.valueOf(Y4));
long j7 = (c0576h.f8284b + Y4) - j6;
if (j7 < 0) {
throw new IOException(com.google.android.gms.measurement.internal.a.l(Y3, "unsupported zip: too many bytes processed for "));
}
if (j7 > 0) {
c0576h.l(j7);
}
j4 = j5 - Y4;
}
}
/* JADX WARN: Multi-variable type inference failed */
public static final m e(C c4, m mVar) {
Ref.ObjectRef objectRef = new Ref.ObjectRef();
objectRef.element = mVar != null ? (Long) mVar.f8298g : 0;
Ref.ObjectRef objectRef2 = new Ref.ObjectRef();
Ref.ObjectRef objectRef3 = new Ref.ObjectRef();
int x3 = c4.x();
if (x3 != 67324752) {
throw new IOException("bad zip: expected " + b(67324752) + " but was " + b(x3));
}
c4.l(2L);
short Y3 = c4.Y();
int i = Y3 & UShort.MAX_VALUE;
if ((Y3 & 1) != 0) {
throw new IOException("unsupported zip: general purpose bit flag=" + b(i));
}
c4.l(18L);
int Y4 = c4.Y() & UShort.MAX_VALUE;
c4.l(c4.Y() & 65535);
if (mVar == null) {
c4.l(Y4);
return null;
}
d(c4, Y4, new k(c4, objectRef, objectRef2, objectRef3));
return new m(mVar.f8293b, mVar.f8294c, null, (Long) mVar.f8296e, (Long) objectRef3.element, (Long) objectRef.element, (Long) objectRef2.element);
}
}