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

169 lines
4.6 KiB
Java

package com.mycompany.app.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.View;
import com.mycompany.app.main.MainApp;
import com.mycompany.app.main.MainUtil;
/* loaded from: classes3.dex */
public class MyCircleView extends View {
/* renamed from: c, reason: collision with root package name */
public boolean f18610c;
public Context f;
public int g;
public int h;
public int i;
public float j;
public Paint k;
public RectF l;
public Paint m;
public RectF n;
public float o;
public float p;
public float q;
public MyCircleView(Context context) {
super(context);
this.f18610c = true;
this.f = context;
}
public final void a(int i, int i2, int i3, boolean z) {
int i4;
this.g = i;
this.h = i2;
if (i != 0) {
Paint paint = new Paint();
this.k = paint;
paint.setAntiAlias(true);
this.k.setStyle(Paint.Style.FILL);
this.k.setColor(this.g);
this.k.setAlpha(MainUtil.b3(this.h));
if (z) {
this.l = new RectF();
}
}
Paint paint2 = new Paint();
this.m = paint2;
paint2.setAntiAlias(true);
this.m.setStyle(Paint.Style.STROKE);
this.m.setStrokeWidth(4.0f);
Paint paint3 = this.m;
if (this.g == 0) {
i4 = -1;
} else {
i4 = -12632257;
}
paint3.setColor(i4);
if (z) {
this.n = new RectF();
this.o = MainApp.G1;
}
setSize(i3);
}
public final void b(int i, int i2) {
Paint paint = this.k;
if (paint != null) {
if (this.g != i) {
this.g = i;
this.h = i2;
paint.setColor(i);
this.k.setAlpha(MainUtil.b3(this.h));
invalidate();
return;
}
if (this.h != i2) {
this.h = i2;
paint.setAlpha(MainUtil.b3(i2));
invalidate();
}
}
}
@Override // android.view.View
public final void invalidate() {
if (!this.f18610c) {
return;
}
super.invalidate();
}
@Override // android.view.View
public final void onDraw(Canvas canvas) {
if (this.f18610c) {
Paint paint = this.k;
if (paint != null) {
RectF rectF = this.l;
if (rectF != null) {
float f = MainApp.v1;
canvas.drawRoundRect(rectF, f, f, paint);
} else {
canvas.drawCircle(this.p, this.q, this.j, paint);
}
}
Paint paint2 = this.m;
if (paint2 != null) {
RectF rectF2 = this.n;
if (rectF2 != null) {
float f2 = MainApp.v1;
canvas.drawRoundRect(rectF2, f2, f2, paint2);
} else {
canvas.drawCircle(this.p, this.q, this.j + 2.0f, paint2);
}
}
}
}
@Override // android.view.View
public final void onSizeChanged(int i, int i2, int i3, int i4) {
super.onSizeChanged(i, i2, i3, i4);
this.p = i / 2.0f;
this.q = i2 / 2.0f;
setSize(this.i);
}
public void setColor(int i) {
if (this.g == i) {
return;
}
this.g = i;
if (i != 0) {
if (this.k == null) {
Paint paint = new Paint();
this.k = paint;
paint.setAntiAlias(true);
this.k.setStyle(Paint.Style.FILL);
}
this.k.setColor(this.g);
} else {
this.k = null;
}
invalidate();
}
public void setSize(int i) {
if (i == 0) {
this.j = this.p;
return;
}
this.i = i;
if (this.p != 0.0f && this.q != 0.0f) {
float G = MainUtil.G(this.f, i) / 2.0f;
this.j = G;
RectF rectF = this.l;
if (rectF != null) {
rectF.set(this.o, this.q - G, getWidth() - this.o, this.q + this.j);
}
RectF rectF2 = this.n;
if (rectF2 != null) {
rectF2.set(this.o - 2.0f, (this.q - this.j) - 2.0f, (getWidth() - this.o) + 2.0f, this.q + this.j + 2.0f);
}
invalidate();
}
}
}