soul-browser/sources/java/androidx/room/RoomSQLiteQuery.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

173 lines
5.2 KiB
Java

package androidx.room;
import androidx.annotation.RestrictTo;
import androidx.sqlite.db.SupportSQLiteProgram;
import androidx.sqlite.db.SupportSQLiteQuery;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
@RestrictTo
/* loaded from: classes.dex */
public class RoomSQLiteQuery implements SupportSQLiteQuery, SupportSQLiteProgram {
public static final TreeMap m = new TreeMap();
/* renamed from: c, reason: collision with root package name */
public volatile String f1631c;
public final long[] f;
public final double[] g;
public final String[] h;
public final byte[][] i;
public final int[] j;
public final int k;
public int l;
/* renamed from: androidx.room.RoomSQLiteQuery$1, reason: invalid class name */
/* loaded from: classes.dex */
final class AnonymousClass1 implements SupportSQLiteProgram {
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void I(int i, long j) {
throw null;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void R(byte[] bArr, int i) {
throw null;
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final void close() {
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void d0(double d, int i) {
throw null;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void g0(int i) {
throw null;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void t(int i, String str) {
throw null;
}
}
public RoomSQLiteQuery(int i) {
this.k = i;
int i2 = i + 1;
this.j = new int[i2];
this.f = new long[i2];
this.g = new double[i2];
this.h = new String[i2];
this.i = new byte[i2];
}
public static RoomSQLiteQuery d(int i, String str) {
TreeMap treeMap = m;
synchronized (treeMap) {
try {
Map.Entry ceilingEntry = treeMap.ceilingEntry(Integer.valueOf(i));
if (ceilingEntry != null) {
treeMap.remove(ceilingEntry.getKey());
RoomSQLiteQuery roomSQLiteQuery = (RoomSQLiteQuery) ceilingEntry.getValue();
roomSQLiteQuery.f1631c = str;
roomSQLiteQuery.l = i;
return roomSQLiteQuery;
}
RoomSQLiteQuery roomSQLiteQuery2 = new RoomSQLiteQuery(i);
roomSQLiteQuery2.f1631c = str;
roomSQLiteQuery2.l = i;
return roomSQLiteQuery2;
} catch (Throwable th) {
throw th;
}
}
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void I(int i, long j) {
this.j[i] = 2;
this.f[i] = j;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void R(byte[] bArr, int i) {
this.j[i] = 5;
this.i[i] = bArr;
}
@Override // androidx.sqlite.db.SupportSQLiteQuery
public final String a() {
return this.f1631c;
}
@Override // androidx.sqlite.db.SupportSQLiteQuery
public final void b(SupportSQLiteProgram supportSQLiteProgram) {
for (int i = 1; i <= this.l; i++) {
int i2 = this.j[i];
if (i2 != 1) {
if (i2 != 2) {
if (i2 != 3) {
if (i2 != 4) {
if (i2 == 5) {
supportSQLiteProgram.R(this.i[i], i);
}
} else {
supportSQLiteProgram.t(i, this.h[i]);
}
} else {
supportSQLiteProgram.d0(this.g[i], i);
}
} else {
supportSQLiteProgram.I(i, this.f[i]);
}
} else {
supportSQLiteProgram.g0(i);
}
}
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final void close() {
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void d0(double d, int i) {
this.j[i] = 3;
this.g[i] = d;
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void g0(int i) {
this.j[i] = 1;
}
public final void release() {
TreeMap treeMap = m;
synchronized (treeMap) {
treeMap.put(Integer.valueOf(this.k), this);
if (treeMap.size() > 15) {
int size = treeMap.size() - 10;
Iterator it = treeMap.descendingKeySet().iterator();
while (true) {
int i = size - 1;
if (size <= 0) {
break;
}
it.next();
it.remove();
size = i;
}
}
}
}
@Override // androidx.sqlite.db.SupportSQLiteProgram
public final void t(int i, String str) {
this.j[i] = 4;
this.h[i] = str;
}
}