526 lines
16 KiB
Java
526 lines
16 KiB
Java
package o;
|
|
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.text.Editable;
|
|
import android.text.method.MetaKeyKeyListener;
|
|
import android.view.KeyEvent;
|
|
import android.view.inputmethod.EditorInfo;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
import java.util.concurrent.locks.ReadWriteLock;
|
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
|
|
/* renamed from: o.neT, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public class C16349neT {
|
|
private static volatile C16349neT h;
|
|
final boolean a;
|
|
final ojQ b;
|
|
final boolean d;
|
|
final int[] e;
|
|
private final boolean g;
|
|
private final RVV i;
|
|
private final int j;
|
|
private final Set<IeS> l;
|
|
private final Sts m;
|
|
private final int s;
|
|
private static final Object f = new Object();
|
|
private static final Object c = new Object();
|
|
private final ReadWriteLock n = new ReentrantReadWriteLock();
|
|
|
|
/* renamed from: o, reason: collision with root package name */
|
|
private volatile int f9224o = 3;
|
|
private final Handler k = new Handler(Looper.getMainLooper());
|
|
|
|
/* renamed from: o.neT$IeS */
|
|
/* loaded from: classes.dex */
|
|
public static abstract class IeS {
|
|
public void b() {
|
|
}
|
|
|
|
public void c(Throwable th) {
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.neT$RVV */
|
|
/* loaded from: classes.dex */
|
|
public interface RVV {
|
|
boolean a(CharSequence charSequence, int i, int i2, int i3);
|
|
}
|
|
|
|
/* renamed from: o.neT$ZqN */
|
|
/* loaded from: classes.dex */
|
|
public static abstract class ZqN {
|
|
public abstract void c(kem kemVar);
|
|
|
|
public abstract void d(Throwable th);
|
|
}
|
|
|
|
/* renamed from: o.neT$ojQ */
|
|
/* loaded from: classes.dex */
|
|
public interface ojQ {
|
|
void e(ZqN zqN);
|
|
}
|
|
|
|
private C16349neT(HBt hBt) {
|
|
this.a = hBt.i;
|
|
this.d = hBt.j;
|
|
this.e = hBt.e;
|
|
this.g = hBt.c;
|
|
this.j = hBt.a;
|
|
this.b = hBt.g;
|
|
this.s = hBt.h;
|
|
this.i = hBt.b;
|
|
wnv wnvVar = new wnv();
|
|
this.l = wnvVar;
|
|
if (hBt.d != null && !hBt.d.isEmpty()) {
|
|
wnvVar.addAll(hBt.d);
|
|
}
|
|
this.m = new LWm(this);
|
|
h();
|
|
}
|
|
|
|
public static C16349neT b(HBt hBt) {
|
|
C16349neT c16349neT;
|
|
C16349neT c16349neT2 = h;
|
|
if (c16349neT2 != null) {
|
|
return c16349neT2;
|
|
}
|
|
synchronized (f) {
|
|
c16349neT = h;
|
|
if (c16349neT == null) {
|
|
c16349neT = new C16349neT(hBt);
|
|
h = c16349neT;
|
|
}
|
|
}
|
|
return c16349neT;
|
|
}
|
|
|
|
public static C16349neT e() {
|
|
C16349neT c16349neT;
|
|
synchronized (f) {
|
|
c16349neT = h;
|
|
if (!(c16349neT != null)) {
|
|
throw new IllegalStateException("EmojiCompat is not initialized.\n\nYou must initialize EmojiCompat prior to referencing the EmojiCompat instance.\n\nThe most likely cause of this error is disabling the EmojiCompatInitializer\neither explicitly in AndroidManifest.xml, or by including\nandroidx.emoji2:emoji2-bundled.\n\nAutomatic initialization is typically performed by EmojiCompatInitializer. If\nyou are not expecting to initialize EmojiCompat manually in your application,\nplease check to ensure it has not been removed from your APK's manifest. You can\ndo this in Android Studio using Build > Analyze APK.\n\nIn the APK Analyzer, ensure that the startup entry for\nEmojiCompatInitializer and InitializationProvider is present in\n AndroidManifest.xml. If it is missing or contains tools:node=\"remove\", and you\nintend to use automatic configuration, verify:\n\n 1. Your application does not include emoji2-bundled\n 2. All modules do not contain an exclusion manifest rule for\n EmojiCompatInitializer or InitializationProvider. For more information\n about manifest exclusions see the documentation for the androidx startup\n library.\n\nIf you intend to use emoji2-bundled, please call EmojiCompat.init. You can\nlearn more in the documentation for BundledEmojiCompatConfig.\n\nIf you intended to perform manual configuration, it is recommended that you call\nEmojiCompat.init immediately on application startup.\n\nIf you still cannot resolve this issue, please open a bug with your specific\nconfiguration to help improve error message.");
|
|
}
|
|
}
|
|
return c16349neT;
|
|
}
|
|
|
|
public void j() {
|
|
if (this.s == 1) {
|
|
if (i()) {
|
|
return;
|
|
}
|
|
this.n.writeLock().lock();
|
|
try {
|
|
if (this.f9224o == 0) {
|
|
return;
|
|
}
|
|
this.f9224o = 0;
|
|
this.n.writeLock().unlock();
|
|
this.m.d();
|
|
return;
|
|
} finally {
|
|
this.n.writeLock().unlock();
|
|
}
|
|
}
|
|
throw new IllegalStateException("Set metadataLoadStrategy to LOAD_STRATEGY_MANUAL to execute manual loading");
|
|
}
|
|
|
|
private void h() {
|
|
this.n.writeLock().lock();
|
|
try {
|
|
if (this.s == 0) {
|
|
this.f9224o = 0;
|
|
}
|
|
this.n.writeLock().unlock();
|
|
if (a() == 0) {
|
|
this.m.d();
|
|
}
|
|
} catch (Throwable th) {
|
|
this.n.writeLock().unlock();
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
void g() {
|
|
ArrayList arrayList = new ArrayList();
|
|
this.n.writeLock().lock();
|
|
try {
|
|
this.f9224o = 1;
|
|
arrayList.addAll(this.l);
|
|
this.l.clear();
|
|
this.n.writeLock().unlock();
|
|
this.k.post(new saX(arrayList, this.f9224o));
|
|
} catch (Throwable th) {
|
|
this.n.writeLock().unlock();
|
|
throw th;
|
|
}
|
|
}
|
|
|
|
void d(Throwable th) {
|
|
ArrayList arrayList = new ArrayList();
|
|
this.n.writeLock().lock();
|
|
try {
|
|
this.f9224o = 2;
|
|
arrayList.addAll(this.l);
|
|
this.l.clear();
|
|
this.n.writeLock().unlock();
|
|
this.k.post(new saX(arrayList, this.f9224o, th));
|
|
} catch (Throwable th2) {
|
|
this.n.writeLock().unlock();
|
|
throw th2;
|
|
}
|
|
}
|
|
|
|
public void c(IeS ieS) {
|
|
if (ieS != null) {
|
|
this.n.writeLock().lock();
|
|
try {
|
|
if (this.f9224o != 1 && this.f9224o != 2) {
|
|
this.l.add(ieS);
|
|
return;
|
|
}
|
|
this.k.post(new saX(ieS, this.f9224o));
|
|
return;
|
|
} finally {
|
|
this.n.writeLock().unlock();
|
|
}
|
|
}
|
|
throw new NullPointerException("initCallback cannot be null");
|
|
}
|
|
|
|
public void d(IeS ieS) {
|
|
if (ieS != null) {
|
|
this.n.writeLock().lock();
|
|
try {
|
|
this.l.remove(ieS);
|
|
return;
|
|
} finally {
|
|
this.n.writeLock().unlock();
|
|
}
|
|
}
|
|
throw new NullPointerException("initCallback cannot be null");
|
|
}
|
|
|
|
public int a() {
|
|
this.n.readLock().lock();
|
|
try {
|
|
return this.f9224o;
|
|
} finally {
|
|
this.n.readLock().unlock();
|
|
}
|
|
}
|
|
|
|
private boolean i() {
|
|
return a() == 1;
|
|
}
|
|
|
|
public CharSequence b(CharSequence charSequence) {
|
|
return b(charSequence, 0, charSequence == null ? 0 : charSequence.length());
|
|
}
|
|
|
|
public CharSequence b(CharSequence charSequence, int i, int i2) {
|
|
return c(charSequence, i, i2, Integer.MAX_VALUE);
|
|
}
|
|
|
|
public CharSequence c(CharSequence charSequence, int i, int i2, int i3) {
|
|
return e(charSequence, i, i2, i3, 0);
|
|
}
|
|
|
|
public CharSequence e(CharSequence charSequence, int i, int i2, int i3, int i4) {
|
|
boolean z;
|
|
if (!i()) {
|
|
throw new IllegalStateException("Not initialized yet");
|
|
}
|
|
if (i < 0) {
|
|
throw new IllegalArgumentException("start cannot be negative");
|
|
}
|
|
if (i2 < 0) {
|
|
throw new IllegalArgumentException("end cannot be negative");
|
|
}
|
|
if (i3 < 0) {
|
|
throw new IllegalArgumentException("maxEmojiCount cannot be negative");
|
|
}
|
|
if (!(i <= i2)) {
|
|
throw new IllegalArgumentException("start should be <= than end");
|
|
}
|
|
if (charSequence == null) {
|
|
return null;
|
|
}
|
|
if (i <= charSequence.length()) {
|
|
if (i2 <= charSequence.length()) {
|
|
if (charSequence.length() == 0 || i == i2) {
|
|
return charSequence;
|
|
}
|
|
if (i4 != 1) {
|
|
z = i4 != 2 ? this.a : false;
|
|
} else {
|
|
z = true;
|
|
}
|
|
return this.m.c(charSequence, i, i2, i3, z);
|
|
}
|
|
throw new IllegalArgumentException("end should be < than charSequence length");
|
|
}
|
|
throw new IllegalArgumentException("start should be < than charSequence length");
|
|
}
|
|
|
|
public void xC_(EditorInfo editorInfo) {
|
|
if (!i() || editorInfo == null) {
|
|
return;
|
|
}
|
|
if (editorInfo.extras == null) {
|
|
editorInfo.extras = new Bundle();
|
|
}
|
|
this.m.xE_(editorInfo);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.neT$tOB */
|
|
/* loaded from: classes.dex */
|
|
public static class tOB {
|
|
tOB() {
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public ZBp b(C2650aic c2650aic) {
|
|
return new GMi(c2650aic);
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.neT$HBt */
|
|
/* loaded from: classes.dex */
|
|
public static abstract class HBt {
|
|
boolean c;
|
|
Set<IeS> d;
|
|
int[] e;
|
|
final ojQ g;
|
|
boolean i;
|
|
boolean j;
|
|
int a = -16711936;
|
|
int h = 0;
|
|
RVV b = new sMT();
|
|
|
|
public HBt(ojQ ojq) {
|
|
if (ojq != null) {
|
|
this.g = ojq;
|
|
return;
|
|
}
|
|
throw new NullPointerException("metadataLoader cannot be null.");
|
|
}
|
|
|
|
public HBt a(int i) {
|
|
this.h = i;
|
|
return this;
|
|
}
|
|
|
|
public final ojQ a() {
|
|
return this.g;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.neT$saX */
|
|
/* loaded from: classes.dex */
|
|
public static class saX implements Runnable {
|
|
private final int b;
|
|
private final List<IeS> d;
|
|
private final Throwable e;
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
saX(o.C16349neT.IeS r3, int r4) {
|
|
/*
|
|
r2 = this;
|
|
r0 = 1
|
|
o.neT$IeS[] r0 = new o.C16349neT.IeS[r0]
|
|
if (r3 == 0) goto L14
|
|
r1 = r3
|
|
o.neT$IeS r1 = (o.C16349neT.IeS) r1
|
|
r1 = 0
|
|
r0[r1] = r3
|
|
java.util.List r3 = java.util.Arrays.asList(r0)
|
|
r0 = 0
|
|
r2.<init>(r3, r4, r0)
|
|
return
|
|
L14:
|
|
java.lang.NullPointerException r3 = new java.lang.NullPointerException
|
|
java.lang.String r4 = "initCallback cannot be null"
|
|
r3.<init>(r4)
|
|
throw r3
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: o.C16349neT.saX.<init>(o.neT$IeS, int):void");
|
|
}
|
|
|
|
saX(Collection<IeS> collection, int i) {
|
|
this(collection, i, null);
|
|
}
|
|
|
|
saX(Collection<IeS> collection, int i, Throwable th) {
|
|
if (collection != null) {
|
|
this.d = new ArrayList(collection);
|
|
this.b = i;
|
|
this.e = th;
|
|
return;
|
|
}
|
|
throw new NullPointerException("initCallbacks cannot be null");
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
int size = this.d.size();
|
|
int i = 0;
|
|
if (this.b != 1) {
|
|
while (i < size) {
|
|
this.d.get(i).c(this.e);
|
|
i++;
|
|
}
|
|
} else {
|
|
while (i < size) {
|
|
this.d.get(i).b();
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.neT$Sts */
|
|
/* loaded from: classes.dex */
|
|
public static class Sts {
|
|
final C16349neT a;
|
|
|
|
CharSequence c(CharSequence charSequence, int i, int i2, int i3, boolean z) {
|
|
return charSequence;
|
|
}
|
|
|
|
void xE_(EditorInfo editorInfo) {
|
|
}
|
|
|
|
Sts(C16349neT c16349neT) {
|
|
this.a = c16349neT;
|
|
}
|
|
|
|
void d() {
|
|
this.a.g();
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.neT$LWm */
|
|
/* loaded from: classes.dex */
|
|
static final class LWm extends Sts {
|
|
private volatile C3480ayO b;
|
|
private volatile kem d;
|
|
|
|
LWm(C16349neT c16349neT) {
|
|
super(c16349neT);
|
|
}
|
|
|
|
@Override // o.C16349neT.Sts
|
|
final void d() {
|
|
try {
|
|
this.a.b.e(new ZqN(this) { // from class: o.neT.LWm.1
|
|
final LWm c;
|
|
|
|
{
|
|
this.c = this;
|
|
}
|
|
|
|
@Override // o.C16349neT.ZqN
|
|
public void c(kem kemVar) {
|
|
this.c.a(kemVar);
|
|
}
|
|
|
|
@Override // o.C16349neT.ZqN
|
|
public void d(Throwable th) {
|
|
this.c.a.d(th);
|
|
}
|
|
});
|
|
} catch (Throwable th) {
|
|
this.a.d(th);
|
|
}
|
|
}
|
|
|
|
final void a(kem kemVar) {
|
|
if (kemVar == null) {
|
|
this.a.d(new IllegalArgumentException("metadataRepo cannot be null"));
|
|
return;
|
|
}
|
|
this.d = kemVar;
|
|
this.b = new C3480ayO(this.d, new tOB(), this.a.i, this.a.d, this.a.e);
|
|
this.a.g();
|
|
}
|
|
|
|
@Override // o.C16349neT.Sts
|
|
final CharSequence c(CharSequence charSequence, int i, int i2, int i3, boolean z) {
|
|
return this.b.b(charSequence, i, i2, i3, z);
|
|
}
|
|
|
|
@Override // o.C16349neT.Sts
|
|
final void xE_(EditorInfo editorInfo) {
|
|
editorInfo.extras.putInt("android.support.text.emoji.emojiCompat_metadataVersion", this.d.d.c());
|
|
editorInfo.extras.putBoolean("android.support.text.emoji.emojiCompat_replaceAll", this.a.a);
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:36:0x003f, code lost:
|
|
|
|
if (java.lang.Character.isHighSurrogate(r5) == false) goto L75;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:65:0x0078, code lost:
|
|
|
|
if (java.lang.Character.isLowSurrogate(r5) == false) goto L85;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:69:0x006b, code lost:
|
|
|
|
if (r11 == false) goto L58;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public static boolean xA_(android.view.inputmethod.InputConnection r7, android.text.Editable r8, int r9, int r10, boolean r11) {
|
|
/*
|
|
Method dump skipped, instructions count: 229
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: o.C16349neT.xA_(android.view.inputmethod.InputConnection, android.text.Editable, int, int, boolean):boolean");
|
|
}
|
|
|
|
public static boolean xB_(Editable editable, int i, KeyEvent keyEvent) {
|
|
boolean xF_;
|
|
if (i != 67) {
|
|
if (i == 112) {
|
|
xF_ = C3480ayO.xF_(editable, keyEvent, true);
|
|
}
|
|
return false;
|
|
}
|
|
xF_ = C3480ayO.xF_(editable, keyEvent, false);
|
|
if (xF_) {
|
|
MetaKeyKeyListener.adjustMetaAfterKeypress(editable);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public boolean d() {
|
|
return this.g;
|
|
}
|
|
|
|
public int c() {
|
|
return this.j;
|
|
}
|
|
|
|
public static boolean b() {
|
|
return h != null;
|
|
}
|
|
}
|