package no.nordicsemi.android.dfu;

import android.annotation.SuppressLint;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import android.content.Intent;
import g.a.a.a.a;
import io.netty.handler.codec.dns.DnsRecord;
import java.util.UUID;
import no.nordicsemi.android.dfu.BaseCustomDfuImpl;
import no.nordicsemi.android.dfu.internal.exception.DeviceDisconnectedException;
import no.nordicsemi.android.dfu.internal.exception.DfuException;
import no.nordicsemi.android.dfu.internal.exception.UnknownResponseException;
import no.nordicsemi.android.dfu.internal.exception.UploadAbortedException;

/* JADX INFO: loaded from: classes2.dex */
@SuppressLint({"MissingPermission"})
public class LegacyDfuImpl extends BaseCustomDfuImpl {
    public static final UUID DEFAULT_DFU_CONTROL_POINT_UUID;
    public static final UUID DEFAULT_DFU_PACKET_UUID;
    public static final UUID DEFAULT_DFU_SERVICE_UUID;
    public static final UUID DEFAULT_DFU_VERSION_UUID;
    public static UUID DFU_CONTROL_POINT_UUID = null;
    public static UUID DFU_PACKET_UUID = null;
    public static UUID DFU_SERVICE_UUID = null;
    private static final int DFU_STATUS_SUCCESS = 1;
    public static UUID DFU_VERSION_UUID = null;
    private static final byte[] OP_CODE_ACTIVATE_AND_RESET;
    private static final int OP_CODE_ACTIVATE_AND_RESET_KEY = 5;
    private static final byte[] OP_CODE_INIT_DFU_PARAMS;
    private static final byte[] OP_CODE_INIT_DFU_PARAMS_COMPLETE;
    private static final int OP_CODE_INIT_DFU_PARAMS_KEY = 2;
    private static final byte[] OP_CODE_INIT_DFU_PARAMS_START;
    private static final int OP_CODE_PACKET_RECEIPT_NOTIF_KEY = 17;
    private static final byte[] OP_CODE_PACKET_RECEIPT_NOTIF_REQ;
    private static final int OP_CODE_PACKET_RECEIPT_NOTIF_REQ_KEY = 8;
    private static final byte[] OP_CODE_RECEIVE_FIRMWARE_IMAGE;
    private static final int OP_CODE_RECEIVE_FIRMWARE_IMAGE_KEY = 3;
    private static final byte[] OP_CODE_RESET;
    private static final int OP_CODE_RESET_KEY = 6;
    private static final int OP_CODE_RESPONSE_CODE_KEY = 16;
    private static final byte[] OP_CODE_START_DFU;
    private static final int OP_CODE_START_DFU_KEY = 1;
    private static final byte[] OP_CODE_START_DFU_V1;
    private static final byte[] OP_CODE_VALIDATE;
    private static final int OP_CODE_VALIDATE_KEY = 4;
    private final LegacyBluetoothCallback mBluetoothCallback;
    private BluetoothGattCharacteristic mControlPointCharacteristic;
    private boolean mImageSizeInProgress;
    private BluetoothGattCharacteristic mPacketCharacteristic;

    public class LegacyBluetoothCallback extends BaseCustomDfuImpl.BaseCustomBluetoothCallback {
        public LegacyBluetoothCallback() {
            super();
        }

        @Override // android.bluetooth.BluetoothGattCallback
        public void onCharacteristicChanged(BluetoothGatt bluetoothGatt, BluetoothGattCharacteristic bluetoothGattCharacteristic) {
            if (bluetoothGattCharacteristic.getIntValue(17, 0).intValue() == 17) {
                LegacyDfuImpl.this.mProgressInfo.setBytesReceived(bluetoothGattCharacteristic.getIntValue(20, 1).intValue());
                handlePacketReceiptNotification(bluetoothGatt, bluetoothGattCharacteristic);
            } else if (!LegacyDfuImpl.this.mRemoteErrorOccurred) {
                if (bluetoothGattCharacteristic.getIntValue(17, 2).intValue() != 1) {
                    LegacyDfuImpl.this.mRemoteErrorOccurred = true;
                }
                handleNotification(bluetoothGatt, bluetoothGattCharacteristic);
            }
            LegacyDfuImpl.this.notifyLock();
        }

