package com.mbridge.msdk.foundation.download.utils; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.ZipInputStream; /* loaded from: classes4.dex */ public class UnzipUtility { private static final int BUFFER_SIZE = 4096; private static final String TAG = "UnzipUtility"; private void extractFile(ZipInputStream zipInputStream, String str) throws IOException { BufferedOutputStream bufferedOutputStream; File file = new File(str); if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } BufferedOutputStream bufferedOutputStream2 = null; try { try { bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file)); } catch (Throwable th) { th = th; } } catch (IOException e) { e = e; } try { byte[] bArr = new byte[4096]; while (true) { int read = zipInputStream.read(bArr); if (read != -1) { bufferedOutputStream.write(bArr, 0, read); } else { bufferedOutputStream.close(); return; } } } catch (IOException e2) { e = e2; throw new IOException(e); } catch (Throwable th2) { th = th2; bufferedOutputStream2 = bufferedOutputStream; if (bufferedOutputStream2 != null) { bufferedOutputStream2.close(); } throw th; } } /* JADX WARN: Code restructure failed: missing block: B:105:0x00fe, code lost: r14.close(); */ /* JADX WARN: Code restructure failed: missing block: B:107:0x0102, code lost: r14 = move-exception; */ /* JADX WARN: Code restructure failed: missing block: B:108:0x0103, code lost: com.mbridge.msdk.foundation.tools.af.b(com.mbridge.msdk.foundation.download.utils.UnzipUtility.TAG, r14.getMessage()); */ /* JADX WARN: Code restructure failed: missing block: B:125:0x011b, code lost: r14.close(); */ /* JADX WARN: Code restructure failed: missing block: B:127:0x011f, code lost: r14 = move-exception; */ /* JADX WARN: Code restructure failed: missing block: B:128:0x0120, code lost: com.mbridge.msdk.foundation.tools.af.b(com.mbridge.msdk.foundation.download.utils.UnzipUtility.TAG, r14.getMessage()); */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public int unzip(java.lang.String r14, java.lang.String r15) throws java.io.IOException { /* Method dump skipped, instructions count: 414 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.download.utils.UnzipUtility.unzip(java.lang.String, java.lang.String):int"); } }