* 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>
419 lines
14 KiB
Java
419 lines
14 KiB
Java
package j$.util.concurrent;
|
|
|
|
import j$.util.Spliterator;
|
|
import j$.util.n1;
|
|
import j$.util.stream.IntStream;
|
|
import j$.util.stream.a0;
|
|
import j$.util.stream.c7;
|
|
import j$.util.stream.i1;
|
|
import java.io.ObjectOutputStream;
|
|
import java.io.ObjectStreamField;
|
|
import java.security.AccessController;
|
|
import java.security.SecureRandom;
|
|
import java.util.Random;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
import java.util.stream.DoubleStream;
|
|
import java.util.stream.IntStream;
|
|
import java.util.stream.LongStream;
|
|
import kotlin.jvm.internal.LongCompanionObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class ThreadLocalRandom extends Random {
|
|
private static final long serialVersionUID = -5851777807851030925L;
|
|
|
|
/* renamed from: a, reason: collision with root package name */
|
|
public long f21307a;
|
|
public int b;
|
|
|
|
/* renamed from: c, reason: collision with root package name */
|
|
public final boolean f21308c;
|
|
private static final ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("rnd", Long.TYPE), new ObjectStreamField("initialized", Boolean.TYPE)};
|
|
public static final ThreadLocal d = new ThreadLocal();
|
|
public static final AtomicInteger e = new AtomicInteger();
|
|
public static final u f = new ThreadLocal();
|
|
public static final AtomicLong g = new AtomicLong(f(System.currentTimeMillis()) ^ f(System.nanoTime()));
|
|
|
|
public /* synthetic */ ThreadLocalRandom(int i) {
|
|
this();
|
|
}
|
|
|
|
public static int e(long j) {
|
|
long j2 = (j ^ (j >>> 33)) * (-49064778989728563L);
|
|
return (int) (((j2 ^ (j2 >>> 33)) * (-4265267296055464877L)) >>> 32);
|
|
}
|
|
|
|
public static long f(long j) {
|
|
long j2 = (j ^ (j >>> 33)) * (-49064778989728563L);
|
|
long j3 = (j2 ^ (j2 >>> 33)) * (-4265267296055464877L);
|
|
return j3 ^ (j3 >>> 33);
|
|
}
|
|
|
|
private ThreadLocalRandom() {
|
|
this.f21308c = true;
|
|
}
|
|
|
|
public static final void d() {
|
|
int addAndGet = e.addAndGet(-1640531527);
|
|
if (addAndGet == 0) {
|
|
addAndGet = 1;
|
|
}
|
|
long f2 = f(g.getAndAdd(-4942790177534073029L));
|
|
ThreadLocalRandom threadLocalRandom = (ThreadLocalRandom) f.get();
|
|
threadLocalRandom.f21307a = f2;
|
|
threadLocalRandom.b = addAndGet;
|
|
}
|
|
|
|
public static ThreadLocalRandom current() {
|
|
ThreadLocalRandom threadLocalRandom = (ThreadLocalRandom) f.get();
|
|
if (threadLocalRandom.b == 0) {
|
|
d();
|
|
}
|
|
return threadLocalRandom;
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final void setSeed(long j) {
|
|
if (this.f21308c) {
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
}
|
|
|
|
public final long g() {
|
|
long j = this.f21307a - 7046029254386353131L;
|
|
this.f21307a = j;
|
|
return j;
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final int next(int i) {
|
|
return nextInt() >>> (32 - i);
|
|
}
|
|
|
|
public final long c(long j, long j2) {
|
|
long f2 = f(g());
|
|
if (j >= j2) {
|
|
return f2;
|
|
}
|
|
long j3 = j2 - j;
|
|
long j4 = j3 - 1;
|
|
if ((j3 & j4) == 0) {
|
|
return (f2 & j4) + j;
|
|
}
|
|
if (j3 > 0) {
|
|
while (true) {
|
|
long j5 = f2 >>> 1;
|
|
long j6 = j5 + j4;
|
|
long j7 = j5 % j3;
|
|
if (j6 - j7 >= 0) {
|
|
return j7 + j;
|
|
}
|
|
f2 = f(g());
|
|
}
|
|
} else {
|
|
while (true) {
|
|
if (f2 >= j && f2 < j2) {
|
|
return f2;
|
|
}
|
|
f2 = f(g());
|
|
}
|
|
}
|
|
}
|
|
|
|
public final int b(int i, int i2) {
|
|
int e2 = e(g());
|
|
if (i >= i2) {
|
|
return e2;
|
|
}
|
|
int i3 = i2 - i;
|
|
int i4 = i3 - 1;
|
|
if ((i3 & i4) == 0) {
|
|
return (e2 & i4) + i;
|
|
}
|
|
if (i3 > 0) {
|
|
int i5 = e2 >>> 1;
|
|
while (true) {
|
|
int i6 = i5 + i4;
|
|
int i7 = i5 % i3;
|
|
if (i6 - i7 >= 0) {
|
|
return i7 + i;
|
|
}
|
|
i5 = e(g()) >>> 1;
|
|
}
|
|
} else {
|
|
while (true) {
|
|
if (e2 >= i && e2 < i2) {
|
|
return e2;
|
|
}
|
|
e2 = e(g());
|
|
}
|
|
}
|
|
}
|
|
|
|
public final double a(double d2, double d3) {
|
|
double nextLong = (nextLong() >>> 11) * 1.1102230246251565E-16d;
|
|
if (d2 >= d3) {
|
|
return nextLong;
|
|
}
|
|
double d4 = ((d3 - d2) * nextLong) + d2;
|
|
return d4 >= d3 ? Double.longBitsToDouble(Double.doubleToLongBits(d3) - 1) : d4;
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public int nextInt() {
|
|
return e(g());
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final int nextInt(int i) {
|
|
if (i <= 0) {
|
|
throw new IllegalArgumentException("bound must be positive");
|
|
}
|
|
int e2 = e(g());
|
|
int i2 = i - 1;
|
|
if ((i & i2) == 0) {
|
|
return e2 & i2;
|
|
}
|
|
while (true) {
|
|
int i3 = e2 >>> 1;
|
|
int i4 = i3 + i2;
|
|
int i5 = i3 % i;
|
|
if (i4 - i5 >= 0) {
|
|
return i5;
|
|
}
|
|
e2 = e(g());
|
|
}
|
|
}
|
|
|
|
public int nextInt(int i, int i2) {
|
|
if (i >= i2) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
return b(i, i2);
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final long nextLong() {
|
|
return f(g());
|
|
}
|
|
|
|
public long nextLong(long j) {
|
|
if (j <= 0) {
|
|
throw new IllegalArgumentException("bound must be positive");
|
|
}
|
|
long f2 = f(g());
|
|
long j2 = j - 1;
|
|
if ((j & j2) == 0) {
|
|
return f2 & j2;
|
|
}
|
|
while (true) {
|
|
long j3 = f2 >>> 1;
|
|
long j4 = j3 + j2;
|
|
long j5 = j3 % j;
|
|
if (j4 - j5 >= 0) {
|
|
return j5;
|
|
}
|
|
f2 = f(g());
|
|
}
|
|
}
|
|
|
|
public long nextLong(long j, long j2) {
|
|
if (j >= j2) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
return c(j, j2);
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final double nextDouble() {
|
|
return (f(g()) >>> 11) * 1.1102230246251565E-16d;
|
|
}
|
|
|
|
public double nextDouble(double d2) {
|
|
if (d2 <= 0.0d) {
|
|
throw new IllegalArgumentException("bound must be positive");
|
|
}
|
|
double f2 = (f(g()) >>> 11) * 1.1102230246251565E-16d * d2;
|
|
return f2 < d2 ? f2 : Double.longBitsToDouble(Double.doubleToLongBits(d2) - 1);
|
|
}
|
|
|
|
public final double nextDouble(double d2, double d3) {
|
|
if (d2 >= d3) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
return a(d2, d3);
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final boolean nextBoolean() {
|
|
return e(g()) < 0;
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final float nextFloat() {
|
|
return (e(g()) >>> 8) * 5.9604645E-8f;
|
|
}
|
|
|
|
@Override // java.util.Random
|
|
public final double nextGaussian() {
|
|
ThreadLocal threadLocal = d;
|
|
Double d2 = (Double) threadLocal.get();
|
|
if (d2 != null) {
|
|
threadLocal.set(null);
|
|
return d2.doubleValue();
|
|
}
|
|
while (true) {
|
|
double nextDouble = (nextDouble() * 2.0d) - 1.0d;
|
|
double nextDouble2 = (nextDouble() * 2.0d) - 1.0d;
|
|
double d3 = (nextDouble2 * nextDouble2) + (nextDouble * nextDouble);
|
|
if (d3 < 1.0d && d3 != 0.0d) {
|
|
double sqrt = StrictMath.sqrt((StrictMath.log(d3) * (-2.0d)) / d3);
|
|
d.set(Double.valueOf(nextDouble2 * sqrt));
|
|
return nextDouble * sqrt;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r9v2, types: [j$.util.stream.IntStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final IntStream ints(long j) {
|
|
if (j < 0) {
|
|
throw new IllegalArgumentException("size must be non-negative");
|
|
}
|
|
w wVar = new w(0L, j, Integer.MAX_VALUE, 0);
|
|
return IntStream.Wrapper.convert(new j$.util.stream.a((Spliterator) wVar, c7.h(wVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r1v1, types: [j$.util.stream.IntStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final java.util.stream.IntStream ints() {
|
|
w wVar = new w(0L, LongCompanionObject.MAX_VALUE, Integer.MAX_VALUE, 0);
|
|
return IntStream.Wrapper.convert(new j$.util.stream.a((Spliterator) wVar, c7.h(wVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r9v3, types: [j$.util.stream.IntStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final java.util.stream.IntStream ints(long j, int i, int i2) {
|
|
if (j < 0) {
|
|
throw new IllegalArgumentException("size must be non-negative");
|
|
}
|
|
if (i >= i2) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
w wVar = new w(0L, j, i, i2);
|
|
return IntStream.Wrapper.convert(new j$.util.stream.a((Spliterator) wVar, c7.h(wVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r8v2, types: [j$.util.stream.IntStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final java.util.stream.IntStream ints(int i, int i2) {
|
|
if (i >= i2) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
w wVar = new w(0L, LongCompanionObject.MAX_VALUE, i, i2);
|
|
return IntStream.Wrapper.convert(new j$.util.stream.a((Spliterator) wVar, c7.h(wVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r11v2, types: [j$.util.stream.a, j$.util.stream.LongStream] */
|
|
@Override // java.util.Random
|
|
public final LongStream longs(long j) {
|
|
if (j < 0) {
|
|
throw new IllegalArgumentException("size must be non-negative");
|
|
}
|
|
x xVar = new x(0L, j, LongCompanionObject.MAX_VALUE, 0L);
|
|
return i1.f(new j$.util.stream.a((Spliterator) xVar, c7.h(xVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r1v1, types: [j$.util.stream.a, j$.util.stream.LongStream] */
|
|
@Override // java.util.Random
|
|
public final LongStream longs() {
|
|
x xVar = new x(0L, LongCompanionObject.MAX_VALUE, LongCompanionObject.MAX_VALUE, 0L);
|
|
return i1.f(new j$.util.stream.a((Spliterator) xVar, c7.h(xVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r11v3, types: [j$.util.stream.a, j$.util.stream.LongStream] */
|
|
@Override // java.util.Random
|
|
public final LongStream longs(long j, long j2, long j3) {
|
|
if (j < 0) {
|
|
throw new IllegalArgumentException("size must be non-negative");
|
|
}
|
|
if (j2 >= j3) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
x xVar = new x(0L, j, j2, j3);
|
|
return i1.f(new j$.util.stream.a((Spliterator) xVar, c7.h(xVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r11v2, types: [j$.util.stream.a, j$.util.stream.LongStream] */
|
|
@Override // java.util.Random
|
|
public final LongStream longs(long j, long j2) {
|
|
if (j >= j2) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
x xVar = new x(0L, LongCompanionObject.MAX_VALUE, j, j2);
|
|
return i1.f(new j$.util.stream.a((Spliterator) xVar, c7.h(xVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r11v2, types: [j$.util.stream.DoubleStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final DoubleStream doubles(long j) {
|
|
if (j < 0) {
|
|
throw new IllegalArgumentException("size must be non-negative");
|
|
}
|
|
v vVar = new v(0L, j, Double.MAX_VALUE, 0.0d);
|
|
return a0.f(new j$.util.stream.a((Spliterator) vVar, c7.h(vVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r1v1, types: [j$.util.stream.DoubleStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final DoubleStream doubles() {
|
|
v vVar = new v(0L, LongCompanionObject.MAX_VALUE, Double.MAX_VALUE, 0.0d);
|
|
return a0.f(new j$.util.stream.a((Spliterator) vVar, c7.h(vVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r11v3, types: [j$.util.stream.DoubleStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final DoubleStream doubles(long j, double d2, double d3) {
|
|
if (j < 0) {
|
|
throw new IllegalArgumentException("size must be non-negative");
|
|
}
|
|
if (d2 >= d3) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
v vVar = new v(0L, j, d2, d3);
|
|
return a0.f(new j$.util.stream.a((Spliterator) vVar, c7.h(vVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r11v2, types: [j$.util.stream.DoubleStream, j$.util.stream.a] */
|
|
@Override // java.util.Random
|
|
public final DoubleStream doubles(double d2, double d3) {
|
|
if (d2 >= d3) {
|
|
throw new IllegalArgumentException("bound must be greater than origin");
|
|
}
|
|
v vVar = new v(0L, LongCompanionObject.MAX_VALUE, d2, d3);
|
|
return a0.f(new j$.util.stream.a((Spliterator) vVar, c7.h(vVar), false));
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r0v4, types: [java.lang.ThreadLocal, j$.util.concurrent.u] */
|
|
static {
|
|
if (((Boolean) AccessController.doPrivileged(new n1(1))).booleanValue()) {
|
|
byte[] seed = SecureRandom.getSeed(8);
|
|
long j = seed[0] & 255;
|
|
for (int i = 1; i < 8; i++) {
|
|
j = (j << 8) | (seed[i] & 255);
|
|
}
|
|
g.set(j);
|
|
}
|
|
}
|
|
|
|
private void writeObject(ObjectOutputStream objectOutputStream) {
|
|
ObjectOutputStream.PutField putFields = objectOutputStream.putFields();
|
|
putFields.put("rnd", this.f21307a);
|
|
putFields.put("initialized", true);
|
|
objectOutputStream.writeFields();
|
|
}
|
|
|
|
private Object readResolve() {
|
|
return current();
|
|
}
|
|
}
|