package com.tencent.mm.plugin.appbrand.game.preload;

import com.tencent.matrix.trace.core.AppMethodBeat;

public final class a {
    public static final String fqf = b.aBv();

    static {
        AppMethodBeat.i(130286);
        AppMethodBeat.o(130286);
    }

    public static a aBu() {
        return b.htj;
    }

    /* JADX WARNING: Removed duplicated region for block: B:46:0x00e5 A:{SYNTHETIC, Splitter:B:46:0x00e5} */
    /* JADX WARNING: Removed duplicated region for block: B:49:0x00ea A:{SYNTHETIC, Splitter:B:49:0x00ea} */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x005f A:{SYNTHETIC, Splitter:B:18:0x005f} */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x0064 A:{SYNTHETIC, Splitter:B:21:0x0064} */
    public static void bW(java.lang.String r9, java.lang.String r10) {
        /*
        r1 = 0;
        r6 = 1;
        r8 = 130285; // 0x1fced float:1.82568E-40 double:6.43693E-319;
        r7 = 0;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r8);
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r0 = r0.append(r9);
        r2 = "tmp";
        r0 = r0.append(r2);
        r4 = r0.toString();
        r0 = "MicroMsg.WAGameLoadingImgManager";
        r2 = "downloadLoadingUrl path:%s";
        r3 = new java.lang.Object[r6];
        r3[r7] = r4;
        com.tencent.mm.sdk.platformtools.ab.i(r0, r2, r3);
        r2 = new java.net.URL;	 Catch:{ Exception -> 0x0078 }
        r2.<init>(r10);	 Catch:{ Exception -> 0x0078 }
        r0 = new java.io.BufferedInputStream;	 Catch:{ Exception -> 0x0078 }
        r2 = r2.openStream();	 Catch:{ Exception -> 0x0078 }
        r0.<init>(r2);	 Catch:{ Exception -> 0x0078 }
    L_0x0038:
        if (r0 == 0) goto L_0x011f;
    L_0x003a:
        r3 = new java.io.FileOutputStream;	 Catch:{ IOException -> 0x011b, all -> 0x00e1 }
        r3.<init>(r4);	 Catch:{ IOException -> 0x011b, all -> 0x00e1 }
        r1 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;
        r1 = new byte[r1];	 Catch:{ IOException -> 0x004f }
    L_0x0043:
        r2 = r0.read(r1);	 Catch:{ IOException -> 0x004f }
        r5 = -1;
        if (r2 == r5) goto L_0x008f;
    L_0x004a:
        r5 = 0;
        r3.write(r1, r5, r2);	 Catch:{ IOException -> 0x004f }
        goto L_0x0043;
    L_0x004f:
        r1 = move-exception;
        r2 = r1;
    L_0x0051:
        r1 = "MicroMsg.WAGameLoadingImgManager";
        r5 = "";
        r6 = 0;
        r6 = new java.lang.Object[r6];	 Catch:{ all -> 0x0118 }
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r2, r5, r6);	 Catch:{ all -> 0x0118 }
        if (r3 == 0) goto L_0x0062;
    L_0x005f:
        r3.close();	 Catch:{ IOException -> 0x00c7 }
    L_0x0062:
        if (r0 == 0) goto L_0x0067;
    L_0x0064:
        r0.close();	 Catch:{ IOException -> 0x00d4 }
    L_0x0067:
        r0 = new java.io.File;
        r0.<init>(r4);
        r1 = new java.io.File;
        r1.<init>(r9);
        r0.renameTo(r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
    L_0x0077:
        return;
    L_0x0078:
        r0 = move-exception;
        r2 = "MicroMsg.WAGameLoadingImgManager";
        r3 = "fetch error failed. path = [%s], error = [%s]";
        r5 = 2;
        r5 = new java.lang.Object[r5];
        r5[r7] = r10;
        r0 = r0.toString();
        r5[r6] = r0;
        com.tencent.mm.sdk.platformtools.ab.e(r2, r3, r5);
        r0 = r1;
        goto L_0x0038;
    L_0x008f:
        r3.flush();	 Catch:{ IOException -> 0x004f }
    L_0x0092:
        if (r3 == 0) goto L_0x0097;
    L_0x0094:
        r3.close();	 Catch:{ IOException -> 0x00ad }
    L_0x0097:
        if (r0 == 0) goto L_0x009c;
    L_0x0099:
        r0.close();	 Catch:{ IOException -> 0x00ba }
    L_0x009c:
        r0 = new java.io.File;
        r0.<init>(r4);
        r1 = new java.io.File;
        r1.<init>(r9);
        r0.renameTo(r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        goto L_0x0077;
    L_0x00ad:
        r1 = move-exception;
        r2 = "MicroMsg.WAGameLoadingImgManager";
        r3 = "";
        r5 = new java.lang.Object[r7];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r2, r1, r3, r5);
        goto L_0x0097;
    L_0x00ba:
        r0 = move-exception;
        r1 = "MicroMsg.WAGameLoadingImgManager";
        r2 = "";
        r3 = new java.lang.Object[r7];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r3);
        goto L_0x009c;
    L_0x00c7:
        r1 = move-exception;
        r2 = "MicroMsg.WAGameLoadingImgManager";
        r3 = "";
        r5 = new java.lang.Object[r7];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r2, r1, r3, r5);
        goto L_0x0062;
    L_0x00d4:
        r0 = move-exception;
        r1 = "MicroMsg.WAGameLoadingImgManager";
        r2 = "";
        r3 = new java.lang.Object[r7];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r3);
        goto L_0x0067;
    L_0x00e1:
        r2 = move-exception;
        r3 = r1;
    L_0x00e3:
        if (r3 == 0) goto L_0x00e8;
    L_0x00e5:
        r3.close();	 Catch:{ IOException -> 0x00fe }
    L_0x00e8:
        if (r0 == 0) goto L_0x00ed;
    L_0x00ea:
        r0.close();	 Catch:{ IOException -> 0x010b }
    L_0x00ed:
        r0 = new java.io.File;
        r0.<init>(r4);
        r1 = new java.io.File;
        r1.<init>(r9);
        r0.renameTo(r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        throw r2;
    L_0x00fe:
        r1 = move-exception;
        r3 = "MicroMsg.WAGameLoadingImgManager";
        r5 = "";
        r6 = new java.lang.Object[r7];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r3, r1, r5, r6);
        goto L_0x00e8;
    L_0x010b:
        r0 = move-exception;
        r1 = "MicroMsg.WAGameLoadingImgManager";
        r3 = "";
        r5 = new java.lang.Object[r7];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r3, r5);
        goto L_0x00ed;
    L_0x0118:
        r1 = move-exception;
        r2 = r1;
        goto L_0x00e3;
    L_0x011b:
        r2 = move-exception;
        r3 = r1;
        goto L_0x0051;
    L_0x011f:
        r3 = r1;
        goto L_0x0092;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.appbrand.game.preload.a.bW(java.lang.String, java.lang.String):void");
    }
}
