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

155 lines
4.6 KiB
Java

package com.google.android.gms.cast.internal;
import android.os.Looper;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.Clock;
import com.google.android.gms.common.util.DefaultClock;
import com.google.android.gms.internal.cast.zzfk;
import java.util.Locale;
/* loaded from: classes.dex */
public final class zzav {
public static final Object j = new Object();
/* renamed from: a, reason: collision with root package name */
public final Logger f3616a;
public final long b;
/* renamed from: c, reason: collision with root package name */
public final String f3617c;
public zzat h;
public Runnable i;
public final Clock e = DefaultClock.getInstance();
public long f = -1;
public long g = 0;
public final zzfk d = new zzfk(Looper.getMainLooper());
public zzav(long j2, String str) {
this.b = j2;
this.f3617c = str;
this.f3616a = new Logger("RequestTracker", str);
}
public final void a(long j2, zzat zzatVar) {
zzat zzatVar2;
long j3;
long j4;
long currentTimeMillis = this.e.currentTimeMillis();
Object obj = j;
synchronized (obj) {
zzatVar2 = this.h;
j3 = this.f;
j4 = this.g;
this.f = j2;
this.h = zzatVar;
this.g = currentTimeMillis;
}
if (zzatVar2 != null) {
zzatVar2.a(j3, j4, currentTimeMillis, this.f3617c);
}
synchronized (obj) {
try {
Runnable runnable = this.i;
if (runnable != null) {
this.d.removeCallbacks(runnable);
}
Runnable runnable2 = new Runnable() { // from class: com.google.android.gms.cast.internal.zzau
@Override // java.lang.Runnable
public final /* synthetic */ void run() {
zzav zzavVar = zzav.this;
synchronized (zzav.j) {
try {
if (!zzavVar.b()) {
return;
}
zzavVar.e(15);
} catch (Throwable th) {
throw th;
}
}
}
};
this.i = runnable2;
this.d.postDelayed(runnable2, this.b);
} catch (Throwable th) {
throw th;
}
}
}
public final boolean b() {
boolean z;
synchronized (j) {
if (this.f != -1) {
z = true;
} else {
z = false;
}
}
return z;
}
public final boolean c(long j2) {
boolean z;
synchronized (j) {
long j3 = this.f;
z = false;
if (j3 != -1 && j3 == j2) {
z = true;
}
}
return z;
}
public final void d(long j2, int i, zzaq zzaqVar) {
synchronized (j) {
try {
if (c(j2)) {
Locale locale = Locale.ROOT;
f(zzaqVar, i, "request " + j2 + " completed");
}
} catch (Throwable th) {
throw th;
}
}
}
public final boolean e(int i) {
synchronized (j) {
try {
if (b()) {
Locale locale = Locale.ROOT;
f(null, i, "clearing request " + this.f);
return true;
}
return false;
} catch (Throwable th) {
throw th;
}
}
}
public final void f(Object obj, int i, String str) {
this.f3616a.b(str, new Object[0]);
Object obj2 = j;
synchronized (obj2) {
try {
if (this.h != null) {
((zzat) Preconditions.checkNotNull(this.h)).b(this.f3617c, this.f, i, obj, this.g, this.e.currentTimeMillis());
}
this.f = -1L;
this.h = null;
synchronized (obj2) {
Runnable runnable = this.i;
if (runnable != null) {
this.d.removeCallbacks(runnable);
this.i = null;
}
}
} catch (Throwable th) {
throw th;
} finally {
}
}
}
}