* Decompile and recreate Soul Browser v1.4.85 with APK CI builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix CI build: include bundled google.jks and remove PR trigger The apktool build failed in CI because app/unknown/.../google.jks was excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files and commit the missing resource. Also remove the redundant pull_request workflow trigger. Co-authored-by: KaKi87 <KaKi87@pm.me> * Change package ID to com.github.kaki87.soulbrowser Rename the application ID so the rebuilt APK can be installed alongside the original Soul Browser from Google Play. - Update AndroidManifest package, permissions, providers, and actions - Update R class references in smali (com/github/kaki87/soulbrowser/R) - Update shortcuts.xml targetPackage - Rename app label to "Soul Rebuild" for easy identification Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install compatibility: remove split APK metadata and bundle native libs The rebuilt APK still declared requiredSplitTypes and Play Store split metadata, causing Android to reject standalone installs as incompatible. - Remove requiredSplitTypes and split-related manifest meta-data - Merge native libs from all ABI splits with uncompressed storage - Page-align before signing for extractNativeLibs=false - Add .so to apktool doNotCompress list Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install failure: use apksigner v2/v3 and bundle arm64 native libs Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only produces v1 signatures, causing Android to reject the install. - Sign with apksigner (v1+v2+v3) instead of jarsigner - Add arm64-v8a native libraries from universal Soul Browser 1.4.79 - Set extractNativeLibs=true for reliable sideload installs - Commit stable debug keystore for consistent signatures across builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Add committed debug keystore for consistent APK signatures Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix startup crash: use original classes2.dex desugar libraries Apktool recompiles smali_classes2 into a broken classes2.dex, causing ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init. Inject the original classes2.dex (Java 8+ desugar libs) after apktool build instead of using the recompiled version. Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix missing drawable resources from density split APKs The base APK is an app bundle module; density-specific drawables like seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild, causing Resources$NotFoundException at runtime. - Merge non-9-patch resources from split APKs before apktool build - Sync public.xml IDs from R smali only when backing files exist - Add 713 density-specific resource IDs to public.xml Co-authored-by: KaKi87 <KaKi87@pm.me> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
254 lines
7 KiB
Java
254 lines
7 KiB
Java
package com.google.android.gms.common.util;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import com.google.android.gms.common.annotation.KeepForSdk;
|
|
import com.google.android.gms.common.internal.Objects;
|
|
import java.lang.reflect.Array;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
|
|
@KeepForSdk
|
|
/* loaded from: classes.dex */
|
|
public final class ArrayUtils {
|
|
private ArrayUtils() {
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static <T> T[] concat(@NonNull T[]... tArr) {
|
|
if (tArr.length != 0) {
|
|
int i = 0;
|
|
for (T[] tArr2 : tArr) {
|
|
i += tArr2.length;
|
|
}
|
|
T[] tArr3 = (T[]) Arrays.copyOf(tArr[0], i);
|
|
int length = tArr[0].length;
|
|
for (int i2 = 1; i2 < tArr.length; i2++) {
|
|
T[] tArr4 = tArr[i2];
|
|
int length2 = tArr4.length;
|
|
System.arraycopy(tArr4, 0, tArr3, length, length2);
|
|
length += length2;
|
|
}
|
|
return tArr3;
|
|
}
|
|
return (T[]) ((Object[]) Array.newInstance(tArr.getClass(), 0));
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static byte[] concatByteArrays(@NonNull byte[]... bArr) {
|
|
if (bArr.length != 0) {
|
|
int i = 0;
|
|
for (byte[] bArr2 : bArr) {
|
|
i += bArr2.length;
|
|
}
|
|
byte[] copyOf = Arrays.copyOf(bArr[0], i);
|
|
int length = bArr[0].length;
|
|
for (int i2 = 1; i2 < bArr.length; i2++) {
|
|
byte[] bArr3 = bArr[i2];
|
|
int length2 = bArr3.length;
|
|
System.arraycopy(bArr3, 0, copyOf, length, length2);
|
|
length += length2;
|
|
}
|
|
return copyOf;
|
|
}
|
|
return new byte[0];
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static boolean contains(@Nullable int[] iArr, int i) {
|
|
if (iArr != null) {
|
|
for (int i2 : iArr) {
|
|
if (i2 == i) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static <T> ArrayList<T> newArrayList() {
|
|
return new ArrayList<>();
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public static <T> T[] removeAll(@NonNull T[] tArr, @NonNull T... tArr2) {
|
|
int length;
|
|
int i;
|
|
if (tArr == null) {
|
|
return null;
|
|
}
|
|
if (tArr2 != null && (length = tArr2.length) != 0) {
|
|
Class<?> cls = tArr2.getClass();
|
|
T[] tArr3 = (T[]) ((Object[]) Array.newInstance(cls.getComponentType(), tArr.length));
|
|
if (length == 1) {
|
|
i = 0;
|
|
for (T t : tArr) {
|
|
if (!Objects.equal(tArr2[0], t)) {
|
|
tArr3[i] = t;
|
|
i++;
|
|
}
|
|
}
|
|
} else {
|
|
int i2 = 0;
|
|
for (T t2 : tArr) {
|
|
if (!contains(tArr2, t2)) {
|
|
tArr3[i2] = t2;
|
|
i2++;
|
|
}
|
|
}
|
|
i = i2;
|
|
}
|
|
if (tArr3 == null) {
|
|
return null;
|
|
}
|
|
if (i == tArr3.length) {
|
|
return tArr3;
|
|
}
|
|
return (T[]) Arrays.copyOf(tArr3, i);
|
|
}
|
|
return (T[]) Arrays.copyOf(tArr, tArr.length);
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static <T> ArrayList<T> toArrayList(@NonNull T[] tArr) {
|
|
ArrayList<T> arrayList = new ArrayList<>(tArr.length);
|
|
for (T t : tArr) {
|
|
arrayList.add(t);
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
@NonNull
|
|
@KeepForSdk
|
|
public static int[] toPrimitiveArray(@Nullable Collection<Integer> collection) {
|
|
int i = 0;
|
|
if (collection != null && !collection.isEmpty()) {
|
|
int[] iArr = new int[collection.size()];
|
|
Iterator<Integer> it = collection.iterator();
|
|
while (it.hasNext()) {
|
|
iArr[i] = it.next().intValue();
|
|
i++;
|
|
}
|
|
return iArr;
|
|
}
|
|
return new int[0];
|
|
}
|
|
|
|
@Nullable
|
|
@KeepForSdk
|
|
public static Integer[] toWrapperArray(@Nullable int[] iArr) {
|
|
if (iArr == null) {
|
|
return null;
|
|
}
|
|
int length = iArr.length;
|
|
Integer[] numArr = new Integer[length];
|
|
for (int i = 0; i < length; i++) {
|
|
numArr[i] = Integer.valueOf(iArr[i]);
|
|
}
|
|
return numArr;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static void writeArray(@NonNull StringBuilder sb, @NonNull double[] dArr) {
|
|
int length = dArr.length;
|
|
for (int i = 0; i < length; i++) {
|
|
if (i != 0) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(dArr[i]);
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static void writeStringArray(@NonNull StringBuilder sb, @NonNull String[] strArr) {
|
|
int length = strArr.length;
|
|
for (int i = 0; i < length; i++) {
|
|
if (i != 0) {
|
|
sb.append(",");
|
|
}
|
|
sb.append("\"");
|
|
sb.append(strArr[i]);
|
|
sb.append("\"");
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static <T> boolean contains(@NonNull T[] tArr, @Nullable T t) {
|
|
int length = tArr != null ? tArr.length : 0;
|
|
int i = 0;
|
|
while (true) {
|
|
if (i >= length) {
|
|
break;
|
|
}
|
|
if (!Objects.equal(tArr[i], t)) {
|
|
i++;
|
|
} else if (i >= 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static void writeArray(@NonNull StringBuilder sb, @NonNull float[] fArr) {
|
|
int length = fArr.length;
|
|
for (int i = 0; i < length; i++) {
|
|
if (i != 0) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(fArr[i]);
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static void writeArray(@NonNull StringBuilder sb, @NonNull int[] iArr) {
|
|
int length = iArr.length;
|
|
for (int i = 0; i < length; i++) {
|
|
if (i != 0) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(iArr[i]);
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static void writeArray(@NonNull StringBuilder sb, @NonNull long[] jArr) {
|
|
int length = jArr.length;
|
|
for (int i = 0; i < length; i++) {
|
|
if (i != 0) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(jArr[i]);
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static <T> void writeArray(@NonNull StringBuilder sb, @NonNull T[] tArr) {
|
|
int length = tArr.length;
|
|
for (int i = 0; i < length; i++) {
|
|
if (i != 0) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(tArr[i]);
|
|
}
|
|
}
|
|
|
|
@KeepForSdk
|
|
public static void writeArray(@NonNull StringBuilder sb, @NonNull boolean[] zArr) {
|
|
int length = zArr.length;
|
|
for (int i = 0; i < length; i++) {
|
|
if (i != 0) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(zArr[i]);
|
|
}
|
|
}
|
|
}
|