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

106 lines
4.3 KiB
Java

package com.google.android.gms.ads;
/* loaded from: classes.dex */
public class MediationUtils {
/* JADX WARN: Removed duplicated region for block: B:32:0x00a7 */
/* JADX WARN: Removed duplicated region for block: B:39:0x00bb A[SYNTHETIC] */
@androidx.annotation.Nullable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static com.google.android.gms.ads.AdSize findClosestSize(@androidx.annotation.NonNull android.content.Context r9, @androidx.annotation.NonNull com.google.android.gms.ads.AdSize r10, @androidx.annotation.NonNull java.util.List<com.google.android.gms.ads.AdSize> r11) {
/*
r0 = 0
if (r11 == 0) goto Lbe
if (r10 != 0) goto L7
goto Lbe
L7:
boolean r1 = r10.e
if (r1 != 0) goto L32
boolean r1 = r10.g
if (r1 != 0) goto L32
android.content.res.Resources r1 = r9.getResources()
android.util.DisplayMetrics r1 = r1.getDisplayMetrics()
float r1 = r1.density
int r2 = r10.getWidthInPixels(r9)
float r2 = (float) r2
float r2 = r2 / r1
int r2 = java.lang.Math.round(r2)
int r9 = r10.getHeightInPixels(r9)
float r9 = (float) r9
float r9 = r9 / r1
int r9 = java.lang.Math.round(r9)
com.google.android.gms.ads.AdSize r10 = new com.google.android.gms.ads.AdSize
r10.<init>(r2, r9)
L32:
java.util.Iterator r9 = r11.iterator()
L36:
boolean r11 = r9.hasNext()
if (r11 == 0) goto Lbe
java.lang.Object r11 = r9.next()
com.google.android.gms.ads.AdSize r11 = (com.google.android.gms.ads.AdSize) r11
if (r11 == 0) goto L36
int r1 = r10.getWidth()
int r2 = r11.getWidth()
int r3 = r10.getHeight()
double r4 = (double) r1
r6 = 4602678819172646912(0x3fe0000000000000, double:0.5)
double r4 = r4 * r6
double r6 = (double) r2
int r8 = r11.getHeight()
int r4 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1))
if (r4 > 0) goto L36
if (r1 < r2) goto L36
boolean r1 = r10.g
if (r1 == 0) goto L8c
int r1 = r10.h
com.google.android.gms.internal.ads.zzbgb r3 = com.google.android.gms.internal.ads.zzbgk.a9
com.google.android.gms.internal.ads.zzbgi r4 = com.google.android.gms.ads.internal.client.zzbd.zzc()
java.lang.Object r3 = r4.a(r3)
java.lang.Integer r3 = (java.lang.Integer) r3
int r3 = r3.intValue()
if (r3 > r2) goto L36
com.google.android.gms.internal.ads.zzbgb r2 = com.google.android.gms.internal.ads.zzbgk.b9
com.google.android.gms.internal.ads.zzbgi r3 = com.google.android.gms.ads.internal.client.zzbd.zzc()
java.lang.Object r2 = r3.a(r2)
java.lang.Integer r2 = (java.lang.Integer) r2
int r2 = r2.intValue()
if (r2 > r8) goto L36
if (r1 < r8) goto L36
goto La4
L8c:
boolean r1 = r10.e
if (r1 == 0) goto L95
int r1 = r10.f
if (r1 < r8) goto L36
goto La4
L95:
double r1 = (double) r3
r4 = 4604480259023595110(0x3fe6666666666666, double:0.7)
double r1 = r1 * r4
double r4 = (double) r8
int r1 = (r1 > r4 ? 1 : (r1 == r4 ? 0 : -1))
if (r1 > 0) goto L36
if (r3 >= r8) goto La4
goto L36
La4:
if (r0 != 0) goto La7
goto Lbb
La7:
int r1 = r0.getWidth()
int r2 = r0.getHeight()
int r2 = r2 * r1
int r1 = r11.getWidth()
int r3 = r11.getHeight()
int r3 = r3 * r1
if (r2 > r3) goto L36
Lbb:
r0 = r11
goto L36
Lbe:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.ads.MediationUtils.findClosestSize(android.content.Context, com.google.android.gms.ads.AdSize, java.util.List):com.google.android.gms.ads.AdSize");
}
}