        @Override // no.nordicsemi.android.dfu.BaseCustomDfuImpl.BaseCustomBluetoothCallback
        public void onPacketCharacteristicWrite(BluetoothGatt bluetoothGatt, BluetoothGattCharacteristic bluetoothGattCharacteristic, int i2) {
            if (LegacyDfuImpl.this.mImageSizeInProgress) {
                DfuBaseService dfuBaseService = LegacyDfuImpl.this.mService;
                StringBuilder sbF = a.F("Data written to ");
                sbF.append(bluetoothGattCharacteristic.getUuid());
                sbF.append(", value (0x): ");
                sbF.append(parse(bluetoothGattCharacteristic));
                dfuBaseService.sendLogBroadcast(5, sbF.toString());
                LegacyDfuImpl.this.mImageSizeInProgress = false;
            }
        }
    }

    static {
        UUID uuid = new UUID(23296205844446L, 1523193452336828707L);
        DEFAULT_DFU_SERVICE_UUID = uuid;
        UUID uuid2 = new UUID(23300500811742L, 1523193452336828707L);
        DEFAULT_DFU_CONTROL_POINT_UUID = uuid2;
        UUID uuid3 = new UUID(23304795779038L, 1523193452336828707L);
        DEFAULT_DFU_PACKET_UUID = uuid3;
        UUID uuid4 = new UUID(23313385713630L, 1523193452336828707L);
        DEFAULT_DFU_VERSION_UUID = uuid4;
        DFU_SERVICE_UUID = uuid;
        DFU_CONTROL_POINT_UUID = uuid2;
        DFU_PACKET_UUID = uuid3;
        DFU_VERSION_UUID = uuid4;
        OP_CODE_START_DFU = new byte[]{1, 0};
        OP_CODE_START_DFU_V1 = new byte[]{1};
        OP_CODE_INIT_DFU_PARAMS = new byte[]{2};
        OP_CODE_INIT_DFU_PARAMS_START = new byte[]{2, 0};
        OP_CODE_INIT_DFU_PARAMS_COMPLETE = new byte[]{2, 1};
        OP_CODE_RECEIVE_FIRMWARE_IMAGE = new byte[]{3};
        OP_CODE_VALIDATE = new byte[]{4};
        OP_CODE_ACTIVATE_AND_RESET = new byte[]{5};
        OP_CODE_RESET = new byte[]{6};
        OP_CODE_PACKET_RECEIPT_NOTIF_REQ = new byte[]{8, 0, 0};
    }

    public LegacyDfuImpl(Intent intent, DfuBaseService dfuBaseService) {
        super(intent, dfuBaseService);
        this.mBluetoothCallback = new LegacyBluetoothCallback();
    }

    private int getStatusCode(byte[] bArr, int i2) throws UnknownResponseException {
        if (bArr == null || bArr.length != 3 || bArr[0] != 16 || bArr[1] != i2 || bArr[2] < 1 || bArr[2] > 6) {
            throw new UnknownResponseException("Invalid response received", bArr, 16, i2);
        }
        return bArr[2];
    }

    private int readVersion(BluetoothGattCharacteristic bluetoothGattCharacteristic) {
        if (bluetoothGattCharacteristic != null) {
            return bluetoothGattCharacteristic.getIntValue(18, 0).intValue();
        }
        return 0;
    }

    private void resetAndRestart(BluetoothGatt bluetoothGatt, Intent intent) throws UploadAbortedException, DfuException, DeviceDisconnectedException {
        this.mService.sendLogBroadcast(15, "Last upload interrupted. Restarting device...");
        this.mProgressInfo.setProgress(-5);
        logi("Sending Reset command (Op Code = 6)");
        writeOpCode(this.mControlPointCharacteristic, OP_CODE_RESET);
        this.mService.sendLogBroadcast(10, "Reset request sent");
        this.mService.waitUntilDisconnected();
        this.mService.sendLogBroadcast(5, "Disconnected by the remote device");
        BluetoothGattService service = bluetoothGatt.getService(BaseDfuImpl.GENERIC_ATTRIBUTE_SERVICE_UUID);
        this.mService.refreshDeviceCache(bluetoothGatt, !((service == null || service.getCharacteristic(BaseDfuImpl.SERVICE_CHANGED_UUID) == null) ? false : true));
        this.mService.close(bluetoothGatt);
        logi("Restarting the service");
        Intent intent2 = new Intent();
        intent2.fillIn(intent, 24);
        restartService(intent2, false);
    }

