package epson.print.ecclient;

import android.util.Log;
import epson.common.Constants;
import java.net.URL;

public class HttpNonSsl extends HttpAccess {
    final int BUFFER_SIZE = 2048;
    StringBuilder mBuffer = new StringBuilder(2048);
    private volatile boolean mCanceled = false;

    public void setDisplay(DebugDisplay debugDisplay) {
        this.mDisplay = debugDisplay;
    }

    private void dispHttpRes(String str) {
        if (this.mDisplay != null) {
            DebugDisplay debugDisplay = this.mDisplay;
            debugDisplay.addResText(str + Constants.BREAK_LINE);
        }
        Log.v("epson_connect", str);
    }

    private void dispHttpCmd(URL url) {
        if (this.mDisplay != null) {
            DebugDisplay debugDisplay = this.mDisplay;
            debugDisplay.addResText("=> " + url.toString() + Constants.BREAK_LINE);
        }
        Log.v("epson_connect", url.toString());
    }

    /* JADX WARNING: Removed duplicated region for block: B:24:0x00b4  */
    /* JADX WARNING: Removed duplicated region for block: B:27:0x00ba  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public int HttpGet(java.lang.String r5) {
        /*
            r4 = this;
            r0 = 0
            r4.mHttpRetCode = r0
            r1 = 0
            java.lang.StringBuilder r2 = r4.mBuffer     // Catch:{ Exception -> 0x0095 }
            r2.setLength(r0)     // Catch:{ Exception -> 0x0095 }
            java.net.URL r2 = new java.net.URL     // Catch:{ Exception -> 0x0095 }
            r2.<init>(r5)     // Catch:{ Exception -> 0x0095 }
            java.lang.StringBuilder r5 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x0095 }
            r5.<init>()     // Catch:{ Exception -> 0x0095 }
            java.lang.String r3 = "[get]::"
            r5.append(r3)     // Catch:{ Exception -> 0x0095 }
            java.lang.String r3 = r2.toString()     // Catch:{ Exception -> 0x0095 }
            r5.append(r3)     // Catch:{ Exception -> 0x0095 }
            java.lang.String r5 = r5.toString()     // Catch:{ Exception -> 0x0095 }
            r4.dispHttpRes(r5)     // Catch:{ Exception -> 0x0095 }
            java.net.URLConnection r5 = r2.openConnection()     // Catch:{ Exception -> 0x0095 }
            java.net.HttpURLConnection r5 = (java.net.HttpURLConnection) r5     // Catch:{ Exception -> 0x0095 }
            r1 = 1
            r5.setDoInput(r1)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.String r1 = "GET"
            r5.setRequestMethod(r1)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r5.connect()     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.io.InputStream r1 = r5.getInputStream()     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.io.BufferedReader r2 = new java.io.BufferedReader     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.io.InputStreamReader r3 = new java.io.InputStreamReader     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r3.<init>(r1)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r1 = 2048(0x800, float:2.87E-42)
            r2.<init>(r3, r1)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
        L_0x0048:
            java.lang.String r1 = r2.readLine()     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            if (r1 == 0) goto L_0x0054
            java.lang.StringBuilder r3 = r4.mBuffer     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r3.append(r1)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            goto L_0x0048
        L_0x0054:
            java.lang.StringBuilder r1 = r4.mBuffer     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.String r1 = r1.toString()     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r4.mResString = r1     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            int r1 = r5.getResponseCode()     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r4.mHttpRetCode = r1     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.StringBuilder r1 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r1.<init>()     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.String r2 = "get return :: <"
            r1.append(r2)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            int r2 = r4.mHttpRetCode     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r1.append(r2)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.String r2 = "> '"
            r1.append(r2)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.String r2 = r4.mResString     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r1.append(r2)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.String r2 = "'\n"
            r1.append(r2)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            java.lang.String r1 = r1.toString()     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            r4.dispHttpRes(r1)     // Catch:{ Exception -> 0x008f, all -> 0x008d }
            if (r5 == 0) goto L_0x008c
            r5.disconnect()
        L_0x008c:
            return r0
        L_0x008d:
            r0 = move-exception
            goto L_0x00b8
        L_0x008f:
            r0 = move-exception
            r1 = r5
            goto L_0x0096
        L_0x0092:
            r0 = move-exception
            r5 = r1
            goto L_0x00b8
        L_0x0095:
            r0 = move-exception
        L_0x0096:
            java.lang.String r5 = "epson_connect"
            java.lang.StringBuilder r2 = new java.lang.StringBuilder     // Catch:{ all -> 0x0092 }
            r2.<init>()     // Catch:{ all -> 0x0092 }
            java.lang.String r3 = "error in HttpGet: "
            r2.append(r3)     // Catch:{ all -> 0x0092 }
            java.lang.String r0 = r0.toString()     // Catch:{ all -> 0x0092 }
            r2.append(r0)     // Catch:{ all -> 0x0092 }
            java.lang.String r0 = r2.toString()     // Catch:{ all -> 0x0092 }
            android.util.Log.w(r5, r0)     // Catch:{ all -> 0x0092 }
            r5 = -1100(0xfffffffffffffbb4, float:NaN)
            if (r1 == 0) goto L_0x00b7
            r1.disconnect()
        L_0x00b7:
            return r5
        L_0x00b8:
            if (r5 == 0) goto L_0x00bd
            r5.disconnect()
        L_0x00bd:
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: epson.print.ecclient.HttpNonSsl.HttpGet(java.lang.String):int");
    }

    /* JADX WARNING: Removed duplicated region for block: B:24:0x00e2  */
    /* JADX WARNING: Removed duplicated region for block: B:27:0x00e8  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public int HttpPost(java.lang.String r5, java.lang.String r6) {
        /*
            r4 = this;
            r0 = 0
            r4.mHttpRetCode = r0
            java.lang.String r1 = "epson_connect"
            java.lang.StringBuilder r2 = new java.lang.StringBuilder
            r2.<init>()
            java.lang.String r3 = "body char length: "
            r2.append(r3)
            int r3 = r6.length()
            r2.append(r3)
            java.lang.String r2 = r2.toString()
            android.util.Log.v(r1, r2)
            r1 = 0
            java.lang.StringBuilder r2 = r4.mBuffer     // Catch:{ Exception -> 0x00c3 }
            r2.setLength(r0)     // Catch:{ Exception -> 0x00c3 }
            java.net.URL r2 = new java.net.URL     // Catch:{ Exception -> 0x00c3 }
            r2.<init>(r5)     // Catch:{ Exception -> 0x00c3 }
            java.lang.StringBuilder r5 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x00c3 }
            r5.<init>()     // Catch:{ Exception -> 0x00c3 }
            java.lang.String r3 = "[post]:: "
            r5.append(r3)     // Catch:{ Exception -> 0x00c3 }
            java.lang.String r3 = r2.toString()     // Catch:{ Exception -> 0x00c3 }
            r5.append(r3)     // Catch:{ Exception -> 0x00c3 }
            java.lang.String r3 = " :: "
            r5.append(r3)     // Catch:{ Exception -> 0x00c3 }
            r5.append(r6)     // Catch:{ Exception -> 0x00c3 }
            java.lang.String r5 = r5.toString()     // Catch:{ Exception -> 0x00c3 }
            r4.dispHttpRes(r5)     // Catch:{ Exception -> 0x00c3 }
            java.net.URLConnection r5 = r2.openConnection()     // Catch:{ Exception -> 0x00c3 }
            java.net.HttpURLConnection r5 = (java.net.HttpURLConnection) r5     // Catch:{ Exception -> 0x00c3 }
            java.lang.String r1 = "POST"
            r5.setRequestMethod(r1)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r1 = 1
            r5.setDoOutput(r1)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.io.PrintStream r1 = new java.io.PrintStream     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.io.OutputStream r2 = r5.getOutputStream()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r1.<init>(r2)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r1.print(r6)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r1.close()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.io.InputStream r6 = r5.getInputStream()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.io.BufferedReader r1 = new java.io.BufferedReader     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.io.InputStreamReader r2 = new java.io.InputStreamReader     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r2.<init>(r6)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r6 = 2048(0x800, float:2.87E-42)
            r1.<init>(r2, r6)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
        L_0x0076:
            java.lang.String r6 = r1.readLine()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            if (r6 == 0) goto L_0x0082
            java.lang.StringBuilder r2 = r4.mBuffer     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r2.append(r6)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            goto L_0x0076
        L_0x0082:
            java.lang.StringBuilder r6 = r4.mBuffer     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.lang.String r6 = r6.toString()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r4.mResString = r6     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            int r6 = r5.getResponseCode()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r4.mHttpRetCode = r6     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.lang.StringBuilder r6 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r6.<init>()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.lang.String r1 = "post return :: <"
            r6.append(r1)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            int r1 = r4.mHttpRetCode     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r6.append(r1)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.lang.String r1 = "> '"
            r6.append(r1)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.lang.String r1 = r4.mResString     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r6.append(r1)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.lang.String r1 = "'\n"
            r6.append(r1)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            java.lang.String r6 = r6.toString()     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            r4.dispHttpRes(r6)     // Catch:{ Exception -> 0x00bd, all -> 0x00bb }
            if (r5 == 0) goto L_0x00ba
            r5.disconnect()
        L_0x00ba:
            return r0
        L_0x00bb:
            r6 = move-exception
            goto L_0x00e6
        L_0x00bd:
            r6 = move-exception
            r1 = r5
            goto L_0x00c4
        L_0x00c0:
            r6 = move-exception
            r5 = r1
            goto L_0x00e6
        L_0x00c3:
            r6 = move-exception
        L_0x00c4:
            java.lang.String r5 = "epson_connect"
            java.lang.StringBuilder r0 = new java.lang.StringBuilder     // Catch:{ all -> 0x00c0 }
            r0.<init>()     // Catch:{ all -> 0x00c0 }
            java.lang.String r2 = "error in HttpPost: "
            r0.append(r2)     // Catch:{ all -> 0x00c0 }
            java.lang.String r6 = r6.toString()     // Catch:{ all -> 0x00c0 }
            r0.append(r6)     // Catch:{ all -> 0x00c0 }
            java.lang.String r6 = r0.toString()     // Catch:{ all -> 0x00c0 }
            android.util.Log.w(r5, r6)     // Catch:{ all -> 0x00c0 }
            r5 = -1100(0xfffffffffffffbb4, float:NaN)
            if (r1 == 0) goto L_0x00e5
            r1.disconnect()
        L_0x00e5:
            return r5
        L_0x00e6:
            if (r5 == 0) goto L_0x00eb
            r5.disconnect()
        L_0x00eb:
            throw r6
        */
        throw new UnsupportedOperationException("Method not decompiled: epson.print.ecclient.HttpNonSsl.HttpPost(java.lang.String, java.lang.String):int");
    }

    /* JADX WARNING: Code restructure failed: missing block: B:34:0x00d1, code lost:
        r8 = th;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:35:0x00d4, code lost:
        r8 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:36:0x00d5, code lost:
        r1 = r7;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:37:0x00d7, code lost:
        r8 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:38:0x00d8, code lost:
        r1 = r7;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:39:0x00da, code lost:
        r8 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:40:0x00db, code lost:
        r1 = r7;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:41:0x00dd, code lost:
        r8 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:42:0x00de, code lost:
        r1 = r7;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:50:0x0101, code lost:
        r1.disconnect();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:57:0x0122, code lost:
        r1.disconnect();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:64:0x0143, code lost:
        r1.disconnect();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:71:0x0164, code lost:
        r1.disconnect();
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x00d1 A[ExcHandler: all (th java.lang.Throwable), Splitter:B:8:0x0031] */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x00d4 A[ExcHandler: Exception (e java.lang.Exception), Splitter:B:8:0x0031] */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x00da A[ExcHandler: FileNotFoundException (e java.io.FileNotFoundException), Splitter:B:8:0x0031] */
    /* JADX WARNING: Removed duplicated region for block: B:41:0x00dd A[ExcHandler: ProtocolException (e java.net.ProtocolException), Splitter:B:8:0x0031] */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x0101  */
    /* JADX WARNING: Removed duplicated region for block: B:57:0x0122  */
    /* JADX WARNING: Removed duplicated region for block: B:64:0x0143  */
    /* JADX WARNING: Removed duplicated region for block: B:71:0x0164  */
    /* JADX WARNING: Removed duplicated region for block: B:74:0x016a  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public int PostFile(java.lang.String r7, java.lang.String r8, java.lang.String r9, java.lang.String r10, int r11, int r12) {
        /*
            r6 = this;
            r8 = 0
            r6.mHttpRetCode = r8
            r0 = -1000(0xfffffffffffffc18, float:NaN)
            if (r7 == 0) goto L_0x016e
            if (r9 == 0) goto L_0x016e
            if (r10 != 0) goto L_0x000d
            goto L_0x016e
        L_0x000d:
            r1 = 0
            r2 = -1100(0xfffffffffffffbb4, float:NaN)
            java.lang.StringBuilder r3 = r6.mBuffer     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            r3.setLength(r8)     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            java.io.BufferedInputStream r3 = new java.io.BufferedInputStream     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            java.io.FileInputStream r4 = new java.io.FileInputStream     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            r4.<init>(r10)     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            r10 = 2048(0x800, float:2.87E-42)
            r3.<init>(r4, r10)     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            java.net.URL r4 = new java.net.URL     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            r4.<init>(r7)     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            r6.dispHttpCmd(r4)     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            java.net.URLConnection r7 = r4.openConnection()     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            java.net.HttpURLConnection r7 = (java.net.HttpURLConnection) r7     // Catch:{ ProtocolException -> 0x0147, FileNotFoundException -> 0x0126, IOException -> 0x0105, Exception -> 0x00e4 }
            java.lang.String r1 = "POST"
            r7.setRequestMethod(r1)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r1 = "Content-Type"
            r7.setRequestProperty(r1, r9)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r9 = "Content-Length"
            java.lang.StringBuilder r1 = new java.lang.StringBuilder     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r1.<init>()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r4 = ""
            r1.append(r4)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r1.append(r12)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r1 = r1.toString()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r7.setRequestProperty(r9, r1)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r9 = 1
            r7.setDoOutput(r9)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r7.connect()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.io.OutputStream r9 = r7.getOutputStream()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            byte[] r10 = new byte[r10]     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            long r4 = (long) r11     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r3.skip(r4)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
        L_0x0060:
            if (r12 <= 0) goto L_0x009e
            int r11 = r3.read(r10)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            if (r11 > 0) goto L_0x0075
            java.lang.String r8 = "epson_connect"
            java.lang.String r9 = "read file size error: in PostFile : "
            android.util.Log.w(r8, r9)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            if (r7 == 0) goto L_0x0074
            r7.disconnect()
        L_0x0074:
            return r0
        L_0x0075:
            if (r11 <= r12) goto L_0x0078
            r11 = r12
        L_0x0078:
            r9.write(r10, r8, r11)     // Catch:{ IOException -> 0x007d, ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, Exception -> 0x00d4, all -> 0x00d1 }
            int r12 = r12 - r11
            goto L_0x0060
        L_0x007d:
            r8 = move-exception
            java.lang.String r9 = "epson_connect"
            java.lang.StringBuilder r10 = new java.lang.StringBuilder     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r10.<init>()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r11 = "error: in post_file : "
            r10.append(r11)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r8 = r8.toString()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r10.append(r8)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r8 = r10.toString()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            android.util.Log.w(r9, r8)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            if (r7 == 0) goto L_0x009d
            r7.disconnect()
        L_0x009d:
            return r0
        L_0x009e:
            r3.close()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r9.close()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r9 = r7.getResponseMessage()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r6.mResString = r9     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r9 = "post file return :: "
            r6.dispHttpRes(r9)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.StringBuilder r9 = new java.lang.StringBuilder     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r9.<init>()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r10 = r6.mResString     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r9.append(r10)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r10 = "\n"
            r9.append(r10)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            java.lang.String r9 = r9.toString()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r6.dispHttpRes(r9)     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            int r9 = r7.getResponseCode()     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            r6.mHttpRetCode = r9     // Catch:{ ProtocolException -> 0x00dd, FileNotFoundException -> 0x00da, IOException -> 0x00d7, Exception -> 0x00d4, all -> 0x00d1 }
            if (r7 == 0) goto L_0x00d0
            r7.disconnect()
        L_0x00d0:
            return r8
        L_0x00d1:
            r8 = move-exception
            goto L_0x0168
        L_0x00d4:
            r8 = move-exception
            r1 = r7
            goto L_0x00e5
        L_0x00d7:
            r8 = move-exception
            r1 = r7
            goto L_0x0106
        L_0x00da:
            r8 = move-exception
            r1 = r7
            goto L_0x0127
        L_0x00dd:
            r8 = move-exception
            r1 = r7
            goto L_0x0148
        L_0x00e0:
            r8 = move-exception
            r7 = r1
            goto L_0x0168
        L_0x00e4:
            r8 = move-exception
        L_0x00e5:
            java.lang.String r7 = "epson_connect"
            java.lang.StringBuilder r9 = new java.lang.StringBuilder     // Catch:{ all -> 0x00e0 }
            r9.<init>()     // Catch:{ all -> 0x00e0 }
            java.lang.String r10 = "error: in post_file : "
            r9.append(r10)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r8.toString()     // Catch:{ all -> 0x00e0 }
            r9.append(r8)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r9.toString()     // Catch:{ all -> 0x00e0 }
            android.util.Log.w(r7, r8)     // Catch:{ all -> 0x00e0 }
            if (r1 == 0) goto L_0x0104
            r1.disconnect()
        L_0x0104:
            return r0
        L_0x0105:
            r8 = move-exception
        L_0x0106:
            java.lang.String r7 = "epson_connect"
            java.lang.StringBuilder r9 = new java.lang.StringBuilder     // Catch:{ all -> 0x00e0 }
            r9.<init>()     // Catch:{ all -> 0x00e0 }
            java.lang.String r10 = "error: in post_file : "
            r9.append(r10)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r8.toString()     // Catch:{ all -> 0x00e0 }
            r9.append(r8)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r9.toString()     // Catch:{ all -> 0x00e0 }
            android.util.Log.w(r7, r8)     // Catch:{ all -> 0x00e0 }
            if (r1 == 0) goto L_0x0125
            r1.disconnect()
        L_0x0125:
            return r2
        L_0x0126:
            r8 = move-exception
        L_0x0127:
            java.lang.String r7 = "epson_connect"
            java.lang.StringBuilder r9 = new java.lang.StringBuilder     // Catch:{ all -> 0x00e0 }
            r9.<init>()     // Catch:{ all -> 0x00e0 }
            java.lang.String r10 = "error: FileNotFound in post_file : "
            r9.append(r10)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r8.toString()     // Catch:{ all -> 0x00e0 }
            r9.append(r8)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r9.toString()     // Catch:{ all -> 0x00e0 }
            android.util.Log.w(r7, r8)     // Catch:{ all -> 0x00e0 }
            if (r1 == 0) goto L_0x0146
            r1.disconnect()
        L_0x0146:
            return r0
        L_0x0147:
            r8 = move-exception
        L_0x0148:
            java.lang.String r7 = "epson_connect"
            java.lang.StringBuilder r9 = new java.lang.StringBuilder     // Catch:{ all -> 0x00e0 }
            r9.<init>()     // Catch:{ all -> 0x00e0 }
            java.lang.String r10 = "error: in post_file : "
            r9.append(r10)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r8.toString()     // Catch:{ all -> 0x00e0 }
            r9.append(r8)     // Catch:{ all -> 0x00e0 }
            java.lang.String r8 = r9.toString()     // Catch:{ all -> 0x00e0 }
            android.util.Log.w(r7, r8)     // Catch:{ all -> 0x00e0 }
            if (r1 == 0) goto L_0x0167
            r1.disconnect()
        L_0x0167:
            return r2
        L_0x0168:
            if (r7 == 0) goto L_0x016d
            r7.disconnect()
        L_0x016d:
            throw r8
        L_0x016e:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: epson.print.ecclient.HttpNonSsl.PostFile(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int):int");
    }

    /* JADX WARNING: Code restructure failed: missing block: B:25:0x00a9, code lost:
        r9 = th;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:26:0x00aa, code lost:
        r1 = r8;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:27:0x00ad, code lost:
        r9 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:28:0x00ae, code lost:
        r1 = r8;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:29:0x00b0, code lost:
        r9 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:30:0x00b1, code lost:
        r1 = r8;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:31:0x00b3, code lost:
        r9 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:32:0x00b4, code lost:
        r1 = r8;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x00a9 A[ExcHandler: all (th java.lang.Throwable), Splitter:B:7:0x003d] */
    /* JADX WARNING: Removed duplicated region for block: B:27:0x00ad A[ExcHandler: Exception (e java.lang.Exception), Splitter:B:7:0x003d] */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x00b3 A[ExcHandler: ProtocolException (e java.net.ProtocolException), Splitter:B:7:0x003d] */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x00d5  */
    /* JADX WARNING: Removed duplicated region for block: B:46:0x00f6  */
    /* JADX WARNING: Removed duplicated region for block: B:54:0x0119  */
    /* JADX WARNING: Removed duplicated region for block: B:57:0x011f  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public int GetFile(java.lang.String r8, java.lang.String r9) {
        /*
            r7 = this;
            r0 = -1000(0xfffffffffffffc18, float:NaN)
            if (r8 == 0) goto L_0x0123
            if (r9 != 0) goto L_0x0008
            goto L_0x0123
        L_0x0008:
            r1 = 0
            java.io.FileOutputStream r2 = new java.io.FileOutputStream     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r2.<init>(r9)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.io.BufferedOutputStream r3 = new java.io.BufferedOutputStream     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r4 = 2048(0x800, float:2.87E-42)
            r3.<init>(r2, r4)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.net.URL r2 = new java.net.URL     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r2.<init>(r8)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.lang.StringBuilder r5 = new java.lang.StringBuilder     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r5.<init>()     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.lang.String r6 = "[GetFile]::"
            r5.append(r6)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r5.append(r8)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.lang.String r8 = "::"
            r5.append(r8)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r5.append(r9)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.lang.String r8 = r5.toString()     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r7.dispHttpRes(r8)     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.net.URLConnection r8 = r2.openConnection()     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            java.net.HttpURLConnection r8 = (java.net.HttpURLConnection) r8     // Catch:{ ProtocolException -> 0x00fa, IOException -> 0x00d9, Exception -> 0x00b8 }
            r9 = 1
            r8.setDoInput(r9)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.String r9 = "GET"
            r8.setRequestMethod(r9)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r8.connect()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.io.InputStream r9 = r8.getInputStream()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.io.BufferedInputStream r1 = new java.io.BufferedInputStream     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r1.<init>(r9, r4)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            byte[] r9 = new byte[r4]     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
        L_0x0053:
            r2 = 0
            int r5 = r1.read(r9, r2, r4)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            if (r5 <= 0) goto L_0x007f
            r3.write(r9, r2, r5)     // Catch:{ IOException -> 0x005e, ProtocolException -> 0x00b3, Exception -> 0x00ad, all -> 0x00a9 }
            goto L_0x0053
        L_0x005e:
            r9 = move-exception
            java.lang.String r1 = "epson_connect"
            java.lang.StringBuilder r2 = new java.lang.StringBuilder     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r2.<init>()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.String r3 = "error: in GetFile() : "
            r2.append(r3)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.String r9 = r9.toString()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r2.append(r9)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.String r9 = r2.toString()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            android.util.Log.w(r1, r9)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            if (r8 == 0) goto L_0x007e
            r8.disconnect()
        L_0x007e:
            return r0
        L_0x007f:
            r3.close()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            int r9 = r8.getResponseCode()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r7.mHttpRetCode = r9     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.StringBuilder r9 = new java.lang.StringBuilder     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r9.<init>()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.String r1 = "get return :: <"
            r9.append(r1)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            int r1 = r7.mHttpRetCode     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r9.append(r1)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.String r1 = ">\n"
            r9.append(r1)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            java.lang.String r9 = r9.toString()     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            r7.dispHttpRes(r9)     // Catch:{ ProtocolException -> 0x00b3, IOException -> 0x00b0, Exception -> 0x00ad, all -> 0x00a9 }
            if (r8 == 0) goto L_0x00a8
            r8.disconnect()
        L_0x00a8:
            return r2
        L_0x00a9:
            r9 = move-exception
            r1 = r8
            goto L_0x011d
        L_0x00ad:
            r9 = move-exception
            r1 = r8
            goto L_0x00b9
        L_0x00b0:
            r9 = move-exception
            r1 = r8
            goto L_0x00da
        L_0x00b3:
            r9 = move-exception
            r1 = r8
            goto L_0x00fb
        L_0x00b6:
            r9 = move-exception
            goto L_0x011d
        L_0x00b8:
            r9 = move-exception
        L_0x00b9:
            java.lang.String r8 = "epson_connect"
            java.lang.StringBuilder r2 = new java.lang.StringBuilder     // Catch:{ all -> 0x00b6 }
            r2.<init>()     // Catch:{ all -> 0x00b6 }
            java.lang.String r3 = "error in GetFile: "
            r2.append(r3)     // Catch:{ all -> 0x00b6 }
            java.lang.String r9 = r9.toString()     // Catch:{ all -> 0x00b6 }
            r2.append(r9)     // Catch:{ all -> 0x00b6 }
            java.lang.String r9 = r2.toString()     // Catch:{ all -> 0x00b6 }
            android.util.Log.w(r8, r9)     // Catch:{ all -> 0x00b6 }
            if (r1 == 0) goto L_0x00d8
            r1.disconnect()
        L_0x00d8:
            return r0
        L_0x00d9:
            r9 = move-exception
        L_0x00da:
            java.lang.String r8 = "epson_connect"
            java.lang.StringBuilder r2 = new java.lang.StringBuilder     // Catch:{ all -> 0x00b6 }
            r2.<init>()     // Catch:{ all -> 0x00b6 }
            java.lang.String r3 = "error: in GetFile : "
            r2.append(r3)     // Catch:{ all -> 0x00b6 }
            java.lang.String r9 = r9.toString()     // Catch:{ all -> 0x00b6 }
            r2.append(r9)     // Catch:{ all -> 0x00b6 }
            java.lang.String r9 = r2.toString()     // Catch:{ all -> 0x00b6 }
            android.util.Log.w(r8, r9)     // Catch:{ all -> 0x00b6 }
            if (r1 == 0) goto L_0x00f9
            r1.disconnect()
        L_0x00f9:
            return r0
        L_0x00fa:
            r9 = move-exception
        L_0x00fb:
            java.lang.String r8 = "epson_connect"
            java.lang.StringBuilder r0 = new java.lang.StringBuilder     // Catch:{ all -> 0x00b6 }
            r0.<init>()     // Catch:{ all -> 0x00b6 }
            java.lang.String r2 = "error: in GetFile : "
            r0.append(r2)     // Catch:{ all -> 0x00b6 }
            java.lang.String r9 = r9.toString()     // Catch:{ all -> 0x00b6 }
            r0.append(r9)     // Catch:{ all -> 0x00b6 }
            java.lang.String r9 = r0.toString()     // Catch:{ all -> 0x00b6 }
            android.util.Log.w(r8, r9)     // Catch:{ all -> 0x00b6 }
            r8 = -1100(0xfffffffffffffbb4, float:NaN)
            if (r1 == 0) goto L_0x011c
            r1.disconnect()
        L_0x011c:
            return r8
        L_0x011d:
            if (r1 == 0) goto L_0x0122
            r1.disconnect()
        L_0x0122:
            throw r9
        L_0x0123:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: epson.print.ecclient.HttpNonSsl.GetFile(java.lang.String, java.lang.String):int");
    }

    public void cancel() {
        this.mCanceled = true;
    }

    public void resetCancel() {
        this.mCanceled = false;
    }
}
