* 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>
371 lines
12 KiB
Java
371 lines
12 KiB
Java
package androidx.emoji2.text;
|
|
|
|
import android.os.Build;
|
|
import android.text.Editable;
|
|
import android.text.SpanWatcher;
|
|
import android.text.Spannable;
|
|
import android.text.SpannableStringBuilder;
|
|
import android.text.TextWatcher;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.core.util.Preconditions;
|
|
import java.lang.reflect.Array;
|
|
import java.util.ArrayList;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
@RestrictTo
|
|
/* loaded from: classes.dex */
|
|
public final class SpannableBuilder extends SpannableStringBuilder {
|
|
|
|
/* renamed from: c, reason: collision with root package name */
|
|
public final Class f1024c;
|
|
public final ArrayList f;
|
|
|
|
/* loaded from: classes.dex */
|
|
public static class WatcherWrapper implements TextWatcher, SpanWatcher {
|
|
|
|
/* renamed from: c, reason: collision with root package name */
|
|
public final Object f1025c;
|
|
public final AtomicInteger f = new AtomicInteger(0);
|
|
|
|
public WatcherWrapper(Object obj) {
|
|
this.f1025c = obj;
|
|
}
|
|
|
|
@Override // android.text.TextWatcher
|
|
public final void afterTextChanged(Editable editable) {
|
|
((TextWatcher) this.f1025c).afterTextChanged(editable);
|
|
}
|
|
|
|
@Override // android.text.TextWatcher
|
|
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
|
((TextWatcher) this.f1025c).beforeTextChanged(charSequence, i, i2, i3);
|
|
}
|
|
|
|
@Override // android.text.SpanWatcher
|
|
public final void onSpanAdded(Spannable spannable, Object obj, int i, int i2) {
|
|
if (this.f.get() > 0 && (obj instanceof EmojiSpan)) {
|
|
return;
|
|
}
|
|
((SpanWatcher) this.f1025c).onSpanAdded(spannable, obj, i, i2);
|
|
}
|
|
|
|
@Override // android.text.SpanWatcher
|
|
public final void onSpanChanged(Spannable spannable, Object obj, int i, int i2, int i3, int i4) {
|
|
int i5;
|
|
int i6;
|
|
if (this.f.get() > 0 && (obj instanceof EmojiSpan)) {
|
|
return;
|
|
}
|
|
if (Build.VERSION.SDK_INT < 28) {
|
|
if (i > i2) {
|
|
i = 0;
|
|
}
|
|
if (i3 > i4) {
|
|
i5 = i;
|
|
i6 = 0;
|
|
((SpanWatcher) this.f1025c).onSpanChanged(spannable, obj, i5, i2, i6, i4);
|
|
}
|
|
}
|
|
i5 = i;
|
|
i6 = i3;
|
|
((SpanWatcher) this.f1025c).onSpanChanged(spannable, obj, i5, i2, i6, i4);
|
|
}
|
|
|
|
@Override // android.text.SpanWatcher
|
|
public final void onSpanRemoved(Spannable spannable, Object obj, int i, int i2) {
|
|
if (this.f.get() > 0 && (obj instanceof EmojiSpan)) {
|
|
return;
|
|
}
|
|
((SpanWatcher) this.f1025c).onSpanRemoved(spannable, obj, i, i2);
|
|
}
|
|
|
|
@Override // android.text.TextWatcher
|
|
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
|
((TextWatcher) this.f1025c).onTextChanged(charSequence, i, i2, i3);
|
|
}
|
|
}
|
|
|
|
public SpannableBuilder(Class cls, CharSequence charSequence) {
|
|
super(charSequence);
|
|
this.f = new ArrayList();
|
|
Preconditions.c(cls, "watcherClass cannot be null");
|
|
this.f1024c = cls;
|
|
}
|
|
|
|
public final void a() {
|
|
int i = 0;
|
|
while (true) {
|
|
ArrayList arrayList = this.f;
|
|
if (i < arrayList.size()) {
|
|
((WatcherWrapper) arrayList.get(i)).f.incrementAndGet();
|
|
i++;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final Editable append(CharSequence charSequence) {
|
|
super.append(charSequence);
|
|
return this;
|
|
}
|
|
|
|
public final void b() {
|
|
e();
|
|
int i = 0;
|
|
while (true) {
|
|
ArrayList arrayList = this.f;
|
|
if (i < arrayList.size()) {
|
|
((WatcherWrapper) arrayList.get(i)).onTextChanged(this, 0, length(), length());
|
|
i++;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final WatcherWrapper c(Object obj) {
|
|
int i = 0;
|
|
while (true) {
|
|
ArrayList arrayList = this.f;
|
|
if (i < arrayList.size()) {
|
|
WatcherWrapper watcherWrapper = (WatcherWrapper) arrayList.get(i);
|
|
if (watcherWrapper.f1025c == obj) {
|
|
return watcherWrapper;
|
|
}
|
|
i++;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final boolean d(Object obj) {
|
|
if (obj != null) {
|
|
if (this.f1024c == obj.getClass()) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final Editable delete(int i, int i2) {
|
|
super.delete(i, i2);
|
|
return this;
|
|
}
|
|
|
|
public final void e() {
|
|
int i = 0;
|
|
while (true) {
|
|
ArrayList arrayList = this.f;
|
|
if (i < arrayList.size()) {
|
|
((WatcherWrapper) arrayList.get(i)).f.decrementAndGet();
|
|
i++;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Spanned
|
|
public final int getSpanEnd(Object obj) {
|
|
WatcherWrapper c2;
|
|
if (d(obj) && (c2 = c(obj)) != null) {
|
|
obj = c2;
|
|
}
|
|
return super.getSpanEnd(obj);
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Spanned
|
|
public final int getSpanFlags(Object obj) {
|
|
WatcherWrapper c2;
|
|
if (d(obj) && (c2 = c(obj)) != null) {
|
|
obj = c2;
|
|
}
|
|
return super.getSpanFlags(obj);
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Spanned
|
|
public final int getSpanStart(Object obj) {
|
|
WatcherWrapper c2;
|
|
if (d(obj) && (c2 = c(obj)) != null) {
|
|
obj = c2;
|
|
}
|
|
return super.getSpanStart(obj);
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Spanned
|
|
public final Object[] getSpans(int i, int i2, Class cls) {
|
|
if (this.f1024c == cls) {
|
|
WatcherWrapper[] watcherWrapperArr = (WatcherWrapper[]) super.getSpans(i, i2, WatcherWrapper.class);
|
|
Object[] objArr = (Object[]) Array.newInstance((Class<?>) cls, watcherWrapperArr.length);
|
|
for (int i3 = 0; i3 < watcherWrapperArr.length; i3++) {
|
|
objArr[i3] = watcherWrapperArr[i3].f1025c;
|
|
}
|
|
return objArr;
|
|
}
|
|
return super.getSpans(i, i2, cls);
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final Editable insert(int i, CharSequence charSequence) {
|
|
super.insert(i, charSequence);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Spanned
|
|
public final int nextSpanTransition(int i, int i2, Class cls) {
|
|
if (cls == null || this.f1024c == cls) {
|
|
cls = WatcherWrapper.class;
|
|
}
|
|
return super.nextSpanTransition(i, i2, cls);
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Spannable
|
|
public final void removeSpan(Object obj) {
|
|
WatcherWrapper watcherWrapper;
|
|
if (d(obj)) {
|
|
watcherWrapper = c(obj);
|
|
if (watcherWrapper != null) {
|
|
obj = watcherWrapper;
|
|
}
|
|
} else {
|
|
watcherWrapper = null;
|
|
}
|
|
super.removeSpan(obj);
|
|
if (watcherWrapper != null) {
|
|
this.f.remove(watcherWrapper);
|
|
}
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final /* bridge */ /* synthetic */ Editable replace(int i, int i2, CharSequence charSequence) {
|
|
replace(i, i2, charSequence);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Spannable
|
|
public final void setSpan(Object obj, int i, int i2, int i3) {
|
|
if (d(obj)) {
|
|
WatcherWrapper watcherWrapper = new WatcherWrapper(obj);
|
|
this.f.add(watcherWrapper);
|
|
obj = watcherWrapper;
|
|
}
|
|
super.setSpan(obj, i, i2, i3);
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, java.lang.CharSequence
|
|
public final CharSequence subSequence(int i, int i2) {
|
|
return new SpannableBuilder(this.f1024c, this, i, i2);
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final SpannableStringBuilder append(CharSequence charSequence) {
|
|
super.append(charSequence);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final SpannableStringBuilder delete(int i, int i2) {
|
|
super.delete(i, i2);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final SpannableStringBuilder insert(int i, CharSequence charSequence) {
|
|
super.insert(i, charSequence);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final /* bridge */ /* synthetic */ Editable replace(int i, int i2, CharSequence charSequence, int i3, int i4) {
|
|
replace(i, i2, charSequence, i3, i4);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final Appendable append(CharSequence charSequence) {
|
|
super.append(charSequence);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final Editable insert(int i, CharSequence charSequence, int i2, int i3) {
|
|
super.insert(i, charSequence, i2, i3);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final SpannableStringBuilder replace(int i, int i2, CharSequence charSequence) {
|
|
a();
|
|
super.replace(i, i2, charSequence);
|
|
e();
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final Editable append(char c2) {
|
|
super.append(c2);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final SpannableStringBuilder insert(int i, CharSequence charSequence, int i2, int i3) {
|
|
super.insert(i, charSequence, i2, i3);
|
|
return this;
|
|
}
|
|
|
|
public SpannableBuilder(Class cls, SpannableBuilder spannableBuilder, int i, int i2) {
|
|
super(spannableBuilder, i, i2);
|
|
this.f = new ArrayList();
|
|
Preconditions.c(cls, "watcherClass cannot be null");
|
|
this.f1024c = cls;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final SpannableStringBuilder append(char c2) {
|
|
super.append(c2);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final Appendable append(char c2) {
|
|
super.append(c2);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable
|
|
public final SpannableStringBuilder replace(int i, int i2, CharSequence charSequence, int i3, int i4) {
|
|
a();
|
|
super.replace(i, i2, charSequence, i3, i4);
|
|
e();
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final Editable append(CharSequence charSequence, int i, int i2) {
|
|
super.append(charSequence, i, i2);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final SpannableStringBuilder append(CharSequence charSequence, int i, int i2) {
|
|
super.append(charSequence, i, i2);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder, android.text.Editable, java.lang.Appendable
|
|
public final Appendable append(CharSequence charSequence, int i, int i2) {
|
|
super.append(charSequence, i, i2);
|
|
return this;
|
|
}
|
|
|
|
@Override // android.text.SpannableStringBuilder
|
|
public final SpannableStringBuilder append(CharSequence charSequence, Object obj, int i) {
|
|
super.append(charSequence, obj, i);
|
|
return this;
|
|
}
|
|
}
|