soul-browser/sources/java/com/google/android/material/textfield/TextInputEditText.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

156 lines
6.1 KiB
Java

package com.google.android.material.textfield;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatEditText;
import com.google.android.gms.ads.RequestConfiguration;
import java.util.Locale;
/* loaded from: classes3.dex */
public class TextInputEditText extends AppCompatEditText {
public final Rect k;
public boolean l;
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public TextInputEditText(@androidx.annotation.NonNull android.content.Context r8, @androidx.annotation.Nullable android.util.AttributeSet r9) {
/*
r7 = this;
int r3 = androidx.appcompat.R.attr.editTextStyle
r6 = 0
android.content.Context r0 = com.google.android.material.theme.overlay.MaterialThemeOverlay.a(r8, r9, r3, r6)
r7.<init>(r0, r9, r3)
android.graphics.Rect r0 = new android.graphics.Rect
r0.<init>()
r7.k = r0
int[] r2 = com.google.android.material.R.styleable.TextInputEditText
int r4 = com.google.android.material.R.style.Widget_Design_TextInputEditText
int[] r5 = new int[r6]
r0 = r8
r1 = r9
android.content.res.TypedArray r8 = com.google.android.material.internal.ThemeEnforcement.d(r0, r1, r2, r3, r4, r5)
int r9 = com.google.android.material.R.styleable.TextInputEditText_textInputLayoutFocusedRectEnabled
boolean r9 = r8.getBoolean(r9, r6)
r7.setTextInputLayoutFocusedRectEnabled(r9)
r8.recycle()
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.textfield.TextInputEditText.<init>(android.content.Context, android.util.AttributeSet):void");
}
@Nullable
private CharSequence getHintFromLayout() {
TextInputLayout textInputLayout = getTextInputLayout();
if (textInputLayout != null) {
return textInputLayout.getHint();
}
return null;
}
@Nullable
private TextInputLayout getTextInputLayout() {
for (ViewParent parent = getParent(); parent instanceof View; parent = parent.getParent()) {
if (parent instanceof TextInputLayout) {
return (TextInputLayout) parent;
}
}
return null;
}
@Override // android.widget.TextView, android.view.View
public final void getFocusedRect(Rect rect) {
super.getFocusedRect(rect);
TextInputLayout textInputLayout = getTextInputLayout();
if (textInputLayout != null && this.l && rect != null) {
Rect rect2 = this.k;
textInputLayout.getFocusedRect(rect2);
rect.bottom = rect2.bottom;
}
}
@Override // android.view.View
public final boolean getGlobalVisibleRect(Rect rect, Point point) {
TextInputLayout textInputLayout = getTextInputLayout();
if (textInputLayout != null && this.l) {
boolean globalVisibleRect = textInputLayout.getGlobalVisibleRect(rect, point);
if (globalVisibleRect && point != null) {
point.offset(-getScrollX(), -getScrollY());
}
return globalVisibleRect;
}
return super.getGlobalVisibleRect(rect, point);
}
@Override // android.widget.TextView
@Nullable
public CharSequence getHint() {
TextInputLayout textInputLayout = getTextInputLayout();
if (textInputLayout != null && textInputLayout.J) {
return textInputLayout.getHint();
}
return super.getHint();
}
@Override // android.widget.TextView, android.view.View
public final void onAttachedToWindow() {
String str;
super.onAttachedToWindow();
TextInputLayout textInputLayout = getTextInputLayout();
if (textInputLayout != null && textInputLayout.J && super.getHint() == null) {
String str2 = Build.MANUFACTURER;
if (str2 != null) {
str = str2.toLowerCase(Locale.ENGLISH);
} else {
str = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
}
if (str.equals("meizu")) {
setHint(RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED);
}
}
}
@Override // androidx.appcompat.widget.AppCompatEditText, android.widget.TextView, android.view.View
public final InputConnection onCreateInputConnection(EditorInfo editorInfo) {
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
if (onCreateInputConnection != null && editorInfo.hintText == null) {
editorInfo.hintText = getHintFromLayout();
}
return onCreateInputConnection;
}
@Override // android.view.View
public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
getTextInputLayout();
}
@Override // android.view.View
public final boolean requestRectangleOnScreen(Rect rect) {
TextInputLayout textInputLayout = getTextInputLayout();
if (textInputLayout != null && this.l && rect != null) {
int height = textInputLayout.getHeight() - getHeight();
int i = rect.left;
int i2 = rect.top;
int i3 = rect.right;
int i4 = rect.bottom + height;
Rect rect2 = this.k;
rect2.set(i, i2, i3, i4);
return super.requestRectangleOnScreen(rect2);
}
return super.requestRectangleOnScreen(rect);
}
public void setTextInputLayoutFocusedRectEnabled(boolean z) {
this.l = z;
}
}