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

125 lines
4 KiB
Java

package com.google.android.gms.internal.ads;
import android.util.Log;
import j$.util.DesugarTimeZone;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.Map;
/* loaded from: classes.dex */
public final class zzash {
public static zzaqt a(zzarg zzargVar) {
long j;
long j2;
boolean z;
long j3;
long j4;
long j5;
long j6;
long j7;
long j8;
long j9;
long currentTimeMillis = System.currentTimeMillis();
Map map = zzargVar.f4365c;
if (map != null) {
String str = (String) map.get("Date");
if (str != null) {
j = b(str);
} else {
j = 0;
}
String str2 = (String) map.get("Cache-Control");
int i = 0;
if (str2 != null) {
String[] split2 = str2.split(",", 0);
z = false;
j3 = 0;
j4 = 0;
while (i < split2.length) {
String trim = split2[i].trim();
if (!trim.equals("no-cache") && !trim.equals("no-store")) {
if (trim.startsWith("max-age=")) {
try {
j4 = Long.parseLong(trim.substring(8));
} catch (Exception unused) {
}
} else if (trim.startsWith("stale-while-revalidate=")) {
j3 = Long.parseLong(trim.substring(23));
} else if (trim.equals("must-revalidate") || trim.equals("proxy-revalidate")) {
z = true;
}
i++;
} else {
return null;
}
}
j2 = 0;
i = 1;
} else {
j2 = 0;
z = false;
j3 = 0;
j4 = 0;
}
String str3 = (String) map.get("Expires");
if (str3 != null) {
j5 = b(str3);
} else {
j5 = j2;
}
String str4 = (String) map.get("Last-Modified");
if (str4 != null) {
j6 = currentTimeMillis;
j7 = b(str4);
} else {
j6 = currentTimeMillis;
j7 = j2;
}
String str5 = (String) map.get("ETag");
if (i != 0) {
long j10 = (j4 * 1000) + j6;
if (z) {
j9 = j10;
} else {
Long.signum(j3);
j9 = (j3 * 1000) + j10;
}
j8 = j10;
} else {
if (j > j2 && j5 >= j) {
j8 = (j5 - j) + j6;
} else {
j8 = j2;
}
j9 = j8;
}
zzaqt zzaqtVar = new zzaqt();
zzaqtVar.f4353a = zzargVar.b;
zzaqtVar.b = str5;
zzaqtVar.f = j8;
zzaqtVar.e = j9;
zzaqtVar.f4354c = j;
zzaqtVar.d = j7;
zzaqtVar.g = map;
zzaqtVar.h = zzargVar.d;
return zzaqtVar;
}
return null;
}
public static long b(String str) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
simpleDateFormat.setTimeZone(DesugarTimeZone.getTimeZone("GMT"));
return simpleDateFormat.parse(str).getTime();
} catch (ParseException e) {
if (!"0".equals(str) && !"-1".equals(str)) {
Log.e("Volley", zzarw.d("Unable to parse dateStr: %s, falling back to 0", str), e);
return 0L;
}
zzarw.a("Unable to parse dateStr: %s, falling back to 0", str);
return 0L;
}
}
}