soul-browser/sources/java/com/mycompany/app/crop/Handle.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

180 lines
7.1 KiB
Java

package com.mycompany.app.crop;
import android.graphics.RectF;
/* JADX WARN: Enum visitor error
jadx.core.utils.exceptions.JadxRuntimeException: Init of enum field 'f' uses external variables
at jadx.core.dex.visitors.EnumVisitor.createEnumFieldByConstructor(EnumVisitor.java:451)
at jadx.core.dex.visitors.EnumVisitor.processEnumFieldByRegister(EnumVisitor.java:395)
at jadx.core.dex.visitors.EnumVisitor.extractEnumFieldsFromFilledArray(EnumVisitor.java:324)
at jadx.core.dex.visitors.EnumVisitor.extractEnumFieldsFromInsn(EnumVisitor.java:262)
at jadx.core.dex.visitors.EnumVisitor.convertToEnum(EnumVisitor.java:151)
at jadx.core.dex.visitors.EnumVisitor.visit(EnumVisitor.java:100)
*/
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
/* loaded from: classes3.dex */
public final class Handle {
public static final Handle f;
public static final Handle g;
public static final Handle h;
public static final Handle i;
public static final Handle j;
public static final Handle k;
public static final Handle l;
public static final Handle m;
public static final Handle n;
public static final /* synthetic */ Handle[] o;
/* renamed from: c, reason: collision with root package name */
public final HandleHelper f12880c;
static {
final Edge edge = Edge.g;
final Edge edge2 = Edge.f;
Handle handle = new Handle("TOP_START", 0, new HandleHelper(edge, edge2));
f = handle;
final Edge edge3 = Edge.h;
Handle handle2 = new Handle("TOP_END", 1, new HandleHelper(edge, edge3));
g = handle2;
final Edge edge4 = Edge.i;
Handle handle3 = new Handle("BOTTOM_START", 2, new HandleHelper(edge4, edge2));
h = handle3;
Handle handle4 = new Handle("BOTTOM_END", 3, new HandleHelper(edge4, edge3));
i = handle4;
Handle handle5 = new Handle("START", 4, new HandleHelper(edge2) { // from class: com.mycompany.app.crop.VerticalHandleHelper
public final Edge d;
{
super(null, edge2);
this.d = edge2;
}
@Override // com.mycompany.app.crop.HandleHelper
public final void a(float f2, float f3, float f4, float f5, RectF rectF) {
Edge edge5 = this.d;
edge5.b(f2, f3, f5, f4, rectF);
Edge edge6 = Edge.g;
float f6 = edge6.f12878c;
Edge edge7 = Edge.i;
float f7 = edge7.f12878c;
float f8 = (((Edge.h.f12878c - Edge.f.f12878c) / f4) - (f7 - f6)) / 2.0f;
edge6.f12878c = f6 - f8;
edge7.f12878c = f7 + f8;
if (edge6.e(rectF, f5) && !edge5.c(edge6, rectF, f4)) {
edge7.f(-edge6.g(rectF));
edge5.a(f4);
}
if (edge7.e(rectF, f5) && !edge5.c(edge7, rectF, f4)) {
edge6.f(-edge7.g(rectF));
edge5.a(f4);
}
}
});
j = handle5;
Handle handle6 = new Handle("TOP", 5, new HandleHelper(edge) { // from class: com.mycompany.app.crop.HorizontalHandleHelper
public final Edge d;
{
super(edge, null);
this.d = edge;
}
@Override // com.mycompany.app.crop.HandleHelper
public final void a(float f2, float f3, float f4, float f5, RectF rectF) {
Edge edge5 = this.d;
edge5.b(f2, f3, f5, f4, rectF);
Edge edge6 = Edge.f;
float f6 = edge6.f12878c;
Edge edge7 = Edge.h;
float f7 = edge7.f12878c;
float f8 = (((Edge.i.f12878c - Edge.g.f12878c) * f4) - (f7 - f6)) / 2.0f;
edge6.f12878c = f6 - f8;
edge7.f12878c = f7 + f8;
if (edge6.e(rectF, f5) && !edge5.c(edge6, rectF, f4)) {
edge7.f(-edge6.g(rectF));
edge5.a(f4);
}
if (edge7.e(rectF, f5) && !edge5.c(edge7, rectF, f4)) {
edge6.f(-edge7.g(rectF));
edge5.a(f4);
}
}
});
k = handle6;
Handle handle7 = new Handle("END", 6, new HandleHelper(edge3) { // from class: com.mycompany.app.crop.VerticalHandleHelper
public final Edge d;
{
super(null, edge3);
this.d = edge3;
}
@Override // com.mycompany.app.crop.HandleHelper
public final void a(float f2, float f3, float f4, float f5, RectF rectF) {
Edge edge5 = this.d;
edge5.b(f2, f3, f5, f4, rectF);
Edge edge6 = Edge.g;
float f6 = edge6.f12878c;
Edge edge7 = Edge.i;
float f7 = edge7.f12878c;
float f8 = (((Edge.h.f12878c - Edge.f.f12878c) / f4) - (f7 - f6)) / 2.0f;
edge6.f12878c = f6 - f8;
edge7.f12878c = f7 + f8;
if (edge6.e(rectF, f5) && !edge5.c(edge6, rectF, f4)) {
edge7.f(-edge6.g(rectF));
edge5.a(f4);
}
if (edge7.e(rectF, f5) && !edge5.c(edge7, rectF, f4)) {
edge6.f(-edge7.g(rectF));
edge5.a(f4);
}
}
});
l = handle7;
Handle handle8 = new Handle("BOTTOM", 7, new HandleHelper(edge4) { // from class: com.mycompany.app.crop.HorizontalHandleHelper
public final Edge d;
{
super(edge4, null);
this.d = edge4;
}
@Override // com.mycompany.app.crop.HandleHelper
public final void a(float f2, float f3, float f4, float f5, RectF rectF) {
Edge edge5 = this.d;
edge5.b(f2, f3, f5, f4, rectF);
Edge edge6 = Edge.f;
float f6 = edge6.f12878c;
Edge edge7 = Edge.h;
float f7 = edge7.f12878c;
float f8 = (((Edge.i.f12878c - Edge.g.f12878c) * f4) - (f7 - f6)) / 2.0f;
edge6.f12878c = f6 - f8;
edge7.f12878c = f7 + f8;
if (edge6.e(rectF, f5) && !edge5.c(edge6, rectF, f4)) {
edge7.f(-edge6.g(rectF));
edge5.a(f4);
}
if (edge7.e(rectF, f5) && !edge5.c(edge7, rectF, f4)) {
edge6.f(-edge7.g(rectF));
edge5.a(f4);
}
}
});
m = handle8;
Handle handle9 = new Handle("CENTER", 8, new HandleHelper(null, null));
n = handle9;
o = new Handle[]{handle, handle2, handle3, handle4, handle5, handle6, handle7, handle8, handle9};
}
public Handle(String str, int i2, HandleHelper handleHelper) {
this.f12880c = handleHelper;
}
public static Handle valueOf(String str) {
return (Handle) Enum.valueOf(Handle.class, str);
}
public static Handle[] values() {
return (Handle[]) o.clone();
}
}