Browse Source

批量替换

liuyuqi-dellpc 3 years ago
parent
commit
6bce8d278d
1 changed files with 45 additions and 144 deletions
  1. 45 144
      app/src/main/java/com/epson/cameracopy/alt/BmpFileInfo.java

+ 45 - 144
app/src/main/java/com/epson/cameracopy/alt/BmpFileInfo.java

@@ -284,122 +284,23 @@ class BmpFileInfo {
     }
 
     public int getFileSize() {
-        return this.mFileSize;
+        return mFileSize;
     }
 
     public int getWidth() {
-        return this.mWidth;
+        return mWidth;
     }
 
     public int getHeight() {
-        return this.mHeight;
+        return mHeight;
     }
 
     public int getBitPerPixel() {
-        return this.mBitPerPixel;
+        return mBitPerPixel;
     }
 
-    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r0v3, resolved type: java.nio.channels.FileChannel} */
-    /* JADX WARNING: type inference failed for: r0v2 */
-    /* JADX WARNING: type inference failed for: r0v4, types: [java.io.FileInputStream] */
-    /* JADX WARNING: type inference failed for: r0v5 */
-    /* JADX WARNING: type inference failed for: r0v6 */
-    /* JADX WARNING: type inference failed for: r0v7 */
-    /* JADX WARNING: type inference failed for: r0v8 */
-    /* JADX WARNING: type inference failed for: r0v10 */
-    /* JADX WARNING: type inference failed for: r0v11 */
-    /* JADX WARNING: type inference failed for: r0v12 */
-    /* JADX WARNING: Multi-variable type inference failed */
-    /* JADX WARNING: Removed duplicated region for block: B:38:0x004f A[SYNTHETIC, Splitter:B:38:0x004f] */
-    /* JADX WARNING: Removed duplicated region for block: B:42:0x0056 A[SYNTHETIC, Splitter:B:42:0x0056] */
-    /* JADX WARNING: Removed duplicated region for block: B:49:0x0060 A[SYNTHETIC, Splitter:B:49:0x0060] */
-    /* JADX WARNING: Removed duplicated region for block: B:53:0x0067 A[SYNTHETIC, Splitter:B:53:0x0067] */
-    /* Code decompiled incorrectly, please refer to instructions dump. */
     public int transferImageData(java.nio.channels.WritableByteChannel r12) {
-        /*
-            r11 = this;
-            int r0 = r11.mImageDataBytes
-            r1 = 0
-            if (r0 <= 0) goto L_0x006b
-            int r0 = r11.mDataOffset
-            if (r0 > 0) goto L_0x000b
-            goto L_0x006b
-        L_0x000b:
-            r0 = 0
-            java.io.FileInputStream r2 = new java.io.FileInputStream     // Catch:{ IOException -> 0x0048, all -> 0x0045 }
-            java.lang.String r3 = r11.mFileName     // Catch:{ IOException -> 0x0048, all -> 0x0045 }
-            r2.<init>(r3)     // Catch:{ IOException -> 0x0048, all -> 0x0045 }
-            java.nio.channels.FileChannel r0 = r2.getChannel()     // Catch:{ IOException -> 0x0040, all -> 0x003e }
-            int r3 = r11.mDataOffset     // Catch:{ IOException -> 0x0040, all -> 0x003e }
-            long r5 = (long) r3     // Catch:{ IOException -> 0x0040, all -> 0x003e }
-            int r3 = r11.mImageDataBytes     // Catch:{ IOException -> 0x0040, all -> 0x003e }
-            long r7 = (long) r3     // Catch:{ IOException -> 0x0040, all -> 0x003e }
-            r4 = r0
-            r9 = r12
-            long r3 = r4.transferTo(r5, r7, r9)     // Catch:{ IOException -> 0x0040, all -> 0x003e }
-            int r12 = r11.mImageDataBytes     // Catch:{ IOException -> 0x0040, all -> 0x003e }
-            long r5 = (long) r12
-            int r12 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))
-            if (r12 >= 0) goto L_0x0033
-            r2.close()     // Catch:{ IOException -> 0x002d }
-        L_0x002d:
-            if (r0 == 0) goto L_0x0032
-            r0.close()     // Catch:{ IOException -> 0x0032 }
-        L_0x0032:
-            return r1
-        L_0x0033:
-            r2.close()     // Catch:{ IOException -> 0x0036 }
-        L_0x0036:
-            if (r0 == 0) goto L_0x003b
-            r0.close()     // Catch:{ IOException -> 0x003b }
-        L_0x003b:
-            int r12 = r11.mImageDataBytes
-            return r12
-        L_0x003e:
-            r12 = move-exception
-            goto L_0x005e
-        L_0x0040:
-            r12 = move-exception
-            r10 = r2
-            r2 = r0
-            r0 = r10
-            goto L_0x004a
-        L_0x0045:
-            r12 = move-exception
-            r2 = r0
-            goto L_0x005e
-        L_0x0048:
-            r12 = move-exception
-            r2 = r0
-        L_0x004a:
-            r12.printStackTrace()     // Catch:{ all -> 0x005a }
-            if (r0 == 0) goto L_0x0054
-            r0.close()     // Catch:{ IOException -> 0x0053 }
-            goto L_0x0054
-        L_0x0053:
-        L_0x0054:
-            if (r2 == 0) goto L_0x0059
-            r2.close()     // Catch:{ IOException -> 0x0059 }
-        L_0x0059:
-            return r1
-        L_0x005a:
-            r12 = move-exception
-            r10 = r2
-            r2 = r0
-            r0 = r10
-        L_0x005e:
-            if (r2 == 0) goto L_0x0065
-            r2.close()     // Catch:{ IOException -> 0x0064 }
-            goto L_0x0065
-        L_0x0064:
-        L_0x0065:
-            if (r0 == 0) goto L_0x006a
-            r0.close()     // Catch:{ IOException -> 0x006a }
-        L_0x006a:
-            throw r12
-        L_0x006b:
-            return r1
-        */
+
         throw new UnsupportedOperationException("Method not decompiled: com.epson.cameracopy.alt.BmpFileInfo.transferImageData(java.nio.channels.WritableByteChannel):int");
     }
 
