package a8; public final class g implements a8.h { public final kotlinx.coroutines.CoroutineScope a; public final qbsg.top.ble.BleManagerFacade b; public final kotlinx.coroutines.flow.MutableStateFlow c; public final kotlinx.coroutines.flow.StateFlow d; public final kotlinx.coroutines.flow.MutableStateFlow e; public final kotlinx.coroutines.flow.StateFlow f; public byte[] g; public kotlinx.coroutines.Job h; public String i; public qbsg.top.ble.data.BleSessionFacade j; public final int k; public final int l; public final int m; public final int n; public g(kotlinx.coroutines.CoroutineScope p2, qbsg.top.ble.BleManagerFacade p3) { kotlin.jvm.internal.s.f(p2, "scope"); kotlin.jvm.internal.s.f(p3, "bleManager"); this.a = p2; this.b = p3; int v2_1 = kotlinx.coroutines.flow.StateFlowKt.MutableStateFlow(new a8.i()); this.c = v2_1; this.d = kotlinx.coroutines.flow.FlowKt.asStateFlow(v2_1); int v2_4 = kotlinx.coroutines.flow.StateFlowKt.MutableStateFlow(0); this.e = v2_4; this.f = kotlinx.coroutines.flow.FlowKt.asStateFlow(v2_4); this.k = 3; this.l = 5; this.m = 6; this.n = 3; return; } public static byte[] c(int p3) { byte v3_3 = ((byte) ((p3 >> 8) & 255)); byte[] v1_1 = new byte[2]; v1_1[0] = ((byte) (p3 & 255)); v1_1[1] = v3_3; return v1_1; } public static byte[] d(int p5) { byte v1_2 = ((byte) ((p5 >> 8) & 255)); byte v2_2 = ((byte) ((p5 >> 16) & 255)); byte v5_1 = ((byte) ((p5 >> 24) & 255)); byte[] v3_1 = new byte[4]; v3_1[0] = ((byte) (p5 & 255)); v3_1[1] = v1_2; v3_1[2] = v2_2; v3_1[3] = v5_1; return v3_1; } public static int e(byte[] p4) { if (p4.length != 0) { if (p4.length != 1) { if (p4.length < 4) { return (((p4[1] & 255) << 8) | (p4[0] & 255)); } else { return (((p4[3] & 255) << 24) | (((p4[0] & 255) | ((p4[1] & 255) << 8)) | ((p4[2] & 255) << 16))); } } else { return (p4[0] & 255); } } else { return -1; } } public final int a() { return ((((this.l & 255) << 24) | ((this.m & 255) << 16)) | ((this.n & 255) << 8)); } public final int b() { int v1 = this.k; if (v1 == 3) { v1 = 19; } else { if (v1 == 4) { v1 = 18; } } return (v1 << 24); } public final Object f(byte[] p48, String p49, qbsg.top.ble.GattOtaChannel p50, kotlin.coroutines.jvm.internal.ContinuationImpl p51) { String v9_0; Object v1_0 = this; long v0_0 = p50; Exception v3_62 = "724249f0-5ec3-4b5f-8804-42345af08651"; Object v4_43 = "61c8849c-f639-4765-946e-5c3419bebb2a"; Throwable v5_20 = "b7de1eea-823d-43bb-a3af-c4903dfce23c"; if (!(p51 instanceof a8.e)) { v9_0 = new a8.e(this, p51); } else { v9_0 = ((a8.e) p51); int v10_13 = ((a8.e) p51).t; if ((v10_13 & -2147483648) == 0) { } else { ((a8.e) p51).t = (v10_13 - -2147483648); } } try { Object v6_0; Object v4_11; Exception v3_15; long v0_15; Object v6_2; String v2_0; int v8_0; int v12_9; Exception v3_17; int v8_1; Object v6_4; int v8_3; int v8_4; Object v4_18; int v13_0; Object v6_9; int v13_1; int v10_0; Exception v3_80; Object v6_10; String v15_0; long v0_24; Object v6_11; long v0_25; Object v6_12; int v13_4; int v20_0; long v0_26; int v10_5; long v48_7; String v15_5; Exception v3_29; int v8_13; Object v6_16; int v10_7; Throwable v32_2; String v15_8; int v21_1; Throwable v32_4; int v21_2; int v10_11; Object v4_32; Throwable v5_1; Throwable v5_2; Throwable v32_7; int v10_14; int v21_6; Throwable v32_9; Object v4_36; int v7_0; int v7_1; Object v4_40; int v7_2; Object v4_41; Object v4_42; String v9_1; long v11_0; long v33_3; int v7_5; int v22_0; long v11_1; String v9_3; Throwable v5_14; int v7_7; String v9_4; int v34_0; Throwable v5_15; Throwable v5_16; int v34_2; int v12_6; int v7_10; long v24_1; Throwable v5_18; int v7_12; long v14_1; long v14_2; int v23_0; long v14_3; int v38_0; long v14_4; long v0_10; int v38_1; Exception v3_1; int v7_17; int v7_18; Exception v3_4; Exception v3_61; Object v4_2; long v14_9; long v0_13; Exception v3_63; long v0_2; Object v4_4; Exception v3_64; long v14_11; Object v4_6; long v0_5; String v2_23 = v9_0.r; int v10_15 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED(); long v14_8 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; int v51_1 = 0; v20_0 = 8; v13_1 = this.b; int v23_1 = v2_23; v2_0 = this.e; Object v26 = "8082caa8-41a6-4021-91c6-56f9b954cc34"; int v12_7 = "0000fef5-0000-1000-8000-00805f9b34fb"; switch (v9_0.t) { case 0: q6.y.Y(v23_1); try { v11_0 = p50.hasService("0000fef5-0000-1000-8000-00805f9b34fb"); try { if (v11_0 == 0) { v20_0 = v2_0; v10_0 = v13_1; try { throw new Exception("\u8bbe\u5907\u4e0d\u652f\u6301 SUOTA \u670d\u52a1\uff08\u56fa\u4ef6\u7248\u672c\u53ef\u80fd\u4e0d\u652f\u6301 OTA\uff09"); } catch (long v0_14) { v11_0 = p49; throw v0_14; } catch (long v0_8) { v11_0 = p49; } catch (long v0_9) { v11_0 = p49; v10_0.closeOtaChannel(v11_0); v1_0.i = 0; throw v0_9; } } else { try { while(true) { int v13_8; v11_0 = v2_0.getValue(); Throwable v32_11 = ((a8.j) v11_0); int v23 = 4; long v29 = 5000; v13_1 = v23_0; v14_8 = v38_1; v51_1 = 0; } try { if (!p50.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", "64b4e8b5-0de5-401b-a21d-acc8db3b913a")) { v11_0 = p48; v7_18 = p49; v13_1 = 23; v14_11 = 20; try { if (!v0_0.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", "42c3dfdd-77be-4d9c-8454-8f875267fb3b")) { v33_3 = v3_62; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v15_8 = v14_11; v6_12 = v0_0; v0_26 = v13_1; v3_64 = v11_0; v11_0 = v7_18; if (!v6_12.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v5_20)) { v7_10 = v3_64; v5_16 = v6_12; if (!v5_16.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v4_43)) { v6_10 = v5_16; v5_15 = v15_8; v4_41 = v0_26; v0_25 = (v5_15 + 3); if ((v4_41 >= v0_25) && (v4_41 != 23)) { v3_80 = v6_10; v6_9 = v5_15; v5_14 = v4_41; Object v4_47 = v7_10; int v7_29 = Math.min(v6_9, (v5_14 - 3)); int v13_24 = new z7.h0(v4_47, v7_29, 2); v3_80.requestHighPriority(); while(true) { Object v4_49; long v14_23 = v2_0.getValue(); a8.j v39_1 = ((a8.j) v14_23); if (v39_1 == null) { v22_0 = v4_47; if (v39_1 == null) { v4_49 = 0; } else { v4_49 = a8.j.a(v39_1, 0, 0, "\u542f\u7528\u72b6\u6001\u901a\u77e5...", 0, 47); } } else { v22_0 = v4_47; if (v39_1.b() != 1) { } else { v4_49 = v39_1; } } if (v2_0.compareAndSet(v14_23, v4_49)) { break; } v23 = 4; v29 = 5000; v4_47 = v22_0; v51_1 = 0; } if (!v3_80.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", "5f78df94-798c-46f5-990a-b3eb6a065c88")) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("SERV_STATUS \u7279\u5f81\u503c\u672a\u627e\u5230"); } else { v3_80.enableNotification("0000fef5-0000-1000-8000-00805f9b34fb", "5f78df94-798c-46f5-990a-b3eb6a065c88"); v3_80.writeDescriptor("0000fef5-0000-1000-8000-00805f9b34fb", "5f78df94-798c-46f5-990a-b3eb6a065c88", "00002902-0000-1000-8000-00805f9b34fb", z7.k0.a); Object v4_54 = new a8.d(v3_80, 0, 9); v9_0.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v9_0.d = v11_0; v9_0.e = v3_80; v9_0.f = v13_24; v9_0.i = v6_9; v9_0.j = v5_14; v9_0.k = v0_25; v9_0.l = v7_29; v9_0.t = 6; v4_40 = kotlinx.coroutines.TimeoutKt.withTimeout(8000, v4_54, v9_0); if (v4_40 != v10_15) { v8_13 = v3_80; v3_61 = v0_25; v0_24 = v7_29; v7_7 = v13_24; if (!((Boolean) v4_40).booleanValue()) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("CCCD \u5199\u5165\u5931\u8d25"); } else { v14_9 = "8082caa8-41a6-4021-91c6-56f9b954cc34"; if (!v8_13.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", "8082caa8-41a6-4021-91c6-56f9b954cc34")) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("SPOTA_MEM_DEV \u672a\u627e\u5230"); } else { v8_13.writeCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", "8082caa8-41a6-4021-91c6-56f9b954cc34", a8.g.d(this.b()), 1); Object v4_61 = new a8.d(v8_13, 0, 10); v9_0.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v9_0.d = v11_0; v9_0.e = v8_13; v9_0.f = v7_7; v9_0.i = v6_9; v9_0.j = v5_14; v9_0.k = v3_61; v9_0.l = v0_24; v9_0.t = 7; v13_1 = v5_14; String v15_13 = v6_9; v4_36 = kotlinx.coroutines.TimeoutKt.withTimeout(8000, v4_61, v9_0); if (v4_36 != v10_15) { v5_2 = v15_13; v6_4 = v7_7; v7_5 = v8_13; if (!((Boolean) v4_36).booleanValue()) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("\u5199 MEM_DEV \u5931\u8d25"); } else { Object v4_64 = this.k; if ((v4_64 != 3) && (v4_64 != 4)) { while (!v7_5.getNotifyEvents().isEmpty()) { v7_5.getNotifyEvents().tryReceive-PtdJZtk(); } v4_18 = v32_7; if (!v7_5.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v4_18)) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("SPOTA_PATCH_LEN \u672a\u627e\u5230"); } else { int v8_28 = v38_1; if (!v7_5.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v8_28)) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("SPOTA_PATCH_DATA \u672a\u627e\u5230"); } else { v9_3 = v3_61; v3_29 = v6_4.c(); v15_5 = v9_0; v1_0 = v7_5; v38_0 = v8_28; v26 = v14_9; v8_4 = -1; v7_0 = v0_24; v0_13 = v51_1; v20_0 = v2_0; v2_0 = v13_1; v13_4 = a.b.k(); if (v0_13 >= v3_29) { v3_1 = v10_15; Throwable v32_13 = v13_4; v14_1 = v26; v1_0.writeCharacteristic(v12_7, v14_1, a8.g.d(-33554432), 1); long v0_55 = new a8.d(v1_0, 0, 3); v15_5.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v15_5.d = v11_0; v15_5.e = v1_0; v15_5.f = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v6_4); v15_5.i = v5_2; v15_5.j = v2_0; v15_5.k = v9_3; v15_5.l = v7_0; v13_0 = v1_0; Object v4_1 = v2_0; Object v1_1 = v32_13; v15_5.q = v1_1; v15_5.m = v8_4; Throwable v32_0 = v1_1; v15_5.t = 12; v2_0 = kotlinx.coroutines.TimeoutKt.withTimeout(8000, v0_55, v15_5); if (v2_0 != v3_1) { v15_0 = v6_4; v6_0 = v9_3; v9_0 = v15_5; v1_0 = v4_1; v0_2 = v8_4; v8_0 = v5_2; v4_2 = v32_0; v2_0 = ((Boolean) v2_0).booleanValue(); if (v2_0 == null) { v1_0 = this; v10_0 = v23_0; throw new Exception("\u5199 END_SIGNAL \u5931\u8d25"); } else { long v48_1 = v15_0; String v2_4 = new a8.d(v13_0, 0, 11); v9_0.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v9_0.d = v11_0; v9_0.e = v13_0; v9_0.f = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v48_1); v9_0.i = v8_0; v9_0.j = v1_0; v9_0.k = v6_0; v9_0.l = v7_0; v9_0.q = v4_2; v9_0.m = v0_2; v9_0.t = 13; long v27 = v4_2; v2_0 = kotlinx.coroutines.TimeoutKt.withTimeout(60000, v2_4, v9_0); if (v2_0 != v3_1) { v10_5 = v9_0; v4_4 = v27; v9_1 = v8_0; v8_1 = v1_0; v1_0 = v0_2; v0_5 = v13_0; v13_1 = v48_1; String v2_5 = ((p6.g) v2_0); String v15_4 = a8.g.e(((byte[]) v2_5.d)); long v48_2 = v2_5; v2_0 = 2; if (v15_4 != 2) { v1_0 = this; v10_0 = v23_0; String v2_6 = z7.k0.a(v15_4); Exception v3_3 = new StringBuilder(); v3_3.append("CRC \u6821\u9a8c\u5931\u8d25: "); v3_3.append(v2_6); throw new Exception(v3_3.toString()); } else { int v49_1 = v13_1; v0_5.writeCharacteristic(v12_7, v14_1, a8.g.d(-50331648), 1); v2_0 = new a8.d(v0_5, 0, 4); v10_5.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v10_5.d = v11_0; v10_5.e = v0_5; v10_5.f = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v49_1); v10_5.g = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v48_2); v10_5.i = v9_1; v10_5.j = v8_1; v10_5.k = v6_0; v10_5.l = v7_0; v10_5.q = v4_4; v10_5.m = v1_0; v10_5.n = v15_4; v10_5.t = 14; if (kotlinx.coroutines.TimeoutKt.withTimeoutOrNull(5000, v2_0, v10_5) != v3_1) { v3_4 = v4_4; v1_0 = this; try { this.g(new a8.b((((double) (a.b.k() - v3_4)) / 4652007308841189376))); v0_5.requestBalancedPriority(); v10_0 = v23_0; } catch (long v0_8) { v10_0 = v23_0; } } else { return v3_1; } } } else { return v3_1; } } } else { return v3_1; } } else { int v21_0 = v10_15; try { int v10_6 = v6_4.b; Throwable v32_1 = v3_29; Exception v3_10 = Math.min(v10_6, (v6_4.a.length - (v0_13 * v10_6))); } catch (kotlinx.coroutines.TimeoutCancellationException) { v1_0 = this; Object v4_12 = v20_0; v10_0 = v23_0; } if (v3_10 == v8_4) { v10_7 = v3_10; v24_1 = v4_18; v4_6 = v32_1; v32_2 = v13_4; v14_2 = v21_0; v13_1 = v9_3; v21_2 = v14_2; v14_3 = v2_0; v9_4 = v7_0; v2_0 = v1_0; v1_0 = v0_13; v0_15 = v4_6; v3_17 = v6_4.a(v0_13).iterator(); v4_11 = v8_4; v7_1 = v32_2; if (!v3_17.hasNext()) { long v33_0 = v10_7; v34_0 = v12_7; Exception v3_18 = v21_2; int v10_12 = v1_0; Exception v3_19; int v21_3; if (v10_12 != (v6_4.c() - 1)) { v21_3 = v3_18; v3_19 = 30000; } else { v21_3 = v3_18; v3_19 = 60000; } long v48_4 = v4_11; int v35_1 = v3_19; Object v1_15 = new a8.d(v2_0, 0, 12); v15_5.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v15_5.d = v11_0; v15_5.e = v2_0; v15_5.f = v6_4; v15_5.g = 0; v15_5.h = 0; v15_5.i = v5_2; v15_5.j = v14_3; v15_5.k = v13_1; v15_5.l = v9_4; v15_5.q = v7_1; v12_6 = v48_4; v15_5.m = v12_6; v15_5.n = v10_12; v15_5.o = v0_15; v15_5.p = v33_0; v15_5.t = 11; Object v1_16 = kotlinx.coroutines.TimeoutKt.withTimeout(v35_1, v1_15, v15_5); v3_1 = v21_3; if (v1_16 != v3_1) { int v21_4 = v2_0; v2_0 = v1_16; v1_0 = v21_4; v14_4 = v11_0; v11_1 = v14_3; v21_6 = v5_2; v32_4 = v7_1; v7_2 = v6_4; v6_2 = v10_12; v10_14 = v9_4; v2_0 = a8.g.e(((byte[]) ((p6.g) v2_0).d)); if (v2_0 != 2) { v5_2 = this; Object v6_3 = (v6_2 + 1); Object v1_17 = z7.k0.a(v2_0); v2_0 = new StringBuilder(); v2_0.append("\u5757 "); v2_0.append(v6_3); v2_0.append(" \u5931\u8d25: "); v2_0.append(v1_17); throw new Exception(v2_0.toString()); } else { String v2_16 = (v6_2 + 1); this.g(new a8.a(((v2_16 * 100) / v7_2.c()), v6_2, v7_2, (((double) (a.b.k() - v32_4)) / 4652007308841189376))); v6_4 = v7_2; v7_0 = v10_14; v8_4 = v12_6; v9_3 = v13_1; v5_2 = v21_6; v4_18 = v24_1; v12_7 = v34_0; v51_1 = 0; v10_15 = v3_1; v3_29 = v0_15; v0_13 = v2_16; v2_0 = v11_1; v11_0 = v14_4; v13_4 = v32_4; } } } else { long v33_1 = v10_7; int v10_17 = ((byte[]) v3_17.next()); Throwable v32_6 = v1_0; int v34_1 = v4_11; Object v4_19 = v38_0; v2_0.writeCharacteristic(v12_7, v4_19, v10_17, v51_1); v38_0 = v4_19; long v48_5 = v10_17; Object v1_21 = new a8.d(v2_0, 0, 2); v15_5.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v15_5.d = v11_0; v15_5.e = v2_0; v15_5.f = v6_4; v15_5.g = v3_17; v15_5.h = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v48_5); v15_5.i = v5_2; v15_5.j = v14_3; v15_5.k = v13_1; v15_5.l = v9_4; v15_5.q = v7_1; Object v4_23 = v34_1; v15_5.m = v4_23; int v10_19 = v32_6; v15_5.n = v10_19; v15_5.o = v0_15; v48_7 = v3_17; Exception v3_34 = v33_1; v15_5.p = v3_34; v34_2 = v12_7; v15_5.t = 10; v12_9 = v4_23; v3_1 = v21_2; if (kotlinx.coroutines.TimeoutKt.withTimeout(5000, v1_21, v15_5) != v3_1) { v1_0 = v10_19; v10_7 = v3_34; while(true) { v21_2 = v3_1; v3_17 = v48_7; v4_11 = v12_9; v12_7 = v34_2; v51_1 = 0; } } } } else { long v48_3 = v3_10; v1_0.writeCharacteristic(v12_7, v4_18, a8.g.c(v3_10), 1); v24_1 = v4_18; Exception v3_13 = new a8.d(v1_0, 0, 1); v15_5.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v15_5.d = v11_0; v15_5.e = v1_0; v15_5.f = v6_4; v15_5.i = v5_2; v15_5.j = v2_0; v15_5.k = v9_3; v15_5.l = v7_0; v15_5.q = v13_4; v15_5.m = v8_4; v15_5.n = v0_13; v4_6 = v32_1; v15_5.o = v4_6; int v10_10 = v48_3; v15_5.p = v10_10; v15_5.t = 9; v32_2 = v13_4; Exception v3_14 = kotlinx.coroutines.TimeoutKt.withTimeout(8000, v3_13, v15_5); v14_2 = v21_0; if (v3_14 != v14_2) { v21_1 = v5_2; v8_3 = v9_3; v9_0 = v15_5; v5_1 = v0_13; v0_10 = v10_10; v10_11 = v2_0; v2_0 = v3_14; v3_15 = v22_0; v2_0 = ((Boolean) v2_0).booleanValue(); if (v2_0 == null) { throw new Exception("\u5199 PATCH_LEN \u5931\u8d25"); } else { v22_0 = v3_15; v15_5 = v9_0; v2_0 = v10_11; v10_7 = v0_10; v9_3 = v8_3; v8_4 = v10_7; v0_13 = v5_1; v5_2 = v21_1; } } else { v3_1 = v14_2; return v3_1; } } } } } } else { Object v4_65 = v33_3; if (!v7_5.hasCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v4_65)) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("SPOTA_GPIO_MAP \u672a\u627e\u5230"); } else { v7_5.writeCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v4_65, a8.g.d(this.a()), 1); Object v4_67 = new a8.d(v7_5, 0, 0); v9_0.c = kotlin.coroutines.jvm.internal.SpillingKt.nullOutSpilledVariable(v22_0); v9_0.d = v11_0; v9_0.e = v7_5; v9_0.f = v6_4; v9_0.i = v5_2; v9_0.j = v13_1; v9_0.k = v3_61; v9_0.l = v0_24; v9_0.t = v20_0; int v8_26 = v5_2; v20_0 = v6_4; v4_32 = kotlinx.coroutines.TimeoutKt.withTimeout(8000, v4_67, v9_0); if (v4_32 != v10_15) { v5_2 = v8_26; v6_4 = v20_0; if (!((Boolean) v4_32).booleanValue()) { v20_0 = v2_0; v10_0 = v23_0; throw new Exception("\u5199 GPIO_MAP \u5931\u8d25"); } } else { v3_1 = v10_15; return v3_1; } } } } } else { } } } } else { } } } else { v6_10.requestMtu(v0_25); Exception v3_77 = new a8.d(v6_10, 0, 13); v9_0.c = v7_10; v9_0.d = v11_0; v9_0.e = v6_10; v9_0.i = v5_15; v9_0.j = v4_41; v9_0.k = v0_25; v9_0.t = 5; v3_63 = kotlinx.coroutines.TimeoutKt.withTimeoutOrNull(8000, v3_77, v9_0); if (v3_63 != v10_15) { Exception v3_79 = ((Integer) v3_63); if (v3_79 == null) { } else { v5_14 = v3_79.intValue(); v3_80 = v6_10; v6_9 = v5_15; } } else { } } } else { v5_16.readCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v4_43); Exception v3_73 = new a8.d(v5_16, 0, 8); v9_0.c = v7_10; v9_0.d = v11_0; v9_0.e = v5_16; v9_0.i = v15_8; v9_0.j = v0_26; v9_0.t = 4; if (kotlinx.coroutines.TimeoutKt.withTimeout(5000, v3_73, v9_0) != v10_15) { v6_11 = v11_0; v4_42 = v15_8; v11_0 = v6_11; v6_10 = v5_16; v5_15 = v4_42; } } } else { v6_12.readCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", v5_20); Throwable v5_23 = new a8.d(v6_12, 0, 7); v9_0.c = v3_64; v9_0.d = v11_0; v9_0.e = v6_12; v9_0.i = v15_8; v9_0.j = v0_26; v9_0.t = 3; v5_18 = kotlinx.coroutines.TimeoutKt.withTimeout(5000, v5_23, v9_0); if (v5_18 != v10_15) { Throwable v5_26 = ((byte[]) ((p6.g) v5_18).d); if (v5_26.length < 2) { } else { v0_26 = ((v5_26[v51_1] & 255) | ((v5_26[1] & 255) << 8)); } } else { } } } else { try { v0_0.readCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", "42c3dfdd-77be-4d9c-8454-8f875267fb3b"); v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v33_3 = v3_62; Object v6_20 = new a8.d(v0_0, 0, 6); v9_0.c = v11_0; v9_0.d = v7_18; v9_0.e = v0_0; v9_0.i = v14_11; v9_0.j = v13_1; v9_0.t = 2; Exception v3_70 = v13_1; v15_8 = v14_11; v6_16 = kotlinx.coroutines.TimeoutKt.withTimeout(5000, v6_20, v9_0); } catch (kotlinx.coroutines.TimeoutCancellationException) { v4_12 = v2_0; v11_0 = v7_18; } catch (long v0_14) { v11_0 = v7_18; v10_0 = v23_0; } catch (long v0_8) { v20_0 = v2_0; v11_0 = v7_18; } catch (long v0_9) { v11_0 = v7_18; v10_0 = v23_0; } if (v6_16 != v10_15) { v7_12 = v0_0; v0_26 = v3_70; v3_64 = v11_0; v11_0 = v7_18; Object v6_23 = ((byte[]) ((p6.g) v6_16).d); if (v6_23.length >= 2) { v15_8 = (((v6_23[1] & 255) << 8) | (v6_23[v51_1] & 255)); } v6_12 = v7_12; } } } catch (kotlinx.coroutines.TimeoutCancellationException) { v10_0 = v23_0; v4_12 = v2_0; v11_0 = v7_18; } catch (long v0_14) { v10_0 = v23_0; v11_0 = v7_18; } catch (long v0_8) { v20_0 = v2_0; v10_0 = v23_0; v11_0 = v7_18; } catch (long v0_9) { v10_0 = v23_0; v11_0 = v7_18; } v11_0 = p49; v4_12 = v20_0; } else { try { p50.readCharacteristic("0000fef5-0000-1000-8000-00805f9b34fb", "64b4e8b5-0de5-401b-a21d-acc8db3b913a"); int v7_20 = new a8.d(p50, 0, 5); v11_0 = p48; v9_0.c = p48; v9_0.d = p49; v9_0.e = p50; v9_0.i = 20; v9_0.j = 23; v9_0.t = 1; } catch (kotlinx.coroutines.TimeoutCancellationException) { v11_0 = p49; v4_12 = v2_0; } catch (long v0_14) { v11_0 = p49; } catch (long v0_8) { v11_0 = p49; v20_0 = v2_0; } catch (long v0_9) { v11_0 = p49; } if (kotlinx.coroutines.TimeoutKt.withTimeout(5000, v7_20, v9_0) != v10_15) { v7_17 = p50; v13_1 = 23; v32_9 = 20; v7_18 = p49; v0_0 = v7_17; v14_11 = v32_9; } } } catch (kotlinx.coroutines.TimeoutCancellationException) { v10_0 = v23_0; v11_0 = p49; v4_12 = v2_0; } catch (long v0_14) { } catch (long v0_8) { v20_0 = v2_0; v10_0 = v23_0; } catch (long v0_9) { v10_0 = v23_0; } v10_0 = v23_0; } catch (kotlinx.coroutines.TimeoutCancellationException) { v20_0 = v2_0; v10_0 = v13_1; } if (v32_11 == null) { v23_0 = v13_1; v38_1 = v14_8; if (v32_11 == null) { v13_8 = 0; if (!v2_0.compareAndSet(v11_0, v13_8)) { } } else { v13_8 = a8.j.a(v32_11, 0, 0, "\u8bfb\u53d6 SUOTA \u8bbe\u5907\u4fe1\u606f...", 0, 47); } } else { v23_0 = v13_1; v38_1 = v14_8; if (v32_11.b() != 1) { } else { v13_8 = v32_11; } } } } catch (kotlinx.coroutines.TimeoutCancellationException) { } } catch (long v0_8) { v20_0 = v2_0; v10_0 = v13_1; } catch (long v0_9) { v10_0 = v13_1; } case 1: long v0_29 = v9_0.j; long v11_12 = v9_0.e; long v48_10 = v9_0.i; p49 = v9_0.d; int v7_16 = ((byte[]) v9_0.c); try { q6.y.Y(v23_1); v11_0 = v7_16; v7_17 = v11_12; v32_9 = v48_10; v23_0 = v13_1; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v13_1 = v0_29; } catch (kotlinx.coroutines.TimeoutCancellationException) { v11_0 = p49; v4_12 = v2_0; v10_0 = v13_1; } catch (long v0_14) { v11_0 = p49; v10_0 = v13_1; } catch (long v0_8) { v11_0 = p49; v20_0 = v2_0; v10_0 = v13_1; } catch (long v0_9) { v11_0 = p49; v10_0 = v13_1; } break; case 2: v0_26 = v9_0.j; v7_12 = v9_0.e; v11_0 = v9_0.d; long v48_9 = v9_0.i; Object v6_15 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v33_3 = "724249f0-5ec3-4b5f-8804-42345af08651"; v3_64 = v6_15; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v6_16 = v23_1; v15_8 = v48_9; v23_0 = v13_1; break; case 3: v0_26 = v9_0.j; Throwable v5_17 = v9_0.i; v6_12 = v9_0.e; v7_10 = v9_0.d; long v11_11 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v33_3 = "724249f0-5ec3-4b5f-8804-42345af08651"; v3_64 = v11_11; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v15_8 = v5_17; v11_0 = v7_10; v5_18 = v23_1; v23_0 = v13_1; break; case 4: v0_26 = v9_0.j; v4_42 = v9_0.i; v5_16 = v9_0.e; v6_11 = v9_0.d; v7_10 = ((byte[]) v9_0.c); try { q6.y.Y(v23_1); v33_3 = "724249f0-5ec3-4b5f-8804-42345af08651"; v23_0 = v13_1; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; } catch (kotlinx.coroutines.TimeoutCancellationException) { v4_12 = v2_0; v11_0 = v6_11; } catch (long v0_14) { v11_0 = v6_11; } catch (long v0_8) { v20_0 = v2_0; v11_0 = v6_11; } catch (long v0_9) { v11_0 = v6_11; } break; case 5: v0_25 = v9_0.k; v4_41 = v9_0.j; v5_15 = v9_0.i; v6_10 = v9_0.e; int v7_9 = v9_0.d; long v11_9 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v11_0 = v7_9; v7_10 = v11_9; v33_3 = "724249f0-5ec3-4b5f-8804-42345af08651"; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v3_63 = v23_1; v23_0 = v13_1; break; case 6: v0_24 = v9_0.l; v5_14 = v9_0.j; v6_9 = v9_0.i; v7_7 = ((z7.h0) v9_0.f); v8_13 = v9_0.e; v11_0 = v9_0.d; int v22_6 = v9_0.k; Object v4_39 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v33_3 = "724249f0-5ec3-4b5f-8804-42345af08651"; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v3_61 = v22_6; v22_0 = v4_39; v4_40 = v23_1; v23_0 = v13_1; break; case 7: v0_24 = v9_0.l; Throwable v5_13 = v9_0.j; Object v6_8 = v9_0.i; v7_7 = ((z7.h0) v9_0.f); v8_13 = v9_0.e; v11_0 = v9_0.d; int v22_5 = v9_0.k; Object v4_35 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v33_3 = "724249f0-5ec3-4b5f-8804-42345af08651"; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v3_61 = v22_5; v14_9 = "8082caa8-41a6-4021-91c6-56f9b954cc34"; v22_0 = v4_35; v4_36 = v23_1; v23_0 = v13_1; v13_1 = v5_13; v5_2 = v6_8; break; case 8: v0_24 = v9_0.l; v3_61 = v9_0.k; Object v4_31 = v9_0.j; v5_2 = v9_0.i; v6_4 = ((z7.h0) v9_0.f); v7_5 = v9_0.e; int v8_12 = v9_0.d; long v11_7 = ((byte[]) v9_0.c); try { q6.y.Y(v23_1); int v22_4 = v13_1; v13_1 = v4_31; v4_32 = v23_1; v23_0 = v22_4; v22_0 = v11_7; v38_1 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v32_7 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v14_9 = "8082caa8-41a6-4021-91c6-56f9b954cc34"; v11_0 = v8_12; } catch (kotlinx.coroutines.TimeoutCancellationException) { v4_12 = v2_0; v11_0 = v8_12; } catch (long v0_14) { v11_0 = v8_12; } catch (long v0_8) { v20_0 = v2_0; v11_0 = v8_12; } catch (long v0_9) { v11_0 = v8_12; } break; case 9: v0_10 = v9_0.p; Object v4_30 = v9_0.n; Throwable v5_12 = v9_0.q; v7_0 = v9_0.l; v8_3 = v9_0.k; long v11_4 = v9_0.j; int v20_3 = v9_0.o; v21_1 = v9_0.i; long v48_8 = ((z7.h0) v9_0.f); int v22_3 = v9_0.e; long v24_4 = v9_0.d; v3_15 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v32_2 = v5_12; v38_0 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v1_0 = v22_3; v6_4 = v48_8; v5_1 = v4_30; v14_2 = v10_15; v10_11 = v11_4; v4_6 = v20_3; v11_0 = v24_4; v20_0 = v2_0; v24_1 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v2_0 = v23_1; v23_0 = v13_1; break; case 10: long v0_23 = v9_0.p; Object v4_29 = v9_0.n; Throwable v5_11 = v9_0.m; Object v6_6 = v9_0.q; int v8_11 = v9_0.l; long v11_3 = v9_0.k; int v20_2 = v9_0.o; int v21_7 = v9_0.j; int v22_2 = v9_0.i; v48_7 = ((java.util.Iterator) v9_0.g); int v49_2 = ((z7.h0) v9_0.f); long v24_3 = v9_0.e; String v50_1 = v9_0.d; Exception v3_53 = ((byte[]) v9_0.c); try { q6.y.Y(v23_1); v1_0 = v4_29; v34_2 = "0000fef5-0000-1000-8000-00805f9b34fb"; v23_0 = v13_1; v38_0 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v14_3 = v21_7; v12_9 = v5_11; v13_1 = v11_3; v5_2 = v22_2; v11_0 = v50_1; v22_0 = v3_53; v3_1 = v10_15; v10_7 = v0_23; v0_15 = v20_2; v20_0 = v2_0; v2_0 = v24_3; v24_1 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v15_5 = v9_0; v9_4 = v8_11; v7_1 = v6_6; v6_4 = v49_2; } catch (kotlinx.coroutines.TimeoutCancellationException) { v11_0 = v50_1; } catch (long v0_14) { v11_0 = v50_1; } catch (long v0_8) { v11_0 = v50_1; } catch (long v0_9) { v11_0 = v50_1; } break; case 11: v0_15 = v9_0.o; Object v4_13 = v9_0.m; v5_2 = v9_0.q; int v7_3 = v9_0.l; int v8_5 = v9_0.k; v11_1 = v9_0.j; int v20_1 = v9_0.n; v21_6 = v9_0.i; long v48_6 = ((z7.h0) v9_0.f); int v22_1 = v9_0.e; long v24_2 = v9_0.d; Exception v3_38 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v32_4 = v5_2; v34_0 = "0000fef5-0000-1000-8000-00805f9b34fb"; v38_0 = "457871e8-d516-4ca1-9116-57d0b17b9cb2"; v6_2 = v20_1; v1_0 = v22_1; v14_4 = v24_2; v20_0 = v2_0; v22_0 = v3_38; v12_6 = v4_13; v3_1 = v10_15; v24_1 = "9d84b9a3-000c-49d8-9183-855b673fda31"; v2_0 = v23_1; v10_14 = v7_3; v15_5 = v9_0; v23_0 = v13_1; v7_2 = v48_6; v13_1 = v8_5; break; case 12: v0_2 = v9_0.m; Throwable v5_31 = v9_0.l; v6_0 = v9_0.k; int v7_30 = v9_0.j; v8_0 = v9_0.i; long v11_17 = ((z7.h0) v9_0.f); long v14_27 = v9_0.e; String v15_19 = v9_0.d; int v20_5 = v9_0.q; Exception v3_0 = ((byte[]) v9_0.c); try { q6.y.Y(v23_1); v15_0 = v11_17; v11_0 = v15_19; v22_0 = v3_0; v1_0 = v7_30; v3_1 = v10_15; v7_0 = v5_31; v4_2 = v20_5; v20_0 = v2_0; v2_0 = v23_1; v23_0 = v13_1; v13_0 = v14_27; v14_1 = "8082caa8-41a6-4021-91c6-56f9b954cc34"; } catch (kotlinx.coroutines.TimeoutCancellationException) { v4_12 = v2_0; v10_0 = v13_0; v11_0 = v15_0; } catch (long v0_14) { v10_0 = v13_0; v11_0 = v15_0; } catch (long v0_8) { v20_0 = v2_0; v10_0 = v13_0; v11_0 = v15_0; } catch (long v0_9) { v10_0 = v13_0; v11_0 = v15_0; } break; case 13: long v0_33 = v9_0.m; Throwable v5_21 = v9_0.l; v6_0 = v9_0.k; int v7_22 = v9_0.j; int v8_14 = v9_0.i; long v14_18 = ((z7.h0) v9_0.f); String v15_10 = v9_0.e; v11_0 = v9_0.d; Throwable v18_1 = v9_0.q; Exception v3_78 = ((byte[]) v9_0.c); q6.y.Y(v23_1); v1_0 = v0_33; v20_0 = v2_0; v22_0 = v3_78; v3_1 = v10_15; v0_5 = v15_10; v2_0 = v23_1; v10_5 = v9_0; v23_0 = v13_1; v13_1 = v14_18; v14_1 = "8082caa8-41a6-4021-91c6-56f9b954cc34"; v9_1 = v8_14; v8_1 = v7_22; v7_0 = v5_21; v4_4 = v18_1; break; case 14: v3_4 = v9_0.q; long v0 = ((z7.h0) v9_0.f); v0_5 = v9_0.e; Throwable v5_19 = v9_0.d; try { q6.y.Y(v23_1); v20_0 = v2_0; v11_0 = v5_19; v23_0 = v13_1; } catch (kotlinx.coroutines.TimeoutCancellationException) { v4_12 = v2_0; v11_0 = v5_19; } catch (long v0_14) { v11_0 = v5_19; } catch (long v0_8) { v20_0 = v2_0; v11_0 = v5_19; } catch (long v0_9) { v11_0 = v5_19; } break; default: throw new IllegalStateException("call to \'resume\' before \'invoke\' with coroutine"); } } catch (kotlinx.coroutines.TimeoutCancellationException) { } catch (long v0_14) { } catch (long v0_8) { } catch (long v0_9) { } catch (kotlinx.coroutines.TimeoutCancellationException) { v4_12 = v2_0; v11_0 = v7_10; } catch (long v0_14) { v11_0 = v7_10; } catch (long v0_8) { v20_0 = v2_0; v11_0 = v7_10; } catch (long v0_9) { v11_0 = v7_10; } catch (kotlinx.coroutines.TimeoutCancellationException) { v4_12 = v2_0; v10_0 = v13_1; v11_0 = v24_1; } catch (long v0_14) { v10_0 = v13_1; v11_0 = v24_1; } catch (long v0_8) { v20_0 = v2_0; v10_0 = v13_1; v11_0 = v24_1; } catch (long v0_9) { v10_0 = v13_1; v11_0 = v24_1; } catch (kotlinx.coroutines.TimeoutCancellationException) { } catch (long v0_14) { } catch (long v0_8) { } catch (long v0_9) { } catch (kotlinx.coroutines.TimeoutCancellationException) { v1_0 = this; } catch (long v0_14) { v1_0 = this; } catch (long v0_8) { v1_0 = this; } catch (long v0_9) { v1_0 = this; } catch (kotlinx.coroutines.TimeoutCancellationException) { v1_0 = this; v10_0 = v23_0; } catch (kotlinx.coroutines.TimeoutCancellationException) { } catch (kotlinx.coroutines.TimeoutCancellationException) { } catch (kotlinx.coroutines.TimeoutCancellationException) { v20_0 = v2_0; } catch (long v0_14) { v1_0 = this; } catch (long v0_8) { v1_0 = this; } catch (long v0_9) { v1_0 = this; } v10_0.closeOtaChannel(v11_0); v1_0.i = 0; return p6.a0.a; } public final void g(a7.c p6) { do { boolean v0_0 = this.e; Object v1 = v0_0.getValue(); int v2_0 = ((a8.j) v1); if ((v2_0 == 0) || (v2_0.b() != 1)) { if (v2_0 == 0) { v2_0 = 0; } else { v2_0 = ((a8.j) p6.invoke(v2_0)); } } } while(!v0_0.compareAndSet(v1, v2_0)); return; } }