    private void setNumberOfPackets(byte[] bArr, int i2) {
        bArr[1] = (byte) (i2 & DnsRecord.CLASS_ANY);
        bArr[2] = (byte) ((i2 >> 8) & DnsRecord.CLASS_ANY);
    }

    private void writeImageSize(BluetoothGattCharacteristic bluetoothGattCharacteristic, int i2) throws UploadAbortedException, DfuException, DeviceDisconnectedException {
        this.mReceivedData = null;
        this.mError = 0;
        this.mImageSizeInProgress = true;
        bluetoothGattCharacteristic.setWriteType(1);
        bluetoothGattCharacteristic.setValue(new byte[4]);
        bluetoothGattCharacteristic.setValue(i2, 20, 0);
        DfuBaseService dfuBaseService = this.mService;
        StringBuilder sbF = a.F("Writing to characteristic ");
        sbF.append(bluetoothGattCharacteristic.getUuid());
        dfuBaseService.sendLogBroadcast(1, sbF.toString());
        DfuBaseService dfuBaseService2 = this.mService;
        StringBuilder sbF2 = a.F("gatt.writeCharacteristic(");
        sbF2.append(bluetoothGattCharacteristic.getUuid());
        sbF2.append(")");
        dfuBaseService2.sendLogBroadcast(0, sbF2.toString());
        this.mGatt.writeCharacteristic(bluetoothGattCharacteristic);
        try {
            synchronized (this.mLock) {
                while (true) {
                    if ((!this.mImageSizeInProgress || !this.mConnected || this.mError != 0 || this.mAborted) && !this.mPaused) {
                        break;
                    } else {
                        this.mLock.wait();
                    }
                }
            }
        } catch (InterruptedException e2) {
            loge("Sleeping interrupted", e2);
        }
        if (this.mAborted) {
            throw new UploadAbortedException();
        }
        if (!this.mConnected) {
            throw new DeviceDisconnectedException("Unable to write Image Size: device disconnected");
        }
        if (this.mError != 0) {
            throw new DfuException("Unable to write Image Size", this.mError);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:25:0x0083  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x009e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    private void writeImageSize(android.bluetooth.BluetoothGattCharacteristic r4, int r5, int r6, int r7) throws no.nordicsemi.android.dfu.internal.exception.UploadAbortedException, no.nordicsemi.android.dfu.internal.exception.DfuException, no.nordicsemi.android.dfu.internal.exception.DeviceDisconnectedException {
        /*
            r3 = this;
            r0 = 0
            r3.mReceivedData = r0
            r0 = 0
            r3.mError = r0
            r1 = 1
            r3.mImageSizeInProgress = r1
            r4.setWriteType(r1)
            r2 = 12
            byte[] r2 = new byte[r2]
            r4.setValue(r2)
            r2 = 20
            r4.setValue(r5, r2, r0)
            r5 = 4
            r4.setValue(r6, r2, r5)
            r5 = 8
            r4.setValue(r7, r2, r5)
            no.nordicsemi.android.dfu.DfuBaseService r5 = r3.mService
            java.lang.String r6 = "Writing to characteristic "
            java.lang.StringBuilder r6 = g.a.a.a.a.F(r6)
            java.util.UUID r7 = r4.getUuid()
            r6.append(r7)
            java.lang.String r6 = r6.toString()
            r5.sendLogBroadcast(r1, r6)
            no.nordicsemi.android.dfu.DfuBaseService r5 = r3.mService
            java.lang.String r6 = "gatt.writeCharacteristic("
            java.lang.StringBuilder r6 = g.a.a.a.a.F(r6)
            java.util.UUID r7 = r4.getUuid()
            r6.append(r7)
            java.lang.String r7 = ")"
            r6.append(r7)
            java.lang.String r6 = r6.toString()
            r5.sendLogBroadcast(r0, r6)
            android.bluetooth.BluetoothGatt r5 = r3.mGatt
            r5.writeCharacteristic(r4)
            java.lang.Object r4 = r3.mLock     // Catch: java.lang.InterruptedException -> L79
            monitor-enter(r4)     // Catch: java.lang.InterruptedException -> L79
        L5a:
            boolean r5 = r3.mImageSizeInProgress     // Catch: java.lang.Throwable -> L76
            if (r5 == 0) goto L6a
            boolean r5 = r3.mConnected     // Catch: java.lang.Throwable -> L76
            if (r5 == 0) goto L6a
            int r5 = r3.mError     // Catch: java.lang.Throwable -> L76
            if (r5 != 0) goto L6a
            boolean r5 = r3.mAborted     // Catch: java.lang.Throwable -> L76
            if (r5 == 0) goto L6e
        L6a:
            boolean r5 = r3.mPaused     // Catch: java.lang.Throwable -> L76
            if (r5 == 0) goto L74
        L6e:
            java.lang.Object r5 = r3.mLock     // Catch: java.lang.Throwable -> L76
            r5.wait()     // Catch: java.lang.Throwable -> L76
            goto L5a
        L74:
            monitor-exit(r4)     // Catch: java.lang.Throwable -> L76
            goto L7f
        L76:
            r5 = move-exception
            monitor-exit(r4)     // Catch: java.lang.Throwable -> L76
            throw r5     // Catch: java.lang.InterruptedException -> L79
        L79:
            r4 = move-exception
            java.lang.String r5 = "Sleeping interrupted"
            r3.loge(r5, r4)
        L7f:
            boolean r4 = r3.mAborted
            if (r4 != 0) goto L9e
            boolean r4 = r3.mConnected
            if (r4 == 0) goto L96
            int r4 = r3.mError
            if (r4 != 0) goto L8c
            return
        L8c:
            no.nordicsemi.android.dfu.internal.exception.DfuException r4 = new no.nordicsemi.android.dfu.internal.exception.DfuException
            java.lang.String r5 = "Unable to write Image Sizes"
            int r6 = r3.mError
            r4.<init>(r5, r6)
            throw r4
        L96:
            no.nordicsemi.android.dfu.internal.exception.DeviceDisconnectedException r4 = new no.nordicsemi.android.dfu.internal.exception.DeviceDisconnectedException
            java.lang.String r5 = "Unable to write Image Sizes: device disconnected"
            r4.<init>(r5)
            throw r4
        L9e:
            no.nordicsemi.android.dfu.internal.exception.UploadAbortedException r4 = new no.nordicsemi.android.dfu.internal.exception.UploadAbortedException
            r4.<init>()
            throw r4
        */
        throw new UnsupportedOperationException("Method not decompiled: no.nordicsemi.android.dfu.LegacyDfuImpl.writeImageSize(android.bluetooth.BluetoothGattCharacteristic, int, int, int):void");
    }

    private void writeOpCode(BluetoothGattCharacteristic bluetoothGattCharacteristic, byte[] bArr) throws UploadAbortedException, DfuException, DeviceDisconnectedException {
        writeOpCode(bluetoothGattCharacteristic, bArr, bArr[0] == 6 || bArr[0] == 5);
    }

    @Override // no.nordicsemi.android.dfu.BaseCustomDfuImpl
    public UUID getControlPointCharacteristicUUID() {
        return DFU_CONTROL_POINT_UUID;
    }

    @Override // no.nordicsemi.android.dfu.BaseCustomDfuImpl
    public UUID getDfuServiceUUID() {
        return DFU_SERVICE_UUID;
    }

    @Override // no.nordicsemi.android.dfu.DfuCallback
    public BaseCustomDfuImpl.BaseCustomBluetoothCallback getGattCallback() {
        return this.mBluetoothCallback;
    }

    @Override // no.nordicsemi.android.dfu.BaseCustomDfuImpl
    public UUID getPacketCharacteristicUUID() {
        return DFU_PACKET_UUID;
    }

    @Override // no.nordicsemi.android.dfu.DfuService
    public boolean isClientCompatible(Intent intent, BluetoothGatt bluetoothGatt) {
        BluetoothGattCharacteristic characteristic;
        BluetoothGattService service = bluetoothGatt.getService(DFU_SERVICE_UUID);
        if (service == null || (characteristic = service.getCharacteristic(DFU_CONTROL_POINT_UUID)) == null || characteristic.getDescriptor(BaseDfuImpl.CLIENT_CHARACTERISTIC_CONFIG) == null) {
            return false;
        }
        this.mControlPointCharacteristic = characteristic;
        BluetoothGattCharacteristic characteristic2 = service.getCharacteristic(DFU_PACKET_UUID);
        this.mPacketCharacteristic = characteristic2;
        return characteristic2 != null;
    }

    /* JADX WARN: Can't wrap try/catch for region: R(7:(9:177|40|41|169|42|43|171|44|45)|(3:175|47|48)(12:51|(5:54|55|166|56|57)|84|102|(4:104|(1:106)(1:107)|108|(1:110)(2:111|112))|(1:120)(1:119)|(1:122)|123|164|124|125|(2:127|(4:129|(1:131)(1:132)|133|184)(2:134|135))(2:136|137))|71|72|168|73|(1:183)(2:78|(2:80|81)(12:82|(2:85|86)|84|102|(0)|(4:114|116|118|120)(0)|(0)|123|164|124|125|(0)(0)))) */
    /* JADX WARN: Code restructure failed: missing block: B:100:0x03c9, code lost:
    
        if (r5 == 1) goto L101;
     */
    /* JADX WARN: Code restructure failed: missing block: B:101:0x03cb, code lost:
    
        r4 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:142:0x0667, code lost:
    
        throw new no.nordicsemi.android.dfu.internal.exception.RemoteDfuException(r6, r5);
     */
    /* JADX WARN: Code restructure failed: missing block: B:143:0x0668, code lost:
    
        throw r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:145:0x066a, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Code restructure failed: missing block: B:153:0x067d, code lost:
    
        r2 = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:89:0x031c, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x0323, code lost:
    
        if (r0.getErrorNumber() != 3) goto L144;
     */
    /* JADX WARN: Code restructure failed: missing block: B:95:0x0328, code lost:
    
        r28.mRemoteErrorOccurred = false;
        logw("DFU target does not support DFU v.2");
        r28.mService.sendLogBroadcast(15, "DFU target does not support DFU v.2");
        r28.mService.sendLogBroadcast(1, "Switching to DFU v.1");
        logi("Resending Start DFU command (Op Code = 1)");
        writeOpCode(r28.mControlPointCharacteristic, no.nordicsemi.android.dfu.LegacyDfuImpl.OP_CODE_START_DFU_V1);
        r28.mService.sendLogBroadcast(10, "DFU Start sent (Op Code = 1)");
        logi("Sending application image size to DFU Packet: " + r28.mImageSizeInBytes + " bytes");
        writeImageSize(r28.mPacketCharacteristic, r28.mImageSizeInBytes);
        r28.mService.sendLogBroadcast(10, "Firmware image size sent (" + r28.mImageSizeInBytes + " bytes)");
        r3 = readNotificationResponse();
        r5 = getStatusCode(r3, 1);
        r7 = r28.mService;
        r8 = new java.lang.StringBuilder();
        r8.append("Response received (Op Code = ");
        r8.append((int) r3[1]);
        r3 = r16;
        r8.append(r3);
        r8.append(r5);
        r8.append(")");
        r7.sendLogBroadcast(10, r8.toString());
     */
    /* JADX WARN: Code restructure failed: missing block: B:96:0x03c2, code lost:
    
        if (r5 == 2) goto L97;
     */
    /* JADX WARN: Code restructure failed: missing block: B:97:0x03c4, code lost:
    
        resetAndRestart(r10, r29);
     */
    /* JADX WARN: Code restructure failed: missing block: B:98:0x03c7, code lost:
    
        return;
     */
    /* JADX WARN: Removed duplicated region for block: B:104:0x03d0 A[Catch: UnknownResponseException -> 0x01fe, UploadAbortedException -> 0x0206, RemoteDfuException -> 0x066a, TryCatch #14 {RemoteDfuException -> 0x066a, blocks: (B:91:0x031e, B:95:0x0328, B:97:0x03c4, B:102:0x03cc, B:104:0x03d0, B:106:0x03db, B:108:0x044b, B:111:0x047a, B:112:0x0481, B:107:0x041e, B:114:0x0484, B:122:0x0494, B:123:0x04d2, B:124:0x04f1, B:125:0x0504, B:127:0x0562, B:129:0x0616, B:133:0x0645, B:134:0x064a, B:135:0x0651, B:136:0x0652, B:137:0x0659, B:139:0x065b, B:140:0x0661, B:120:0x0490, B:141:0x0662, B:142:0x0667, B:143:0x0668, B:144:0x0669), top: B:180:0x031e }] */
    /* JADX WARN: Removed duplicated region for block: B:120:0x0490 A[Catch: UnknownResponseException -> 0x01fe, UploadAbortedException -> 0x0206, RemoteDfuException -> 0x066a, TryCatch #14 {RemoteDfuException -> 0x066a, blocks: (B:91:0x031e, B:95:0x0328, B:97:0x03c4, B:102:0x03cc, B:104:0x03d0, B:106:0x03db, B:108:0x044b, B:111:0x047a, B:112:0x0481, B:107:0x041e, B:114:0x0484, B:122:0x0494, B:123:0x04d2, B:124:0x04f1, B:125:0x0504, B:127:0x0562, B:129:0x0616, B:133:0x0645, B:134:0x064a, B:135:0x0651, B:136:0x0652, B:137:0x0659, B:139:0x065b, B:140:0x0661, B:120:0x0490, B:141:0x0662, B:142:0x0667, B:143:0x0668, B:144:0x0669), top: B:180:0x031e }] */
    /* JADX WARN: Removed duplicated region for block: B:122:0x0494 A[Catch: UnknownResponseException -> 0x01fe, UploadAbortedException -> 0x0206, RemoteDfuException -> 0x066a, TryCatch #14 {RemoteDfuException -> 0x066a, blocks: (B:91:0x031e, B:95:0x0328, B:97:0x03c4, B:102:0x03cc, B:104:0x03d0, B:106:0x03db, B:108:0x044b, B:111:0x047a, B:112:0x0481, B:107:0x041e, B:114:0x0484, B:122:0x0494, B:123:0x04d2, B:124:0x04f1, B:125:0x0504, B:127:0x0562, B:129:0x0616, B:133:0x0645, B:134:0x064a, B:135:0x0651, B:136:0x0652, B:137:0x0659, B:139:0x065b, B:140:0x0661, B:120:0x0490, B:141:0x0662, B:142:0x0667, B:143:0x0668, B:144:0x0669), top: B:180:0x031e }] */
    /* JADX WARN: Removed duplicated region for block: B:127:0x0562 A[Catch: UnknownResponseException -> 0x01fe, UploadAbortedException -> 0x0206, RemoteDfuException -> 0x066a, TryCatch #14 {RemoteDfuException -> 0x066a, blocks: (B:91:0x031e, B:95:0x0328, B:97:0x03c4, B:102:0x03cc, B:104:0x03d0, B:106:0x03db, B:108:0x044b, B:111:0x047a, B:112:0x0481, B:107:0x041e, B:114:0x0484, B:122:0x0494, B:123:0x04d2, B:124:0x04f1, B:125:0x0504, B:127:0x0562, B:129:0x0616, B:133:0x0645, B:134:0x064a, B:135:0x0651, B:136:0x0652, B:137:0x0659, B:139:0x065b, B:140:0x0661, B:120:0x0490, B:141:0x0662, B:142:0x0667, B:143:0x0668, B:144:0x0669), top: B:180:0x031e }] */
    /* JADX WARN: Removed duplicated region for block: B:136:0x0652 A[Catch: UnknownResponseException -> 0x01fe, UploadAbortedException -> 0x0206, RemoteDfuException -> 0x066a, TryCatch #14 {RemoteDfuException -> 0x066a, blocks: (B:91:0x031e, B:95:0x0328, B:97:0x03c4, B:102:0x03cc, B:104:0x03d0, B:106:0x03db, B:108:0x044b, B:111:0x047a, B:112:0x0481, B:107:0x041e, B:114:0x0484, B:122:0x0494, B:123:0x04d2, B:124:0x04f1, B:125:0x0504, B:127:0x0562, B:129:0x0616, B:133:0x0645, B:134:0x064a, B:135:0x0651, B:136:0x0652, B:137:0x0659, B:139:0x065b, B:140:0x0661, B:120:0x0490, B:141:0x0662, B:142:0x0667, B:143:0x0668, B:144:0x0669), top: B:180:0x031e }] */
    @Override // no.nordicsemi.android.dfu.DfuService
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void performDfu(android.content.Intent r29) throws no.nordicsemi.android.dfu.internal.exception.UploadAbortedException, no.nordicsemi.android.dfu.internal.exception.DfuException, no.nordicsemi.android.dfu.internal.exception.DeviceDisconnectedException {
        /*
            Method dump skipped, instruction units count: 1822
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: no.nordicsemi.android.dfu.LegacyDfuImpl.performDfu(android.content.Intent):void");
    }
}
