MD5 校验值:66bdc43743bbe9109f1c82a63c9f5e2f
h.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package i2; import a1.z; import android.util.Log; import com.bumptech.glide.load.ImageHeaderParser; import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.Charset; public final class h implements ImageHeaderParser { public static final byte[] f5834a = "Exif\u0000\u0000".getBytes(Charset.forName("UTF-8")); public static final int[] f5835b = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8}; public static final class a implements c { public final ByteBuffer f5836a; public a(ByteBuffer byteBuffer) { this.f5836a = byteBuffer; byteBuffer.order(ByteOrder.BIG_ENDIAN); } @Override public final int a() { return ((b() << 8) & 65280) | (b() & 255); } @Override public final int b() { if (this.f5836a.remaining() < 1) { return -1; } return this.f5836a.get(); } @Override public final long skip(long j10) { int min = (int) Math.min(this.f5836a.remaining(), j10); ByteBuffer byteBuffer = this.f5836a; byteBuffer.position(byteBuffer.position() + min); return min; } } public static final class b { public final ByteBuffer f5837a; public b(byte[] bArr, int i10) { this.f5837a = (ByteBuffer) ByteBuffer.wrap(bArr).order(ByteOrder.BIG_ENDIAN).limit(i10); } public final short a(int i10) { boolean z10; if (this.f5837a.remaining() - i10 >= 2) { z10 = true; } else { z10 = false; } if (z10) { return this.f5837a.getShort(i10); } return (short) -1; } } public interface c { int a(); int b(); long skip(long j10); } public static final class d implements c { public final InputStream f5838a; public d(InputStream inputStream) { this.f5838a = inputStream; } @Override public final int a() { return ((this.f5838a.read() << 8) & 65280) | (this.f5838a.read() & 255); } @Override public final int b() { return this.f5838a.read(); } public final int c(byte[] bArr, int i10) { int i11 = i10; while (i11 > 0) { int read = this.f5838a.read(bArr, i10 - i11, i11); if (read == -1) { break; } i11 -= read; } return i10 - i11; } @Override public final long skip(long j10) { if (j10 < 0) { return 0L; } long j11 = j10; while (j11 > 0) { long skip = this.f5838a.skip(j11); if (skip <= 0) { if (this.f5838a.read() == -1) { break; } skip = 1; } j11 -= skip; } return j10 - j11; } } public static ImageHeaderParser.ImageType d(c cVar) { int a3 = cVar.a(); if (a3 == 65496) { return ImageHeaderParser.ImageType.JPEG; } int a10 = ((a3 << 16) & (-65536)) | (cVar.a() & 65535); if (a10 == -1991225785) { cVar.skip(21L); if (cVar.b() >= 3) { return ImageHeaderParser.ImageType.PNG_A; } return ImageHeaderParser.ImageType.PNG; } if ((a10 >> 8) == 4671814) { return ImageHeaderParser.ImageType.GIF; } if (a10 != 1380533830) { return ImageHeaderParser.ImageType.UNKNOWN; } cVar.skip(4L); if ((((cVar.a() << 16) & (-65536)) | (cVar.a() & 65535)) != 1464156752) { return ImageHeaderParser.ImageType.UNKNOWN; } int a11 = ((cVar.a() << 16) & (-65536)) | (cVar.a() & 65535); if ((a11 & (-256)) != 1448097792) { return ImageHeaderParser.ImageType.UNKNOWN; } int i10 = a11 & 255; if (i10 == 88) { cVar.skip(4L); if ((cVar.b() & 16) != 0) { return ImageHeaderParser.ImageType.WEBP_A; } return ImageHeaderParser.ImageType.WEBP; } if (i10 == 76) { cVar.skip(4L); if ((cVar.b() & 8) != 0) { return ImageHeaderParser.ImageType.WEBP_A; } return ImageHeaderParser.ImageType.WEBP; } return ImageHeaderParser.ImageType.WEBP; } public static int e(d dVar, byte[] bArr, int i10) { boolean z10; ByteOrder byteOrder; boolean z11; int i11; boolean z12; int i12; int c10 = dVar.c(bArr, i10); if (c10 != i10) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Unable to read exif segment data, length: " + i10 + ", actually read: " + c10); } return -1; } if (bArr != null && i10 > f5834a.length) { z10 = true; } else { z10 = false; } if (z10) { int i13 = 0; while (true) { byte[] bArr2 = f5834a; if (i13 >= bArr2.length) { break; } if (bArr[i13] != bArr2[i13]) { z10 = false; break; } i13++; } } if (z10) { b bVar = new b(bArr, i10); short a3 = bVar.a(6); if (a3 != 18761) { if (a3 != 19789) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Unknown endianness = " + ((int) a3)); } byteOrder = ByteOrder.BIG_ENDIAN; } else { byteOrder = ByteOrder.BIG_ENDIAN; } } else { byteOrder = ByteOrder.LITTLE_ENDIAN; } bVar.f5837a.order(byteOrder); if (bVar.f5837a.remaining() - 10 >= 4) { z11 = true; } else { z11 = false; } if (z11) { i11 = bVar.f5837a.getInt(10); } else { i11 = -1; } int i14 = i11 + 6; short a10 = bVar.a(i14); for (int i15 = 0; i15 < a10; i15++) { int i16 = (i15 * 12) + i14 + 2; short a11 = bVar.a(i16); if (a11 == 274) { short a12 = bVar.a(i16 + 2); if (a12 >= 1 && a12 <= 12) { int i17 = i16 + 4; if (bVar.f5837a.remaining() - i17 >= 4) { z12 = true; } else { z12 = false; } if (z12) { i12 = bVar.f5837a.getInt(i17); } else { i12 = -1; } if (i12 < 0) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Negative tiff component count"); } } else { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Got tagIndex=" + i15 + " tagType=" + ((int) a11) + " formatCode=" + ((int) a12) + " componentCount=" + i12); } int i18 = i12 + f5835b[a12]; if (i18 > 4) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Got byte count > 4, not orientation, continuing, formatCode=" + ((int) a12)); } } else { int i19 = i16 + 8; if (i19 >= 0 && i19 <= bVar.f5837a.remaining()) { if (i18 >= 0 && i18 + i19 <= bVar.f5837a.remaining()) { return bVar.a(i19); } if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Illegal number of bytes for TI tag data tagType=" + ((int) a11)); } } else if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Illegal tagValueOffset=" + i19 + " tagType=" + ((int) a11)); } } } } else if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Got invalid format code = " + ((int) a12)); } } } return -1; } if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Missing jpeg exif preamble"); } return -1; } @Override public final ImageHeaderParser.ImageType a(ByteBuffer byteBuffer) { z.y(byteBuffer); return d(new a(byteBuffer)); } @Override public final ImageHeaderParser.ImageType b(InputStream inputStream) { return d(new d(inputStream)); } @Override public final int c(InputStream inputStream, c2.b bVar) { boolean z10; int i10; d dVar = new d(inputStream); z.y(bVar); int a3 = dVar.a(); if ((a3 & 65496) != 65496 && a3 != 19789 && a3 != 18761) { z10 = false; } else { z10 = true; } int i11 = -1; if (!z10) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Parser doesn't handle magic number: " + a3); } return i11; } while (true) { short read = (short) (dVar.f5838a.read() & 255); if (read != 255) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Unknown segmentId=" + ((int) read)); } } else { short read2 = (short) (dVar.f5838a.read() & 255); if (read2 == 218) { break; } if (read2 == 217) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Found MARKER_EOI in exif segment"); } } else { i10 = dVar.a() - 2; if (read2 == 225) { break; } long j10 = i10; long skip = dVar.skip(j10); if (skip != j10) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Unable to skip enough data, type: " + ((int) read2) + ", wanted to skip: " + i10 + ", but actually skipped: " + skip); } } } } } if (i10 == -1) { if (Log.isLoggable("DfltImageHeaderParser", 3)) { Log.d("DfltImageHeaderParser", "Failed to parse exif segment length, or exif segment not found"); } } else { byte[] bArr = (byte[]) bVar.c(i10, byte[].class); try { i11 = e(dVar, bArr, i10); } finally { bVar.put(bArr); } } return i11; } }