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

131 lines
8.5 KiB
Java

package com.google.android.gms.internal.ads;
import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.spec.ECField;
import java.security.spec.ECFieldFp;
import java.security.spec.ECParameterSpec;
import java.security.spec.ECPoint;
import java.security.spec.EllipticCurve;
/* loaded from: classes.dex */
public final class zzhhq {
/* renamed from: a, reason: collision with root package name */
public static final ECParameterSpec f8558a = g("115792089210356248762697446949407573530086143415290314195533631308867097853951", "115792089210356248762697446949407573529996955224135760342422259061068512044369", "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5");
public static final ECParameterSpec b = g("39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319", "39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643", "b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", "aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f");
/* renamed from: c, reason: collision with root package name */
public static final ECParameterSpec f8559c = g("6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151", "6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449", "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", "c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650");
public static final BigInteger d = BigInteger.valueOf(2);
public static final BigInteger e = BigInteger.valueOf(3);
public static final BigInteger f = BigInteger.valueOf(4);
public static final BigInteger g = BigInteger.valueOf(8);
public static void a(ECPoint eCPoint, EllipticCurve ellipticCurve) {
BigInteger c2 = c(ellipticCurve);
BigInteger affineX = eCPoint.getAffineX();
BigInteger affineY = eCPoint.getAffineY();
if (affineX != null && affineY != null) {
if (affineX.signum() != -1 && affineX.compareTo(c2) < 0) {
if (affineY.signum() != -1 && affineY.compareTo(c2) < 0) {
if (affineY.multiply(affineY).mod(c2).equals(affineX.multiply(affineX).add(ellipticCurve.getA()).multiply(affineX).add(ellipticCurve.getB()).mod(c2))) {
return;
} else {
throw new GeneralSecurityException("Point is not on curve");
}
}
throw new GeneralSecurityException("y is out of range");
}
throw new GeneralSecurityException("x is out of range");
}
throw new GeneralSecurityException("point is at infinity");
}
public static boolean b(ECParameterSpec eCParameterSpec, ECParameterSpec eCParameterSpec2) {
if (eCParameterSpec.getCurve().equals(eCParameterSpec2.getCurve()) && eCParameterSpec.getGenerator().equals(eCParameterSpec2.getGenerator()) && eCParameterSpec.getOrder().equals(eCParameterSpec2.getOrder()) && eCParameterSpec.getCofactor() == eCParameterSpec2.getCofactor()) {
return true;
}
return false;
}
public static BigInteger c(EllipticCurve ellipticCurve) {
ECField field = ellipticCurve.getField();
if (field instanceof ECFieldFp) {
return ((ECFieldFp) field).getP();
}
throw new GeneralSecurityException("Only curves over prime order fields are supported");
}
public static zzhhp d(ECPoint eCPoint, BigInteger bigInteger) {
if (eCPoint.equals(ECPoint.POINT_INFINITY)) {
return zzhhp.d;
}
BigInteger mod = new BigInteger(1, zzhkc.a((bigInteger.bitLength() + 8) / 8)).mod(bigInteger);
BigInteger mod2 = mod.multiply(mod).mod(bigInteger);
return new zzhhp(eCPoint.getAffineX().multiply(mod2).mod(bigInteger), eCPoint.getAffineY().multiply(mod2.multiply(mod).mod(bigInteger)).mod(bigInteger), mod);
}
public static zzhhp e(zzhhp zzhhpVar, BigInteger bigInteger, BigInteger bigInteger2) {
BigInteger bigInteger3 = zzhhpVar.b;
if (bigInteger3.equals(BigInteger.ZERO)) {
return zzhhp.d;
}
BigInteger bigInteger4 = zzhhpVar.f8556a;
BigInteger mod = bigInteger4.multiply(bigInteger4).mod(bigInteger2);
BigInteger mod2 = bigInteger3.multiply(bigInteger3).mod(bigInteger2);
BigInteger mod3 = mod2.multiply(mod2).mod(bigInteger2);
BigInteger bigInteger5 = zzhhpVar.f8557c;
BigInteger mod4 = bigInteger5.multiply(bigInteger5).mod(bigInteger2);
BigInteger add = bigInteger4.add(mod2);
BigInteger subtract = add.multiply(add).mod(bigInteger2).subtract(mod).subtract(mod3);
BigInteger bigInteger6 = d;
BigInteger multiply = subtract.multiply(bigInteger6);
BigInteger add2 = mod.multiply(e).add(bigInteger.multiply(mod4).multiply(mod4).mod(bigInteger2));
BigInteger mod5 = add2.multiply(add2).mod(bigInteger2).subtract(multiply.multiply(bigInteger6)).mod(bigInteger2);
BigInteger mod6 = add2.multiply(multiply.subtract(mod5)).mod(bigInteger2).subtract(mod3.multiply(g)).mod(bigInteger2);
BigInteger add3 = bigInteger3.add(bigInteger5);
return new zzhhp(mod5, mod6, add3.multiply(add3).mod(bigInteger2).subtract(mod2).subtract(mod4).mod(bigInteger2));
}
public static zzhhp f(zzhhp zzhhpVar, zzhhp zzhhpVar2, BigInteger bigInteger, BigInteger bigInteger2) {
BigInteger bigInteger3 = zzhhpVar.f8557c;
BigInteger bigInteger4 = BigInteger.ZERO;
if (bigInteger3.equals(bigInteger4)) {
return zzhhpVar2;
}
if (zzhhpVar2.f8557c.equals(bigInteger4)) {
return zzhhpVar;
}
BigInteger bigInteger5 = zzhhpVar.f8557c;
BigInteger mod = bigInteger5.multiply(bigInteger5).mod(bigInteger2);
BigInteger bigInteger6 = zzhhpVar2.f8557c;
BigInteger mod2 = bigInteger6.multiply(bigInteger6).mod(bigInteger2);
BigInteger mod3 = zzhhpVar.f8556a.multiply(mod2).mod(bigInteger2);
BigInteger mod4 = zzhhpVar2.f8556a.multiply(mod).mod(bigInteger2);
BigInteger mod5 = zzhhpVar.b.multiply(bigInteger6).mod(bigInteger2).multiply(mod2).mod(bigInteger2);
BigInteger mod6 = zzhhpVar2.b.multiply(bigInteger5).mod(bigInteger2).multiply(mod).mod(bigInteger2);
if (mod3.equals(mod4)) {
if (!mod5.equals(mod6)) {
return zzhhp.d;
}
return e(zzhhpVar, bigInteger, bigInteger2);
}
BigInteger mod7 = mod4.subtract(mod3).mod(bigInteger2);
BigInteger mod8 = mod7.multiply(f).multiply(mod7).mod(bigInteger2);
BigInteger mod9 = mod7.multiply(mod8).mod(bigInteger2);
BigInteger subtract = mod6.subtract(mod5);
BigInteger bigInteger7 = d;
BigInteger mod10 = subtract.multiply(bigInteger7).mod(bigInteger2);
BigInteger mod11 = mod3.multiply(mod8).mod(bigInteger2);
BigInteger mod12 = mod10.multiply(mod10).mod(bigInteger2).subtract(mod9).subtract(mod11.multiply(bigInteger7)).mod(bigInteger2);
BigInteger mod13 = mod10.multiply(mod11.subtract(mod12)).subtract(mod5.multiply(bigInteger7).multiply(mod9)).mod(bigInteger2);
BigInteger add = bigInteger5.add(bigInteger6);
return new zzhhp(mod12, mod13, add.multiply(add).mod(bigInteger2).subtract(mod).subtract(mod2).multiply(mod7).mod(bigInteger2));
}
public static ECParameterSpec g(String str, String str2, String str3, String str4, String str5) {
BigInteger bigInteger = new BigInteger(str);
return new ECParameterSpec(new EllipticCurve(new ECFieldFp(bigInteger), bigInteger.subtract(new BigInteger("3")), new BigInteger(str3, 16)), new ECPoint(new BigInteger(str4, 16), new BigInteger(str5, 16)), new BigInteger(str2), 1);
}
}