soul-browser/sources/java/androidx/core/view/SoftwareKeyboardControllerCompat.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

129 lines
4.9 KiB
Java

package androidx.core.view;
import android.R;
import android.os.Build;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.inputmethod.InputMethodManager;
import androidx.annotation.RequiresApi;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes.dex */
public final class SoftwareKeyboardControllerCompat {
/* renamed from: a, reason: collision with root package name */
public final Impl20 f786a;
/* loaded from: classes.dex */
public static class Impl {
}
@RequiresApi
/* loaded from: classes.dex */
public static class Impl20 extends Impl {
/* renamed from: a, reason: collision with root package name */
public final View f787a;
public Impl20(View view) {
this.f787a = view;
}
public void a() {
View view = this.f787a;
if (view != null) {
((InputMethodManager) view.getContext().getSystemService("input_method")).hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
public void b() {
View view;
View view2 = this.f787a;
if (view2 != null) {
if (!view2.isInEditMode() && !view2.onCheckIsTextEditor()) {
view = view2.getRootView().findFocus();
} else {
view2.requestFocus();
view = view2;
}
if (view == null) {
view = view2.getRootView().findViewById(R.id.content);
}
if (view != null && view.hasWindowFocus()) {
view.post(new c(view, 0));
}
}
}
}
@RequiresApi
/* loaded from: classes.dex */
public static class Impl30 extends Impl20 {
public View b;
@Override // androidx.core.view.SoftwareKeyboardControllerCompat.Impl20
public final void a() {
WindowInsetsController windowInsetsController;
View view = this.b;
if (view != null) {
windowInsetsController = view.getWindowInsetsController();
} else {
windowInsetsController = null;
}
if (windowInsetsController != null) {
final AtomicBoolean atomicBoolean = new AtomicBoolean(false);
WindowInsetsController.OnControllableInsetsChangedListener onControllableInsetsChangedListener = new WindowInsetsController.OnControllableInsetsChangedListener() { // from class: androidx.core.view.d
@Override // android.view.WindowInsetsController.OnControllableInsetsChangedListener
public final void onControllableInsetsChanged(WindowInsetsController windowInsetsController2, int i) {
boolean z;
AtomicBoolean atomicBoolean2 = atomicBoolean;
if ((i & 8) != 0) {
z = true;
} else {
z = false;
}
atomicBoolean2.set(z);
}
};
windowInsetsController.addOnControllableInsetsChangedListener(onControllableInsetsChangedListener);
if (!atomicBoolean.get() && view != null) {
((InputMethodManager) view.getContext().getSystemService("input_method")).hideSoftInputFromWindow(view.getWindowToken(), 0);
}
windowInsetsController.removeOnControllableInsetsChangedListener(onControllableInsetsChangedListener);
windowInsetsController.hide(WindowInsets.Type.ime());
return;
}
super.a();
}
@Override // androidx.core.view.SoftwareKeyboardControllerCompat.Impl20
public final void b() {
WindowInsetsController windowInsetsController;
View view = this.b;
if (view != null && Build.VERSION.SDK_INT < 33) {
((InputMethodManager) view.getContext().getSystemService("input_method")).isActive();
}
if (view != null) {
windowInsetsController = view.getWindowInsetsController();
} else {
windowInsetsController = null;
}
if (windowInsetsController != null) {
windowInsetsController.show(WindowInsets.Type.ime());
}
super.b();
}
}
/* JADX WARN: Type inference failed for: r0v2, types: [androidx.core.view.SoftwareKeyboardControllerCompat$Impl20, androidx.core.view.SoftwareKeyboardControllerCompat$Impl30] */
public SoftwareKeyboardControllerCompat(View view) {
if (Build.VERSION.SDK_INT >= 30) {
?? impl20 = new Impl20(view);
impl20.b = view;
this.f786a = impl20;
return;
}
this.f786a = new Impl20(view);
}
}