mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
1003 lines
43 KiB
Java
1003 lines
43 KiB
Java
package io.flutter.embedding.engine.systemchannels;
|
|
|
|
import android.os.Bundle;
|
|
import androidx.autofill.HintConstants;
|
|
import com.alibaba.fastjson.parser.JSONLexer;
|
|
import io.flutter.Log;
|
|
import io.flutter.embedding.engine.dart.DartExecutor;
|
|
import io.flutter.plugin.common.JSONMethodCodec;
|
|
import io.flutter.plugin.common.MethodCall;
|
|
import io.flutter.plugin.common.MethodChannel;
|
|
import io.flutter.plugin.editing.TextEditingDelta;
|
|
import io.sentry.protocol.ViewHierarchyNode;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
import kotlin.text.Typography;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class TextInputChannel {
|
|
private static final String TAG = "TextInputChannel";
|
|
public final MethodChannel channel;
|
|
final MethodChannel.MethodCallHandler parsingMethodHandler;
|
|
private TextInputMethodHandler textInputMethodHandler;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public interface TextInputMethodHandler {
|
|
void clearClient();
|
|
|
|
void finishAutofillContext(boolean z);
|
|
|
|
void hide();
|
|
|
|
void requestAutofill();
|
|
|
|
void sendAppPrivateCommand(String str, Bundle bundle);
|
|
|
|
void setClient(int i, Configuration configuration);
|
|
|
|
void setEditableSizeAndTransform(double d, double d2, double[] dArr);
|
|
|
|
void setEditingState(TextEditState textEditState);
|
|
|
|
void setPlatformViewClient(int i, boolean z);
|
|
|
|
void show();
|
|
}
|
|
|
|
public void setTextInputMethodHandler(TextInputMethodHandler textInputMethodHandler) {
|
|
this.textInputMethodHandler = textInputMethodHandler;
|
|
}
|
|
|
|
public TextInputChannel(DartExecutor dartExecutor) {
|
|
MethodChannel.MethodCallHandler methodCallHandler = new MethodChannel.MethodCallHandler() { // from class: io.flutter.embedding.engine.systemchannels.TextInputChannel.1
|
|
@Override // io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
|
public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
|
|
Bundle bundle;
|
|
if (TextInputChannel.this.textInputMethodHandler == null) {
|
|
return;
|
|
}
|
|
String str = methodCall.method;
|
|
Object obj = methodCall.arguments;
|
|
Log.v(TextInputChannel.TAG, "Received '" + str + "' message.");
|
|
str.hashCode();
|
|
char c = 65535;
|
|
switch (str.hashCode()) {
|
|
case -1779068172:
|
|
if (str.equals("TextInput.setPlatformViewClient")) {
|
|
c = 0;
|
|
break;
|
|
}
|
|
break;
|
|
case -1015421462:
|
|
if (str.equals("TextInput.setEditingState")) {
|
|
c = 1;
|
|
break;
|
|
}
|
|
break;
|
|
case -37561188:
|
|
if (str.equals("TextInput.setClient")) {
|
|
c = 2;
|
|
break;
|
|
}
|
|
break;
|
|
case 270476819:
|
|
if (str.equals("TextInput.hide")) {
|
|
c = 3;
|
|
break;
|
|
}
|
|
break;
|
|
case 270803918:
|
|
if (str.equals("TextInput.show")) {
|
|
c = 4;
|
|
break;
|
|
}
|
|
break;
|
|
case 649192816:
|
|
if (str.equals("TextInput.sendAppPrivateCommand")) {
|
|
c = 5;
|
|
break;
|
|
}
|
|
break;
|
|
case 1204752139:
|
|
if (str.equals("TextInput.setEditableSizeAndTransform")) {
|
|
c = 6;
|
|
break;
|
|
}
|
|
break;
|
|
case 1727570905:
|
|
if (str.equals("TextInput.finishAutofillContext")) {
|
|
c = 7;
|
|
break;
|
|
}
|
|
break;
|
|
case 1904427655:
|
|
if (str.equals("TextInput.clearClient")) {
|
|
c = '\b';
|
|
break;
|
|
}
|
|
break;
|
|
case 2113369584:
|
|
if (str.equals("TextInput.requestAutofill")) {
|
|
c = '\t';
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
switch (c) {
|
|
case 0:
|
|
try {
|
|
JSONObject jSONObject = (JSONObject) obj;
|
|
TextInputChannel.this.textInputMethodHandler.setPlatformViewClient(jSONObject.getInt("platformViewId"), jSONObject.optBoolean("usesVirtualDisplay", false));
|
|
result.success(null);
|
|
return;
|
|
} catch (JSONException e) {
|
|
result.error("error", e.getMessage(), null);
|
|
return;
|
|
}
|
|
case 1:
|
|
try {
|
|
TextInputChannel.this.textInputMethodHandler.setEditingState(TextEditState.fromJson((JSONObject) obj));
|
|
result.success(null);
|
|
return;
|
|
} catch (JSONException e2) {
|
|
result.error("error", e2.getMessage(), null);
|
|
return;
|
|
}
|
|
case 2:
|
|
try {
|
|
JSONArray jSONArray = (JSONArray) obj;
|
|
TextInputChannel.this.textInputMethodHandler.setClient(jSONArray.getInt(0), Configuration.fromJson(jSONArray.getJSONObject(1)));
|
|
result.success(null);
|
|
return;
|
|
} catch (NoSuchFieldException | JSONException e3) {
|
|
result.error("error", e3.getMessage(), null);
|
|
return;
|
|
}
|
|
case 3:
|
|
TextInputChannel.this.textInputMethodHandler.hide();
|
|
result.success(null);
|
|
return;
|
|
case 4:
|
|
TextInputChannel.this.textInputMethodHandler.show();
|
|
result.success(null);
|
|
return;
|
|
case 5:
|
|
try {
|
|
JSONObject jSONObject2 = (JSONObject) obj;
|
|
String string = jSONObject2.getString("action");
|
|
String string2 = jSONObject2.getString("data");
|
|
if (string2 == null || string2.isEmpty()) {
|
|
bundle = null;
|
|
} else {
|
|
bundle = new Bundle();
|
|
bundle.putString("data", string2);
|
|
}
|
|
TextInputChannel.this.textInputMethodHandler.sendAppPrivateCommand(string, bundle);
|
|
result.success(null);
|
|
return;
|
|
} catch (JSONException e4) {
|
|
result.error("error", e4.getMessage(), null);
|
|
return;
|
|
}
|
|
case 6:
|
|
try {
|
|
JSONObject jSONObject3 = (JSONObject) obj;
|
|
double d = jSONObject3.getDouble(ViewHierarchyNode.JsonKeys.WIDTH);
|
|
double d2 = jSONObject3.getDouble(ViewHierarchyNode.JsonKeys.HEIGHT);
|
|
JSONArray jSONArray2 = jSONObject3.getJSONArray("transform");
|
|
double[] dArr = new double[16];
|
|
for (int i = 0; i < 16; i++) {
|
|
dArr[i] = jSONArray2.getDouble(i);
|
|
}
|
|
TextInputChannel.this.textInputMethodHandler.setEditableSizeAndTransform(d, d2, dArr);
|
|
result.success(null);
|
|
return;
|
|
} catch (JSONException e5) {
|
|
result.error("error", e5.getMessage(), null);
|
|
return;
|
|
}
|
|
case 7:
|
|
TextInputChannel.this.textInputMethodHandler.finishAutofillContext(((Boolean) obj).booleanValue());
|
|
result.success(null);
|
|
return;
|
|
case '\b':
|
|
TextInputChannel.this.textInputMethodHandler.clearClient();
|
|
result.success(null);
|
|
return;
|
|
case '\t':
|
|
TextInputChannel.this.textInputMethodHandler.requestAutofill();
|
|
result.success(null);
|
|
return;
|
|
default:
|
|
result.notImplemented();
|
|
return;
|
|
}
|
|
}
|
|
};
|
|
this.parsingMethodHandler = methodCallHandler;
|
|
MethodChannel methodChannel = new MethodChannel(dartExecutor, "flutter/textinput", JSONMethodCodec.INSTANCE);
|
|
this.channel = methodChannel;
|
|
methodChannel.setMethodCallHandler(methodCallHandler);
|
|
}
|
|
|
|
public void requestExistingInputState() {
|
|
this.channel.invokeMethod("TextInputClient.requestExistingInputState", null);
|
|
}
|
|
|
|
private static HashMap<Object, Object> createEditingStateJSON(String str, int i, int i2, int i3, int i4) {
|
|
HashMap<Object, Object> hashMap = new HashMap<>();
|
|
hashMap.put("text", str);
|
|
hashMap.put("selectionBase", Integer.valueOf(i));
|
|
hashMap.put("selectionExtent", Integer.valueOf(i2));
|
|
hashMap.put("composingBase", Integer.valueOf(i3));
|
|
hashMap.put("composingExtent", Integer.valueOf(i4));
|
|
return hashMap;
|
|
}
|
|
|
|
private static HashMap<Object, Object> createEditingDeltaJSON(ArrayList<TextEditingDelta> arrayList) {
|
|
HashMap<Object, Object> hashMap = new HashMap<>();
|
|
JSONArray jSONArray = new JSONArray();
|
|
Iterator<TextEditingDelta> it = arrayList.iterator();
|
|
while (it.hasNext()) {
|
|
jSONArray.put(it.next().toJSON());
|
|
}
|
|
hashMap.put("deltas", jSONArray);
|
|
return hashMap;
|
|
}
|
|
|
|
public void updateEditingState(int i, String str, int i2, int i3, int i4, int i5) {
|
|
Log.v(TAG, "Sending message to update editing state: \nText: " + str + "\nSelection start: " + i2 + "\nSelection end: " + i3 + "\nComposing start: " + i4 + "\nComposing end: " + i5);
|
|
this.channel.invokeMethod("TextInputClient.updateEditingState", Arrays.asList(Integer.valueOf(i), createEditingStateJSON(str, i2, i3, i4, i5)));
|
|
}
|
|
|
|
public void updateEditingStateWithDeltas(int i, ArrayList<TextEditingDelta> arrayList) {
|
|
Log.v(TAG, "Sending message to update editing state with deltas: \nNumber of deltas: " + arrayList.size());
|
|
this.channel.invokeMethod("TextInputClient.updateEditingStateWithDeltas", Arrays.asList(Integer.valueOf(i), createEditingDeltaJSON(arrayList)));
|
|
}
|
|
|
|
public void updateEditingStateWithTag(int i, HashMap<String, TextEditState> hashMap) {
|
|
Log.v(TAG, "Sending message to update editing state for " + String.valueOf(hashMap.size()) + " field(s).");
|
|
HashMap hashMap2 = new HashMap();
|
|
for (Map.Entry<String, TextEditState> entry : hashMap.entrySet()) {
|
|
TextEditState value = entry.getValue();
|
|
hashMap2.put(entry.getKey(), createEditingStateJSON(value.text, value.selectionStart, value.selectionEnd, -1, -1));
|
|
}
|
|
this.channel.invokeMethod("TextInputClient.updateEditingStateWithTag", Arrays.asList(Integer.valueOf(i), hashMap2));
|
|
}
|
|
|
|
public void newline(int i) {
|
|
Log.v(TAG, "Sending 'newline' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.newline"));
|
|
}
|
|
|
|
public void go(int i) {
|
|
Log.v(TAG, "Sending 'go' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.go"));
|
|
}
|
|
|
|
public void search(int i) {
|
|
Log.v(TAG, "Sending 'search' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.search"));
|
|
}
|
|
|
|
public void send(int i) {
|
|
Log.v(TAG, "Sending 'send' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.send"));
|
|
}
|
|
|
|
public void done(int i) {
|
|
Log.v(TAG, "Sending 'done' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.done"));
|
|
}
|
|
|
|
public void next(int i) {
|
|
Log.v(TAG, "Sending 'next' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.next"));
|
|
}
|
|
|
|
public void previous(int i) {
|
|
Log.v(TAG, "Sending 'previous' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.previous"));
|
|
}
|
|
|
|
public void unspecifiedAction(int i) {
|
|
Log.v(TAG, "Sending 'unspecified' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.unspecified"));
|
|
}
|
|
|
|
public void commitContent(int i, Map<String, Object> map) {
|
|
Log.v(TAG, "Sending 'commitContent' message.");
|
|
this.channel.invokeMethod("TextInputClient.performAction", Arrays.asList(Integer.valueOf(i), "TextInputAction.commitContent", map));
|
|
}
|
|
|
|
public void performPrivateCommand(int i, String str, Bundle bundle) {
|
|
HashMap hashMap = new HashMap();
|
|
hashMap.put("action", str);
|
|
if (bundle != null) {
|
|
HashMap hashMap2 = new HashMap();
|
|
for (String str2 : bundle.keySet()) {
|
|
Object obj = bundle.get(str2);
|
|
if (obj instanceof byte[]) {
|
|
hashMap2.put(str2, bundle.getByteArray(str2));
|
|
} else if (obj instanceof Byte) {
|
|
hashMap2.put(str2, Byte.valueOf(bundle.getByte(str2)));
|
|
} else if (obj instanceof char[]) {
|
|
hashMap2.put(str2, bundle.getCharArray(str2));
|
|
} else if (obj instanceof Character) {
|
|
hashMap2.put(str2, Character.valueOf(bundle.getChar(str2)));
|
|
} else if (obj instanceof CharSequence[]) {
|
|
hashMap2.put(str2, bundle.getCharSequenceArray(str2));
|
|
} else if (obj instanceof CharSequence) {
|
|
hashMap2.put(str2, bundle.getCharSequence(str2));
|
|
} else if (obj instanceof float[]) {
|
|
hashMap2.put(str2, bundle.getFloatArray(str2));
|
|
} else if (obj instanceof Float) {
|
|
hashMap2.put(str2, Float.valueOf(bundle.getFloat(str2)));
|
|
}
|
|
}
|
|
hashMap.put("data", hashMap2);
|
|
}
|
|
this.channel.invokeMethod("TextInputClient.performPrivateCommand", Arrays.asList(Integer.valueOf(i), hashMap));
|
|
}
|
|
|
|
public void onConnectionClosed(int i) {
|
|
Log.v(TAG, "Sending 'onConnectionClosed' message.");
|
|
this.channel.invokeMethod("TextInputClient.onConnectionClosed", Arrays.asList(Integer.valueOf(i), "TextInputClient.onConnectionClosed"));
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public static class Configuration {
|
|
public final String actionLabel;
|
|
public final boolean autocorrect;
|
|
public final Autofill autofill;
|
|
public final String[] contentCommitMimeTypes;
|
|
public final boolean enableDeltaModel;
|
|
public final boolean enableIMEPersonalizedLearning;
|
|
public final boolean enableSuggestions;
|
|
public final Configuration[] fields;
|
|
public final Integer inputAction;
|
|
public final InputType inputType;
|
|
public final boolean obscureText;
|
|
public final TextCapitalization textCapitalization;
|
|
|
|
public static Configuration fromJson(JSONObject jSONObject) throws JSONException, NoSuchFieldException {
|
|
Configuration[] configurationArr;
|
|
String string = jSONObject.getString("inputAction");
|
|
if (string == null) {
|
|
throw new JSONException("Configuration JSON missing 'inputAction' property.");
|
|
}
|
|
if (jSONObject.isNull("fields")) {
|
|
configurationArr = null;
|
|
} else {
|
|
JSONArray jSONArray = jSONObject.getJSONArray("fields");
|
|
int length = jSONArray.length();
|
|
Configuration[] configurationArr2 = new Configuration[length];
|
|
for (int i = 0; i < length; i++) {
|
|
configurationArr2[i] = fromJson(jSONArray.getJSONObject(i));
|
|
}
|
|
configurationArr = configurationArr2;
|
|
}
|
|
Integer inputActionFromTextInputAction = inputActionFromTextInputAction(string);
|
|
ArrayList arrayList = new ArrayList();
|
|
JSONArray jSONArray2 = jSONObject.isNull("contentCommitMimeTypes") ? null : jSONObject.getJSONArray("contentCommitMimeTypes");
|
|
if (jSONArray2 != null) {
|
|
for (int i2 = 0; i2 < jSONArray2.length(); i2++) {
|
|
arrayList.add(jSONArray2.optString(i2));
|
|
}
|
|
}
|
|
return new Configuration(jSONObject.optBoolean("obscureText"), jSONObject.optBoolean("autocorrect", true), jSONObject.optBoolean("enableSuggestions"), jSONObject.optBoolean("enableIMEPersonalizedLearning"), jSONObject.optBoolean("enableDeltaModel"), TextCapitalization.fromValue(jSONObject.getString("textCapitalization")), InputType.fromJson(jSONObject.getJSONObject("inputType")), inputActionFromTextInputAction, jSONObject.isNull("actionLabel") ? null : jSONObject.getString("actionLabel"), jSONObject.isNull("autofill") ? null : Autofill.fromJson(jSONObject.getJSONObject("autofill")), (String[]) arrayList.toArray(new String[arrayList.size()]), configurationArr);
|
|
}
|
|
|
|
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
|
/* JADX WARN: Code restructure failed: missing block: B:44:0x0073, code lost:
|
|
|
|
if (r12.equals("TextInputAction.done") == false) goto L4;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private static java.lang.Integer inputActionFromTextInputAction(java.lang.String r12) {
|
|
/*
|
|
r12.hashCode()
|
|
int r0 = r12.hashCode()
|
|
r1 = 7
|
|
r2 = 6
|
|
r3 = 5
|
|
r4 = 4
|
|
r5 = 3
|
|
r6 = 2
|
|
r7 = 1
|
|
java.lang.Integer r8 = java.lang.Integer.valueOf(r7)
|
|
r9 = 0
|
|
java.lang.Integer r10 = java.lang.Integer.valueOf(r9)
|
|
r11 = -1
|
|
switch(r0) {
|
|
case -810971940: goto L76;
|
|
case -737377923: goto L6d;
|
|
case -737089298: goto L62;
|
|
case -737080013: goto L57;
|
|
case -736940669: goto L4c;
|
|
case 469250275: goto L41;
|
|
case 1241689507: goto L36;
|
|
case 1539450297: goto L2b;
|
|
case 2110497650: goto L1e;
|
|
default: goto L1b;
|
|
}
|
|
L1b:
|
|
r7 = r11
|
|
goto L80
|
|
L1e:
|
|
java.lang.String r0 = "TextInputAction.previous"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L27
|
|
goto L1b
|
|
L27:
|
|
r7 = 8
|
|
goto L80
|
|
L2b:
|
|
java.lang.String r0 = "TextInputAction.newline"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L34
|
|
goto L1b
|
|
L34:
|
|
r7 = r1
|
|
goto L80
|
|
L36:
|
|
java.lang.String r0 = "TextInputAction.go"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L3f
|
|
goto L1b
|
|
L3f:
|
|
r7 = r2
|
|
goto L80
|
|
L41:
|
|
java.lang.String r0 = "TextInputAction.search"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L4a
|
|
goto L1b
|
|
L4a:
|
|
r7 = r3
|
|
goto L80
|
|
L4c:
|
|
java.lang.String r0 = "TextInputAction.send"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L55
|
|
goto L1b
|
|
L55:
|
|
r7 = r4
|
|
goto L80
|
|
L57:
|
|
java.lang.String r0 = "TextInputAction.none"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L60
|
|
goto L1b
|
|
L60:
|
|
r7 = r5
|
|
goto L80
|
|
L62:
|
|
java.lang.String r0 = "TextInputAction.next"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L6b
|
|
goto L1b
|
|
L6b:
|
|
r7 = r6
|
|
goto L80
|
|
L6d:
|
|
java.lang.String r0 = "TextInputAction.done"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L80
|
|
goto L1b
|
|
L76:
|
|
java.lang.String r0 = "TextInputAction.unspecified"
|
|
boolean r12 = r12.equals(r0)
|
|
if (r12 != 0) goto L7f
|
|
goto L1b
|
|
L7f:
|
|
r7 = r9
|
|
L80:
|
|
switch(r7) {
|
|
case 0: goto La4;
|
|
case 1: goto L9f;
|
|
case 2: goto L9a;
|
|
case 3: goto L99;
|
|
case 4: goto L94;
|
|
case 5: goto L8f;
|
|
case 6: goto L8a;
|
|
case 7: goto L89;
|
|
case 8: goto L84;
|
|
default: goto L83;
|
|
}
|
|
L83:
|
|
return r10
|
|
L84:
|
|
java.lang.Integer r12 = java.lang.Integer.valueOf(r1)
|
|
return r12
|
|
L89:
|
|
return r8
|
|
L8a:
|
|
java.lang.Integer r12 = java.lang.Integer.valueOf(r6)
|
|
return r12
|
|
L8f:
|
|
java.lang.Integer r12 = java.lang.Integer.valueOf(r5)
|
|
return r12
|
|
L94:
|
|
java.lang.Integer r12 = java.lang.Integer.valueOf(r4)
|
|
return r12
|
|
L99:
|
|
return r8
|
|
L9a:
|
|
java.lang.Integer r12 = java.lang.Integer.valueOf(r3)
|
|
return r12
|
|
L9f:
|
|
java.lang.Integer r12 = java.lang.Integer.valueOf(r2)
|
|
return r12
|
|
La4:
|
|
return r10
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: io.flutter.embedding.engine.systemchannels.TextInputChannel.Configuration.inputActionFromTextInputAction(java.lang.String):java.lang.Integer");
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public static class Autofill {
|
|
public final TextEditState editState;
|
|
public final String hintText;
|
|
public final String[] hints;
|
|
public final String uniqueIdentifier;
|
|
|
|
public static Autofill fromJson(JSONObject jSONObject) throws JSONException, NoSuchFieldException {
|
|
String string = jSONObject.getString("uniqueIdentifier");
|
|
JSONArray jSONArray = jSONObject.getJSONArray("hints");
|
|
String string2 = jSONObject.isNull("hintText") ? null : jSONObject.getString("hintText");
|
|
JSONObject jSONObject2 = jSONObject.getJSONObject("editingValue");
|
|
String[] strArr = new String[jSONArray.length()];
|
|
for (int i = 0; i < jSONArray.length(); i++) {
|
|
strArr[i] = translateAutofillHint(jSONArray.getString(i));
|
|
}
|
|
return new Autofill(string, strArr, string2, TextEditState.fromJson(jSONObject2));
|
|
}
|
|
|
|
private static String translateAutofillHint(String str) {
|
|
str.hashCode();
|
|
char c = 65535;
|
|
switch (str.hashCode()) {
|
|
case -2058889126:
|
|
if (str.equals("birthdayYear")) {
|
|
c = 0;
|
|
break;
|
|
}
|
|
break;
|
|
case -1917283616:
|
|
if (str.equals("oneTimeCode")) {
|
|
c = 1;
|
|
break;
|
|
}
|
|
break;
|
|
case -1844815832:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH)) {
|
|
c = 2;
|
|
break;
|
|
}
|
|
break;
|
|
case -1825589953:
|
|
if (str.equals("telephoneNumberNational")) {
|
|
c = 3;
|
|
break;
|
|
}
|
|
break;
|
|
case -1821235109:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_NEW_PASSWORD)) {
|
|
c = 4;
|
|
break;
|
|
}
|
|
break;
|
|
case -1757573738:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE)) {
|
|
c = 5;
|
|
break;
|
|
}
|
|
break;
|
|
case -1682373820:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY)) {
|
|
c = 6;
|
|
break;
|
|
}
|
|
break;
|
|
case -1658955742:
|
|
if (str.equals("fullStreetAddress")) {
|
|
c = 7;
|
|
break;
|
|
}
|
|
break;
|
|
case -1567118045:
|
|
if (str.equals("telephoneNumberDevice")) {
|
|
c = '\b';
|
|
break;
|
|
}
|
|
break;
|
|
case -1476752575:
|
|
if (str.equals("countryName")) {
|
|
c = '\t';
|
|
break;
|
|
}
|
|
break;
|
|
case -1413737489:
|
|
if (str.equals("middleInitial")) {
|
|
c = '\n';
|
|
break;
|
|
}
|
|
break;
|
|
case -1377792129:
|
|
if (str.equals("addressCity")) {
|
|
c = 11;
|
|
break;
|
|
}
|
|
break;
|
|
case -1249512767:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_GENDER)) {
|
|
c = '\f';
|
|
break;
|
|
}
|
|
break;
|
|
case -1186060294:
|
|
if (str.equals("postalAddressExtendedPostalCode")) {
|
|
c = '\r';
|
|
break;
|
|
}
|
|
break;
|
|
case -1151034798:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_CREDIT_CARD_NUMBER)) {
|
|
c = 14;
|
|
break;
|
|
}
|
|
break;
|
|
case -835992323:
|
|
if (str.equals("namePrefix")) {
|
|
c = 15;
|
|
break;
|
|
}
|
|
break;
|
|
case -818219584:
|
|
if (str.equals("middleName")) {
|
|
c = 16;
|
|
break;
|
|
}
|
|
break;
|
|
case -747304516:
|
|
if (str.equals("nameSuffix")) {
|
|
c = 17;
|
|
break;
|
|
}
|
|
break;
|
|
case -613980922:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE)) {
|
|
c = 18;
|
|
break;
|
|
}
|
|
break;
|
|
case -613352043:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR)) {
|
|
c = 19;
|
|
break;
|
|
}
|
|
break;
|
|
case -549230602:
|
|
if (str.equals("telephoneNumberCountryCode")) {
|
|
c = 20;
|
|
break;
|
|
}
|
|
break;
|
|
case -265713450:
|
|
if (str.equals("username")) {
|
|
c = 21;
|
|
break;
|
|
}
|
|
break;
|
|
case 3373707:
|
|
if (str.equals("name")) {
|
|
c = 22;
|
|
break;
|
|
}
|
|
break;
|
|
case 96619420:
|
|
if (str.equals("email")) {
|
|
c = 23;
|
|
break;
|
|
}
|
|
break;
|
|
case 253202685:
|
|
if (str.equals("addressState")) {
|
|
c = 24;
|
|
break;
|
|
}
|
|
break;
|
|
case 588174851:
|
|
if (str.equals("birthdayMonth")) {
|
|
c = 25;
|
|
break;
|
|
}
|
|
break;
|
|
case 798554127:
|
|
if (str.equals("familyName")) {
|
|
c = JSONLexer.EOI;
|
|
break;
|
|
}
|
|
break;
|
|
case 892233837:
|
|
if (str.equals("telephoneNumber")) {
|
|
c = 27;
|
|
break;
|
|
}
|
|
break;
|
|
case 991032982:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_NEW_USERNAME)) {
|
|
c = 28;
|
|
break;
|
|
}
|
|
break;
|
|
case 1069376125:
|
|
if (str.equals("birthday")) {
|
|
c = 29;
|
|
break;
|
|
}
|
|
break;
|
|
case 1216985755:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_PASSWORD)) {
|
|
c = 30;
|
|
break;
|
|
}
|
|
break;
|
|
case 1469046696:
|
|
if (str.equals("givenName")) {
|
|
c = 31;
|
|
break;
|
|
}
|
|
break;
|
|
case 1662667945:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS)) {
|
|
c = ' ';
|
|
break;
|
|
}
|
|
break;
|
|
case 1921869058:
|
|
if (str.equals("postalAddressExtended")) {
|
|
c = '!';
|
|
break;
|
|
}
|
|
break;
|
|
case 2011152728:
|
|
if (str.equals(HintConstants.AUTOFILL_HINT_POSTAL_CODE)) {
|
|
c = Typography.quote;
|
|
break;
|
|
}
|
|
break;
|
|
case 2011773919:
|
|
if (str.equals("birthdayDay")) {
|
|
c = '#';
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
switch (c) {
|
|
case 0:
|
|
return HintConstants.AUTOFILL_HINT_BIRTH_DATE_YEAR;
|
|
case 1:
|
|
return HintConstants.AUTOFILL_HINT_SMS_OTP;
|
|
case 2:
|
|
return HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH;
|
|
case 3:
|
|
return HintConstants.AUTOFILL_HINT_PHONE_NATIONAL;
|
|
case 4:
|
|
return HintConstants.AUTOFILL_HINT_NEW_PASSWORD;
|
|
case 5:
|
|
return HintConstants.AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE;
|
|
case 6:
|
|
return HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY;
|
|
case 7:
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS_STREET_ADDRESS;
|
|
case '\b':
|
|
return HintConstants.AUTOFILL_HINT_PHONE_NUMBER_DEVICE;
|
|
case '\t':
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS_COUNTRY;
|
|
case '\n':
|
|
return HintConstants.AUTOFILL_HINT_PERSON_NAME_MIDDLE_INITIAL;
|
|
case 11:
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS_LOCALITY;
|
|
case '\f':
|
|
return HintConstants.AUTOFILL_HINT_GENDER;
|
|
case '\r':
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_POSTAL_CODE;
|
|
case 14:
|
|
return HintConstants.AUTOFILL_HINT_CREDIT_CARD_NUMBER;
|
|
case 15:
|
|
return HintConstants.AUTOFILL_HINT_PERSON_NAME_PREFIX;
|
|
case 16:
|
|
return HintConstants.AUTOFILL_HINT_PERSON_NAME_MIDDLE;
|
|
case 17:
|
|
return HintConstants.AUTOFILL_HINT_PERSON_NAME_SUFFIX;
|
|
case 18:
|
|
return HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE;
|
|
case 19:
|
|
return HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR;
|
|
case 20:
|
|
return HintConstants.AUTOFILL_HINT_PHONE_COUNTRY_CODE;
|
|
case 21:
|
|
return "username";
|
|
case 22:
|
|
return HintConstants.AUTOFILL_HINT_PERSON_NAME;
|
|
case 23:
|
|
return HintConstants.AUTOFILL_HINT_EMAIL_ADDRESS;
|
|
case 24:
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS_REGION;
|
|
case 25:
|
|
return HintConstants.AUTOFILL_HINT_BIRTH_DATE_MONTH;
|
|
case 26:
|
|
return HintConstants.AUTOFILL_HINT_PERSON_NAME_FAMILY;
|
|
case 27:
|
|
return HintConstants.AUTOFILL_HINT_PHONE_NUMBER;
|
|
case 28:
|
|
return HintConstants.AUTOFILL_HINT_NEW_USERNAME;
|
|
case 29:
|
|
return HintConstants.AUTOFILL_HINT_BIRTH_DATE_FULL;
|
|
case 30:
|
|
return HintConstants.AUTOFILL_HINT_PASSWORD;
|
|
case 31:
|
|
return HintConstants.AUTOFILL_HINT_PERSON_NAME_GIVEN;
|
|
case ' ':
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS;
|
|
case '!':
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_ADDRESS;
|
|
case '\"':
|
|
return HintConstants.AUTOFILL_HINT_POSTAL_CODE;
|
|
case '#':
|
|
return HintConstants.AUTOFILL_HINT_BIRTH_DATE_DAY;
|
|
default:
|
|
return str;
|
|
}
|
|
}
|
|
|
|
public Autofill(String str, String[] strArr, String str2, TextEditState textEditState) {
|
|
this.uniqueIdentifier = str;
|
|
this.hints = strArr;
|
|
this.hintText = str2;
|
|
this.editState = textEditState;
|
|
}
|
|
}
|
|
|
|
public Configuration(boolean z, boolean z2, boolean z3, boolean z4, boolean z5, TextCapitalization textCapitalization, InputType inputType, Integer num, String str, Autofill autofill, String[] strArr, Configuration[] configurationArr) {
|
|
this.obscureText = z;
|
|
this.autocorrect = z2;
|
|
this.enableSuggestions = z3;
|
|
this.enableIMEPersonalizedLearning = z4;
|
|
this.enableDeltaModel = z5;
|
|
this.textCapitalization = textCapitalization;
|
|
this.inputType = inputType;
|
|
this.inputAction = num;
|
|
this.actionLabel = str;
|
|
this.autofill = autofill;
|
|
this.contentCommitMimeTypes = strArr;
|
|
this.fields = configurationArr;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public static class InputType {
|
|
public final boolean isDecimal;
|
|
public final boolean isSigned;
|
|
public final TextInputType type;
|
|
|
|
public static InputType fromJson(JSONObject jSONObject) throws JSONException, NoSuchFieldException {
|
|
return new InputType(TextInputType.fromValue(jSONObject.getString("name")), jSONObject.optBoolean("signed", false), jSONObject.optBoolean("decimal", false));
|
|
}
|
|
|
|
public InputType(TextInputType textInputType, boolean z, boolean z2) {
|
|
this.type = textInputType;
|
|
this.isSigned = z;
|
|
this.isDecimal = z2;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public enum TextInputType {
|
|
TEXT("TextInputType.text"),
|
|
DATETIME("TextInputType.datetime"),
|
|
NAME("TextInputType.name"),
|
|
POSTAL_ADDRESS("TextInputType.address"),
|
|
NUMBER("TextInputType.number"),
|
|
PHONE("TextInputType.phone"),
|
|
MULTILINE("TextInputType.multiline"),
|
|
EMAIL_ADDRESS("TextInputType.emailAddress"),
|
|
URL("TextInputType.url"),
|
|
VISIBLE_PASSWORD("TextInputType.visiblePassword"),
|
|
NONE("TextInputType.none");
|
|
|
|
private final String encodedName;
|
|
|
|
static TextInputType fromValue(String str) throws NoSuchFieldException {
|
|
for (TextInputType textInputType : values()) {
|
|
if (textInputType.encodedName.equals(str)) {
|
|
return textInputType;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such TextInputType: " + str);
|
|
}
|
|
|
|
TextInputType(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public enum TextCapitalization {
|
|
CHARACTERS("TextCapitalization.characters"),
|
|
WORDS("TextCapitalization.words"),
|
|
SENTENCES("TextCapitalization.sentences"),
|
|
NONE("TextCapitalization.none");
|
|
|
|
private final String encodedName;
|
|
|
|
static TextCapitalization fromValue(String str) throws NoSuchFieldException {
|
|
for (TextCapitalization textCapitalization : values()) {
|
|
if (textCapitalization.encodedName.equals(str)) {
|
|
return textCapitalization;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such TextCapitalization: " + str);
|
|
}
|
|
|
|
TextCapitalization(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes3.dex */
|
|
public static class TextEditState {
|
|
public final int composingEnd;
|
|
public final int composingStart;
|
|
public final int selectionEnd;
|
|
public final int selectionStart;
|
|
public final String text;
|
|
|
|
public boolean hasComposing() {
|
|
int i = this.composingStart;
|
|
return i >= 0 && this.composingEnd > i;
|
|
}
|
|
|
|
public boolean hasSelection() {
|
|
return this.selectionStart >= 0;
|
|
}
|
|
|
|
public static TextEditState fromJson(JSONObject jSONObject) throws JSONException {
|
|
return new TextEditState(jSONObject.getString("text"), jSONObject.getInt("selectionBase"), jSONObject.getInt("selectionExtent"), jSONObject.getInt("composingBase"), jSONObject.getInt("composingExtent"));
|
|
}
|
|
|
|
public TextEditState(String str, int i, int i2, int i3, int i4) throws IndexOutOfBoundsException {
|
|
if (!(i == -1 && i2 == -1) && (i < 0 || i2 < 0)) {
|
|
throw new IndexOutOfBoundsException("invalid selection: (" + String.valueOf(i) + ", " + String.valueOf(i2) + ")");
|
|
}
|
|
if ((i3 != -1 || i4 != -1) && (i3 < 0 || i3 > i4)) {
|
|
throw new IndexOutOfBoundsException("invalid composing range: (" + String.valueOf(i3) + ", " + String.valueOf(i4) + ")");
|
|
}
|
|
if (i4 > str.length()) {
|
|
throw new IndexOutOfBoundsException("invalid composing start: " + String.valueOf(i3));
|
|
}
|
|
if (i > str.length()) {
|
|
throw new IndexOutOfBoundsException("invalid selection start: " + String.valueOf(i));
|
|
}
|
|
if (i2 > str.length()) {
|
|
throw new IndexOutOfBoundsException("invalid selection end: " + String.valueOf(i2));
|
|
}
|
|
this.text = str;
|
|
this.selectionStart = i;
|
|
this.selectionEnd = i2;
|
|
this.composingStart = i3;
|
|
this.composingEnd = i4;
|
|
}
|
|
}
|
|
}
|