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

170 lines
5.4 KiB
Java

package com.google.android.gms.internal.ads;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import java.util.ArrayDeque;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArraySet;
/* loaded from: classes.dex */
public final class zzed {
/* renamed from: a, reason: collision with root package name */
public final zzdn f6387a;
public final zzdx b;
/* renamed from: c, reason: collision with root package name */
public final zzdz f6388c;
public final CopyOnWriteArraySet d;
public final ArrayDeque e;
public final ArrayDeque f;
public final Object g;
public boolean h;
public boolean i;
public zzed(Looper looper, zzdn zzdnVar) {
this(new CopyOnWriteArraySet(), looper, zzdnVar, null, true);
}
public final void a(Object obj) {
obj.getClass();
synchronized (this.g) {
try {
if (this.h) {
return;
}
this.d.add(new zzea(obj));
} catch (Throwable th) {
throw th;
}
}
}
public final void b(Object obj) {
f();
CopyOnWriteArraySet copyOnWriteArraySet = this.d;
Iterator it = copyOnWriteArraySet.iterator();
while (it.hasNext()) {
zzea zzeaVar = (zzea) it.next();
if (zzeaVar.f6298a.equals(obj)) {
zzeaVar.d = true;
zzdz zzdzVar = this.f6388c;
if (zzdzVar != null && zzeaVar.f6299c) {
zzeaVar.f6299c = false;
zzdzVar.a(zzeaVar.f6298a, zzeaVar.b.b());
}
copyOnWriteArraySet.remove(zzeaVar);
}
}
}
public final void c(final int i, final zzdy zzdyVar) {
f();
final CopyOnWriteArraySet copyOnWriteArraySet = new CopyOnWriteArraySet(this.d);
this.f.add(new Runnable() { // from class: com.google.android.gms.internal.ads.zzeb
@Override // java.lang.Runnable
public final void run() {
Iterator it = copyOnWriteArraySet.iterator();
while (it.hasNext()) {
zzea zzeaVar = (zzea) it.next();
if (!zzeaVar.d) {
int i2 = i;
if (i2 != -1) {
zzeaVar.b.a(i2);
}
zzeaVar.f6299c = true;
zzdyVar.zza(zzeaVar.f6298a);
}
}
}
});
}
public final void d() {
f();
ArrayDeque arrayDeque = this.f;
if (!arrayDeque.isEmpty()) {
if (this.f6388c != null) {
zzdx zzdxVar = this.b;
if (!zzdxVar.zzb()) {
zzdxVar.c(zzdxVar.zzc(1));
}
}
ArrayDeque arrayDeque2 = this.e;
boolean isEmpty = arrayDeque2.isEmpty();
arrayDeque2.addAll(arrayDeque);
arrayDeque.clear();
if (isEmpty) {
while (!arrayDeque2.isEmpty()) {
((Runnable) arrayDeque2.peekFirst()).run();
arrayDeque2.removeFirst();
}
}
}
}
public final void e() {
f();
synchronized (this.g) {
this.h = true;
}
CopyOnWriteArraySet copyOnWriteArraySet = this.d;
Iterator it = copyOnWriteArraySet.iterator();
while (it.hasNext()) {
zzea zzeaVar = (zzea) it.next();
zzdz zzdzVar = this.f6388c;
zzeaVar.d = true;
if (zzdzVar != null && zzeaVar.f6299c) {
zzeaVar.f6299c = false;
zzdzVar.a(zzeaVar.f6298a, zzeaVar.b.b());
}
}
copyOnWriteArraySet.clear();
}
public final void f() {
boolean z;
if (!this.i) {
return;
}
if (Thread.currentThread() == this.b.zza().getThread()) {
z = true;
} else {
z = false;
}
zzgqa.f(z);
}
public zzed(CopyOnWriteArraySet copyOnWriteArraySet, Looper looper, zzdn zzdnVar, zzdz zzdzVar, boolean z) {
this.f6387a = zzdnVar;
this.d = copyOnWriteArraySet;
this.f6388c = zzdzVar;
this.g = new Object();
this.e = new ArrayDeque();
this.f = new ArrayDeque();
this.b = zzdnVar.a(looper, new Handler.Callback() { // from class: com.google.android.gms.internal.ads.zzec
@Override // android.os.Handler.Callback
public final boolean handleMessage(Message message) {
zzed zzedVar = zzed.this;
zzdz zzdzVar2 = zzedVar.f6388c;
zzdzVar2.getClass();
Iterator it = zzedVar.d.iterator();
while (it.hasNext()) {
zzea zzeaVar = (zzea) it.next();
if (!zzeaVar.d && zzeaVar.f6299c) {
zzs b = zzeaVar.b.b();
zzeaVar.b = new zzr();
zzeaVar.f6299c = false;
zzdzVar2.a(zzeaVar.f6298a, b);
}
if (zzedVar.b.zzb()) {
return true;
}
}
return true;
}
});
this.i = z;
}
}