* 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>
288 lines
9.5 KiB
Java
288 lines
9.5 KiB
Java
package androidx.appcompat.view.menu;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.Configuration;
|
|
import android.content.res.Resources;
|
|
import android.content.res.TypedArray;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.os.Parcelable;
|
|
import android.text.TextUtils;
|
|
import android.util.AttributeSet;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.appcompat.R;
|
|
import androidx.appcompat.view.menu.MenuBuilder;
|
|
import androidx.appcompat.view.menu.MenuView;
|
|
import androidx.appcompat.widget.ActionMenuView;
|
|
import androidx.appcompat.widget.AppCompatTextView;
|
|
import androidx.appcompat.widget.ForwardingListener;
|
|
import androidx.appcompat.widget.TooltipCompat;
|
|
|
|
@RestrictTo
|
|
/* loaded from: classes.dex */
|
|
public class ActionMenuItemView extends AppCompatTextView implements MenuView.ItemView, View.OnClickListener, ActionMenuView.ActionMenuChildView {
|
|
public MenuItemImpl l;
|
|
public CharSequence m;
|
|
public Drawable n;
|
|
public MenuBuilder.ItemInvoker o;
|
|
public ForwardingListener p;
|
|
public PopupCallback q;
|
|
public boolean r;
|
|
public boolean s;
|
|
public final int t;
|
|
public int u;
|
|
public final int v;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ActionMenuItemForwardingListener extends ForwardingListener {
|
|
public ActionMenuItemForwardingListener() {
|
|
super(ActionMenuItemView.this);
|
|
}
|
|
|
|
@Override // androidx.appcompat.widget.ForwardingListener
|
|
public final ShowableListMenu b() {
|
|
PopupCallback popupCallback = ActionMenuItemView.this.q;
|
|
if (popupCallback != null) {
|
|
return popupCallback.a();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // androidx.appcompat.widget.ForwardingListener
|
|
public final boolean c() {
|
|
ShowableListMenu b;
|
|
ActionMenuItemView actionMenuItemView = ActionMenuItemView.this;
|
|
MenuBuilder.ItemInvoker itemInvoker = actionMenuItemView.o;
|
|
if (itemInvoker != null && itemInvoker.a(actionMenuItemView.l) && (b = b()) != null && b.a()) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public static abstract class PopupCallback {
|
|
public abstract ShowableListMenu a();
|
|
}
|
|
|
|
public ActionMenuItemView(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet, 0);
|
|
Resources resources = context.getResources();
|
|
this.r = q();
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R.styleable.ActionMenuItemView, 0, 0);
|
|
this.t = obtainStyledAttributes.getDimensionPixelSize(R.styleable.ActionMenuItemView_android_minWidth, 0);
|
|
obtainStyledAttributes.recycle();
|
|
this.v = (int) ((resources.getDisplayMetrics().density * 32.0f) + 0.5f);
|
|
setOnClickListener(this);
|
|
this.u = -1;
|
|
setSaveEnabled(false);
|
|
}
|
|
|
|
@Override // androidx.appcompat.widget.ActionMenuView.ActionMenuChildView
|
|
public final boolean a() {
|
|
return !TextUtils.isEmpty(getText());
|
|
}
|
|
|
|
@Override // androidx.appcompat.widget.ActionMenuView.ActionMenuChildView
|
|
public final boolean b() {
|
|
if (!TextUtils.isEmpty(getText()) && this.l.getIcon() == null) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
|
public final void c(MenuItemImpl menuItemImpl) {
|
|
int i;
|
|
this.l = menuItemImpl;
|
|
setIcon(menuItemImpl.getIcon());
|
|
setTitle(menuItemImpl.getTitleCondensed());
|
|
setId(menuItemImpl.f179a);
|
|
if (menuItemImpl.isVisible()) {
|
|
i = 0;
|
|
} else {
|
|
i = 8;
|
|
}
|
|
setVisibility(i);
|
|
setEnabled(menuItemImpl.isEnabled());
|
|
if (menuItemImpl.hasSubMenu() && this.p == null) {
|
|
this.p = new ActionMenuItemForwardingListener();
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView, android.view.View
|
|
public CharSequence getAccessibilityClassName() {
|
|
return Button.class.getName();
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuView.ItemView
|
|
public MenuItemImpl getItemData() {
|
|
return this.l;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
MenuBuilder.ItemInvoker itemInvoker = this.o;
|
|
if (itemInvoker != null) {
|
|
itemInvoker.a(this.l);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView, android.view.View
|
|
public final void onConfigurationChanged(Configuration configuration) {
|
|
super.onConfigurationChanged(configuration);
|
|
this.r = q();
|
|
r();
|
|
}
|
|
|
|
@Override // androidx.appcompat.widget.AppCompatTextView, android.widget.TextView, android.view.View
|
|
public final void onMeasure(int i, int i2) {
|
|
int i3;
|
|
int i4;
|
|
boolean isEmpty = TextUtils.isEmpty(getText());
|
|
if (!isEmpty && (i4 = this.u) >= 0) {
|
|
super.setPadding(i4, getPaddingTop(), getPaddingRight(), getPaddingBottom());
|
|
}
|
|
super.onMeasure(i, i2);
|
|
int mode = View.MeasureSpec.getMode(i);
|
|
int size = View.MeasureSpec.getSize(i);
|
|
int measuredWidth = getMeasuredWidth();
|
|
int i5 = this.t;
|
|
if (mode == Integer.MIN_VALUE) {
|
|
i3 = Math.min(size, i5);
|
|
} else {
|
|
i3 = i5;
|
|
}
|
|
if (mode != 1073741824 && i5 > 0 && measuredWidth < i3) {
|
|
super.onMeasure(View.MeasureSpec.makeMeasureSpec(i3, 1073741824), i2);
|
|
}
|
|
if (isEmpty && this.n != null) {
|
|
super.setPadding((getMeasuredWidth() - this.n.getBounds().width()) / 2, getPaddingTop(), getPaddingRight(), getPaddingBottom());
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView, android.view.View
|
|
public final void onRestoreInstanceState(Parcelable parcelable) {
|
|
super.onRestoreInstanceState(null);
|
|
}
|
|
|
|
@Override // android.widget.TextView, android.view.View
|
|
public final boolean onTouchEvent(MotionEvent motionEvent) {
|
|
ForwardingListener forwardingListener;
|
|
if (this.l.hasSubMenu() && (forwardingListener = this.p) != null && forwardingListener.onTouch(this, motionEvent)) {
|
|
return true;
|
|
}
|
|
return super.onTouchEvent(motionEvent);
|
|
}
|
|
|
|
public final boolean q() {
|
|
Configuration configuration = getContext().getResources().getConfiguration();
|
|
int i = configuration.screenWidthDp;
|
|
int i2 = configuration.screenHeightDp;
|
|
if (i < 480) {
|
|
if ((i < 640 || i2 < 480) && configuration.orientation != 2) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final void r() {
|
|
CharSequence charSequence;
|
|
CharSequence charSequence2;
|
|
boolean z = true;
|
|
boolean z2 = !TextUtils.isEmpty(this.m);
|
|
if (this.n != null && ((this.l.y & 4) != 4 || (!this.r && !this.s))) {
|
|
z = false;
|
|
}
|
|
boolean z3 = z2 & z;
|
|
CharSequence charSequence3 = null;
|
|
if (z3) {
|
|
charSequence = this.m;
|
|
} else {
|
|
charSequence = null;
|
|
}
|
|
setText(charSequence);
|
|
CharSequence charSequence4 = this.l.q;
|
|
if (TextUtils.isEmpty(charSequence4)) {
|
|
if (z3) {
|
|
charSequence2 = null;
|
|
} else {
|
|
charSequence2 = this.l.e;
|
|
}
|
|
setContentDescription(charSequence2);
|
|
} else {
|
|
setContentDescription(charSequence4);
|
|
}
|
|
CharSequence charSequence5 = this.l.r;
|
|
if (TextUtils.isEmpty(charSequence5)) {
|
|
if (!z3) {
|
|
charSequence3 = this.l.e;
|
|
}
|
|
TooltipCompat.a(this, charSequence3);
|
|
return;
|
|
}
|
|
TooltipCompat.a(this, charSequence5);
|
|
}
|
|
|
|
public void setCheckable(boolean z) {
|
|
}
|
|
|
|
public void setChecked(boolean z) {
|
|
}
|
|
|
|
public void setExpandedFormat(boolean z) {
|
|
if (this.s != z) {
|
|
this.s = z;
|
|
MenuItemImpl menuItemImpl = this.l;
|
|
if (menuItemImpl != null) {
|
|
MenuBuilder menuBuilder = menuItemImpl.n;
|
|
menuBuilder.k = true;
|
|
menuBuilder.p(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void setIcon(Drawable drawable) {
|
|
this.n = drawable;
|
|
if (drawable != null) {
|
|
int intrinsicWidth = drawable.getIntrinsicWidth();
|
|
int intrinsicHeight = drawable.getIntrinsicHeight();
|
|
int i = this.v;
|
|
if (intrinsicWidth > i) {
|
|
intrinsicHeight = (int) (intrinsicHeight * (i / intrinsicWidth));
|
|
intrinsicWidth = i;
|
|
}
|
|
if (intrinsicHeight > i) {
|
|
intrinsicWidth = (int) (intrinsicWidth * (i / intrinsicHeight));
|
|
} else {
|
|
i = intrinsicHeight;
|
|
}
|
|
drawable.setBounds(0, 0, intrinsicWidth, i);
|
|
}
|
|
setCompoundDrawables(drawable, null, null, null);
|
|
r();
|
|
}
|
|
|
|
public void setItemInvoker(MenuBuilder.ItemInvoker itemInvoker) {
|
|
this.o = itemInvoker;
|
|
}
|
|
|
|
@Override // android.widget.TextView, android.view.View
|
|
public final void setPadding(int i, int i2, int i3, int i4) {
|
|
this.u = i;
|
|
super.setPadding(i, i2, i3, i4);
|
|
}
|
|
|
|
public void setPopupCallback(PopupCallback popupCallback) {
|
|
this.q = popupCallback;
|
|
}
|
|
|
|
public void setTitle(CharSequence charSequence) {
|
|
this.m = charSequence;
|
|
r();
|
|
}
|
|
}
|