package com.zj.zjsdk.utils; import android.content.Context; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; public class a { public static String a(Context context) { File file = new File(context.getFilesDir().getParent() + File.separator + "ZjSdk" + "_ext"); if (!file.exists()) { try { file.mkdir(); } catch (SecurityException unused) { File file2 = new File(context.getCacheDir() + File.separator + "ZjSdk" + "_ext"); if (!file2.exists()) { file2.mkdir(); } return file2.getAbsolutePath(); } } return file.getAbsolutePath(); } /* JADX WARNING: Removed duplicated region for block: B:30:0x004e */ /* JADX WARNING: Removed duplicated region for block: B:33:0x0056 */ /* JADX WARNING: Removed duplicated region for block: B:37:0x0064 A[SYNTHETIC, Splitter:B:37:0x0064] */ /* JADX WARNING: Removed duplicated region for block: B:42:0x006c A[Catch:{ IOException -> 0x0068 }] */ /* JADX WARNING: Removed duplicated region for block: B:47:? A[RETURN, SYNTHETIC] */ public static void a(Context context, String str, File file) { Throwable th; FileOutputStream fileOutputStream; IOException e; InputStream inputStream = null; try { InputStream open = context.getApplicationContext().getAssets().open(str); try { fileOutputStream = new FileOutputStream(file.getAbsolutePath()); try { byte[] bArr = new byte[1024]; while (true) { int read = open.read(bArr); if (read == -1) { break; } fileOutputStream.write(bArr, 0, read); } if (open != null) { try { open.close(); } catch (IOException e2) { e2.printStackTrace(); b.c("test", "copy file finally error"); return; } } fileOutputStream.close(); } catch (IOException e3) { e = e3; inputStream = open; try { e.printStackTrace(); b.c("test", "copy file error"); if (inputStream != null) { inputStream.close(); } if (fileOutputStream != null) { fileOutputStream.close(); } } catch (Throwable th2) { th = th2; if (inputStream != null) { try { inputStream.close(); } catch (IOException e4) { e4.printStackTrace(); b.c("test", "copy file finally error"); throw th; } } if (fileOutputStream != null) { fileOutputStream.close(); } throw th; } } catch (Throwable th3) { th = th3; inputStream = open; if (inputStream != null) { } if (fileOutputStream != null) { } throw th; } } catch (IOException e5) { e = e5; fileOutputStream = null; inputStream = open; e.printStackTrace(); b.c("test", "copy file error"); if (inputStream != null) { } if (fileOutputStream != null) { } } catch (Throwable th4) { th = th4; fileOutputStream = null; inputStream = open; if (inputStream != null) { } if (fileOutputStream != null) { } throw th; } } catch (IOException e6) { e = e6; fileOutputStream = null; e.printStackTrace(); b.c("test", "copy file error"); if (inputStream != null) { } if (fileOutputStream != null) { } } catch (Throwable th5) { th = th5; fileOutputStream = null; if (inputStream != null) { } if (fileOutputStream != null) { } throw th; } } }