soul-browser/sources/java/com/google/common/collect/ImmutableRangeSet.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

328 lines
12 KiB
Java

package com.google.common.collect;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Preconditions;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.Cut;
import com.google.common.collect.Lists;
import com.google.common.collect.Range;
import com.google.common.collect.SortedLists;
import java.io.Serializable;
import java.lang.Comparable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.RandomAccess;
import java.util.Set;
@GwtIncompatible
/* loaded from: classes3.dex */
public final class ImmutableRangeSet<C extends Comparable> extends AbstractRangeSet<C> implements Serializable {
public static final ImmutableRangeSet f;
public static final ImmutableRangeSet g;
/* renamed from: c, reason: collision with root package name */
public final transient ImmutableList f12302c;
/* renamed from: com.google.common.collect.ImmutableRangeSet$1, reason: invalid class name */
/* loaded from: classes3.dex */
class AnonymousClass1 extends ImmutableList<Range<Comparable>> {
public final /* synthetic */ int g;
public final /* synthetic */ int h;
public final /* synthetic */ Range i;
public final /* synthetic */ ImmutableRangeSet j;
public AnonymousClass1(ImmutableRangeSet immutableRangeSet, int i, int i2, Range range) {
this.g = i;
this.h = i2;
this.i = range;
this.j = immutableRangeSet;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // java.util.List
public final Object get(int i) {
ImmutableList immutableList = this.j.f12302c;
int i2 = this.g;
Preconditions.g(i, i2);
int i3 = this.h;
if (i != 0 && i != i2 - 1) {
return (Range) immutableList.get(i + i3);
}
return ((Range) immutableList.get(i + i3)).d(this.i);
}
@Override // com.google.common.collect.ImmutableCollection
public final boolean m() {
return true;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final int size() {
return this.g;
}
}
/* loaded from: classes3.dex */
public final class AsSet extends ImmutableSortedSet<C> {
public transient Integer k;
/* renamed from: com.google.common.collect.ImmutableRangeSet$AsSet$1, reason: invalid class name */
/* loaded from: classes3.dex */
class AnonymousClass1 extends AbstractIterator<Comparable> {
public final UnmodifiableListIterator g;
public final UnmodifiableIterator h;
public AnonymousClass1(AsSet asSet) {
asSet.getClass();
throw null;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractIterator
public final Object a() {
UnmodifiableIterator unmodifiableIterator = this.h;
if (!unmodifiableIterator.hasNext()) {
UnmodifiableListIterator unmodifiableListIterator = this.g;
if (!unmodifiableListIterator.hasNext()) {
this.f12232c = AbstractIterator.State.g;
return null;
}
Range range = (Range) unmodifiableListIterator.next();
int i = ContiguousSet.k;
range.getClass();
throw null;
}
return (Comparable) unmodifiableIterator.next();
}
}
/* renamed from: com.google.common.collect.ImmutableRangeSet$AsSet$2, reason: invalid class name */
/* loaded from: classes3.dex */
class AnonymousClass2 extends AbstractIterator<Comparable> {
public final UnmodifiableListIterator g;
public final UnmodifiableIterator h;
public AnonymousClass2(AsSet asSet) {
asSet.getClass();
throw null;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractIterator
public final Object a() {
UnmodifiableIterator unmodifiableIterator = this.h;
if (!unmodifiableIterator.hasNext()) {
UnmodifiableListIterator unmodifiableListIterator = this.g;
if (!unmodifiableListIterator.hasNext()) {
this.f12232c = AbstractIterator.State.g;
return null;
}
Range range = (Range) unmodifiableListIterator.next();
int i = ContiguousSet.k;
range.getClass();
throw null;
}
return (Comparable) unmodifiableIterator.next();
}
}
@Override // com.google.common.collect.ImmutableSortedSet
/* renamed from: B */
public final UnmodifiableIterator descendingIterator() {
return new AnonymousClass2(this);
}
@Override // com.google.common.collect.ImmutableSortedSet
public final ImmutableSortedSet G(Object obj, boolean z) {
O(Range.h((Comparable) obj, BoundType.a(z)));
throw null;
}
@Override // com.google.common.collect.ImmutableSortedSet
public final ImmutableSortedSet J(Object obj, boolean z, Object obj2, boolean z2) {
Comparable comparable = (Comparable) obj;
Comparable comparable2 = (Comparable) obj2;
if (!z && !z2) {
Range range = Range.g;
if (comparable.compareTo(comparable2) == 0) {
return RegularImmutableSortedSet.l;
}
}
O(Range.g(comparable, BoundType.a(z), comparable2, BoundType.a(z2)));
throw null;
}
@Override // com.google.common.collect.ImmutableSortedSet
public final ImmutableSortedSet N(Object obj, boolean z) {
O(Range.b((Comparable) obj, BoundType.a(z)));
throw null;
}
public final ImmutableSortedSet O(Range range) {
Cut cut = range.f;
throw null;
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
public final boolean contains(Object obj) {
if (obj != null) {
try {
throw null;
} catch (ClassCastException unused) {
return false;
}
}
return false;
}
@Override // com.google.common.collect.ImmutableSortedSet, java.util.NavigableSet
public final Iterator descendingIterator() {
return new AnonymousClass2(this);
}
@Override // com.google.common.collect.ImmutableSortedSet, com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
public final Iterator iterator() {
return new AnonymousClass1(this);
}
@Override // com.google.common.collect.ImmutableCollection
public final boolean m() {
throw null;
}
@Override // com.google.common.collect.ImmutableCollection
/* renamed from: p */
public final UnmodifiableIterator iterator() {
return new AnonymousClass1(this);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public final int size() {
Integer num = this.k;
num.getClass();
return num.intValue();
}
@Override // java.util.AbstractCollection
public final String toString() {
throw null;
}
@Override // com.google.common.collect.ImmutableSortedSet
public final ImmutableSortedSet y() {
return new DescendingImmutableSortedSet(this);
}
}
/* loaded from: classes3.dex */
public static final class AsSetSerializedForm<C extends Comparable> implements Serializable {
}
/* loaded from: classes3.dex */
public static class Builder<C extends Comparable<?>> {
/* renamed from: a, reason: collision with root package name */
public final ArrayList f12303a = new ArrayList();
}
/* loaded from: classes3.dex */
public static final class ComplementRanges<C extends Comparable> extends ImmutableList<Range<C>> {
@Override // java.util.List
public final Object get(int i) {
Preconditions.g(i, 0);
throw null;
}
@Override // com.google.common.collect.ImmutableCollection
public final boolean m() {
return true;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final int size() {
return 0;
}
}
/* loaded from: classes3.dex */
public static final class SerializedForm<C extends Comparable> implements Serializable {
}
static {
UnmodifiableListIterator unmodifiableListIterator = ImmutableList.f;
f = new ImmutableRangeSet(RegularImmutableList.i);
g = new ImmutableRangeSet(ImmutableList.w(Range.g));
}
public ImmutableRangeSet(ImmutableList immutableList) {
this.f12302c = immutableList;
}
@Override // com.google.common.collect.RangeSet
public final Set a() {
ImmutableList immutableList = this.f12302c;
if (immutableList.isEmpty()) {
int i = ImmutableSet.g;
return RegularImmutableSet.n;
}
Range range = Range.g;
return new RegularImmutableSortedSet(immutableList, Range.RangeLexOrdering.f12386c);
}
/* JADX WARN: Multi-variable type inference failed */
public final Range b(Comparable comparable) {
List transformingSequentialList;
int a2;
e eVar = new e(0);
Cut.BelowValue a3 = Cut.a(comparable);
ImmutableList immutableList = this.f12302c;
if (immutableList instanceof RandomAccess) {
transformingSequentialList = new Lists.TransformingRandomAccessList(immutableList, eVar);
} else {
transformingSequentialList = new Lists.TransformingSequentialList(immutableList, eVar);
}
if (!(transformingSequentialList instanceof RandomAccess)) {
transformingSequentialList = new ArrayList(transformingSequentialList);
}
int size = transformingSequentialList.size() - 1;
int i = 0;
while (true) {
if (i <= size) {
int i2 = (i + size) >>> 1;
int compare = NaturalOrdering.g.compare(a3, transformingSequentialList.get(i2));
if (compare < 0) {
size = i2 - 1;
} else if (compare > 0) {
i = i2 + 1;
} else {
int i3 = i2 - i;
SortedLists.KeyPresentBehavior.f12394c.a(a3, transformingSequentialList.subList(i, size + 1), i3);
a2 = i + i3;
break;
}
} else {
a2 = SortedLists.KeyAbsentBehavior.f12393c.a(i);
break;
}
}
if (a2 != -1) {
Range range = (Range) immutableList.get(a2);
if (range.a(comparable)) {
return range;
}
return null;
}
return null;
}
/* JADX WARN: Multi-variable type inference failed */
public final Range c() {
ImmutableList immutableList = this.f12302c;
if (!immutableList.isEmpty()) {
return new Range(((Range) immutableList.get(0)).f12384c, ((Range) immutableList.get(immutableList.size() - 1)).f);
}
throw new NoSuchElementException();
}
}