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

137 lines
5.3 KiB
Java

package androidx.fragment.app;
import android.R;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
/* loaded from: classes.dex */
public class ListFragment extends Fragment {
/* renamed from: c, reason: collision with root package name */
public final Handler f1140c = new Handler();
public final Runnable f = new Runnable() { // from class: androidx.fragment.app.ListFragment.1
@Override // java.lang.Runnable
public final void run() {
ListView listView = ListFragment.this.h;
listView.focusableViewAvailable(listView);
}
};
public final AdapterView.OnItemClickListener g = new AdapterView.OnItemClickListener() { // from class: androidx.fragment.app.ListFragment.2
@Override // android.widget.AdapterView.OnItemClickListener
public final void onItemClick(AdapterView adapterView, View view, int i, long j) {
ListFragment.this.getClass();
}
};
public ListView h;
public View i;
public View j;
public View k;
public boolean l;
public final void f() {
if (this.h != null) {
return;
}
View view = getView();
if (view != null) {
if (view instanceof ListView) {
this.h = (ListView) view;
} else {
TextView textView = (TextView) view.findViewById(16711681);
if (textView == null) {
this.i = view.findViewById(R.id.empty);
} else {
textView.setVisibility(8);
}
this.j = view.findViewById(16711682);
this.k = view.findViewById(16711683);
View findViewById = view.findViewById(R.id.list);
if (!(findViewById instanceof ListView)) {
if (findViewById == null) {
throw new RuntimeException("Your content must have a ListView whose id attribute is 'android.R.id.list'");
}
throw new RuntimeException("Content has view with id attribute 'android.R.id.list' that is not a ListView class");
}
ListView listView = (ListView) findViewById;
this.h = listView;
View view2 = this.i;
if (view2 != null) {
listView.setEmptyView(view2);
}
}
this.l = true;
this.h.setOnItemClickListener(this.g);
if (this.j != null) {
f();
View view3 = this.j;
if (view3 != null) {
if (this.l) {
this.l = false;
view3.clearAnimation();
this.k.clearAnimation();
this.j.setVisibility(0);
this.k.setVisibility(8);
}
} else {
throw new IllegalStateException("Can't be used with a custom content view");
}
}
this.f1140c.post(this.f);
return;
}
throw new IllegalStateException("Content view not yet created");
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
Context requireContext = requireContext();
FrameLayout frameLayout = new FrameLayout(requireContext);
LinearLayout linearLayout = new LinearLayout(requireContext);
linearLayout.setId(16711682);
linearLayout.setOrientation(1);
linearLayout.setVisibility(8);
linearLayout.setGravity(17);
linearLayout.addView(new ProgressBar(requireContext, null, R.attr.progressBarStyleLarge), new FrameLayout.LayoutParams(-2, -2));
frameLayout.addView(linearLayout, new FrameLayout.LayoutParams(-1, -1));
FrameLayout frameLayout2 = new FrameLayout(requireContext);
frameLayout2.setId(16711683);
TextView textView = new TextView(requireContext);
textView.setId(16711681);
textView.setGravity(17);
frameLayout2.addView(textView, new FrameLayout.LayoutParams(-1, -1));
ListView listView = new ListView(requireContext);
listView.setId(R.id.list);
listView.setDrawSelectorOnTop(false);
frameLayout2.addView(listView, new FrameLayout.LayoutParams(-1, -1));
frameLayout.addView(frameLayout2, new FrameLayout.LayoutParams(-1, -1));
frameLayout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
return frameLayout;
}
@Override // androidx.fragment.app.Fragment
public final void onDestroyView() {
this.f1140c.removeCallbacks(this.f);
this.h = null;
this.l = false;
this.k = null;
this.j = null;
this.i = null;
super.onDestroyView();
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
f();
}
}