soul-browser/sources/java/j$/util/stream/x6.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

168 lines
4.6 KiB
Java

package j$.util.stream;
import j$.lang.Iterable;
import j$.util.Spliterator;
import java.util.Arrays;
/* loaded from: classes2.dex */
public abstract class x6 extends c implements Iterable, Iterable {
public Object e;
public Object[] f;
public abstract Object newArray(int i);
public abstract void p(Object obj, int i, int i2, Object obj2);
public abstract int q(Object obj);
public abstract Spliterator spliterator();
@Override // java.lang.Iterable
public final /* synthetic */ java.util.Spliterator spliterator() {
return Spliterator.Wrapper.convert(spliterator());
}
public abstract Object[] t();
public x6(int i) {
super(i);
this.e = newArray(1 << this.f21390a);
}
public x6() {
this.e = newArray(16);
}
public final void s(long j) {
long q;
int i = this.f21391c;
if (i == 0) {
q = q(this.e);
} else {
q = q(this.f[i]) + this.d[i];
}
if (j > q) {
if (this.f == null) {
Object[] t = t();
this.f = t;
this.d = new long[8];
t[0] = this.e;
}
int i2 = this.f21391c + 1;
while (j > q) {
Object[] objArr = this.f;
if (i2 >= objArr.length) {
int length = objArr.length * 2;
this.f = Arrays.copyOf(objArr, length);
this.d = Arrays.copyOf(this.d, length);
}
int i3 = this.f21390a;
if (i2 != 0 && i2 != 1) {
i3 = Math.min((i3 + i2) - 1, 30);
}
int i4 = 1 << i3;
this.f[i2] = newArray(i4);
long[] jArr = this.d;
jArr[i2] = jArr[i2 - 1] + q(this.f[r6]);
q += i4;
i2++;
}
}
}
public final int r(long j) {
if (this.f21391c == 0) {
if (j < this.b) {
return 0;
}
throw new IndexOutOfBoundsException(Long.toString(j));
}
if (j >= count()) {
throw new IndexOutOfBoundsException(Long.toString(j));
}
for (int i = 0; i <= this.f21391c; i++) {
if (j < this.d[i] + q(this.f[i])) {
return i;
}
}
throw new IndexOutOfBoundsException(Long.toString(j));
}
public void f(int i, Object obj) {
long j = i;
long count = count() + j;
if (count > q(obj) || count < j) {
throw new IndexOutOfBoundsException("does not fit");
}
if (this.f21391c == 0) {
System.arraycopy(this.e, 0, obj, i, this.b);
return;
}
for (int i2 = 0; i2 < this.f21391c; i2++) {
Object obj2 = this.f[i2];
System.arraycopy(obj2, 0, obj, i, q(obj2));
i += q(this.f[i2]);
}
int i3 = this.b;
if (i3 > 0) {
System.arraycopy(this.e, 0, obj, i, i3);
}
}
public Object b() {
long count = count();
if (count >= 2147483639) {
throw new IllegalArgumentException("Stream size exceeds max array size");
}
Object newArray = newArray((int) count);
f(0, newArray);
return newArray;
}
public final void u() {
long q;
if (this.b == q(this.e)) {
if (this.f == null) {
Object[] t = t();
this.f = t;
this.d = new long[8];
t[0] = this.e;
}
int i = this.f21391c;
int i2 = i + 1;
Object[] objArr = this.f;
if (i2 >= objArr.length || objArr[i2] == null) {
if (i == 0) {
q = q(this.e);
} else {
q = q(objArr[i]) + this.d[i];
}
s(q + 1);
}
this.b = 0;
int i3 = this.f21391c + 1;
this.f21391c = i3;
this.e = this.f[i3];
}
}
@Override // j$.util.stream.c
public final void clear() {
Object[] objArr = this.f;
if (objArr != null) {
this.e = objArr[0];
this.f = null;
this.d = null;
}
this.b = 0;
this.f21391c = 0;
}
public void g(Object obj) {
for (int i = 0; i < this.f21391c; i++) {
Object obj2 = this.f[i];
p(obj2, 0, q(obj2), obj);
}
p(this.e, 0, this.b, obj);
}
}