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

134 lines
5.6 KiB
Java

package androidx.appcompat.app;
import android.R;
import android.content.Context;
import android.content.ContextWrapper;
import android.util.AttributeSet;
import android.view.View;
import androidx.appcompat.widget.AppCompatAutoCompleteTextView;
import androidx.appcompat.widget.AppCompatButton;
import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.appcompat.widget.AppCompatRadioButton;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.collection.SimpleArrayMap;
import com.google.android.gms.ads.RequestConfiguration;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public class AppCompatViewInflater {
public static final Class[] b = {Context.class, AttributeSet.class};
/* renamed from: c, reason: collision with root package name */
public static final int[] f103c = {R.attr.onClick};
public static final int[] d = {R.attr.accessibilityHeading};
public static final int[] e = {R.attr.accessibilityPaneTitle};
public static final int[] f = {R.attr.screenReaderFocusable};
public static final String[] g = {"android.widget.", "android.view.", "android.webkit."};
public static final SimpleArrayMap h = new SimpleArrayMap(0);
/* renamed from: a, reason: collision with root package name */
public final Object[] f104a = new Object[2];
/* loaded from: classes.dex */
public static class DeclaredOnClickListener implements View.OnClickListener {
/* renamed from: c, reason: collision with root package name */
public final View f105c;
public final String f;
public Method g;
public Context h;
public DeclaredOnClickListener(View view, String str) {
this.f105c = view;
this.f = str;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
String str;
Method method;
if (this.g == null) {
View view2 = this.f105c;
Context context = view2.getContext();
while (true) {
String str2 = this.f;
if (context != null) {
try {
if (!context.isRestricted() && (method = context.getClass().getMethod(str2, View.class)) != null) {
this.g = method;
this.h = context;
}
} catch (NoSuchMethodException unused) {
}
if (context instanceof ContextWrapper) {
context = ((ContextWrapper) context).getBaseContext();
} else {
context = null;
}
} else {
int id = view2.getId();
if (id == -1) {
str = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
} else {
str = " with id '" + view2.getContext().getResources().getResourceEntryName(id) + "'";
}
StringBuilder w = android.support.v4.media.a.w("Could not find method ", str2, "(View) in a parent or ancestor Context for android:onClick attribute defined on view ");
w.append(view2.getClass());
w.append(str);
throw new IllegalStateException(w.toString());
}
}
}
try {
this.g.invoke(this.h, view);
} catch (IllegalAccessException e) {
throw new IllegalStateException("Could not execute non-public method for android:onClick", e);
} catch (InvocationTargetException e2) {
throw new IllegalStateException("Could not execute method for android:onClick", e2);
}
}
}
public AppCompatAutoCompleteTextView a(Context context, AttributeSet attributeSet) {
return new AppCompatAutoCompleteTextView(context, attributeSet);
}
public AppCompatButton b(Context context, AttributeSet attributeSet) {
return new AppCompatButton(context, attributeSet, androidx.appcompat.R.attr.buttonStyle);
}
public AppCompatCheckBox c(Context context, AttributeSet attributeSet) {
return new AppCompatCheckBox(context, attributeSet, androidx.appcompat.R.attr.checkboxStyle);
}
public AppCompatRadioButton d(Context context, AttributeSet attributeSet) {
return new AppCompatRadioButton(context, attributeSet, androidx.appcompat.R.attr.radioButtonStyle);
}
public AppCompatTextView e(Context context, AttributeSet attributeSet) {
return new AppCompatTextView(context, attributeSet);
}
public final View f(Context context, String str, String str2) {
String concat;
SimpleArrayMap simpleArrayMap = h;
Constructor constructor = (Constructor) simpleArrayMap.get(str);
if (constructor == null) {
if (str2 != null) {
try {
concat = str2.concat(str);
} catch (Exception unused) {
return null;
}
} else {
concat = str;
}
constructor = Class.forName(concat, false, context.getClassLoader()).asSubclass(View.class).getConstructor(b);
simpleArrayMap.put(str, constructor);
}
constructor.setAccessible(true);
return (View) constructor.newInstance(this.f104a);
}
}