soul-browser/sources/java/com/google/android/gms/internal/ads/zzfsv.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

108 lines
3.9 KiB
Java

package com.google.android.gms.internal.ads;
import android.app.UiModeManager;
import android.os.Build;
import android.webkit.WebView;
import j$.util.DesugarCollections;
import java.lang.ref.WeakReference;
import java.util.Date;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONObject;
/* loaded from: classes.dex */
public class zzfsv {
/* renamed from: a, reason: collision with root package name */
public final String f7634a;
/* renamed from: c, reason: collision with root package name */
public long f7635c = System.nanoTime();
public int d = 1;
public zzftx b = new WeakReference(null);
/* JADX WARN: Type inference failed for: r3v1, types: [com.google.android.gms.internal.ads.zzftx, java.lang.ref.WeakReference] */
public zzfsv(String str) {
this.f7634a = str;
}
public void a() {
}
public void b() {
this.b.clear();
}
/* JADX WARN: Multi-variable type inference failed */
public final WebView c() {
return (WebView) this.b.get();
}
public void d(zzfrl zzfrlVar, zzfrj zzfrjVar) {
e(zzfrlVar, zzfrjVar, null);
}
public final void e(zzfrl zzfrlVar, zzfrj zzfrjVar, JSONObject jSONObject) {
String str = zzfrlVar.g;
JSONObject jSONObject2 = new JSONObject();
zzftb.b(jSONObject2, "environment", "app");
zzftb.b(jSONObject2, "adSessionType", zzfrjVar.g);
JSONObject jSONObject3 = new JSONObject();
String str2 = Build.MANUFACTURER;
String str3 = Build.MODEL;
zzftb.b(jSONObject3, "deviceType", android.support.v4.media.a.q(new StringBuilder(String.valueOf(str2).length() + 2 + String.valueOf(str3).length()), str2, "; ", str3));
zzftb.b(jSONObject3, "osVersion", Integer.toString(Build.VERSION.SDK_INT));
zzftb.b(jSONObject3, "os", "Android");
zzftb.b(jSONObject2, "deviceInfo", jSONObject3);
UiModeManager uiModeManager = zzfta.f7639a;
zzfrn zzfrnVar = zzfrn.OTHER;
if (uiModeManager != null) {
int currentModeType = uiModeManager.getCurrentModeType();
if (currentModeType != 1) {
if (currentModeType == 4) {
zzfrnVar = zzfrn.CTV;
}
} else {
zzfrnVar = zzfrn.MOBILE;
}
}
zzftb.b(jSONObject2, "deviceCategory", zzfrnVar.f7600c);
JSONArray jSONArray = new JSONArray();
jSONArray.put("clid");
jSONArray.put("vlid");
zzftb.b(jSONObject2, "supports", jSONArray);
JSONObject jSONObject4 = new JSONObject();
zzfrv zzfrvVar = zzfrjVar.f7594a;
zzftb.b(jSONObject4, "partnerName", zzfrvVar.f7608a);
zzftb.b(jSONObject4, "partnerVersion", zzfrvVar.b);
zzftb.b(jSONObject2, "omidNativeInfo", jSONObject4);
JSONObject jSONObject5 = new JSONObject();
zzftb.b(jSONObject5, "libraryVersion", "1.5.2-google_20241009");
zzftb.b(jSONObject5, "appId", zzfsk.b.f7623a.getApplicationContext().getPackageName());
zzftb.b(jSONObject2, "app", jSONObject5);
String str4 = zzfrjVar.f;
if (str4 != null) {
zzftb.b(jSONObject2, "contentUrl", str4);
}
String str5 = zzfrjVar.e;
if (str5 != null) {
zzftb.b(jSONObject2, "customReferenceData", str5);
}
JSONObject jSONObject6 = new JSONObject();
Iterator it = DesugarCollections.unmodifiableList(zzfrjVar.f7595c).iterator();
if (!it.hasNext()) {
zzfsm.f7625a.a(c(), "startSession", str, jSONObject2, jSONObject6, jSONObject);
} else {
throw null;
}
}
public final void f(Date date) {
if (date == null) {
return;
}
JSONObject jSONObject = new JSONObject();
zzftb.b(jSONObject, "timestamp", Long.valueOf(date.getTime()));
zzfsm.f7625a.a(c(), "setLastActivity", jSONObject);
}
}