483 lines
20 KiB
Java
483 lines
20 KiB
Java
package io.flutter.embedding.engine.systemchannels;
|
|
|
|
import io.flutter.Log;
|
|
import io.flutter.embedding.engine.dart.DartExecutor;
|
|
import io.flutter.plugin.common.JSONMethodCodec;
|
|
import io.flutter.plugin.common.MethodChannel;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class PlatformChannel {
|
|
private static final String TAG = "PlatformChannel";
|
|
public final MethodChannel channel;
|
|
final MethodChannel.MethodCallHandler parsingMethodCallHandler;
|
|
private PlatformMessageHandler platformMessageHandler;
|
|
|
|
/* loaded from: classes.dex */
|
|
public interface PlatformMessageHandler {
|
|
boolean clipboardHasStrings();
|
|
|
|
CharSequence getClipboardData(ClipboardContentFormat clipboardContentFormat);
|
|
|
|
void playSystemSound(SoundType soundType);
|
|
|
|
void popSystemNavigator();
|
|
|
|
void restoreSystemUiOverlays();
|
|
|
|
void setApplicationSwitcherDescription(AppSwitcherDescription appSwitcherDescription);
|
|
|
|
void setClipboardData(String str);
|
|
|
|
void setPreferredOrientations(int i);
|
|
|
|
void setSystemUiChangeListener();
|
|
|
|
void setSystemUiOverlayStyle(SystemChromeStyle systemChromeStyle);
|
|
|
|
void showSystemOverlays(List<SystemUiOverlay> list);
|
|
|
|
void showSystemUiMode(SystemUiMode systemUiMode);
|
|
|
|
void vibrateHapticFeedback(HapticFeedbackType hapticFeedbackType);
|
|
}
|
|
|
|
public void setPlatformMessageHandler(PlatformMessageHandler platformMessageHandler) {
|
|
this.platformMessageHandler = platformMessageHandler;
|
|
}
|
|
|
|
public PlatformChannel(DartExecutor dartExecutor) {
|
|
MethodChannel.MethodCallHandler methodCallHandler = new MethodChannel.MethodCallHandler(this) { // from class: io.flutter.embedding.engine.systemchannels.PlatformChannel.1
|
|
final PlatformChannel this$0;
|
|
|
|
{
|
|
this.this$0 = this;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:24:0x011a A[Catch: JSONException -> 0x0233, TryCatch #7 {JSONException -> 0x0233, blocks: (B:7:0x0028, B:8:0x002c, B:13:0x00c1, B:15:0x00c6, B:17:0x00df, B:19:0x00f3, B:29:0x00f7, B:22:0x010e, B:24:0x011a, B:26:0x0127, B:31:0x00fc, B:32:0x012c, B:34:0x015c, B:36:0x016a, B:46:0x01fb, B:39:0x0217, B:85:0x0153, B:64:0x0191, B:78:0x01b3, B:57:0x01d3, B:71:0x01f3, B:50:0x020f, B:43:0x022b, B:87:0x0031, B:90:0x003c, B:93:0x0047, B:96:0x0053, B:99:0x005e, B:102:0x0068, B:105:0x0073, B:108:0x007d, B:111:0x0087, B:114:0x0091, B:117:0x009b, B:120:0x00a5, B:123:0x00b0, B:53:0x01bc), top: B:6:0x0028, inners: #0, #1, #4, #8 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:26:0x0127 A[Catch: JSONException -> 0x0233, TryCatch #7 {JSONException -> 0x0233, blocks: (B:7:0x0028, B:8:0x002c, B:13:0x00c1, B:15:0x00c6, B:17:0x00df, B:19:0x00f3, B:29:0x00f7, B:22:0x010e, B:24:0x011a, B:26:0x0127, B:31:0x00fc, B:32:0x012c, B:34:0x015c, B:36:0x016a, B:46:0x01fb, B:39:0x0217, B:85:0x0153, B:64:0x0191, B:78:0x01b3, B:57:0x01d3, B:71:0x01f3, B:50:0x020f, B:43:0x022b, B:87:0x0031, B:90:0x003c, B:93:0x0047, B:96:0x0053, B:99:0x005e, B:102:0x0068, B:105:0x0073, B:108:0x007d, B:111:0x0087, B:114:0x0091, B:117:0x009b, B:120:0x00a5, B:123:0x00b0, B:53:0x01bc), top: B:6:0x0028, inners: #0, #1, #4, #8 }] */
|
|
@Override // io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public void onMethodCall(io.flutter.plugin.common.MethodCall r6, io.flutter.plugin.common.MethodChannel.Result r7) {
|
|
/*
|
|
Method dump skipped, instructions count: 670
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: io.flutter.embedding.engine.systemchannels.PlatformChannel.AnonymousClass1.onMethodCall(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result):void");
|
|
}
|
|
};
|
|
this.parsingMethodCallHandler = methodCallHandler;
|
|
MethodChannel methodChannel = new MethodChannel(dartExecutor, "flutter/platform", JSONMethodCodec.INSTANCE);
|
|
this.channel = methodChannel;
|
|
methodChannel.setMethodCallHandler(methodCallHandler);
|
|
}
|
|
|
|
public void systemChromeChanged(boolean z) {
|
|
Log.v(TAG, "Sending 'systemUIChange' message.");
|
|
this.channel.invokeMethod("SystemChrome.systemUIChange", Arrays.asList(Boolean.valueOf(z)));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* JADX WARN: Failed to find 'out' block for switch in B:22:0x003e. Please report as an issue. */
|
|
/* JADX WARN: Removed duplicated region for block: B:35:0x0057 A[RETURN] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public int decodeOrientations(org.json.JSONArray r10) throws org.json.JSONException, java.lang.NoSuchFieldException {
|
|
/*
|
|
r9 = this;
|
|
r0 = 0
|
|
r1 = r0
|
|
r2 = r1
|
|
r3 = r2
|
|
L4:
|
|
int r4 = r10.length()
|
|
r5 = 4
|
|
r6 = 2
|
|
r7 = 1
|
|
if (r1 >= r4) goto L38
|
|
java.lang.String r4 = r10.getString(r1)
|
|
io.flutter.embedding.engine.systemchannels.PlatformChannel$DeviceOrientation r4 = io.flutter.embedding.engine.systemchannels.PlatformChannel.DeviceOrientation.fromValue(r4)
|
|
int[] r8 = io.flutter.embedding.engine.systemchannels.PlatformChannel.AnonymousClass2.$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$DeviceOrientation
|
|
int r4 = r4.ordinal()
|
|
r4 = r8[r4]
|
|
if (r4 == r7) goto L30
|
|
if (r4 == r6) goto L2d
|
|
r6 = 3
|
|
if (r4 == r6) goto L2a
|
|
if (r4 == r5) goto L27
|
|
goto L32
|
|
L27:
|
|
r2 = r2 | 8
|
|
goto L32
|
|
L2a:
|
|
r2 = r2 | 2
|
|
goto L32
|
|
L2d:
|
|
r2 = r2 | 4
|
|
goto L32
|
|
L30:
|
|
r2 = r2 | 1
|
|
L32:
|
|
if (r3 != 0) goto L35
|
|
r3 = r2
|
|
L35:
|
|
int r1 = r1 + 1
|
|
goto L4
|
|
L38:
|
|
if (r2 == 0) goto L58
|
|
r10 = 9
|
|
r1 = 8
|
|
switch(r2) {
|
|
case 2: goto L56;
|
|
case 3: goto L4d;
|
|
case 4: goto L4c;
|
|
case 5: goto L4a;
|
|
case 6: goto L4d;
|
|
case 7: goto L4d;
|
|
case 8: goto L49;
|
|
case 9: goto L4d;
|
|
case 10: goto L46;
|
|
case 11: goto L45;
|
|
case 12: goto L4d;
|
|
case 13: goto L4d;
|
|
case 14: goto L4d;
|
|
case 15: goto L42;
|
|
default: goto L41;
|
|
}
|
|
L41:
|
|
goto L57
|
|
L42:
|
|
r10 = 13
|
|
return r10
|
|
L45:
|
|
return r6
|
|
L46:
|
|
r10 = 11
|
|
return r10
|
|
L49:
|
|
return r1
|
|
L4a:
|
|
r10 = 12
|
|
L4c:
|
|
return r10
|
|
L4d:
|
|
if (r3 == r6) goto L56
|
|
if (r3 == r5) goto L55
|
|
if (r3 == r1) goto L54
|
|
goto L57
|
|
L54:
|
|
return r1
|
|
L55:
|
|
return r10
|
|
L56:
|
|
return r0
|
|
L57:
|
|
return r7
|
|
L58:
|
|
r10 = -1
|
|
return r10
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: io.flutter.embedding.engine.systemchannels.PlatformChannel.decodeOrientations(org.json.JSONArray):int");
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public AppSwitcherDescription decodeAppSwitcherDescription(JSONObject jSONObject) throws JSONException {
|
|
int i = jSONObject.getInt("primaryColor");
|
|
if (i != 0) {
|
|
i |= -16777216;
|
|
}
|
|
return new AppSwitcherDescription(i, jSONObject.getString("label"));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public List<SystemUiOverlay> decodeSystemUiOverlays(JSONArray jSONArray) throws JSONException, NoSuchFieldException {
|
|
ArrayList arrayList = new ArrayList();
|
|
for (int i = 0; i < jSONArray.length(); i++) {
|
|
int i2 = AnonymousClass2.$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiOverlay[SystemUiOverlay.fromValue(jSONArray.getString(i)).ordinal()];
|
|
if (i2 == 1) {
|
|
arrayList.add(SystemUiOverlay.TOP_OVERLAYS);
|
|
} else if (i2 == 2) {
|
|
arrayList.add(SystemUiOverlay.BOTTOM_OVERLAYS);
|
|
}
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: io.flutter.embedding.engine.systemchannels.PlatformChannel$2, reason: invalid class name */
|
|
/* loaded from: classes.dex */
|
|
public static /* synthetic */ class AnonymousClass2 {
|
|
static final int[] $SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$DeviceOrientation;
|
|
static final int[] $SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiMode;
|
|
static final int[] $SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiOverlay;
|
|
|
|
static {
|
|
int[] iArr = new int[SystemUiMode.values().length];
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiMode = iArr;
|
|
try {
|
|
iArr[SystemUiMode.LEAN_BACK.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiMode[SystemUiMode.IMMERSIVE.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiMode[SystemUiMode.IMMERSIVE_STICKY.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiMode[SystemUiMode.EDGE_TO_EDGE.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
int[] iArr2 = new int[SystemUiOverlay.values().length];
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiOverlay = iArr2;
|
|
try {
|
|
iArr2[SystemUiOverlay.TOP_OVERLAYS.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiOverlay[SystemUiOverlay.BOTTOM_OVERLAYS.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
int[] iArr3 = new int[DeviceOrientation.values().length];
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$DeviceOrientation = iArr3;
|
|
try {
|
|
iArr3[DeviceOrientation.PORTRAIT_UP.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
try {
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$DeviceOrientation[DeviceOrientation.PORTRAIT_DOWN.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused8) {
|
|
}
|
|
try {
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$DeviceOrientation[DeviceOrientation.LANDSCAPE_LEFT.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused9) {
|
|
}
|
|
try {
|
|
$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$DeviceOrientation[DeviceOrientation.LANDSCAPE_RIGHT.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused10) {
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public SystemUiMode decodeSystemUiMode(String str) throws JSONException, NoSuchFieldException {
|
|
int i = AnonymousClass2.$SwitchMap$io$flutter$embedding$engine$systemchannels$PlatformChannel$SystemUiMode[SystemUiMode.fromValue(str).ordinal()];
|
|
if (i == 1) {
|
|
return SystemUiMode.LEAN_BACK;
|
|
}
|
|
if (i == 2) {
|
|
return SystemUiMode.IMMERSIVE;
|
|
}
|
|
if (i == 3) {
|
|
return SystemUiMode.IMMERSIVE_STICKY;
|
|
}
|
|
if (i == 4) {
|
|
return SystemUiMode.EDGE_TO_EDGE;
|
|
}
|
|
return SystemUiMode.EDGE_TO_EDGE;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public SystemChromeStyle decodeSystemChromeStyle(JSONObject jSONObject) throws JSONException, NoSuchFieldException {
|
|
return new SystemChromeStyle(!jSONObject.isNull("statusBarColor") ? Integer.valueOf(jSONObject.getInt("statusBarColor")) : null, !jSONObject.isNull("statusBarIconBrightness") ? Brightness.fromValue(jSONObject.getString("statusBarIconBrightness")) : null, !jSONObject.isNull("systemStatusBarContrastEnforced") ? Boolean.valueOf(jSONObject.getBoolean("systemStatusBarContrastEnforced")) : null, !jSONObject.isNull("systemNavigationBarColor") ? Integer.valueOf(jSONObject.getInt("systemNavigationBarColor")) : null, !jSONObject.isNull("systemNavigationBarIconBrightness") ? Brightness.fromValue(jSONObject.getString("systemNavigationBarIconBrightness")) : null, !jSONObject.isNull("systemNavigationBarDividerColor") ? Integer.valueOf(jSONObject.getInt("systemNavigationBarDividerColor")) : null, jSONObject.isNull("systemNavigationBarContrastEnforced") ? null : Boolean.valueOf(jSONObject.getBoolean("systemNavigationBarContrastEnforced")));
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum SoundType {
|
|
CLICK("SystemSoundType.click"),
|
|
ALERT("SystemSoundType.alert");
|
|
|
|
private final String encodedName;
|
|
|
|
static SoundType fromValue(String str) throws NoSuchFieldException {
|
|
for (SoundType soundType : values()) {
|
|
if (soundType.encodedName.equals(str)) {
|
|
return soundType;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such SoundType: " + str);
|
|
}
|
|
|
|
SoundType(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum HapticFeedbackType {
|
|
STANDARD(null),
|
|
LIGHT_IMPACT("HapticFeedbackType.lightImpact"),
|
|
MEDIUM_IMPACT("HapticFeedbackType.mediumImpact"),
|
|
HEAVY_IMPACT("HapticFeedbackType.heavyImpact"),
|
|
SELECTION_CLICK("HapticFeedbackType.selectionClick");
|
|
|
|
private final String encodedName;
|
|
|
|
static HapticFeedbackType fromValue(String str) throws NoSuchFieldException {
|
|
for (HapticFeedbackType hapticFeedbackType : values()) {
|
|
String str2 = hapticFeedbackType.encodedName;
|
|
if ((str2 == null && str == null) || (str2 != null && str2.equals(str))) {
|
|
return hapticFeedbackType;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such HapticFeedbackType: " + str);
|
|
}
|
|
|
|
HapticFeedbackType(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum DeviceOrientation {
|
|
PORTRAIT_UP("DeviceOrientation.portraitUp"),
|
|
PORTRAIT_DOWN("DeviceOrientation.portraitDown"),
|
|
LANDSCAPE_LEFT("DeviceOrientation.landscapeLeft"),
|
|
LANDSCAPE_RIGHT("DeviceOrientation.landscapeRight");
|
|
|
|
private String encodedName;
|
|
|
|
static DeviceOrientation fromValue(String str) throws NoSuchFieldException {
|
|
for (DeviceOrientation deviceOrientation : values()) {
|
|
if (deviceOrientation.encodedName.equals(str)) {
|
|
return deviceOrientation;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such DeviceOrientation: " + str);
|
|
}
|
|
|
|
DeviceOrientation(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum SystemUiOverlay {
|
|
TOP_OVERLAYS("SystemUiOverlay.top"),
|
|
BOTTOM_OVERLAYS("SystemUiOverlay.bottom");
|
|
|
|
private String encodedName;
|
|
|
|
static SystemUiOverlay fromValue(String str) throws NoSuchFieldException {
|
|
for (SystemUiOverlay systemUiOverlay : values()) {
|
|
if (systemUiOverlay.encodedName.equals(str)) {
|
|
return systemUiOverlay;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such SystemUiOverlay: " + str);
|
|
}
|
|
|
|
SystemUiOverlay(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum SystemUiMode {
|
|
LEAN_BACK("SystemUiMode.leanBack"),
|
|
IMMERSIVE("SystemUiMode.immersive"),
|
|
IMMERSIVE_STICKY("SystemUiMode.immersiveSticky"),
|
|
EDGE_TO_EDGE("SystemUiMode.edgeToEdge");
|
|
|
|
private String encodedName;
|
|
|
|
static SystemUiMode fromValue(String str) throws NoSuchFieldException {
|
|
for (SystemUiMode systemUiMode : values()) {
|
|
if (systemUiMode.encodedName.equals(str)) {
|
|
return systemUiMode;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such SystemUiMode: " + str);
|
|
}
|
|
|
|
SystemUiMode(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public static class AppSwitcherDescription {
|
|
public final int color;
|
|
public final String label;
|
|
|
|
public AppSwitcherDescription(int i, String str) {
|
|
this.color = i;
|
|
this.label = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public static class SystemChromeStyle {
|
|
public final Integer statusBarColor;
|
|
public final Brightness statusBarIconBrightness;
|
|
public final Integer systemNavigationBarColor;
|
|
public final Boolean systemNavigationBarContrastEnforced;
|
|
public final Integer systemNavigationBarDividerColor;
|
|
public final Brightness systemNavigationBarIconBrightness;
|
|
public final Boolean systemStatusBarContrastEnforced;
|
|
|
|
public SystemChromeStyle(Integer num, Brightness brightness, Boolean bool, Integer num2, Brightness brightness2, Integer num3, Boolean bool2) {
|
|
this.statusBarColor = num;
|
|
this.statusBarIconBrightness = brightness;
|
|
this.systemStatusBarContrastEnforced = bool;
|
|
this.systemNavigationBarColor = num2;
|
|
this.systemNavigationBarIconBrightness = brightness2;
|
|
this.systemNavigationBarDividerColor = num3;
|
|
this.systemNavigationBarContrastEnforced = bool2;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum Brightness {
|
|
LIGHT("Brightness.light"),
|
|
DARK("Brightness.dark");
|
|
|
|
private String encodedName;
|
|
|
|
static Brightness fromValue(String str) throws NoSuchFieldException {
|
|
for (Brightness brightness : values()) {
|
|
if (brightness.encodedName.equals(str)) {
|
|
return brightness;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such Brightness: " + str);
|
|
}
|
|
|
|
Brightness(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum ClipboardContentFormat {
|
|
PLAIN_TEXT("text/plain");
|
|
|
|
private String encodedName;
|
|
|
|
static ClipboardContentFormat fromValue(String str) throws NoSuchFieldException {
|
|
for (ClipboardContentFormat clipboardContentFormat : values()) {
|
|
if (clipboardContentFormat.encodedName.equals(str)) {
|
|
return clipboardContentFormat;
|
|
}
|
|
}
|
|
throw new NoSuchFieldException("No such ClipboardContentFormat: " + str);
|
|
}
|
|
|
|
ClipboardContentFormat(String str) {
|
|
this.encodedName = str;
|
|
}
|
|
}
|
|
}
|