soul-browser/sources/java/androidx/dynamicanimation/animation/SpringAnimation.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

116 lines
4.3 KiB
Java

package androidx.dynamicanimation.animation;
import android.util.AndroidRuntimeException;
import androidx.dynamicanimation.animation.AnimationHandler;
import androidx.dynamicanimation.animation.DynamicAnimation;
import com.google.android.material.shape.Shapeable;
/* loaded from: classes.dex */
public final class SpringAnimation extends DynamicAnimation<SpringAnimation> {
public SpringForce r;
public float s;
public boolean t;
public SpringAnimation(Shapeable shapeable, FloatPropertyCompat floatPropertyCompat) {
super(shapeable, floatPropertyCompat);
this.r = null;
this.s = Float.MAX_VALUE;
this.t = false;
}
@Override // androidx.dynamicanimation.animation.DynamicAnimation
public final boolean d(long j) {
if (this.t) {
float f = this.s;
if (f != Float.MAX_VALUE) {
this.r.i = f;
this.s = Float.MAX_VALUE;
}
this.b = (float) this.r.i;
this.f990a = 0.0f;
this.t = false;
return true;
}
if (this.s != Float.MAX_VALUE) {
long j2 = j / 2;
DynamicAnimation.MassState c2 = this.r.c(this.b, this.f990a, j2);
SpringForce springForce = this.r;
springForce.i = this.s;
this.s = Float.MAX_VALUE;
DynamicAnimation.MassState c3 = springForce.c(c2.f992a, c2.b, j2);
this.b = c3.f992a;
this.f990a = c3.b;
} else {
DynamicAnimation.MassState c4 = this.r.c(this.b, this.f990a, j);
this.b = c4.f992a;
this.f990a = c4.b;
}
float max = Math.max(this.b, this.g);
this.b = max;
this.b = Math.min(max, Float.MAX_VALUE);
float f2 = this.f990a;
SpringForce springForce2 = this.r;
springForce2.getClass();
if (Math.abs(f2) >= springForce2.e || Math.abs(r1 - ((float) springForce2.i)) >= springForce2.d) {
return false;
}
this.b = (float) this.r.i;
this.f990a = 0.0f;
return true;
}
public final void e(float f) {
if (this.f) {
this.s = f;
return;
}
if (this.r == null) {
this.r = new SpringForce(f);
}
SpringForce springForce = this.r;
double d = f;
springForce.i = d;
double d2 = (float) d;
if (d2 <= Float.MAX_VALUE) {
float f2 = this.g;
if (d2 >= f2) {
double abs = Math.abs(this.i * 0.75f);
springForce.d = abs;
springForce.e = abs * 62.5d;
if (((AnimationHandler.FrameCallbackScheduler16) DynamicAnimation.b().e).a()) {
boolean z = this.f;
if (!z && !z) {
this.f = true;
if (!this.f991c) {
this.b = this.e.a(this.d);
}
float f3 = this.b;
if (f3 <= Float.MAX_VALUE && f3 >= f2) {
DynamicAnimation.b().a(this);
return;
}
throw new IllegalArgumentException("Starting value need to be in between min value and max value");
}
return;
}
throw new AndroidRuntimeException("Animations may only be started on the same thread as the animation handler");
}
throw new UnsupportedOperationException("Final position of the spring cannot be less than the min value.");
}
throw new UnsupportedOperationException("Final position of the spring cannot be greater than the max value.");
}
public final void f() {
if (this.r.b > 0.0d) {
if (((AnimationHandler.FrameCallbackScheduler16) DynamicAnimation.b().e).a()) {
if (this.f) {
this.t = true;
return;
}
return;
}
throw new AndroidRuntimeException("Animations may only be started on the same thread as the animation handler");
}
throw new UnsupportedOperationException("Spring animations can only come to an end when there is damping");
}
}