soul-browser/sources/java/com/mycompany/app/db/DbUtil.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

157 lines
5.2 KiB
Java

package com.mycompany.app.db;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
/* loaded from: classes3.dex */
public class DbUtil {
public static int a(SQLiteDatabase sQLiteDatabase, String str, String str2, String[] strArr) {
int i = 0;
try {
sQLiteDatabase.beginTransaction();
i = sQLiteDatabase.delete(str, str2, strArr);
sQLiteDatabase.setTransactionSuccessful();
} catch (Exception unused) {
}
try {
sQLiteDatabase.endTransaction();
} catch (Exception unused2) {
}
return i;
}
public static void b(SQLiteDatabase sQLiteDatabase, String str, long j) {
try {
sQLiteDatabase.beginTransaction();
sQLiteDatabase.delete(str, "_id=?", new String[]{Long.toString(j)});
sQLiteDatabase.setTransactionSuccessful();
} catch (Exception unused) {
}
try {
sQLiteDatabase.endTransaction();
} catch (Exception unused2) {
}
}
public static int c(SQLiteDatabase sQLiteDatabase, String str, long j) {
int i = 2;
if (j <= 0) {
return 2;
}
Cursor cursor = null;
try {
cursor = sQLiteDatabase.query(str, null, "_id=?", new String[]{Long.toString(j)}, null, null, null);
if (cursor != null) {
if (cursor.moveToFirst()) {
i = 1;
}
}
} catch (Exception unused) {
i = 0;
}
if (cursor != null) {
try {
cursor.close();
} catch (Exception unused2) {
}
}
return i;
}
/* JADX WARN: Removed duplicated region for block: B:9:0x001c A[EXC_TOP_SPLITTER, SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static int d(android.database.sqlite.SQLiteDatabase r8, java.lang.String r9, java.lang.String[] r10, java.lang.String r11, java.lang.String[] r12) {
/*
r5 = 0
r6 = 0
r7 = 0
r0 = r8
r1 = r9
r2 = r10
r3 = r11
r4 = r12
android.database.Cursor r8 = r0.query(r1, r2, r3, r4, r5, r6, r7) // Catch: java.lang.Exception -> L18
if (r8 == 0) goto L16
boolean r9 = r8.moveToFirst() // Catch: java.lang.Exception -> L19
if (r9 == 0) goto L16
r9 = 1
goto L1a
L16:
r9 = 2
goto L1a
L18:
r8 = 0
L19:
r9 = 0
L1a:
if (r8 == 0) goto L1f
r8.close() // Catch: java.lang.Exception -> L1f
L1f:
return r9
*/
throw new UnsupportedOperationException("Method not decompiled: com.mycompany.app.db.DbUtil.d(android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String[], java.lang.String, java.lang.String[]):int");
}
public static long e(SQLiteDatabase sQLiteDatabase, String str, ContentValues contentValues) {
long j = 0;
try {
sQLiteDatabase.beginTransaction();
j = sQLiteDatabase.insert(str, null, contentValues);
sQLiteDatabase.setTransactionSuccessful();
} catch (Exception unused) {
}
try {
sQLiteDatabase.endTransaction();
} catch (Exception unused2) {
}
return j;
}
public static Cursor f(SQLiteDatabase sQLiteDatabase, String str, String[] strArr, long j) {
try {
return sQLiteDatabase.query(str, strArr, "_id=?", new String[]{Long.toString(j)}, null, null, null);
} catch (Exception unused) {
return null;
}
}
public static Cursor g(SQLiteDatabase sQLiteDatabase, String str, String[] strArr, String str2, String[] strArr2, String str3) {
try {
return sQLiteDatabase.query(str, strArr, str2, strArr2, null, null, str3);
} catch (Exception unused) {
return null;
}
}
public static int h(SQLiteDatabase sQLiteDatabase, String str, ContentValues contentValues, String str2, String[] strArr) {
int i = 0;
try {
sQLiteDatabase.beginTransaction();
i = sQLiteDatabase.update(str, contentValues, str2, strArr);
sQLiteDatabase.setTransactionSuccessful();
} catch (Exception unused) {
}
try {
sQLiteDatabase.endTransaction();
} catch (Exception unused2) {
}
return i;
}
public static void i(SQLiteDatabase sQLiteDatabase, String str, ContentValues contentValues, long j) {
try {
sQLiteDatabase.beginTransaction();
sQLiteDatabase.update(str, contentValues, "_id=?", new String[]{Long.toString(j)});
sQLiteDatabase.setTransactionSuccessful();
} catch (Exception unused) {
}
try {
sQLiteDatabase.endTransaction();
} catch (Exception unused2) {
}
}
}