@@ -408,7 +309,7 @@ class BmpFileInfo {
         if (transferImageData <= 0) {
             return false;
         }
-        bmpFileInfo.addSize(transferImageData, this.mHeight);
+        bmpFileInfo.addSize(transferImageData, mHeight);
         return true;
     }
 
@@ -418,17 +319,17 @@ class BmpFileInfo {
         allocate.order(ByteOrder.LITTLE_ENDIAN);
         allocate.put((byte) 66);
         allocate.put((byte) 77);
-        allocate.putInt(this.mFileSize);
+        allocate.putInt(mFileSize);
         allocate.putShort(0);
         allocate.putShort(0);
-        allocate.putInt(this.mDataOffset);
-        allocate.putInt(this.mHeaderSize);
-        allocate.putInt(this.mWidth);
+        allocate.putInt(mDataOffset);
+        allocate.putInt(mHeaderSize);
+        allocate.putInt(mWidth);
         allocate.putInt(0);
         allocate.putShort(1);
-        allocate.putShort((short) this.mBitPerPixel);
+        allocate.putShort((short) mBitPerPixel);
         allocate.putInt(0);
-        allocate.putInt(this.mImageDataBytes);
+        allocate.putInt(mImageDataBytes);
         allocate.putInt(0);
         allocate.putInt(0);
         allocate.putInt(0);
@@ -439,23 +340,23 @@ class BmpFileInfo {
     }
 
     public boolean prepareAppendData() {
-        this.mWriteChannel = null;
+        mWriteChannel = null;
         try {
-            this.mOfs = new RandomAccessFile(this.mFileName, "rw");
-            this.mWriteChannel = this.mOfs.getChannel();
-            writeHeader(this.mWriteChannel);
-            this.mWriteChannel.position((long) this.mDataOffset);
+            mOfs = new RandomAccessFile(mFileName, "rw");
+            mWriteChannel = mOfs.getChannel();
+            writeHeader(mWriteChannel);
+            mWriteChannel.position((long) mDataOffset);
             return true;
         } catch (IOException e) {
             e.printStackTrace();
-            RandomAccessFile randomAccessFile = this.mOfs;
+            RandomAccessFile randomAccessFile = mOfs;
             if (randomAccessFile != null) {
                 try {
                     randomAccessFile.close();
                 } catch (IOException unused) {
                 }
             }
-            FileChannel fileChannel = this.mWriteChannel;
+            FileChannel fileChannel = mWriteChannel;
             if (fileChannel == null) {
                 return false;
             }
@@ -463,32 +364,32 @@ class BmpFileInfo {
                 fileChannel.close();
             } catch (IOException unused2) {
             }
-            this.mWriteChannel = null;
+            mWriteChannel = null;
             return false;
         }
     }
 
     public void closeWriteableChannel() {
-        FileChannel fileChannel = this.mWriteChannel;
+        FileChannel fileChannel = mWriteChannel;
         if (fileChannel != null) {
             try {
                 fileChannel.close();
             } catch (IOException unused) {
             }
-            this.mWriteChannel = null;
+            mWriteChannel = null;
         }
-        RandomAccessFile randomAccessFile = this.mOfs;
+        RandomAccessFile randomAccessFile = mOfs;
         if (randomAccessFile != null) {
             try {
                 randomAccessFile.close();
             } catch (IOException unused2) {
             }
-            this.mOfs = null;
+            mOfs = null;
         }
     }
 
     protected WritableByteChannel getWritableChannelChannel() {
-        return this.mWriteChannel;
+        return mWriteChannel;
     }
 
     public boolean updateHeader() {
@@ -496,44 +397,44 @@ class BmpFileInfo {
         allocate.clear();
         allocate.order(ByteOrder.LITTLE_ENDIAN);
         try {
-            this.mWriteChannel.position(0);
-            if (((long) this.mWriteChannel.read(allocate)) < 38) {
-                FileChannel fileChannel = this.mWriteChannel;
+            mWriteChannel.position(0);
+            if (((long) mWriteChannel.read(allocate)) < 38) {
+                FileChannel fileChannel = mWriteChannel;
                 if (fileChannel != null) {
                     try {
                         fileChannel.close();
                     } catch (IOException unused) {
                     }
-                    this.mWriteChannel = null;
+                    mWriteChannel = null;
                 }
-                RandomAccessFile randomAccessFile = this.mOfs;
+                RandomAccessFile randomAccessFile = mOfs;
                 if (randomAccessFile != null) {
                     try {
                         randomAccessFile.close();
                     } catch (IOException unused2) {
                     }
-                    this.mOfs = null;
+                    mOfs = null;
                 }
                 return false;
             }
             allocate.position(2);
-            allocate.putInt(this.mFileSize);
+            allocate.putInt(mFileSize);
             allocate.position(22);
-            allocate.putInt(this.mHeight);
+            allocate.putInt(mHeight);
             allocate.position(34);
-            allocate.putInt(this.mImageDataBytes);
+            allocate.putInt(mImageDataBytes);
             allocate.rewind();
-            this.mWriteChannel.position(0);
-            this.mWriteChannel.write(allocate);
-            FileChannel fileChannel2 = this.mWriteChannel;
+            mWriteChannel.position(0);
+            mWriteChannel.write(allocate);
+            FileChannel fileChannel2 = mWriteChannel;
             if (fileChannel2 != null) {
                 try {
                     fileChannel2.close();
                 } catch (IOException unused3) {
                 }
-                this.mWriteChannel = null;
+                mWriteChannel = null;
             }
-            RandomAccessFile randomAccessFile2 = this.mOfs;
+            RandomAccessFile randomAccessFile2 = mOfs;
             if (randomAccessFile2 == null) {
                 return true;
             }
@@ -541,29 +442,29 @@ class BmpFileInfo {
                 randomAccessFile2.close();
             } catch (IOException unused4) {
             }
-            this.mOfs = null;
+            mOfs = null;
             return true;
         } catch (IOException e) {
             e.printStackTrace();
-            FileChannel fileChannel3 = this.mWriteChannel;
+            FileChannel fileChannel3 = mWriteChannel;
             if (fileChannel3 != null) {
                 try {
                     fileChannel3.close();
                 } catch (IOException unused5) {
                 }
-                this.mWriteChannel = null;
+                mWriteChannel = null;
             }
-            RandomAccessFile randomAccessFile3 = this.mOfs;
+            RandomAccessFile randomAccessFile3 = mOfs;
             if (randomAccessFile3 != null) {
                 try {
                     randomAccessFile3.close();
                 } catch (IOException unused6) {
                 }
-                this.mOfs = null;
+                mOfs = null;
             }
             return false;
         } catch (Throwable th) {
-            FileChannel fileChannel4 = this.mWriteChannel;
+            FileChannel fileChannel4 = mWriteChannel;
             if (fileChannel4 != null) {
                 try {
                     fileChannel4.close();