soul-browser/sources/java/kotlin/uuid/UuidKt__UuidJVMKt.java
KaKi87 550ddb0413
Decompile and recreate Soul Browser v1.4.85 with APK CI builds (#1)
* 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>
2026-08-10 16:07:14 +02:00

178 lines
9.6 KiB
Java

package kotlin.uuid;
import android.support.v4.media.a;
import com.google.android.gms.ads.RequestConfiguration;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.UUID;
import kotlin.Metadata;
import kotlin.SinceKotlin;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import org.jetbrains.annotations.NotNull;
@Metadata(d1 = {"\u0000@\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\b\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\b\u0010\u0000\u001a\u00020\u0001H\u0001\u001a\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0001H\u0001\u001a\u0014\u0010\u0005\u001a\u00020\u0006*\u00020\u00072\u0006\u0010\b\u001a\u00020\tH\u0001\u001a,\u0010\n\u001a\u00020\u000b*\u00020\u00062\u0006\u0010\f\u001a\u00020\u00072\u0006\u0010\r\u001a\u00020\t2\u0006\u0010\u000e\u001a\u00020\t2\u0006\u0010\u000f\u001a\u00020\tH\u0001\u001a\u001c\u0010\u0010\u001a\u00020\u000b*\u00020\u00072\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\u0011\u001a\u00020\u0006H\u0001\u001a\u0010\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u0014H\u0001\u001a\u0010\u0010\u0015\u001a\u00020\u00012\u0006\u0010\u0016\u001a\u00020\u0014H\u0001\u001a\r\u0010\u0017\u001a\u00020\u0001*\u00020\u0018H\u0087\b\u001a\r\u0010\u0019\u001a\u00020\u0018*\u00020\u0001H\u0087\b\u001a\f\u0010\u001a\u001a\u00020\u0001*\u00020\u001bH\u0007\u001a\u0014\u0010\u001a\u001a\u00020\u0001*\u00020\u001b2\u0006\u0010\b\u001a\u00020\tH\u0007\u001a\u0014\u0010\u001c\u001a\u00020\u001b*\u00020\u001b2\u0006\u0010\u0004\u001a\u00020\u0001H\u0007\u001a\u001c\u0010\u001c\u001a\u00020\u001b*\u00020\u001b2\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\u0004\u001a\u00020\u0001H\u0007\u001a\r\u0010\u001d\u001a\u00020\u0006*\u00020\u0006H\u0080\\u0006\u001e"}, d2 = {"secureRandomUuid", "Lkotlin/uuid/Uuid;", "serializedUuid", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "uuid", "getLongAt", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "index", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "formatBytesInto", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "dst", "dstOffset", "startIndex", "endIndex", "setLongAt", "value", "uuidParseHexDash", "hexDashString", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "uuidParseHex", "hexString", "toKotlinUuid", "Ljava/util/UUID;", "toJavaUuid", "getUuid", "Ljava/nio/ByteBuffer;", "putUuid", "reverseBytes", "kotlin-stdlib"}, k = 5, mv = {2, 2, 0}, xi = 49, xs = "kotlin/uuid/UuidKt")
@SourceDebugExtension({"SMAP\nUuidJVM.kt\nKotlin\n*S Kotlin\n*F\n+ 1 UuidJVM.kt\nkotlin/uuid/UuidKt__UuidJVMKt\n*L\n1#1,277:1\n277#1:278\n277#1:279\n277#1:280\n277#1:281\n277#1:282\n277#1:283\n277#1:284\n277#1:285\n*S KotlinDebug\n*F\n+ 1 UuidJVM.kt\nkotlin/uuid/UuidKt__UuidJVMKt\n*L\n139#1:278\n140#1:279\n184#1:280\n185#1:281\n224#1:282\n225#1:283\n271#1:284\n272#1:285\n*E\n"})
/* loaded from: classes4.dex */
class UuidKt__UuidJVMKt {
@ExperimentalUuidApi
public static final void formatBytesInto(long j, @NotNull byte[] dst, int i, int i2, int i3) {
Intrinsics.checkNotNullParameter(dst, "dst");
UuidKt__UuidKt.formatBytesIntoCommonImpl(j, dst, i, i2, i3);
}
@ExperimentalUuidApi
public static final long getLongAt(@NotNull byte[] bArr, int i) {
Intrinsics.checkNotNullParameter(bArr, "<this>");
return UuidKt__UuidKt.getLongAtCommonImpl(bArr, i);
}
@SinceKotlin(version = "2.0")
@ExperimentalUuidApi
@NotNull
public static final Uuid getUuid(@NotNull ByteBuffer byteBuffer) {
Intrinsics.checkNotNullParameter(byteBuffer, "<this>");
if (byteBuffer.position() + 15 < byteBuffer.limit()) {
long j = byteBuffer.getLong();
long j2 = byteBuffer.getLong();
if (Intrinsics.areEqual(byteBuffer.order(), ByteOrder.LITTLE_ENDIAN)) {
j = Long.reverseBytes(j);
j2 = Long.reverseBytes(j2);
}
return Uuid.INSTANCE.fromLongs(j, j2);
}
throw new BufferUnderflowException();
}
@SinceKotlin(version = "2.0")
@ExperimentalUuidApi
@NotNull
public static final ByteBuffer putUuid(@NotNull ByteBuffer byteBuffer, @NotNull Uuid uuid) {
ByteBuffer putLong;
Intrinsics.checkNotNullParameter(byteBuffer, "<this>");
Intrinsics.checkNotNullParameter(uuid, "uuid");
long mostSignificantBits = uuid.getMostSignificantBits();
long leastSignificantBits = uuid.getLeastSignificantBits();
if (byteBuffer.position() + 15 < byteBuffer.limit()) {
if (Intrinsics.areEqual(byteBuffer.order(), ByteOrder.BIG_ENDIAN)) {
byteBuffer.putLong(mostSignificantBits);
putLong = byteBuffer.putLong(leastSignificantBits);
} else {
byteBuffer.putLong(Long.reverseBytes(mostSignificantBits));
putLong = byteBuffer.putLong(Long.reverseBytes(leastSignificantBits));
}
Intrinsics.checkNotNullExpressionValue(putLong, "toLongs(...)");
return putLong;
}
throw new BufferOverflowException();
}
public static final long reverseBytes(long j) {
return Long.reverseBytes(j);
}
@ExperimentalUuidApi
@NotNull
public static final Uuid secureRandomUuid() {
byte[] bArr = new byte[16];
SecureRandomHolder.INSTANCE.getInstance().nextBytes(bArr);
return UuidKt__UuidKt.uuidFromRandomBytes(bArr);
}
@ExperimentalUuidApi
@NotNull
public static final Object serializedUuid(@NotNull Uuid uuid) {
Intrinsics.checkNotNullParameter(uuid, "uuid");
return new UuidSerialized(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
}
@ExperimentalUuidApi
public static final void setLongAt(@NotNull byte[] bArr, int i, long j) {
Intrinsics.checkNotNullParameter(bArr, "<this>");
UuidKt__UuidKt.setLongAtCommonImpl(bArr, i, j);
}
@SinceKotlin(version = "2.0")
@ExperimentalUuidApi
@NotNull
public static final UUID toJavaUuid(@NotNull Uuid uuid) {
Intrinsics.checkNotNullParameter(uuid, "<this>");
return new UUID(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
}
@SinceKotlin(version = "2.0")
@ExperimentalUuidApi
@NotNull
public static final Uuid toKotlinUuid(@NotNull UUID uuid) {
Intrinsics.checkNotNullParameter(uuid, "<this>");
return Uuid.INSTANCE.fromLongs(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
}
@ExperimentalUuidApi
@NotNull
public static final Uuid uuidParseHex(@NotNull String hexString) {
Intrinsics.checkNotNullParameter(hexString, "hexString");
return UuidKt__UuidKt.uuidParseHexCommonImpl(hexString);
}
@ExperimentalUuidApi
@NotNull
public static final Uuid uuidParseHexDash(@NotNull String hexDashString) {
Intrinsics.checkNotNullParameter(hexDashString, "hexDashString");
return UuidKt__UuidKt.uuidParseHexDashCommonImpl(hexDashString);
}
@SinceKotlin(version = "2.0")
@ExperimentalUuidApi
@NotNull
public static final Uuid getUuid(@NotNull ByteBuffer byteBuffer, int i) {
Intrinsics.checkNotNullParameter(byteBuffer, "<this>");
if (i >= 0) {
if (i + 15 < byteBuffer.limit()) {
long j = byteBuffer.getLong(i);
long j2 = byteBuffer.getLong(i + 8);
if (Intrinsics.areEqual(byteBuffer.order(), ByteOrder.LITTLE_ENDIAN)) {
j = Long.reverseBytes(j);
j2 = Long.reverseBytes(j2);
}
return Uuid.INSTANCE.fromLongs(j, j2);
}
StringBuilder s = a.s(i, "Not enough bytes to read a uuid at index: ", ", with limit: ");
s.append(byteBuffer.limit());
s.append(' ');
throw new IndexOutOfBoundsException(s.toString());
}
throw new IndexOutOfBoundsException(a.e(i, "Negative index: "));
}
@SinceKotlin(version = "2.0")
@ExperimentalUuidApi
@NotNull
public static final ByteBuffer putUuid(@NotNull ByteBuffer byteBuffer, int i, @NotNull Uuid uuid) {
ByteBuffer putLong;
Intrinsics.checkNotNullParameter(byteBuffer, "<this>");
Intrinsics.checkNotNullParameter(uuid, "uuid");
long mostSignificantBits = uuid.getMostSignificantBits();
long leastSignificantBits = uuid.getLeastSignificantBits();
if (i >= 0) {
if (i + 15 < byteBuffer.limit()) {
if (Intrinsics.areEqual(byteBuffer.order(), ByteOrder.BIG_ENDIAN)) {
byteBuffer.putLong(i, mostSignificantBits);
putLong = byteBuffer.putLong(i + 8, leastSignificantBits);
} else {
byteBuffer.putLong(i, Long.reverseBytes(mostSignificantBits));
putLong = byteBuffer.putLong(i + 8, Long.reverseBytes(leastSignificantBits));
}
Intrinsics.checkNotNullExpressionValue(putLong, "toLongs(...)");
return putLong;
}
StringBuilder s = a.s(i, "Not enough capacity to write a uuid at index: ", ", with limit: ");
s.append(byteBuffer.limit());
s.append(' ');
throw new IndexOutOfBoundsException(s.toString());
}
throw new IndexOutOfBoundsException(a.e(i, "Negative index: "));
}
}