soul-browser/sources/java/kotlin/random/Random.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

313 lines
16 KiB
Java

package kotlin.random;
import android.support.v4.media.a;
import com.google.android.gms.ads.RequestConfiguration;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import kotlin.Metadata;
import kotlin.SinceKotlin;
import kotlin.internal.PlatformImplementationsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import org.jetbrains.annotations.NotNull;
@SinceKotlin(version = "1.3")
@Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0006\n\u0000\n\u0002\u0010\u0007\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0006\b'\u0018\u0000 \u00182\u00020\u0001:\u0001\u0018B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0010\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0005H&J\b\u0010\u0007\u001a\u00020\u0005H\u0016J\u0010\u0010\u0007\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0005H\u0016J\u0018\u0010\u0007\u001a\u00020\u00052\u0006\u0010\t\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0005H\u0016J\b\u0010\n\u001a\u00020\u000bH\u0016J\u0010\u0010\n\u001a\u00020\u000b2\u0006\u0010\b\u001a\u00020\u000bH\u0016J\u0018\u0010\n\u001a\u00020\u000b2\u0006\u0010\t\u001a\u00020\u000b2\u0006\u0010\b\u001a\u00020\u000bH\u0016J\b\u0010\f\u001a\u00020\rH\u0016J\b\u0010\u000e\u001a\u00020\u000fH\u0016J\u0010\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\b\u001a\u00020\u000fH\u0016J\u0018\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\t\u001a\u00020\u000f2\u0006\u0010\b\u001a\u00020\u000fH\u0016J\b\u0010\u0010\u001a\u00020\u0011H\u0016J$\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u00132\b\b\u0002\u0010\u0015\u001a\u00020\u00052\b\b\u0002\u0010\u0016\u001a\u00020\u0005H\u0016J\u0010\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u0013H\u0016J\u0010\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0017\u001a\u00020\u0005H\u0016¨\u0006\u0019"}, d2 = {"Lkotlin/random/Random;", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "<init>", "()V", "nextBits", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "bitCount", "nextInt", "until", "from", "nextLong", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextBoolean", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextDouble", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextFloat", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextBytes", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "array", "fromIndex", "toIndex", "size", "Default", "kotlin-stdlib"}, k = 1, mv = {2, 2, 0}, xi = 48)
@SourceDebugExtension({"SMAP\nRandom.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Random.kt\nkotlin/random/Random\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,387:1\n1#2:388\n*E\n"})
/* loaded from: classes4.dex */
public abstract class Random {
/* renamed from: Default, reason: from kotlin metadata */
@NotNull
public static final Companion INSTANCE = new Companion(null);
@NotNull
private static final Random defaultRandom = PlatformImplementationsKt.IMPLEMENTATIONS.defaultPlatformRandom();
@Metadata(d1 = {"\u0000T\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0006\n\u0000\n\u0002\u0010\u0007\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0006\b\u0086\u0003\u0018\u00002\u00020\u00012\u00060\u0002j\u0002`\u0003:\u0001#B\t\b\u0002¢\u0006\u0004\b\u0004\u0010\u0005J\b\u0010\u0007\u001a\u00020\bH\u0002J\u0019\u0010\t\u001a\u00020\n2\n\u0010\u000b\u001a\u00060\fj\u0002`\rH\u0002¢\u0006\u0002\u0010\u000eJ\u0010\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u0010H\u0016J\b\u0010\u0012\u001a\u00020\u0010H\u0016J\u0010\u0010\u0012\u001a\u00020\u00102\u0006\u0010\u0013\u001a\u00020\u0010H\u0016J\u0018\u0010\u0012\u001a\u00020\u00102\u0006\u0010\u0014\u001a\u00020\u00102\u0006\u0010\u0013\u001a\u00020\u0010H\u0016J\b\u0010\u0015\u001a\u00020\u0016H\u0016J\u0010\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0013\u001a\u00020\u0016H\u0016J\u0018\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0014\u001a\u00020\u00162\u0006\u0010\u0013\u001a\u00020\u0016H\u0016J\b\u0010\u0017\u001a\u00020\u0018H\u0016J\b\u0010\u0019\u001a\u00020\u001aH\u0016J\u0010\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u0013\u001a\u00020\u001aH\u0016J\u0018\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u0014\u001a\u00020\u001a2\u0006\u0010\u0013\u001a\u00020\u001aH\u0016J\b\u0010\u001b\u001a\u00020\u001cH\u0016J\u0010\u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020\u001eH\u0016J\u0010\u0010\u001d\u001a\u00020\u001e2\u0006\u0010 \u001a\u00020\u0010H\u0016J \u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020\u001e2\u0006\u0010!\u001a\u00020\u00102\u0006\u0010\"\u001a\u00020\u0010H\u0016R\u000e\u0010\u0006\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006$"}, d2 = {"Lkotlin/random/Random$Default;", "Lkotlin/random/Random;", "Ljava/io/Serializable;", "Lkotlin/io/Serializable;", "<init>", "()V", "defaultRandom", "writeReplace", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "readObject", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "input", "Ljava/io/ObjectInputStream;", "Lkotlin/internal/ReadObjectParameterType;", "(Ljava/io/ObjectInputStream;)V", "nextBits", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "bitCount", "nextInt", "until", "from", "nextLong", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextBoolean", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextDouble", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextFloat", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "nextBytes", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "array", "size", "fromIndex", "toIndex", "Serialized", "kotlin-stdlib"}, k = 1, mv = {2, 2, 0}, xi = 48)
/* renamed from: kotlin.random.Random$Default, reason: from kotlin metadata */
/* loaded from: classes4.dex */
public static final class Companion extends Random implements Serializable {
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u0000\n\u0000\\u0002\u0018\u00002\u00060\u0001j\u0002`\u0002B\t\b\u0002¢\u0006\u0004\b\u0003\u0010\u0004J\b\u0010\u0007\u001a\u00020\bH\u0002R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lkotlin/random/Random$Default$Serialized;", "Ljava/io/Serializable;", "Lkotlin/io/Serializable;", "<init>", "()V", "serialVersionUID", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "readResolve", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "kotlin-stdlib"}, k = 1, mv = {2, 2, 0}, xi = 48)
/* renamed from: kotlin.random.Random$Default$Serialized */
/* loaded from: classes4.dex */
public static final class Serialized implements Serializable {
@NotNull
public static final Serialized INSTANCE = new Serialized();
private static final long serialVersionUID = 0;
private Serialized() {
}
private final Object readResolve() {
return Random.INSTANCE;
}
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private final void readObject(ObjectInputStream input) {
throw new InvalidObjectException("Deserialization is supported via proxy only");
}
private final Object writeReplace() {
return Serialized.INSTANCE;
}
@Override // kotlin.random.Random
public int nextBits(int bitCount) {
return Random.defaultRandom.nextBits(bitCount);
}
@Override // kotlin.random.Random
public boolean nextBoolean() {
return Random.defaultRandom.nextBoolean();
}
@Override // kotlin.random.Random
@NotNull
public byte[] nextBytes(@NotNull byte[] array) {
Intrinsics.checkNotNullParameter(array, "array");
return Random.defaultRandom.nextBytes(array);
}
@Override // kotlin.random.Random
public double nextDouble() {
return Random.defaultRandom.nextDouble();
}
@Override // kotlin.random.Random
public float nextFloat() {
return Random.defaultRandom.nextFloat();
}
@Override // kotlin.random.Random
public int nextInt() {
return Random.defaultRandom.nextInt();
}
@Override // kotlin.random.Random
public long nextLong() {
return Random.defaultRandom.nextLong();
}
private Companion() {
}
@Override // kotlin.random.Random
@NotNull
public byte[] nextBytes(int size) {
return Random.defaultRandom.nextBytes(size);
}
@Override // kotlin.random.Random
public double nextDouble(double until) {
return Random.defaultRandom.nextDouble(until);
}
@Override // kotlin.random.Random
public int nextInt(int until) {
return Random.defaultRandom.nextInt(until);
}
@Override // kotlin.random.Random
public long nextLong(long until) {
return Random.defaultRandom.nextLong(until);
}
@Override // kotlin.random.Random
@NotNull
public byte[] nextBytes(@NotNull byte[] array, int fromIndex, int toIndex) {
Intrinsics.checkNotNullParameter(array, "array");
return Random.defaultRandom.nextBytes(array, fromIndex, toIndex);
}
@Override // kotlin.random.Random
public double nextDouble(double from, double until) {
return Random.defaultRandom.nextDouble(from, until);
}
@Override // kotlin.random.Random
public int nextInt(int from, int until) {
return Random.defaultRandom.nextInt(from, until);
}
@Override // kotlin.random.Random
public long nextLong(long from, long until) {
return Random.defaultRandom.nextLong(from, until);
}
}
public static /* synthetic */ byte[] nextBytes$default(Random random, byte[] bArr, int i, int i2, int i3, Object obj) {
if (obj == null) {
if ((i3 & 2) != 0) {
i = 0;
}
if ((i3 & 4) != 0) {
i2 = bArr.length;
}
return random.nextBytes(bArr, i, i2);
}
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: nextBytes");
}
public abstract int nextBits(int bitCount);
public boolean nextBoolean() {
if (nextBits(1) != 0) {
return true;
}
return false;
}
@NotNull
public byte[] nextBytes(@NotNull byte[] array, int fromIndex, int toIndex) {
Intrinsics.checkNotNullParameter(array, "array");
if (fromIndex < 0 || fromIndex > array.length || toIndex < 0 || toIndex > array.length) {
StringBuilder u = a.u("fromIndex (", fromIndex, toIndex, ") or toIndex (", ") are out of range: 0..");
u.append(array.length);
u.append('.');
throw new IllegalArgumentException(u.toString().toString());
}
if (fromIndex <= toIndex) {
int i = (toIndex - fromIndex) / 4;
for (int i2 = 0; i2 < i; i2++) {
int nextInt = nextInt();
array[fromIndex] = (byte) nextInt;
array[fromIndex + 1] = (byte) (nextInt >>> 8);
array[fromIndex + 2] = (byte) (nextInt >>> 16);
array[fromIndex + 3] = (byte) (nextInt >>> 24);
fromIndex += 4;
}
int i3 = toIndex - fromIndex;
int nextBits = nextBits(i3 * 8);
for (int i4 = 0; i4 < i3; i4++) {
array[fromIndex + i4] = (byte) (nextBits >>> (i4 * 8));
}
return array;
}
throw new IllegalArgumentException(("fromIndex (" + fromIndex + ") must be not greater than toIndex (" + toIndex + ").").toString());
}
public double nextDouble() {
return PlatformRandomKt.doubleFromParts(nextBits(26), nextBits(27));
}
public float nextFloat() {
return nextBits(24) / 1.6777216E7f;
}
public int nextInt() {
return nextBits(32);
}
public long nextLong() {
return (nextInt() << 32) + nextInt();
}
public double nextDouble(double until) {
return nextDouble(0.0d, until);
}
public int nextInt(int until) {
return nextInt(0, until);
}
public long nextLong(long until) {
return nextLong(0L, until);
}
public double nextDouble(double from, double until) {
double nextDouble;
RandomKt.checkRangeBounds(from, until);
double d = until - from;
if (Double.isInfinite(d) && Math.abs(from) <= Double.MAX_VALUE && Math.abs(until) <= Double.MAX_VALUE) {
double d2 = 2;
double nextDouble2 = ((until / d2) - (from / d2)) * nextDouble();
nextDouble = from + nextDouble2 + nextDouble2;
} else {
nextDouble = from + (nextDouble() * d);
}
return nextDouble >= until ? Math.nextAfter(until, Double.NEGATIVE_INFINITY) : nextDouble;
}
public int nextInt(int from, int until) {
int nextInt;
int i;
int i2;
RandomKt.checkRangeBounds(from, until);
int i3 = until - from;
if (i3 > 0 || i3 == Integer.MIN_VALUE) {
if (((-i3) & i3) == i3) {
i2 = nextBits(RandomKt.fastLog2(i3));
return from + i2;
}
do {
nextInt = nextInt() >>> 1;
i = nextInt % i3;
} while ((i3 - 1) + (nextInt - i) < 0);
i2 = i;
return from + i2;
}
while (true) {
int nextInt2 = nextInt();
if (from <= nextInt2 && nextInt2 < until) {
return nextInt2;
}
}
}
public long nextLong(long from, long until) {
long nextLong;
long j;
long j2;
int nextInt;
RandomKt.checkRangeBounds(from, until);
long j3 = until - from;
if (j3 > 0) {
if (((-j3) & j3) == j3) {
int i = (int) j3;
int i2 = (int) (j3 >>> 32);
if (i != 0) {
nextInt = nextBits(RandomKt.fastLog2(i));
} else if (i2 == 1) {
nextInt = nextInt();
} else {
j2 = (nextBits(RandomKt.fastLog2(i2)) << 32) + (4294967295L & nextInt());
return from + j2;
}
j2 = nextInt & 4294967295L;
return from + j2;
}
do {
nextLong = nextLong() >>> 1;
j = nextLong % j3;
} while ((j3 - 1) + (nextLong - j) < 0);
j2 = j;
return from + j2;
}
while (true) {
long nextLong2 = nextLong();
if (from <= nextLong2 && nextLong2 < until) {
return nextLong2;
}
}
}
@NotNull
public byte[] nextBytes(@NotNull byte[] array) {
Intrinsics.checkNotNullParameter(array, "array");
return nextBytes(array, 0, array.length);
}
@NotNull
public byte[] nextBytes(int size) {
return nextBytes(new byte[size]);
}
}