* 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>
902 lines
28 KiB
Java
902 lines
28 KiB
Java
package androidx.appcompat.view.menu;
|
|
|
|
import android.content.ComponentName;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.pm.ActivityInfo;
|
|
import android.content.pm.PackageManager;
|
|
import android.content.pm.ResolveInfo;
|
|
import android.content.res.Resources;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.os.Bundle;
|
|
import android.os.Parcelable;
|
|
import android.util.SparseArray;
|
|
import android.view.KeyCharacterMap;
|
|
import android.view.KeyEvent;
|
|
import android.view.MenuItem;
|
|
import android.view.SubMenu;
|
|
import android.view.View;
|
|
import android.view.ViewConfiguration;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.core.internal.view.SupportMenu;
|
|
import androidx.core.view.ViewConfigurationCompat;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
|
@RestrictTo
|
|
/* loaded from: classes.dex */
|
|
public class MenuBuilder implements SupportMenu {
|
|
public static final int[] y = {1, 4, 5, 3, 2, 0};
|
|
|
|
/* renamed from: a, reason: collision with root package name */
|
|
public final Context f176a;
|
|
public final Resources b;
|
|
|
|
/* renamed from: c, reason: collision with root package name */
|
|
public boolean f177c;
|
|
public final boolean d;
|
|
public Callback e;
|
|
public final ArrayList f;
|
|
public final ArrayList g;
|
|
public boolean h;
|
|
public final ArrayList i;
|
|
public final ArrayList j;
|
|
public boolean k;
|
|
public CharSequence m;
|
|
public Drawable n;
|
|
public View o;
|
|
public MenuItemImpl v;
|
|
public boolean x;
|
|
public int l = 0;
|
|
public boolean p = false;
|
|
public boolean q = false;
|
|
public boolean r = false;
|
|
public boolean s = false;
|
|
public final ArrayList t = new ArrayList();
|
|
public final CopyOnWriteArrayList u = new CopyOnWriteArrayList();
|
|
public boolean w = false;
|
|
|
|
@RestrictTo
|
|
/* loaded from: classes.dex */
|
|
public interface Callback {
|
|
boolean a(MenuBuilder menuBuilder, MenuItem menuItem);
|
|
|
|
void b(MenuBuilder menuBuilder);
|
|
}
|
|
|
|
@RestrictTo
|
|
/* loaded from: classes.dex */
|
|
public interface ItemInvoker {
|
|
boolean a(MenuItemImpl menuItemImpl);
|
|
}
|
|
|
|
public MenuBuilder(Context context) {
|
|
boolean z = false;
|
|
this.f176a = context;
|
|
Resources resources = context.getResources();
|
|
this.b = resources;
|
|
this.f = new ArrayList();
|
|
this.g = new ArrayList();
|
|
this.h = true;
|
|
this.i = new ArrayList();
|
|
this.j = new ArrayList();
|
|
this.k = true;
|
|
if (resources.getConfiguration().keyboard != 1 && ViewConfigurationCompat.e(ViewConfiguration.get(context), context)) {
|
|
z = true;
|
|
}
|
|
this.d = z;
|
|
}
|
|
|
|
public MenuItemImpl a(int i, int i2, int i3, CharSequence charSequence) {
|
|
int i4;
|
|
int i5 = ((-65536) & i3) >> 16;
|
|
if (i5 >= 0 && i5 < 6) {
|
|
int i6 = (y[i5] << 16) | (65535 & i3);
|
|
MenuItemImpl menuItemImpl = new MenuItemImpl(this, i, i2, i3, i6, charSequence, this.l);
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size() - 1;
|
|
while (true) {
|
|
if (size >= 0) {
|
|
if (((MenuItemImpl) arrayList.get(size)).d <= i6) {
|
|
i4 = size + 1;
|
|
break;
|
|
}
|
|
size--;
|
|
} else {
|
|
i4 = 0;
|
|
break;
|
|
}
|
|
}
|
|
arrayList.add(i4, menuItemImpl);
|
|
p(true);
|
|
return menuItemImpl;
|
|
}
|
|
throw new IllegalArgumentException("order does not contain a valid category.");
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final MenuItem add(CharSequence charSequence) {
|
|
return a(0, 0, 0, charSequence);
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final int addIntentOptions(int i, int i2, int i3, ComponentName componentName, Intent[] intentArr, Intent intent, int i4, MenuItem[] menuItemArr) {
|
|
int i5;
|
|
Intent intent2;
|
|
int i6;
|
|
PackageManager packageManager = this.f176a.getPackageManager();
|
|
List<ResolveInfo> queryIntentActivityOptions = packageManager.queryIntentActivityOptions(componentName, intentArr, intent, 0);
|
|
if (queryIntentActivityOptions != null) {
|
|
i5 = queryIntentActivityOptions.size();
|
|
} else {
|
|
i5 = 0;
|
|
}
|
|
if ((i4 & 1) == 0) {
|
|
removeGroup(i);
|
|
}
|
|
for (int i7 = 0; i7 < i5; i7++) {
|
|
ResolveInfo resolveInfo = queryIntentActivityOptions.get(i7);
|
|
int i8 = resolveInfo.specificIndex;
|
|
if (i8 < 0) {
|
|
intent2 = intent;
|
|
} else {
|
|
intent2 = intentArr[i8];
|
|
}
|
|
Intent intent3 = new Intent(intent2);
|
|
ActivityInfo activityInfo = resolveInfo.activityInfo;
|
|
intent3.setComponent(new ComponentName(activityInfo.applicationInfo.packageName, activityInfo.name));
|
|
MenuItemImpl a2 = a(i, i2, i3, resolveInfo.loadLabel(packageManager));
|
|
a2.setIcon(resolveInfo.loadIcon(packageManager));
|
|
a2.g = intent3;
|
|
if (menuItemArr != null && (i6 = resolveInfo.specificIndex) >= 0) {
|
|
menuItemArr[i6] = a2;
|
|
}
|
|
}
|
|
return i5;
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final SubMenu addSubMenu(CharSequence charSequence) {
|
|
return addSubMenu(0, 0, 0, charSequence);
|
|
}
|
|
|
|
public final void b(MenuPresenter menuPresenter, Context context) {
|
|
this.u.add(new WeakReference(menuPresenter));
|
|
menuPresenter.h(context, this);
|
|
this.k = true;
|
|
}
|
|
|
|
public final void c(boolean z) {
|
|
if (this.s) {
|
|
return;
|
|
}
|
|
this.s = true;
|
|
CopyOnWriteArrayList copyOnWriteArrayList = this.u;
|
|
Iterator it = copyOnWriteArrayList.iterator();
|
|
while (it.hasNext()) {
|
|
WeakReference weakReference = (WeakReference) it.next();
|
|
MenuPresenter menuPresenter = (MenuPresenter) weakReference.get();
|
|
if (menuPresenter == null) {
|
|
copyOnWriteArrayList.remove(weakReference);
|
|
} else {
|
|
menuPresenter.c(this, z);
|
|
}
|
|
}
|
|
this.s = false;
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final void clear() {
|
|
MenuItemImpl menuItemImpl = this.v;
|
|
if (menuItemImpl != null) {
|
|
d(menuItemImpl);
|
|
}
|
|
this.f.clear();
|
|
p(true);
|
|
}
|
|
|
|
public final void clearHeader() {
|
|
this.n = null;
|
|
this.m = null;
|
|
this.o = null;
|
|
p(false);
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final void close() {
|
|
c(true);
|
|
}
|
|
|
|
public boolean d(MenuItemImpl menuItemImpl) {
|
|
CopyOnWriteArrayList copyOnWriteArrayList = this.u;
|
|
boolean z = false;
|
|
if (!copyOnWriteArrayList.isEmpty() && this.v == menuItemImpl) {
|
|
w();
|
|
Iterator it = copyOnWriteArrayList.iterator();
|
|
while (it.hasNext()) {
|
|
WeakReference weakReference = (WeakReference) it.next();
|
|
MenuPresenter menuPresenter = (MenuPresenter) weakReference.get();
|
|
if (menuPresenter == null) {
|
|
copyOnWriteArrayList.remove(weakReference);
|
|
} else {
|
|
z = menuPresenter.g(menuItemImpl);
|
|
if (z) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
v();
|
|
if (z) {
|
|
this.v = null;
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
|
|
public boolean e(MenuBuilder menuBuilder, MenuItem menuItem) {
|
|
Callback callback = this.e;
|
|
if (callback != null && callback.a(menuBuilder, menuItem)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public boolean f(MenuItemImpl menuItemImpl) {
|
|
CopyOnWriteArrayList copyOnWriteArrayList = this.u;
|
|
boolean z = false;
|
|
if (copyOnWriteArrayList.isEmpty()) {
|
|
return false;
|
|
}
|
|
w();
|
|
Iterator it = copyOnWriteArrayList.iterator();
|
|
while (it.hasNext()) {
|
|
WeakReference weakReference = (WeakReference) it.next();
|
|
MenuPresenter menuPresenter = (MenuPresenter) weakReference.get();
|
|
if (menuPresenter == null) {
|
|
copyOnWriteArrayList.remove(weakReference);
|
|
} else {
|
|
z = menuPresenter.k(menuItemImpl);
|
|
if (z) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
v();
|
|
if (z) {
|
|
this.v = menuItemImpl;
|
|
}
|
|
return z;
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final MenuItem findItem(int i) {
|
|
MenuItem findItem;
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
for (int i2 = 0; i2 < size; i2++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) arrayList.get(i2);
|
|
if (menuItemImpl.f179a == i) {
|
|
return menuItemImpl;
|
|
}
|
|
if (menuItemImpl.hasSubMenu() && (findItem = menuItemImpl.o.findItem(i)) != null) {
|
|
return findItem;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final MenuItemImpl g(int i, KeyEvent keyEvent) {
|
|
char c2;
|
|
ArrayList arrayList = this.t;
|
|
arrayList.clear();
|
|
h(arrayList, i, keyEvent);
|
|
if (arrayList.isEmpty()) {
|
|
return null;
|
|
}
|
|
int metaState = keyEvent.getMetaState();
|
|
KeyCharacterMap.KeyData keyData = new KeyCharacterMap.KeyData();
|
|
keyEvent.getKeyData(keyData);
|
|
int size = arrayList.size();
|
|
if (size == 1) {
|
|
return (MenuItemImpl) arrayList.get(0);
|
|
}
|
|
boolean n = n();
|
|
for (int i2 = 0; i2 < size; i2++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) arrayList.get(i2);
|
|
if (n) {
|
|
c2 = menuItemImpl.j;
|
|
} else {
|
|
c2 = menuItemImpl.h;
|
|
}
|
|
char[] cArr = keyData.meta;
|
|
if ((c2 == cArr[0] && (metaState & 2) == 0) || ((c2 == cArr[2] && (metaState & 2) != 0) || (n && c2 == '\b' && i == 67))) {
|
|
return menuItemImpl;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final MenuItem getItem(int i) {
|
|
return (MenuItem) this.f.get(i);
|
|
}
|
|
|
|
public final void h(List list, int i, KeyEvent keyEvent) {
|
|
char c2;
|
|
int i2;
|
|
boolean n = n();
|
|
int modifiers = keyEvent.getModifiers();
|
|
KeyCharacterMap.KeyData keyData = new KeyCharacterMap.KeyData();
|
|
if (keyEvent.getKeyData(keyData) || i == 67) {
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
for (int i3 = 0; i3 < size; i3++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) arrayList.get(i3);
|
|
if (menuItemImpl.hasSubMenu()) {
|
|
menuItemImpl.o.h(list, i, keyEvent);
|
|
}
|
|
if (n) {
|
|
c2 = menuItemImpl.j;
|
|
} else {
|
|
c2 = menuItemImpl.h;
|
|
}
|
|
if (n) {
|
|
i2 = menuItemImpl.k;
|
|
} else {
|
|
i2 = menuItemImpl.i;
|
|
}
|
|
if ((modifiers & 69647) == (i2 & 69647) && c2 != 0) {
|
|
char[] cArr = keyData.meta;
|
|
if ((c2 == cArr[0] || c2 == cArr[2] || (n && c2 == '\b' && i == 67)) && menuItemImpl.isEnabled()) {
|
|
list.add(menuItemImpl);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final boolean hasVisibleItems() {
|
|
if (!this.x) {
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
for (int i = 0; i < size; i++) {
|
|
if (((MenuItemImpl) arrayList.get(i)).isVisible()) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final void i() {
|
|
ArrayList l = l();
|
|
if (!this.k) {
|
|
return;
|
|
}
|
|
CopyOnWriteArrayList copyOnWriteArrayList = this.u;
|
|
Iterator it = copyOnWriteArrayList.iterator();
|
|
boolean z = false;
|
|
while (it.hasNext()) {
|
|
WeakReference weakReference = (WeakReference) it.next();
|
|
MenuPresenter menuPresenter = (MenuPresenter) weakReference.get();
|
|
if (menuPresenter == null) {
|
|
copyOnWriteArrayList.remove(weakReference);
|
|
} else {
|
|
z |= menuPresenter.e();
|
|
}
|
|
}
|
|
ArrayList arrayList = this.i;
|
|
ArrayList arrayList2 = this.j;
|
|
if (z) {
|
|
arrayList.clear();
|
|
arrayList2.clear();
|
|
int size = l.size();
|
|
for (int i = 0; i < size; i++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) l.get(i);
|
|
if ((menuItemImpl.x & 32) == 32) {
|
|
arrayList.add(menuItemImpl);
|
|
} else {
|
|
arrayList2.add(menuItemImpl);
|
|
}
|
|
}
|
|
} else {
|
|
arrayList.clear();
|
|
arrayList2.clear();
|
|
arrayList2.addAll(l());
|
|
}
|
|
this.k = false;
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final boolean isShortcutKey(int i, KeyEvent keyEvent) {
|
|
if (g(i, keyEvent) != null) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public String j() {
|
|
return "android:menu:actionviewstates";
|
|
}
|
|
|
|
public MenuBuilder k() {
|
|
return this;
|
|
}
|
|
|
|
public final ArrayList l() {
|
|
boolean z = this.h;
|
|
ArrayList arrayList = this.g;
|
|
if (!z) {
|
|
return arrayList;
|
|
}
|
|
arrayList.clear();
|
|
ArrayList arrayList2 = this.f;
|
|
int size = arrayList2.size();
|
|
for (int i = 0; i < size; i++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) arrayList2.get(i);
|
|
if (menuItemImpl.isVisible()) {
|
|
arrayList.add(menuItemImpl);
|
|
}
|
|
}
|
|
this.h = false;
|
|
this.k = true;
|
|
return arrayList;
|
|
}
|
|
|
|
public boolean m() {
|
|
return this.w;
|
|
}
|
|
|
|
public boolean n() {
|
|
return this.f177c;
|
|
}
|
|
|
|
public boolean o() {
|
|
return this.d;
|
|
}
|
|
|
|
public void p(boolean z) {
|
|
if (!this.p) {
|
|
if (z) {
|
|
this.h = true;
|
|
this.k = true;
|
|
}
|
|
CopyOnWriteArrayList copyOnWriteArrayList = this.u;
|
|
if (!copyOnWriteArrayList.isEmpty()) {
|
|
w();
|
|
Iterator it = copyOnWriteArrayList.iterator();
|
|
while (it.hasNext()) {
|
|
WeakReference weakReference = (WeakReference) it.next();
|
|
MenuPresenter menuPresenter = (MenuPresenter) weakReference.get();
|
|
if (menuPresenter == null) {
|
|
copyOnWriteArrayList.remove(weakReference);
|
|
} else {
|
|
menuPresenter.d(z);
|
|
}
|
|
}
|
|
v();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
this.q = true;
|
|
if (z) {
|
|
this.r = true;
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final boolean performIdentifierAction(int i, int i2) {
|
|
return q(findItem(i), null, i2);
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final boolean performShortcut(int i, KeyEvent keyEvent, int i2) {
|
|
boolean z;
|
|
MenuItemImpl g = g(i, keyEvent);
|
|
if (g != null) {
|
|
z = q(g, null, i2);
|
|
} else {
|
|
z = false;
|
|
}
|
|
if ((i2 & 2) != 0) {
|
|
c(true);
|
|
}
|
|
return z;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:17:0x0054 */
|
|
/* JADX WARN: Removed duplicated region for block: B:22:0x0060 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final boolean q(android.view.MenuItem r7, androidx.appcompat.view.menu.MenuPresenter r8, int r9) {
|
|
/*
|
|
r6 = this;
|
|
androidx.appcompat.view.menu.MenuItemImpl r7 = (androidx.appcompat.view.menu.MenuItemImpl) r7
|
|
r0 = 0
|
|
if (r7 == 0) goto Lcc
|
|
boolean r1 = r7.isEnabled()
|
|
if (r1 != 0) goto Ld
|
|
goto Lcc
|
|
Ld:
|
|
androidx.appcompat.view.menu.MenuBuilder r1 = r7.n
|
|
android.view.MenuItem$OnMenuItemClickListener r2 = r7.p
|
|
r3 = 1
|
|
if (r2 == 0) goto L1c
|
|
boolean r2 = r2.onMenuItemClick(r7)
|
|
if (r2 == 0) goto L1c
|
|
L1a:
|
|
r1 = r3
|
|
goto L41
|
|
L1c:
|
|
boolean r2 = r1.e(r1, r7)
|
|
if (r2 == 0) goto L23
|
|
goto L1a
|
|
L23:
|
|
android.content.Intent r2 = r7.g
|
|
if (r2 == 0) goto L35
|
|
android.content.Context r1 = r1.f176a // Catch: android.content.ActivityNotFoundException -> L2d
|
|
r1.startActivity(r2) // Catch: android.content.ActivityNotFoundException -> L2d
|
|
goto L1a
|
|
L2d:
|
|
r1 = move-exception
|
|
java.lang.String r2 = "MenuItemImpl"
|
|
java.lang.String r4 = "Can't find activity to handle intent; ignoring"
|
|
android.util.Log.e(r2, r4, r1)
|
|
L35:
|
|
androidx.core.view.ActionProvider r1 = r7.A
|
|
if (r1 == 0) goto L40
|
|
boolean r1 = r1.e()
|
|
if (r1 == 0) goto L40
|
|
goto L1a
|
|
L40:
|
|
r1 = r0
|
|
L41:
|
|
androidx.core.view.ActionProvider r2 = r7.A
|
|
if (r2 == 0) goto L4d
|
|
boolean r4 = r2.a()
|
|
if (r4 == 0) goto L4d
|
|
r4 = r3
|
|
goto L4e
|
|
L4d:
|
|
r4 = r0
|
|
L4e:
|
|
boolean r5 = r7.e()
|
|
if (r5 == 0) goto L60
|
|
boolean r7 = r7.expandActionView()
|
|
r1 = r1 | r7
|
|
if (r1 == 0) goto Lcb
|
|
r6.c(r3)
|
|
goto Lcb
|
|
L60:
|
|
boolean r5 = r7.hasSubMenu()
|
|
if (r5 != 0) goto L71
|
|
if (r4 == 0) goto L69
|
|
goto L71
|
|
L69:
|
|
r7 = r9 & 1
|
|
if (r7 != 0) goto Lcb
|
|
r6.c(r3)
|
|
goto Lcb
|
|
L71:
|
|
r9 = r9 & 4
|
|
if (r9 != 0) goto L78
|
|
r6.c(r0)
|
|
L78:
|
|
boolean r9 = r7.hasSubMenu()
|
|
if (r9 != 0) goto L8c
|
|
androidx.appcompat.view.menu.SubMenuBuilder r9 = new androidx.appcompat.view.menu.SubMenuBuilder
|
|
android.content.Context r5 = r6.f176a
|
|
r9.<init>(r5, r6, r7)
|
|
r7.o = r9
|
|
java.lang.CharSequence r5 = r7.e
|
|
r9.setHeaderTitle(r5)
|
|
L8c:
|
|
androidx.appcompat.view.menu.SubMenuBuilder r7 = r7.o
|
|
if (r4 == 0) goto L93
|
|
r2.f(r7)
|
|
L93:
|
|
java.util.concurrent.CopyOnWriteArrayList r9 = r6.u
|
|
boolean r2 = r9.isEmpty()
|
|
if (r2 == 0) goto L9c
|
|
goto Lc5
|
|
L9c:
|
|
if (r8 == 0) goto La2
|
|
boolean r0 = r8.j(r7)
|
|
La2:
|
|
java.util.Iterator r8 = r9.iterator()
|
|
La6:
|
|
boolean r2 = r8.hasNext()
|
|
if (r2 == 0) goto Lc5
|
|
java.lang.Object r2 = r8.next()
|
|
java.lang.ref.WeakReference r2 = (java.lang.ref.WeakReference) r2
|
|
java.lang.Object r4 = r2.get()
|
|
androidx.appcompat.view.menu.MenuPresenter r4 = (androidx.appcompat.view.menu.MenuPresenter) r4
|
|
if (r4 != 0) goto Lbe
|
|
r9.remove(r2)
|
|
goto La6
|
|
Lbe:
|
|
if (r0 != 0) goto La6
|
|
boolean r0 = r4.j(r7)
|
|
goto La6
|
|
Lc5:
|
|
r1 = r1 | r0
|
|
if (r1 != 0) goto Lcb
|
|
r6.c(r3)
|
|
Lcb:
|
|
return r1
|
|
Lcc:
|
|
return r0
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.view.menu.MenuBuilder.q(android.view.MenuItem, androidx.appcompat.view.menu.MenuPresenter, int):boolean");
|
|
}
|
|
|
|
public final void r(MenuPresenter menuPresenter) {
|
|
CopyOnWriteArrayList copyOnWriteArrayList = this.u;
|
|
Iterator it = copyOnWriteArrayList.iterator();
|
|
while (it.hasNext()) {
|
|
WeakReference weakReference = (WeakReference) it.next();
|
|
MenuPresenter menuPresenter2 = (MenuPresenter) weakReference.get();
|
|
if (menuPresenter2 == null || menuPresenter2 == menuPresenter) {
|
|
copyOnWriteArrayList.remove(weakReference);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final void removeGroup(int i) {
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
int i2 = 0;
|
|
int i3 = 0;
|
|
while (true) {
|
|
if (i3 < size) {
|
|
if (((MenuItemImpl) arrayList.get(i3)).b == i) {
|
|
break;
|
|
} else {
|
|
i3++;
|
|
}
|
|
} else {
|
|
i3 = -1;
|
|
break;
|
|
}
|
|
}
|
|
if (i3 >= 0) {
|
|
int size2 = arrayList.size() - i3;
|
|
while (true) {
|
|
int i4 = i2 + 1;
|
|
if (i2 >= size2 || ((MenuItemImpl) arrayList.get(i3)).b != i) {
|
|
break;
|
|
}
|
|
if (i3 >= 0 && i3 < arrayList.size()) {
|
|
arrayList.remove(i3);
|
|
}
|
|
i2 = i4;
|
|
}
|
|
p(true);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final void removeItem(int i) {
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
int i2 = 0;
|
|
while (true) {
|
|
if (i2 < size) {
|
|
if (((MenuItemImpl) arrayList.get(i2)).f179a == i) {
|
|
break;
|
|
} else {
|
|
i2++;
|
|
}
|
|
} else {
|
|
i2 = -1;
|
|
break;
|
|
}
|
|
}
|
|
if (i2 >= 0 && i2 < arrayList.size()) {
|
|
arrayList.remove(i2);
|
|
p(true);
|
|
}
|
|
}
|
|
|
|
public final void s(Bundle bundle) {
|
|
MenuItem findItem;
|
|
if (bundle != null) {
|
|
SparseArray<Parcelable> sparseParcelableArray = bundle.getSparseParcelableArray(j());
|
|
int size = this.f.size();
|
|
for (int i = 0; i < size; i++) {
|
|
MenuItem item = getItem(i);
|
|
View actionView = item.getActionView();
|
|
if (actionView != null && actionView.getId() != -1) {
|
|
actionView.restoreHierarchyState(sparseParcelableArray);
|
|
}
|
|
if (item.hasSubMenu()) {
|
|
((SubMenuBuilder) item.getSubMenu()).s(bundle);
|
|
}
|
|
}
|
|
int i2 = bundle.getInt("android:menu:expandedactionview");
|
|
if (i2 > 0 && (findItem = findItem(i2)) != null) {
|
|
findItem.expandActionView();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final void setGroupCheckable(int i, boolean z, boolean z2) {
|
|
int i2;
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
for (int i3 = 0; i3 < size; i3++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) arrayList.get(i3);
|
|
if (menuItemImpl.b == i) {
|
|
int i4 = menuItemImpl.x & (-5);
|
|
if (z2) {
|
|
i2 = 4;
|
|
} else {
|
|
i2 = 0;
|
|
}
|
|
menuItemImpl.x = i4 | i2;
|
|
menuItemImpl.setCheckable(z);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public void setGroupDividerEnabled(boolean z) {
|
|
this.w = z;
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final void setGroupEnabled(int i, boolean z) {
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
for (int i2 = 0; i2 < size; i2++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) arrayList.get(i2);
|
|
if (menuItemImpl.b == i) {
|
|
menuItemImpl.setEnabled(z);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final void setGroupVisible(int i, boolean z) {
|
|
int i2;
|
|
ArrayList arrayList = this.f;
|
|
int size = arrayList.size();
|
|
boolean z2 = false;
|
|
for (int i3 = 0; i3 < size; i3++) {
|
|
MenuItemImpl menuItemImpl = (MenuItemImpl) arrayList.get(i3);
|
|
if (menuItemImpl.b == i) {
|
|
int i4 = menuItemImpl.x;
|
|
int i5 = i4 & (-9);
|
|
if (z) {
|
|
i2 = 0;
|
|
} else {
|
|
i2 = 8;
|
|
}
|
|
int i6 = i5 | i2;
|
|
menuItemImpl.x = i6;
|
|
if (i4 != i6) {
|
|
z2 = true;
|
|
}
|
|
}
|
|
}
|
|
if (z2) {
|
|
p(true);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public void setQwertyMode(boolean z) {
|
|
this.f177c = z;
|
|
p(false);
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final int size() {
|
|
return this.f.size();
|
|
}
|
|
|
|
public final void t(Bundle bundle) {
|
|
int size = this.f.size();
|
|
SparseArray<? extends Parcelable> sparseArray = null;
|
|
for (int i = 0; i < size; i++) {
|
|
MenuItem item = getItem(i);
|
|
View actionView = item.getActionView();
|
|
if (actionView != null && actionView.getId() != -1) {
|
|
if (sparseArray == null) {
|
|
sparseArray = new SparseArray<>();
|
|
}
|
|
actionView.saveHierarchyState(sparseArray);
|
|
if (item.isActionViewExpanded()) {
|
|
bundle.putInt("android:menu:expandedactionview", item.getItemId());
|
|
}
|
|
}
|
|
if (item.hasSubMenu()) {
|
|
((SubMenuBuilder) item.getSubMenu()).t(bundle);
|
|
}
|
|
}
|
|
if (sparseArray != null) {
|
|
bundle.putSparseParcelableArray(j(), sparseArray);
|
|
}
|
|
}
|
|
|
|
public final void u(int i, CharSequence charSequence, int i2, Drawable drawable, View view) {
|
|
if (view != null) {
|
|
this.o = view;
|
|
this.m = null;
|
|
this.n = null;
|
|
} else {
|
|
if (i > 0) {
|
|
this.m = this.b.getText(i);
|
|
} else if (charSequence != null) {
|
|
this.m = charSequence;
|
|
}
|
|
if (i2 > 0) {
|
|
this.n = this.f176a.getDrawable(i2);
|
|
} else if (drawable != null) {
|
|
this.n = drawable;
|
|
}
|
|
this.o = null;
|
|
}
|
|
p(false);
|
|
}
|
|
|
|
public final void v() {
|
|
this.p = false;
|
|
if (this.q) {
|
|
this.q = false;
|
|
p(this.r);
|
|
}
|
|
}
|
|
|
|
public final void w() {
|
|
if (!this.p) {
|
|
this.p = true;
|
|
this.q = false;
|
|
this.r = false;
|
|
}
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final MenuItem add(int i) {
|
|
return a(0, 0, 0, this.b.getString(i));
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final SubMenu addSubMenu(int i) {
|
|
return addSubMenu(0, 0, 0, this.b.getString(i));
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final MenuItem add(int i, int i2, int i3, CharSequence charSequence) {
|
|
return a(i, i2, i3, charSequence);
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public SubMenu addSubMenu(int i, int i2, int i3, CharSequence charSequence) {
|
|
MenuItemImpl a2 = a(i, i2, i3, charSequence);
|
|
SubMenuBuilder subMenuBuilder = new SubMenuBuilder(this.f176a, this, a2);
|
|
a2.o = subMenuBuilder;
|
|
subMenuBuilder.setHeaderTitle(a2.e);
|
|
return subMenuBuilder;
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final MenuItem add(int i, int i2, int i3, int i4) {
|
|
return a(i, i2, i3, this.b.getString(i4));
|
|
}
|
|
|
|
@Override // android.view.Menu
|
|
public final SubMenu addSubMenu(int i, int i2, int i3, int i4) {
|
|
return addSubMenu(i, i2, i3, this.b.getString(i4));
|
|
}
|
|
}
|