|
@@ -4,6 +4,9 @@ package epson.maintain;
|
|
|
import android.support.annotation.VisibleForTesting;
|
|
|
import android.support.media.ExifInterface;
|
|
|
|
|
|
+import androidx.annotation.NonNull;
|
|
|
+import androidx.annotation.Nullable;
|
|
|
+
|
|
|
import java.io.BufferedOutputStream;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.Closeable;
|
|
@@ -24,137 +27,14 @@ public class EfuReader {
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:37:0x0062 A[SYNTHETIC, Splitter:B:37:0x0062] */
|
|
|
/* Code decompiled incorrectly, please refer to instructions dump. */
|
|
|
public static void unzipOnlyOneEntry(@android.support.annotation.NonNull java.lang.String r3, @android.support.annotation.NonNull java.lang.String r4) throws java.io.IOException {
|
|
|
- /*
|
|
|
- java.util.zip.ZipFile r0 = new java.util.zip.ZipFile
|
|
|
- r0.<init>(r3)
|
|
|
- int r3 = r0.size()
|
|
|
- r1 = 1
|
|
|
- if (r3 != r1) goto L_0x007d
|
|
|
- java.util.Enumeration r3 = r0.entries()
|
|
|
- boolean r1 = r3.hasMoreElements()
|
|
|
- if (r1 == 0) goto L_0x0075
|
|
|
- java.lang.Object r3 = r3.nextElement() // Catch:{ NoSuchElementException -> 0x006e }
|
|
|
- java.util.zip.ZipEntry r3 = (java.util.zip.ZipEntry) r3 // Catch:{ NoSuchElementException -> 0x006e }
|
|
|
- boolean r1 = r3.isDirectory()
|
|
|
- if (r1 != 0) goto L_0x0066
|
|
|
- r1 = 0
|
|
|
- java.io.BufferedInputStream r2 = new java.io.BufferedInputStream // Catch:{ all -> 0x0059 }
|
|
|
- java.io.InputStream r3 = r0.getInputStream(r3) // Catch:{ all -> 0x0059 }
|
|
|
- r2.<init>(r3) // Catch:{ all -> 0x0059 }
|
|
|
- java.io.BufferedOutputStream r3 = new java.io.BufferedOutputStream // Catch:{ all -> 0x0057 }
|
|
|
- java.io.FileOutputStream r0 = new java.io.FileOutputStream // Catch:{ all -> 0x0057 }
|
|
|
- r0.<init>(r4) // Catch:{ all -> 0x0057 }
|
|
|
- r3.<init>(r0) // Catch:{ all -> 0x0057 }
|
|
|
- r4 = 4096(0x1000, float:5.74E-42)
|
|
|
- byte[] r4 = new byte[r4] // Catch:{ all -> 0x0054 }
|
|
|
- L_0x003a:
|
|
|
- r0 = -1
|
|
|
- int r1 = r2.read(r4) // Catch:{ IOException -> 0x004d }
|
|
|
- if (r0 == r1) goto L_0x0046
|
|
|
- r0 = 0
|
|
|
- r3.write(r4, r0, r1) // Catch:{ IOException -> 0x004d }
|
|
|
- goto L_0x003a
|
|
|
- L_0x0046:
|
|
|
- r3.close()
|
|
|
- r2.close() // Catch:{ IOException -> 0x004c }
|
|
|
- L_0x004c:
|
|
|
- return
|
|
|
- L_0x004d:
|
|
|
- r4 = move-exception
|
|
|
- epson.maintain.EfuReader$WriteException r0 = new epson.maintain.EfuReader$WriteException // Catch:{ all -> 0x0054 }
|
|
|
- r0.<init>(r4) // Catch:{ all -> 0x0054 }
|
|
|
- throw r0 // Catch:{ all -> 0x0054 }
|
|
|
- L_0x0054:
|
|
|
- r4 = move-exception
|
|
|
- r1 = r3
|
|
|
- goto L_0x005b
|
|
|
- L_0x0057:
|
|
|
- r4 = move-exception
|
|
|
- goto L_0x005b
|
|
|
- L_0x0059:
|
|
|
- r4 = move-exception
|
|
|
- r2 = r1
|
|
|
- L_0x005b:
|
|
|
- if (r1 == 0) goto L_0x0060
|
|
|
- r1.close()
|
|
|
- L_0x0060:
|
|
|
- if (r2 == 0) goto L_0x0065
|
|
|
- r2.close() // Catch:{ IOException -> 0x0065 }
|
|
|
- L_0x0065:
|
|
|
- throw r4
|
|
|
- L_0x0066:
|
|
|
- java.io.IOException r3 = new java.io.IOException
|
|
|
- java.lang.String r4 = "zip no entry."
|
|
|
- r3.<init>(r4)
|
|
|
- throw r3
|
|
|
- L_0x006e:
|
|
|
- r3 = move-exception
|
|
|
- java.io.IOException r4 = new java.io.IOException
|
|
|
- r4.<init>(r3)
|
|
|
- throw r4
|
|
|
- L_0x0075:
|
|
|
- java.io.IOException r3 = new java.io.IOException
|
|
|
- java.lang.String r4 = "zip no entry."
|
|
|
- r3.<init>(r4)
|
|
|
- throw r3
|
|
|
- L_0x007d:
|
|
|
- java.io.IOException r3 = new java.io.IOException
|
|
|
- java.lang.StringBuilder r4 = new java.lang.StringBuilder
|
|
|
- r4.<init>()
|
|
|
- java.lang.String r1 = "entry != 1 <"
|
|
|
- r4.append(r1)
|
|
|
- int r0 = r0.size()
|
|
|
- r4.append(r0)
|
|
|
- java.lang.String r0 = ">"
|
|
|
- r4.append(r0)
|
|
|
- java.lang.String r4 = r4.toString()
|
|
|
- r3.<init>(r4)
|
|
|
- throw r3
|
|
|
- */
|
|
|
+
|
|
|
throw new UnsupportedOperationException("Method not decompiled: epson.maintain.EfuReader.unzipOnlyOneEntry(java.lang.String, java.lang.String):void");
|
|
|
}
|
|
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:22:0x0031 */
|
|
|
/* Code decompiled incorrectly, please refer to instructions dump. */
|
|
|
public void writeOnlyOneFirmwareData(java.io.File r3, java.io.File r4) throws java.io.IOException {
|
|
|
- /*
|
|
|
- r2 = this;
|
|
|
- boolean r0 = epson.maintain.EfuReader.RcxFileReader.checkHeaderId(r3)
|
|
|
- if (r0 != 0) goto L_0x0035
|
|
|
- r0 = 0
|
|
|
- epson.maintain.EfuReader$RcxFileReader r1 = new epson.maintain.EfuReader$RcxFileReader // Catch:{ all -> 0x002d }
|
|
|
- r1.<init>(r3) // Catch:{ all -> 0x002d }
|
|
|
- boolean r3 = r1.readHeader() // Catch:{ all -> 0x002b }
|
|
|
- if (r3 == 0) goto L_0x0025
|
|
|
- boolean r3 = r2.checkHeaderData(r1) // Catch:{ all -> 0x002b }
|
|
|
- if (r3 == 0) goto L_0x001f
|
|
|
- r1.writeOnlyOneFirmwareData(r4) // Catch:{ all -> 0x002b }
|
|
|
- r1.close()
|
|
|
- return
|
|
|
- L_0x001f:
|
|
|
- java.io.IOException r3 = new java.io.IOException // Catch:{ all -> 0x002b }
|
|
|
- r3.<init>() // Catch:{ all -> 0x002b }
|
|
|
- throw r3 // Catch:{ all -> 0x002b }
|
|
|
- L_0x0025:
|
|
|
- java.io.IOException r3 = new java.io.IOException // Catch:{ all -> 0x002b }
|
|
|
- r3.<init>() // Catch:{ all -> 0x002b }
|
|
|
- throw r3 // Catch:{ all -> 0x002b }
|
|
|
- L_0x002b:
|
|
|
- r3 = move-exception
|
|
|
- goto L_0x002f
|
|
|
- L_0x002d:
|
|
|
- r3 = move-exception
|
|
|
- r1 = r0
|
|
|
- L_0x002f:
|
|
|
- if (r1 == 0) goto L_0x0034
|
|
|
- r1.close()
|
|
|
- L_0x0034:
|
|
|
- throw r3
|
|
|
- L_0x0035:
|
|
|
- java.io.IOException r3 = new java.io.IOException
|
|
|
- r3.<init>()
|
|
|
- throw r3
|
|
|
- */
|
|
|
+
|
|
|
throw new UnsupportedOperationException("Method not decompiled: epson.maintain.EfuReader.writeOnlyOneFirmwareData(java.io.File, java.io.File):void");
|
|
|
}
|
|
|
|
|
@@ -194,44 +74,7 @@ public class EfuReader {
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:27:0x0028 A[SYNTHETIC, Splitter:B:27:0x0028] */
|
|
|
/* Code decompiled incorrectly, please refer to instructions dump. */
|
|
|
private static byte[] getFileByte(java.io.File r5, int r6) {
|
|
|
- /*
|
|
|
- byte[] r0 = new byte[r6]
|
|
|
- r1 = 0
|
|
|
- java.io.FileInputStream r2 = new java.io.FileInputStream // Catch:{ IOException -> 0x0025, all -> 0x001e }
|
|
|
- r2.<init>(r5) // Catch:{ IOException -> 0x0025, all -> 0x001e }
|
|
|
- r5 = 0
|
|
|
- L_0x0009:
|
|
|
- int r3 = r6 - r5
|
|
|
- int r3 = r2.read(r0, r5, r3) // Catch:{ IOException -> 0x001c, all -> 0x0019 }
|
|
|
- r4 = -1
|
|
|
- if (r3 == r4) goto L_0x0015
|
|
|
- int r5 = r5 + r3
|
|
|
- if (r5 < r6) goto L_0x0009
|
|
|
- L_0x0015:
|
|
|
- r2.close() // Catch:{ IOException -> 0x0018 }
|
|
|
- L_0x0018:
|
|
|
- return r0
|
|
|
- L_0x0019:
|
|
|
- r5 = move-exception
|
|
|
- r1 = r2
|
|
|
- goto L_0x001f
|
|
|
- L_0x001c:
|
|
|
- goto L_0x0026
|
|
|
- L_0x001e:
|
|
|
- r5 = move-exception
|
|
|
- L_0x001f:
|
|
|
- if (r1 == 0) goto L_0x0024
|
|
|
- r1.close() // Catch:{ IOException -> 0x0024 }
|
|
|
- L_0x0024:
|
|
|
- throw r5
|
|
|
- L_0x0025:
|
|
|
- r2 = r1
|
|
|
- L_0x0026:
|
|
|
- if (r2 == 0) goto L_0x002b
|
|
|
- r2.close() // Catch:{ IOException -> 0x002b }
|
|
|
- L_0x002b:
|
|
|
- return r1
|
|
|
- */
|
|
|
+
|
|
|
throw new UnsupportedOperationException("Method not decompiled: epson.maintain.EfuReader.RcxFileReader.getFileByte(java.io.File, int):byte[]");
|
|
|
}
|
|
|
|
|
@@ -247,51 +90,7 @@ public class EfuReader {
|
|
|
/* JADX WARNING: Exception block dominator not found, dom blocks: [] */
|
|
|
/* Code decompiled incorrectly, please refer to instructions dump. */
|
|
|
public boolean readHeader() {
|
|
|
- /*
|
|
|
- r6 = this;
|
|
|
- java.util.HashMap<java.lang.String, java.lang.String> r0 = r6.mSectionAKeyAndValue
|
|
|
- r0.clear()
|
|
|
- r0 = -1
|
|
|
- r6.mHeaderEndPosition = r0
|
|
|
- r0 = 0
|
|
|
- java.lang.String r1 = ""
|
|
|
- L_0x000c:
|
|
|
- java.io.RandomAccessFile r2 = r6.f333is // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- java.lang.String r2 = r6.getNextLine(r2) // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- r3 = 1
|
|
|
- if (r2 == 0) goto L_0x003d
|
|
|
- boolean r4 = isCommentLine(r2) // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- if (r4 == 0) goto L_0x001c
|
|
|
- goto L_0x000c
|
|
|
- L_0x001c:
|
|
|
- java.lang.String r4 = isSectionSeparator(r2) // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- if (r4 == 0) goto L_0x0024
|
|
|
- r1 = r4
|
|
|
- goto L_0x000c
|
|
|
- L_0x0024:
|
|
|
- java.lang.String[] r2 = isKeyAndValueData(r2) // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- if (r2 != 0) goto L_0x002b
|
|
|
- goto L_0x000c
|
|
|
- L_0x002b:
|
|
|
- java.lang.String r4 = "A"
|
|
|
- boolean r4 = r4.equals(r1) // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- if (r4 == 0) goto L_0x000c
|
|
|
- java.util.HashMap<java.lang.String, java.lang.String> r4 = r6.mSectionAKeyAndValue // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- r5 = r2[r0] // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- r2 = r2[r3] // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- r4.put(r5, r2) // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- goto L_0x000c
|
|
|
- L_0x003d:
|
|
|
- java.io.RandomAccessFile r1 = r6.f333is // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- long r1 = r1.getFilePointer() // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- r6.mHeaderEndPosition = r1 // Catch:{ IOException | OutOfMemoryError -> 0x0048, all -> 0x0046 }
|
|
|
- return r3
|
|
|
- L_0x0046:
|
|
|
- r0 = move-exception
|
|
|
- throw r0
|
|
|
- L_0x0048:
|
|
|
- return r0
|
|
|
- */
|
|
|
+
|
|
|
throw new UnsupportedOperationException("Method not decompiled: epson.maintain.EfuReader.RcxFileReader.readHeader():boolean");
|
|
|
}
|
|
|
|
|
@@ -370,143 +169,13 @@ public class EfuReader {
|
|
|
@android.support.annotation.VisibleForTesting
|
|
|
/* Code decompiled incorrectly, please refer to instructions dump. */
|
|
|
static void writeRemainingData(@android.support.annotation.NonNull java.io.RandomAccessFile r3, long r4, @android.support.annotation.NonNull java.io.File r6) throws java.io.IOException {
|
|
|
- /*
|
|
|
- r0 = 0
|
|
|
- java.io.BufferedOutputStream r1 = new java.io.BufferedOutputStream // Catch:{ IOException -> 0x002d }
|
|
|
- java.io.FileOutputStream r2 = new java.io.FileOutputStream // Catch:{ IOException -> 0x002d }
|
|
|
- r2.<init>(r6) // Catch:{ IOException -> 0x002d }
|
|
|
- r1.<init>(r2) // Catch:{ IOException -> 0x002d }
|
|
|
- r3.seek(r4) // Catch:{ IOException -> 0x0028, all -> 0x0025 }
|
|
|
- writeRemainingData(r3, r1) // Catch:{ IOException -> 0x0028, all -> 0x0025 }
|
|
|
- r1.close() // Catch:{ IOException -> 0x0015 }
|
|
|
- return
|
|
|
- L_0x0015:
|
|
|
- r3 = move-exception
|
|
|
- boolean r4 = r6.exists()
|
|
|
- if (r4 == 0) goto L_0x001f
|
|
|
- r6.delete()
|
|
|
- L_0x001f:
|
|
|
- epson.maintain.EfuReader$WriteException r4 = new epson.maintain.EfuReader$WriteException
|
|
|
- r4.<init>(r3)
|
|
|
- throw r4
|
|
|
- L_0x0025:
|
|
|
- r3 = move-exception
|
|
|
- r0 = r1
|
|
|
- goto L_0x0038
|
|
|
- L_0x0028:
|
|
|
- r3 = move-exception
|
|
|
- r0 = r1
|
|
|
- goto L_0x002e
|
|
|
- L_0x002b:
|
|
|
- r3 = move-exception
|
|
|
- goto L_0x0038
|
|
|
- L_0x002d:
|
|
|
- r3 = move-exception
|
|
|
- L_0x002e:
|
|
|
- boolean r4 = r6.exists() // Catch:{ all -> 0x002b }
|
|
|
- if (r4 == 0) goto L_0x0037
|
|
|
- r6.delete() // Catch:{ all -> 0x002b }
|
|
|
- L_0x0037:
|
|
|
- throw r3 // Catch:{ all -> 0x002b }
|
|
|
- L_0x0038:
|
|
|
- if (r0 == 0) goto L_0x004e
|
|
|
- r0.close() // Catch:{ IOException -> 0x003e }
|
|
|
- goto L_0x004e
|
|
|
- L_0x003e:
|
|
|
- r3 = move-exception
|
|
|
- boolean r4 = r6.exists()
|
|
|
- if (r4 == 0) goto L_0x0048
|
|
|
- r6.delete()
|
|
|
- L_0x0048:
|
|
|
- epson.maintain.EfuReader$WriteException r4 = new epson.maintain.EfuReader$WriteException
|
|
|
- r4.<init>(r3)
|
|
|
- throw r4
|
|
|
- L_0x004e:
|
|
|
- throw r3
|
|
|
- */
|
|
|
+
|
|
|
throw new UnsupportedOperationException("Method not decompiled: epson.maintain.EfuReader.RcxFileReader.writeRemainingData(java.io.RandomAccessFile, long, java.io.File):void");
|
|
|
}
|
|
|
|
|
|
- /* JADX WARNING: Code restructure failed: missing block: B:21:0x002f, code lost:
|
|
|
- r8.delete();
|
|
|
- */
|
|
|
- /* JADX WARNING: Code restructure failed: missing block: B:24:?, code lost:
|
|
|
- r1.close();
|
|
|
- */
|
|
|
- /* JADX WARNING: Code restructure failed: missing block: B:27:0x003c, code lost:
|
|
|
- if (r8.exists() == false) goto L_?;
|
|
|
- */
|
|
|
- /* JADX WARNING: Code restructure failed: missing block: B:38:?, code lost:
|
|
|
- return false;
|
|
|
- */
|
|
|
- /* JADX WARNING: Code restructure failed: missing block: B:39:?, code lost:
|
|
|
- return false;
|
|
|
- */
|
|
|
- /* JADX WARNING: Code restructure failed: missing block: B:40:?, code lost:
|
|
|
- return false;
|
|
|
- */
|
|
|
- /* JADX WARNING: Failed to process nested try/catch */
|
|
|
- /* JADX WARNING: Missing exception handler attribute for start block: B:18:0x0029 */
|
|
|
- /* JADX WARNING: Removed duplicated region for block: B:21:0x002f A[Catch:{ all -> 0x0027 }] */
|
|
|
- /* JADX WARNING: Removed duplicated region for block: B:23:0x0034 A[SYNTHETIC, Splitter:B:23:0x0034] */
|
|
|
- /* JADX WARNING: Removed duplicated region for block: B:29:0x0042 A[SYNTHETIC, Splitter:B:29:0x0042] */
|
|
|
- /* JADX WARNING: Removed duplicated region for block: B:38:? A[RETURN, SYNTHETIC] */
|
|
|
- /* Code decompiled incorrectly, please refer to instructions dump. */
|
|
|
+
|
|
|
static boolean searchDataAndWriteRemaining(@android.support.annotation.NonNull java.io.RandomAccessFile r4, long r5, @android.support.annotation.NonNull byte[] r7, @android.support.annotation.NonNull java.io.File r8) {
|
|
|
- /*
|
|
|
- r0 = 0
|
|
|
- r1 = 0
|
|
|
- java.io.BufferedOutputStream r2 = new java.io.BufferedOutputStream // Catch:{ IOException -> 0x0029 }
|
|
|
- java.io.FileOutputStream r3 = new java.io.FileOutputStream // Catch:{ IOException -> 0x0029 }
|
|
|
- r3.<init>(r8) // Catch:{ IOException -> 0x0029 }
|
|
|
- r2.<init>(r3) // Catch:{ IOException -> 0x0029 }
|
|
|
- seekDataPosition(r4, r5, r7) // Catch:{ IOException -> 0x0025, all -> 0x0022 }
|
|
|
- writeRemainingData(r4, r2) // Catch:{ IOException -> 0x0025, all -> 0x0022 }
|
|
|
- r4 = 1
|
|
|
- r2.close() // Catch:{ IOException -> 0x0018 }
|
|
|
- r0 = 1
|
|
|
- goto L_0x003f
|
|
|
- L_0x0018:
|
|
|
- boolean r4 = r8.exists()
|
|
|
- if (r4 == 0) goto L_0x003f
|
|
|
- L_0x001e:
|
|
|
- r8.delete()
|
|
|
- goto L_0x003f
|
|
|
- L_0x0022:
|
|
|
- r4 = move-exception
|
|
|
- r1 = r2
|
|
|
- goto L_0x0040
|
|
|
- L_0x0025:
|
|
|
- r1 = r2
|
|
|
- goto L_0x0029
|
|
|
- L_0x0027:
|
|
|
- r4 = move-exception
|
|
|
- goto L_0x0040
|
|
|
- L_0x0029:
|
|
|
- boolean r4 = r8.exists() // Catch:{ all -> 0x0027 }
|
|
|
- if (r4 == 0) goto L_0x0032
|
|
|
- r8.delete() // Catch:{ all -> 0x0027 }
|
|
|
- L_0x0032:
|
|
|
- if (r1 == 0) goto L_0x003f
|
|
|
- r1.close() // Catch:{ IOException -> 0x0038 }
|
|
|
- goto L_0x003f
|
|
|
- L_0x0038:
|
|
|
- boolean r4 = r8.exists()
|
|
|
- if (r4 == 0) goto L_0x003f
|
|
|
- goto L_0x001e
|
|
|
- L_0x003f:
|
|
|
- return r0
|
|
|
- L_0x0040:
|
|
|
- if (r1 == 0) goto L_0x004f
|
|
|
- r1.close() // Catch:{ IOException -> 0x0046 }
|
|
|
- goto L_0x004f
|
|
|
- L_0x0046:
|
|
|
- boolean r5 = r8.exists()
|
|
|
- if (r5 == 0) goto L_0x004f
|
|
|
- r8.delete()
|
|
|
- L_0x004f:
|
|
|
- throw r4
|
|
|
- */
|
|
|
+
|
|
|
throw new UnsupportedOperationException("Method not decompiled: epson.maintain.EfuReader.RcxFileReader.searchDataAndWriteRemaining(java.io.RandomAccessFile, long, byte[], java.io.File):boolean");
|
|
|
}
|
|
|
|