soul-browser/sources/java/androidx/appcompat/widget/AppCompatButton.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

408 lines
15 KiB
Java

package androidx.appcompat.widget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.text.InputFilter;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.inspector.PropertyMapper;
import android.view.inspector.PropertyReader;
import android.widget.Button;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.appcompat.R;
import androidx.core.view.TintableBackgroundView;
import androidx.core.widget.AutoSizeableTextView;
import androidx.core.widget.TextViewCompat;
import androidx.core.widget.TintableCompoundDrawablesView;
import java.util.function.IntFunction;
/* loaded from: classes.dex */
public class AppCompatButton extends Button implements TintableBackgroundView, AutoSizeableTextView, TintableCompoundDrawablesView, EmojiCompatConfigurationView {
/* renamed from: c, reason: collision with root package name */
public final AppCompatBackgroundHelper f222c;
public final AppCompatTextHelper f;
public AppCompatEmojiTextHelper g;
@RequiresApi
@RestrictTo
/* loaded from: classes.dex */
public final class InspectionCompanion implements android.view.inspector.InspectionCompanion {
/* renamed from: a, reason: collision with root package name */
public int f223a;
public int b;
/* renamed from: c, reason: collision with root package name */
public int f224c;
public int d;
public int e;
public int f;
public int g;
public int h;
/* renamed from: androidx.appcompat.widget.AppCompatButton$InspectionCompanion$1, reason: invalid class name */
/* loaded from: classes.dex */
class AnonymousClass1 implements IntFunction<String> {
@Override // java.util.function.IntFunction
public final String apply(int i) {
if (i != 0) {
if (i != 1) {
return String.valueOf(i);
}
return "uniform";
}
return "none";
}
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r1v3, types: [java.lang.Object, java.util.function.IntFunction] */
public final void mapProperties(PropertyMapper propertyMapper) {
this.f223a = propertyMapper.mapInt("autoSizeMaxTextSize", R.attr.autoSizeMaxTextSize);
this.b = propertyMapper.mapInt("autoSizeMinTextSize", R.attr.autoSizeMinTextSize);
this.f224c = propertyMapper.mapInt("autoSizeStepGranularity", R.attr.autoSizeStepGranularity);
this.d = propertyMapper.mapIntEnum("autoSizeTextType", R.attr.autoSizeTextType, new Object());
this.e = propertyMapper.mapObject("backgroundTint", R.attr.backgroundTint);
this.f = propertyMapper.mapObject("backgroundTintMode", R.attr.backgroundTintMode);
this.g = propertyMapper.mapObject("drawableTint", R.attr.drawableTint);
this.h = propertyMapper.mapObject("drawableTintMode", R.attr.drawableTintMode);
}
public final void readProperties(Object obj, PropertyReader propertyReader) {
AppCompatButton appCompatButton = (AppCompatButton) obj;
propertyReader.readInt(this.f223a, appCompatButton.getAutoSizeMaxTextSize());
propertyReader.readInt(this.b, appCompatButton.getAutoSizeMinTextSize());
propertyReader.readInt(this.f224c, appCompatButton.getAutoSizeStepGranularity());
propertyReader.readIntEnum(this.d, appCompatButton.getAutoSizeTextType());
propertyReader.readObject(this.e, appCompatButton.getBackgroundTintList());
propertyReader.readObject(this.f, appCompatButton.getBackgroundTintMode());
propertyReader.readObject(this.g, appCompatButton.getCompoundDrawableTintList());
propertyReader.readObject(this.h, appCompatButton.getCompoundDrawableTintMode());
}
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public AppCompatButton(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
TintContextWrapper.a(context);
ThemeUtils.a(getContext(), this);
AppCompatBackgroundHelper appCompatBackgroundHelper = new AppCompatBackgroundHelper(this);
this.f222c = appCompatBackgroundHelper;
appCompatBackgroundHelper.d(attributeSet, i);
AppCompatTextHelper appCompatTextHelper = new AppCompatTextHelper(this);
this.f = appCompatTextHelper;
appCompatTextHelper.f(attributeSet, i);
appCompatTextHelper.b();
getEmojiTextViewHelper().a(attributeSet, i);
}
@NonNull
private AppCompatEmojiTextHelper getEmojiTextViewHelper() {
if (this.g == null) {
this.g = new AppCompatEmojiTextHelper(this);
}
return this.g;
}
@Override // android.widget.TextView, android.view.View
public final void drawableStateChanged() {
super.drawableStateChanged();
AppCompatBackgroundHelper appCompatBackgroundHelper = this.f222c;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.a();
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
appCompatTextHelper.b();
}
}
@Override // android.widget.TextView
@RestrictTo
public int getAutoSizeMaxTextSize() {
if (ViewUtils.f352c) {
return super.getAutoSizeMaxTextSize();
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
return Math.round(appCompatTextHelper.i.e);
}
return -1;
}
@Override // android.widget.TextView
@RestrictTo
public int getAutoSizeMinTextSize() {
if (ViewUtils.f352c) {
return super.getAutoSizeMinTextSize();
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
return Math.round(appCompatTextHelper.i.d);
}
return -1;
}
@Override // android.widget.TextView
@RestrictTo
public int getAutoSizeStepGranularity() {
if (ViewUtils.f352c) {
return super.getAutoSizeStepGranularity();
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
return Math.round(appCompatTextHelper.i.f284c);
}
return -1;
}
@Override // android.widget.TextView
@RestrictTo
public int[] getAutoSizeTextAvailableSizes() {
if (ViewUtils.f352c) {
return super.getAutoSizeTextAvailableSizes();
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
return appCompatTextHelper.i.f;
}
return new int[0];
}
@Override // android.widget.TextView
@SuppressLint({"WrongConstant"})
@RestrictTo
public int getAutoSizeTextType() {
if (ViewUtils.f352c) {
if (super.getAutoSizeTextType() != 1) {
return 0;
}
return 1;
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper == null) {
return 0;
}
return appCompatTextHelper.i.f283a;
}
@Override // android.widget.TextView
@Nullable
public ActionMode.Callback getCustomSelectionActionModeCallback() {
return TextViewCompat.g(super.getCustomSelectionActionModeCallback());
}
@Nullable
@RestrictTo
public ColorStateList getSupportBackgroundTintList() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.f222c;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.b();
}
return null;
}
@Nullable
@RestrictTo
public PorterDuff.Mode getSupportBackgroundTintMode() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.f222c;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.c();
}
return null;
}
@Nullable
@RestrictTo
public ColorStateList getSupportCompoundDrawablesTintList() {
return this.f.d();
}
@Nullable
@RestrictTo
public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
return this.f.e();
}
@Override // android.view.View
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
super.onInitializeAccessibilityEvent(accessibilityEvent);
accessibilityEvent.setClassName(Button.class.getName());
}
@Override // android.view.View
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
accessibilityNodeInfo.setClassName(Button.class.getName());
}
@Override // android.widget.TextView, android.view.View
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null && !ViewUtils.f352c) {
appCompatTextHelper.i.a();
}
}
@Override // android.widget.TextView
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
super.onTextChanged(charSequence, i, i2, i3);
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
AppCompatTextViewAutoSizeHelper appCompatTextViewAutoSizeHelper = appCompatTextHelper.i;
if (!ViewUtils.f352c && appCompatTextViewAutoSizeHelper.f()) {
appCompatTextViewAutoSizeHelper.a();
}
}
}
@Override // android.widget.TextView
public void setAllCaps(boolean z) {
super.setAllCaps(z);
getEmojiTextViewHelper().b(z);
}
@Override // android.widget.TextView
public final void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) {
if (ViewUtils.f352c) {
super.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
return;
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
appCompatTextHelper.h(i, i2, i3, i4);
}
}
@Override // android.widget.TextView
public final void setAutoSizeTextTypeUniformWithPresetSizes(int[] iArr, int i) {
if (ViewUtils.f352c) {
super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
return;
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
appCompatTextHelper.i(iArr, i);
}
}
@Override // android.widget.TextView
@RestrictTo
public void setAutoSizeTextTypeWithDefaults(int i) {
if (ViewUtils.f352c) {
super.setAutoSizeTextTypeWithDefaults(i);
return;
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
appCompatTextHelper.j(i);
}
}
@Override // android.view.View
public void setBackgroundDrawable(@Nullable Drawable drawable) {
super.setBackgroundDrawable(drawable);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.f222c;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.e();
}
}
@Override // android.view.View
public void setBackgroundResource(@DrawableRes int i) {
super.setBackgroundResource(i);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.f222c;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.f(i);
}
}
@Override // android.widget.TextView
public void setCustomSelectionActionModeCallback(@Nullable ActionMode.Callback callback) {
super.setCustomSelectionActionModeCallback(TextViewCompat.h(callback, this));
}
public void setEmojiCompatEnabled(boolean z) {
getEmojiTextViewHelper().c(z);
}
@Override // android.widget.TextView
public void setFilters(@NonNull InputFilter[] inputFilterArr) {
super.setFilters(getEmojiTextViewHelper().b.a(inputFilterArr));
}
public void setSupportAllCaps(boolean z) {
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
appCompatTextHelper.f273a.setAllCaps(z);
}
}
@RestrictTo
public void setSupportBackgroundTintList(@Nullable ColorStateList colorStateList) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.f222c;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.h(colorStateList);
}
}
@RestrictTo
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.f222c;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.i(mode);
}
}
@Override // androidx.core.widget.TintableCompoundDrawablesView
@RestrictTo
public void setSupportCompoundDrawablesTintList(@Nullable ColorStateList colorStateList) {
AppCompatTextHelper appCompatTextHelper = this.f;
appCompatTextHelper.k(colorStateList);
appCompatTextHelper.b();
}
@Override // androidx.core.widget.TintableCompoundDrawablesView
@RestrictTo
public void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode mode) {
AppCompatTextHelper appCompatTextHelper = this.f;
appCompatTextHelper.l(mode);
appCompatTextHelper.b();
}
@Override // android.widget.TextView
public final void setTextAppearance(Context context, int i) {
super.setTextAppearance(context, i);
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
appCompatTextHelper.g(context, i);
}
}
@Override // android.widget.TextView
public final void setTextSize(int i, float f) {
boolean z = ViewUtils.f352c;
if (z) {
super.setTextSize(i, f);
return;
}
AppCompatTextHelper appCompatTextHelper = this.f;
if (appCompatTextHelper != null) {
AppCompatTextViewAutoSizeHelper appCompatTextViewAutoSizeHelper = appCompatTextHelper.i;
if (!z && !appCompatTextViewAutoSizeHelper.f()) {
appCompatTextViewAutoSizeHelper.g(f, i);
}
}
}
}