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

72 lines
3.7 KiB
Java

package com.google.android.gms.internal.ads;
import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.spec.ECParameterSpec;
import java.security.spec.ECPoint;
import java.security.spec.EllipticCurve;
/* loaded from: classes.dex */
public final class zzhrf {
/* renamed from: a, reason: collision with root package name */
public zzhri f8694a = null;
public zzhxd b = null;
public final zzhrg a() {
ECPoint eCPoint;
zzhri zzhriVar = this.f8694a;
if (zzhriVar != null) {
zzhxd zzhxdVar = this.b;
if (zzhxdVar != null) {
BigInteger bigInteger = zzhxdVar.f8864a;
ECPoint eCPoint2 = zzhriVar.b;
zzhra zzhraVar = zzhriVar.f8698a.b;
BigInteger order = zzhraVar.b.getOrder();
if (bigInteger.signum() > 0 && bigInteger.compareTo(order) < 0) {
ECParameterSpec eCParameterSpec = zzhraVar.b;
if (!zzhhq.b(eCParameterSpec, zzhhq.f8558a) && !zzhhq.b(eCParameterSpec, zzhhq.b) && !zzhhq.b(eCParameterSpec, zzhhq.f8559c)) {
throw new GeneralSecurityException("spec must be NIST P256, P384 or P521");
}
if (bigInteger.signum() == 1) {
if (bigInteger.compareTo(eCParameterSpec.getOrder()) < 0) {
EllipticCurve curve = eCParameterSpec.getCurve();
ECPoint generator = eCParameterSpec.getGenerator();
zzhhq.a(generator, curve);
BigInteger a2 = eCParameterSpec.getCurve().getA();
BigInteger c2 = zzhhq.c(curve);
zzhhp d = zzhhq.d(ECPoint.POINT_INFINITY, c2);
zzhhp d2 = zzhhq.d(generator, c2);
for (int bitLength = bigInteger.bitLength(); bitLength >= 0; bitLength--) {
if (bigInteger.testBit(bitLength)) {
d = zzhhq.f(d, d2, a2, c2);
d2 = zzhhq.e(d2, a2, c2);
} else {
d2 = zzhhq.f(d, d2, a2, c2);
d = zzhhq.e(d, a2, c2);
}
}
if (d.f8557c.equals(BigInteger.ZERO)) {
eCPoint = ECPoint.POINT_INFINITY;
} else {
BigInteger modInverse = d.f8557c.modInverse(c2);
BigInteger mod = modInverse.multiply(modInverse).mod(c2);
eCPoint = new ECPoint(d.f8556a.multiply(mod).mod(c2), d.b.multiply(mod).mod(c2).multiply(modInverse).mod(c2));
}
zzhhq.a(eCPoint, curve);
if (eCPoint.equals(eCPoint2)) {
return new zzhrg(this.f8694a, this.b);
}
throw new GeneralSecurityException("Invalid private value");
}
throw new GeneralSecurityException("k must be smaller than the order of the generator");
}
throw new GeneralSecurityException("k must be positive");
}
throw new GeneralSecurityException("Invalid private value");
}
throw new GeneralSecurityException("Cannot build without a private value");
}
throw new GeneralSecurityException("Cannot build without a ecdsa public key");
}
}