MD5 校验值:1c0b849068c6d731df1325f993a128f9
a.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package o; import android.content.res.AssetManager; import android.util.Log; import com.google.android.gms.ads.RequestConfiguration; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.Closeable; import java.io.DataInput; import java.io.DataInputStream; import java.io.EOFException; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.Charset; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.TimeZone; import java.util.regex.Pattern; public class a { private static final c[] D; private static final c[] E; private static final c[] F; private static final c[] G; private static final c[] H; private static final c I; private static final c[] J; private static final c[] K; private static final c[] L; private static final c[] M; static final c[][] N; private static final c[] O; private static final c P; private static final c Q; private static final HashMap<Integer, c>[] R; private static final HashMap<String, c>[] S; private static final HashSet<String> T; private static final HashMap<Integer, Integer> U; static final Charset V; static final byte[] W; private static final Pattern X; private static final Pattern Y; private static SimpleDateFormat f19619z; private final String f19620a; private final AssetManager.AssetInputStream f19621b; private int f19622c; private final HashMap<String, b>[] f19623d; private Set<Integer> f19624e; private ByteOrder f19625f; private boolean f19626g; private int f19627h; private int f19628i; private byte[] f19629j; private int f19630k; private int f19631l; private int f19632m; private int f19633n; private int f19634o; private int f19635p; private boolean f19636q; private static final List<Integer> f19611r = Arrays.asList(1, 6, 3, 8); private static final List<Integer> f19612s = Arrays.asList(2, 7, 4, 5); public static final int[] f19613t = {8, 8, 8}; public static final int[] f19614u = {4}; public static final int[] f19615v = {8}; static final byte[] f19616w = {-1, -40, -1}; private static final byte[] f19617x = {79, 76, 89, 77, 80, 0}; private static final byte[] f19618y = {79, 76, 89, 77, 80, 85, 83, 0, 73, 73}; static final String[] A = {RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "BYTE", "STRING", "USHORT", "ULONG", "URATIONAL", "SBYTE", "UNDEFINED", "SSHORT", "SLONG", "SRATIONAL", "SINGLE", "DOUBLE"}; static final int[] B = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 1}; static final byte[] C = {65, 83, 67, 73, 73, 0, 0, 0}; public static class b { public final int f19643a; public final int f19644b; public final byte[] f19645c; b(int i6, int i7, byte[] bArr) { this.f19643a = i6; this.f19644b = i7; this.f19645c = bArr; } public static b a(String str) { byte[] bytes = (str + (char) 0).getBytes(a.V); return new b(2, bytes.length, bytes); } public static b b(long j6, ByteOrder byteOrder) { return c(new long[]{j6}, byteOrder); } public static b c(long[] jArr, ByteOrder byteOrder) { ByteBuffer wrap = ByteBuffer.wrap(new byte[a.B[4] * jArr.length]); wrap.order(byteOrder); for (long j6 : jArr) { wrap.putInt((int) j6); } return new b(4, jArr.length, wrap.array()); } public static b d(d dVar, ByteOrder byteOrder) { return e(new d[]{dVar}, byteOrder); } public static b e(d[] dVarArr, ByteOrder byteOrder) { ByteBuffer wrap = ByteBuffer.wrap(new byte[a.B[5] * dVarArr.length]); wrap.order(byteOrder); for (d dVar : dVarArr) { wrap.putInt((int) dVar.f19650a); wrap.putInt((int) dVar.f19651b); } return new b(5, dVarArr.length, wrap.array()); } public static b f(int i6, ByteOrder byteOrder) { return g(new int[]{i6}, byteOrder); } public static b g(int[] iArr, ByteOrder byteOrder) { ByteBuffer wrap = ByteBuffer.wrap(new byte[a.B[3] * iArr.length]); wrap.order(byteOrder); for (int i6 : iArr) { wrap.putShort((short) i6); } return new b(3, iArr.length, wrap.array()); } public double h(ByteOrder byteOrder) { Object k6 = k(byteOrder); if (k6 != null) { if (k6 instanceof String) { return Double.parseDouble((String) k6); } if (k6 instanceof long[]) { if (((long[]) k6).length == 1) { return r5[0]; } throw new NumberFormatException("There are more than one component"); } if (k6 instanceof int[]) { if (((int[]) k6).length == 1) { return r5[0]; } throw new NumberFormatException("There are more than one component"); } if (k6 instanceof double[]) { double[] dArr = (double[]) k6; if (dArr.length == 1) { return dArr[0]; } throw new NumberFormatException("There are more than one component"); } if (k6 instanceof d[]) { d[] dVarArr = (d[]) k6; if (dVarArr.length == 1) { return dVarArr[0].a(); } throw new NumberFormatException("There are more than one component"); } throw new NumberFormatException("Couldn't find a double value"); } throw new NumberFormatException("NULL can't be converted to a double value"); } public int i(ByteOrder byteOrder) { Object k6 = k(byteOrder); if (k6 != null) { if (k6 instanceof String) { return Integer.parseInt((String) k6); } if (k6 instanceof long[]) { long[] jArr = (long[]) k6; if (jArr.length == 1) { return (int) jArr[0]; } throw new NumberFormatException("There are more than one component"); } if (k6 instanceof int[]) { int[] iArr = (int[]) k6; if (iArr.length == 1) { return iArr[0]; } throw new NumberFormatException("There are more than one component"); } throw new NumberFormatException("Couldn't find a integer value"); } throw new NumberFormatException("NULL can't be converted to a integer value"); } public String j(ByteOrder byteOrder) { Object k6 = k(byteOrder); if (k6 == null) { return null; } if (k6 instanceof String) { return (String) k6; } StringBuilder sb = new StringBuilder(); int i6 = 0; if (k6 instanceof long[]) { long[] jArr = (long[]) k6; while (i6 < jArr.length) { sb.append(jArr[i6]); i6++; if (i6 != jArr.length) { sb.append(","); } } return sb.toString(); } if (k6 instanceof int[]) { int[] iArr = (int[]) k6; while (i6 < iArr.length) { sb.append(iArr[i6]); i6++; if (i6 != iArr.length) { sb.append(","); } } return sb.toString(); } if (k6 instanceof double[]) { double[] dArr = (double[]) k6; while (i6 < dArr.length) { sb.append(dArr[i6]); i6++; if (i6 != dArr.length) { sb.append(","); } } return sb.toString(); } if (!(k6 instanceof d[])) { return null; } d[] dVarArr = (d[]) k6; while (i6 < dVarArr.length) { sb.append(dVarArr[i6].f19650a); sb.append('/'); sb.append(dVarArr[i6].f19651b); i6++; if (i6 != dVarArr.length) { sb.append(","); } } return sb.toString(); } Object k(ByteOrder byteOrder) { C0104a c0104a; InputStream inputStream; byte b6; byte[] bArr; InputStream inputStream2 = null; try { try { c0104a = new C0104a(this.f19645c); try { c0104a.d(byteOrder); boolean z5 = true; int i6 = 0; switch (this.f19643a) { case 1: case 6: byte[] bArr2 = this.f19645c; if (bArr2.length == 1 && bArr2[0] >= 0 && bArr2[0] <= 1) { String str = new String(new char[]{(char) (bArr2[0] + 48)}); try { c0104a.close(); } catch (IOException e6) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e6); } return str; } String str2 = new String(bArr2, a.V); try { c0104a.close(); } catch (IOException e7) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e7); } return str2; case 2: case 7: if (this.f19644b >= a.C.length) { int i7 = 0; while (true) { bArr = a.C; if (i7 < bArr.length) { if (this.f19645c[i7] != bArr[i7]) { z5 = false; } else { i7++; } } } if (z5) { i6 = bArr.length; } } StringBuilder sb = new StringBuilder(); while (i6 < this.f19644b && (b6 = this.f19645c[i6]) != 0) { if (b6 >= 32) { sb.append((char) b6); } else { sb.append('?'); } i6++; } String sb2 = sb.toString(); try { c0104a.close(); } catch (IOException e8) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e8); } return sb2; case 3: int[] iArr = new int[this.f19644b]; while (i6 < this.f19644b) { iArr[i6] = c0104a.readUnsignedShort(); i6++; } try { c0104a.close(); } catch (IOException e9) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e9); } return iArr; case 4: long[] jArr = new long[this.f19644b]; while (i6 < this.f19644b) { jArr[i6] = c0104a.b(); i6++; } try { c0104a.close(); } catch (IOException e10) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e10); } return jArr; case 5: d[] dVarArr = new d[this.f19644b]; while (i6 < this.f19644b) { dVarArr[i6] = new d(c0104a.b(), c0104a.b()); i6++; } try { c0104a.close(); } catch (IOException e11) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e11); } return dVarArr; case 8: int[] iArr2 = new int[this.f19644b]; while (i6 < this.f19644b) { iArr2[i6] = c0104a.readShort(); i6++; } try { c0104a.close(); } catch (IOException e12) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e12); } return iArr2; case 9: int[] iArr3 = new int[this.f19644b]; while (i6 < this.f19644b) { iArr3[i6] = c0104a.readInt(); i6++; } try { c0104a.close(); } catch (IOException e13) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e13); } return iArr3; case 10: d[] dVarArr2 = new d[this.f19644b]; while (i6 < this.f19644b) { dVarArr2[i6] = new d(c0104a.readInt(), c0104a.readInt()); i6++; } try { c0104a.close(); } catch (IOException e14) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e14); } return dVarArr2; case 11: double[] dArr = new double[this.f19644b]; while (i6 < this.f19644b) { dArr[i6] = c0104a.readFloat(); i6++; } try { c0104a.close(); } catch (IOException e15) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e15); } return dArr; case 12: double[] dArr2 = new double[this.f19644b]; while (i6 < this.f19644b) { dArr2[i6] = c0104a.readDouble(); i6++; } try { c0104a.close(); } catch (IOException e16) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e16); } return dArr2; default: try { c0104a.close(); } catch (IOException e17) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e17); } return null; } } catch (IOException e18) { e = e18; Log.w("ExifInterface", "IOException occurred during reading a value", e); if (c0104a != null) { try { c0104a.close(); } catch (IOException e19) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e19); } } return null; } } catch (Throwable th) { th = th; inputStream2 = inputStream; if (inputStream2 != null) { try { inputStream2.close(); } catch (IOException e20) { Log.e("ExifInterface", "IOException occurred while closing InputStream", e20); } } throw th; } } catch (IOException e21) { e = e21; c0104a = null; } catch (Throwable th2) { th = th2; if (inputStream2 != null) { } throw th; } } public String toString() { return "(" + a.A[this.f19643a] + ", data length:" + this.f19645c.length + ")"; } } public static class d { public final long f19650a; public final long f19651b; d(long j6, long j7) { if (j7 == 0) { this.f19650a = 0L; this.f19651b = 1L; } else { this.f19650a = j6; this.f19651b = j7; } } public double a() { double d6 = this.f19650a; double d7 = this.f19651b; Double.isNaN(d6); Double.isNaN(d7); return d6 / d7; } public String toString() { return this.f19650a + "/" + this.f19651b; } } static { c[] cVarArr = {new c("NewSubfileType", 254, 4), new c("SubfileType", 255, 4), new c("ImageWidth", 256, 3, 4), new c("ImageLength", 257, 3, 4), new c("BitsPerSample", 258, 3), new c("Compression", 259, 3), new c("PhotometricInterpretation", 262, 3), new c("ImageDescription", 270, 2), new c("Make", 271, 2), new c("Model", 272, 2), new c("StripOffsets", 273, 3, 4), new c("Orientation", 274, 3), new c("SamplesPerPixel", 277, 3), new c("RowsPerStrip", 278, 3, 4), new c("StripByteCounts", 279, 3, 4), new c("XResolution", 282, 5), new c("YResolution", 283, 5), new c("PlanarConfiguration", 284, 3), new c("ResolutionUnit", 296, 3), new c("TransferFunction", 301, 3), new c("Software", 305, 2), new c("DateTime", 306, 2), new c("Artist", 315, 2), new c("WhitePoint", 318, 5), new c("PrimaryChromaticities", 319, 5), new c("SubIFDPointer", 330, 4), new c("JPEGInterchangeFormat", 513, 4), new c("JPEGInterchangeFormatLength", 514, 4), new c("YCbCrCoefficients", 529, 5), new c("YCbCrSubSampling", 530, 3), new c("YCbCrPositioning", 531, 3), new c("ReferenceBlackWhite", 532, 5), new c("Copyright", 33432, 2), new c("ExifIFDPointer", 34665, 4), new c("GPSInfoIFDPointer", 34853, 4), new c("SensorTopBorder", 4, 4), new c("SensorLeftBorder", 5, 4), new c("SensorBottomBorder", 6, 4), new c("SensorRightBorder", 7, 4), new c("ISO", 23, 3), new c("JpgFromRaw", 46, 7)}; D = cVarArr; c[] cVarArr2 = {new c("ExposureTime", 33434, 5), new c("FNumber", 33437, 5), new c("ExposureProgram", 34850, 3), new c("SpectralSensitivity", 34852, 2), new c("PhotographicSensitivity", 34855, 3), new c("OECF", 34856, 7), new c("ExifVersion", 36864, 2), new c("DateTimeOriginal", 36867, 2), new c("DateTimeDigitized", 36868, 2), new c("ComponentsConfiguration", 37121, 7), new c("CompressedBitsPerPixel", 37122, 5), new c("ShutterSpeedValue", 37377, 10), new c("ApertureValue", 37378, 5), new c("BrightnessValue", 37379, 10), new c("ExposureBiasValue", 37380, 10), new c("MaxApertureValue", 37381, 5), new c("SubjectDistance", 37382, 5), new c("MeteringMode", 37383, 3), new c("LightSource", 37384, 3), new c("Flash", 37385, 3), new c("FocalLength", 37386, 5), new c("SubjectArea", 37396, 3), new c("MakerNote", 37500, 7), new c("UserComment", 37510, 7), new c("SubSecTime", 37520, 2), new c("SubSecTimeOriginal", 37521, 2), new c("SubSecTimeDigitized", 37522, 2), new c("FlashpixVersion", 40960, 7), new c("ColorSpace", 40961, 3), new c("PixelXDimension", 40962, 3, 4), new c("PixelYDimension", 40963, 3, 4), new c("RelatedSoundFile", 40964, 2), new c("InteroperabilityIFDPointer", 40965, 4), new c("FlashEnergy", 41483, 5), new c("SpatialFrequencyResponse", 41484, 7), new c("FocalPlaneXResolution", 41486, 5), new c("FocalPlaneYResolution", 41487, 5), new c("FocalPlaneResolutionUnit", 41488, 3), new c("SubjectLocation", 41492, 3), new c("ExposureIndex", 41493, 5), new c("SensingMethod", 41495, 3), new c("FileSource", 41728, 7), new c("SceneType", 41729, 7), new c("CFAPattern", 41730, 7), new c("CustomRendered", 41985, 3), new c("ExposureMode", 41986, 3), new c("WhiteBalance", 41987, 3), new c("DigitalZoomRatio", 41988, 5), new c("FocalLengthIn35mmFilm", 41989, 3), new c("SceneCaptureType", 41990, 3), new c("GainControl", 41991, 3), new c("Contrast", 41992, 3), new c("Saturation", 41993, 3), new c("Sharpness", 41994, 3), new c("DeviceSettingDescription", 41995, 7), new c("SubjectDistanceRange", 41996, 3), new c("ImageUniqueID", 42016, 2), new c("DNGVersion", 50706, 1), new c("DefaultCropSize", 50720, 3, 4)}; E = cVarArr2; c[] cVarArr3 = {new c("GPSVersionID", 0, 1), new c("GPSLatitudeRef", 1, 2), new c("GPSLatitude", 2, 5), new c("GPSLongitudeRef", 3, 2), new c("GPSLongitude", 4, 5), new c("GPSAltitudeRef", 5, 1), new c("GPSAltitude", 6, 5), new c("GPSTimeStamp", 7, 5), new c("GPSSatellites", 8, 2), new c("GPSStatus", 9, 2), new c("GPSMeasureMode", 10, 2), new c("GPSDOP", 11, 5), new c("GPSSpeedRef", 12, 2), new c("GPSSpeed", 13, 5), new c("GPSTrackRef", 14, 2), new c("GPSTrack", 15, 5), new c("GPSImgDirectionRef", 16, 2), new c("GPSImgDirection", 17, 5), new c("GPSMapDatum", 18, 2), new c("GPSDestLatitudeRef", 19, 2), new c("GPSDestLatitude", 20, 5), new c("GPSDestLongitudeRef", 21, 2), new c("GPSDestLongitude", 22, 5), new c("GPSDestBearingRef", 23, 2), new c("GPSDestBearing", 24, 5), new c("GPSDestDistanceRef", 25, 2), new c("GPSDestDistance", 26, 5), new c("GPSProcessingMethod", 27, 7), new c("GPSAreaInformation", 28, 7), new c("GPSDateStamp", 29, 2), new c("GPSDifferential", 30, 3)}; F = cVarArr3; c[] cVarArr4 = {new c("InteroperabilityIndex", 1, 2)}; G = cVarArr4; c[] cVarArr5 = {new c("NewSubfileType", 254, 4), new c("SubfileType", 255, 4), new c("ThumbnailImageWidth", 256, 3, 4), new c("ThumbnailImageLength", 257, 3, 4), new c("BitsPerSample", 258, 3), new c("Compression", 259, 3), new c("PhotometricInterpretation", 262, 3), new c("ImageDescription", 270, 2), new c("Make", 271, 2), new c("Model", 272, 2), new c("StripOffsets", 273, 3, 4), new c("Orientation", 274, 3), new c("SamplesPerPixel", 277, 3), new c("RowsPerStrip", 278, 3, 4), new c("StripByteCounts", 279, 3, 4), new c("XResolution", 282, 5), new c("YResolution", 283, 5), new c("PlanarConfiguration", 284, 3), new c("ResolutionUnit", 296, 3), new c("TransferFunction", 301, 3), new c("Software", 305, 2), new c("DateTime", 306, 2), new c("Artist", 315, 2), new c("WhitePoint", 318, 5), new c("PrimaryChromaticities", 319, 5), new c("SubIFDPointer", 330, 4), new c("JPEGInterchangeFormat", 513, 4), new c("JPEGInterchangeFormatLength", 514, 4), new c("YCbCrCoefficients", 529, 5), new c("YCbCrSubSampling", 530, 3), new c("YCbCrPositioning", 531, 3), new c("ReferenceBlackWhite", 532, 5), new c("Copyright", 33432, 2), new c("ExifIFDPointer", 34665, 4), new c("GPSInfoIFDPointer", 34853, 4), new c("DNGVersion", 50706, 1), new c("DefaultCropSize", 50720, 3, 4)}; H = cVarArr5; I = new c("StripOffsets", 273, 3); c[] cVarArr6 = {new c("ThumbnailImage", 256, 7), new c("CameraSettingsIFDPointer", 8224, 4), new c("ImageProcessingIFDPointer", 8256, 4)}; J = cVarArr6; c[] cVarArr7 = {new c("PreviewImageStart", 257, 4), new c("PreviewImageLength", 258, 4)}; K = cVarArr7; c[] cVarArr8 = {new c("AspectFrame", 4371, 3)}; L = cVarArr8; c[] cVarArr9 = {new c("ColorSpace", 55, 3)}; M = cVarArr9; c[][] cVarArr10 = {cVarArr, cVarArr2, cVarArr3, cVarArr4, cVarArr5, cVarArr, cVarArr6, cVarArr7, cVarArr8, cVarArr9}; N = cVarArr10; O = new c[]{new c("SubIFDPointer", 330, 4), new c("ExifIFDPointer", 34665, 4), new c("GPSInfoIFDPointer", 34853, 4), new c("InteroperabilityIFDPointer", 40965, 4), new c("CameraSettingsIFDPointer", 8224, 1), new c("ImageProcessingIFDPointer", 8256, 1)}; P = new c("JPEGInterchangeFormat", 513, 4); Q = new c("JPEGInterchangeFormatLength", 514, 4); R = new HashMap[cVarArr10.length]; S = new HashMap[cVarArr10.length]; T = new HashSet<>(Arrays.asList("FNumber", "DigitalZoomRatio", "ExposureTime", "SubjectDistance", "GPSTimeStamp")); U = new HashMap<>(); Charset forName = Charset.forName("US-ASCII"); V = forName; W = "Exif\u0000\u0000".getBytes(forName); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss"); f19619z = simpleDateFormat; simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); int i6 = 0; while (true) { c[][] cVarArr11 = N; if (i6 < cVarArr11.length) { R[i6] = new HashMap<>(); S[i6] = new HashMap<>(); for (c cVar : cVarArr11[i6]) { R[i6].put(Integer.valueOf(cVar.f19646a), cVar); S[i6].put(cVar.f19647b, cVar); } i6++; } else { HashMap<Integer, Integer> hashMap = U; c[] cVarArr12 = O; hashMap.put(Integer.valueOf(cVarArr12[0].f19646a), 5); hashMap.put(Integer.valueOf(cVarArr12[1].f19646a), 1); hashMap.put(Integer.valueOf(cVarArr12[2].f19646a), 2); hashMap.put(Integer.valueOf(cVarArr12[3].f19646a), 3); hashMap.put(Integer.valueOf(cVarArr12[4].f19646a), 7); hashMap.put(Integer.valueOf(cVarArr12[5].f19646a), 8); X = Pattern.compile(".*[1-9].*"); Y = Pattern.compile("^([0-9][0-9]):([0-9][0-9]):([0-9][0-9])$"); return; } } } public a(String str) throws IOException { c[][] cVarArr = N; this.f19623d = new HashMap[cVarArr.length]; this.f19624e = new HashSet(cVarArr.length); this.f19625f = ByteOrder.BIG_ENDIAN; if (str != null) { FileInputStream fileInputStream = null; this.f19621b = null; this.f19620a = str; try { FileInputStream fileInputStream2 = new FileInputStream(str); try { u(fileInputStream2); b(fileInputStream2); } catch (Throwable th) { th = th; fileInputStream = fileInputStream2; b(fileInputStream); throw th; } } catch (Throwable th2) { th = th2; } } else { throw new IllegalArgumentException("filename cannot be null"); } } private void A(C0104a c0104a) throws IOException { HashMap<String, b> hashMap = this.f19623d[4]; b bVar = hashMap.get("Compression"); if (bVar != null) { int i6 = bVar.i(this.f19625f); this.f19630k = i6; if (i6 != 1) { if (i6 == 6) { m(c0104a, hashMap); return; } else if (i6 != 7) { return; } } if (s(hashMap)) { n(c0104a, hashMap); return; } return; } this.f19630k = 6; m(c0104a, hashMap); } private void B(int i6, int i7) throws IOException { if (this.f19623d[i6].isEmpty() || this.f19623d[i7].isEmpty()) { return; } b bVar = this.f19623d[i6].get("ImageLength"); b bVar2 = this.f19623d[i6].get("ImageWidth"); b bVar3 = this.f19623d[i7].get("ImageLength"); b bVar4 = this.f19623d[i7].get("ImageWidth"); if (bVar == null || bVar2 == null || bVar3 == null || bVar4 == null) { return; } int i8 = bVar.i(this.f19625f); int i9 = bVar2.i(this.f19625f); int i10 = bVar3.i(this.f19625f); int i11 = bVar4.i(this.f19625f); if (i8 >= i10 || i9 >= i11) { return; } HashMap<String, b>[] hashMapArr = this.f19623d; HashMap<String, b> hashMap = hashMapArr[i6]; hashMapArr[i6] = hashMapArr[i7]; hashMapArr[i7] = hashMap; } private void C(C0104a c0104a, int i6) throws IOException { b f6; b f7; b bVar = this.f19623d[i6].get("DefaultCropSize"); b bVar2 = this.f19623d[i6].get("SensorTopBorder"); b bVar3 = this.f19623d[i6].get("SensorLeftBorder"); b bVar4 = this.f19623d[i6].get("SensorBottomBorder"); b bVar5 = this.f19623d[i6].get("SensorRightBorder"); if (bVar == null) { if (bVar2 != null && bVar3 != null && bVar4 != null && bVar5 != null) { int i7 = bVar2.i(this.f19625f); int i8 = bVar4.i(this.f19625f); int i9 = bVar5.i(this.f19625f); int i10 = bVar3.i(this.f19625f); if (i8 <= i7 || i9 <= i10) { return; } b f8 = b.f(i8 - i7, this.f19625f); b f9 = b.f(i9 - i10, this.f19625f); this.f19623d[i6].put("ImageLength", f8); this.f19623d[i6].put("ImageWidth", f9); return; } z(c0104a, i6); return; } if (bVar.f19643a == 5) { d[] dVarArr = (d[]) bVar.k(this.f19625f); if (dVarArr != null && dVarArr.length == 2) { f6 = b.d(dVarArr[0], this.f19625f); f7 = b.d(dVarArr[1], this.f19625f); } else { Log.w("ExifInterface", "Invalid crop size values. cropSize=" + Arrays.toString(dVarArr)); return; } } else { int[] iArr = (int[]) bVar.k(this.f19625f); if (iArr != null && iArr.length == 2) { f6 = b.f(iArr[0], this.f19625f); f7 = b.f(iArr[1], this.f19625f); } else { Log.w("ExifInterface", "Invalid crop size values. cropSize=" + Arrays.toString(iArr)); return; } } this.f19623d[i6].put("ImageWidth", f6); this.f19623d[i6].put("ImageLength", f7); } private void D(InputStream inputStream) throws IOException { B(0, 5); B(0, 4); B(5, 4); b bVar = this.f19623d[1].get("PixelXDimension"); b bVar2 = this.f19623d[1].get("PixelYDimension"); if (bVar != null && bVar2 != null) { this.f19623d[0].put("ImageWidth", bVar); this.f19623d[0].put("ImageLength", bVar2); } if (this.f19623d[4].isEmpty() && t(this.f19623d[5])) { HashMap<String, b>[] hashMapArr = this.f19623d; hashMapArr[4] = hashMapArr[5]; hashMapArr[5] = new HashMap<>(); } t(this.f19623d[4]); } private void a() { String d6 = d("DateTimeOriginal"); if (d6 != null && d("DateTime") == null) { this.f19623d[0].put("DateTime", b.a(d6)); } if (d("ImageWidth") == null) { this.f19623d[0].put("ImageWidth", b.b(0L, this.f19625f)); } if (d("ImageLength") == null) { this.f19623d[0].put("ImageLength", b.b(0L, this.f19625f)); } if (d("Orientation") == null) { this.f19623d[0].put("Orientation", b.b(0L, this.f19625f)); } if (d("LightSource") == null) { this.f19623d[1].put("LightSource", b.b(0L, this.f19625f)); } } private static void b(Closeable closeable) { if (closeable != null) { try { closeable.close(); } catch (RuntimeException e6) { throw e6; } catch (Exception unused) { } } } private static long[] c(Object obj) { if (obj instanceof int[]) { int[] iArr = (int[]) obj; long[] jArr = new long[iArr.length]; for (int i6 = 0; i6 < iArr.length; i6++) { jArr[i6] = iArr[i6]; } return jArr; } if (obj instanceof long[]) { return (long[]) obj; } return null; } private b f(String str) { if ("ISOSpeedRatings".equals(str)) { str = "PhotographicSensitivity"; } for (int i6 = 0; i6 < N.length; i6++) { b bVar = this.f19623d[i6].get(str); if (bVar != null) { return bVar; } } return null; } private void g(C0104a c0104a, int i6, int i7) throws IOException { c0104a.d(ByteOrder.BIG_ENDIAN); c0104a.c(i6); byte readByte = c0104a.readByte(); if (readByte == -1) { int i8 = i6 + 1; if (c0104a.readByte() != -40) { throw new IOException("Invalid marker: " + Integer.toHexString(readByte & 255)); } int i9 = i8 + 1; while (true) { byte readByte2 = c0104a.readByte(); if (readByte2 == -1) { byte readByte3 = c0104a.readByte(); int i10 = i9 + 1 + 1; if (readByte3 != -39 && readByte3 != -38) { int readUnsignedShort = c0104a.readUnsignedShort() - 2; int i11 = i10 + 2; if (readUnsignedShort < 0) { throw new IOException("Invalid length"); } if (readByte3 != -31) { if (readByte3 != -2) { switch (readByte3) { default: switch (readByte3) { default: switch (readByte3) { default: switch (readByte3) { } case -55: case -54: case -53: if (c0104a.skipBytes(1) == 1) { this.f19623d[i7].put("ImageLength", b.b(c0104a.readUnsignedShort(), this.f19625f)); this.f19623d[i7].put("ImageWidth", b.b(c0104a.readUnsignedShort(), this.f19625f)); readUnsignedShort -= 5; break; } else { throw new IOException("Invalid SOFx"); } } case -59: case -58: case -57: break; } case -64: case -63: case -62: case -61: break; } } else { byte[] bArr = new byte[readUnsignedShort]; if (c0104a.read(bArr) == readUnsignedShort) { if (d("UserComment") == null) { this.f19623d[1].put("UserComment", b.a(new String(bArr, V))); } readUnsignedShort = 0; } else { throw new IOException("Invalid exif"); } } } else if (readUnsignedShort >= 6) { byte[] bArr2 = new byte[6]; if (c0104a.read(bArr2) == 6) { i11 += 6; readUnsignedShort -= 6; if (Arrays.equals(bArr2, W)) { if (readUnsignedShort > 0) { this.f19631l = i11; byte[] bArr3 = new byte[readUnsignedShort]; if (c0104a.read(bArr3) == readUnsignedShort) { i11 += readUnsignedShort; x(bArr3, i7); readUnsignedShort = 0; } else { throw new IOException("Invalid exif"); } } else { throw new IOException("Invalid exif"); } } } else { throw new IOException("Invalid exif"); } } if (readUnsignedShort >= 0) { if (c0104a.skipBytes(readUnsignedShort) != readUnsignedShort) { throw new IOException("Invalid JPEG segment"); } i9 = i11 + readUnsignedShort; } else { throw new IOException("Invalid length"); } } } else { throw new IOException("Invalid marker:" + Integer.toHexString(readByte2 & 255)); } } } else { throw new IOException("Invalid marker: " + Integer.toHexString(readByte & 255)); } } private int h(BufferedInputStream bufferedInputStream) throws IOException { bufferedInputStream.mark(5000); byte[] bArr = new byte[5000]; bufferedInputStream.read(bArr); bufferedInputStream.reset(); if (o(bArr)) { return 4; } if (q(bArr)) { return 9; } if (p(bArr)) { return 7; } return r(bArr) ? 10 : 0; } private void i(C0104a c0104a) throws IOException { k(c0104a); b bVar = this.f19623d[1].get("MakerNote"); if (bVar != null) { C0104a c0104a2 = new C0104a(bVar.f19645c); c0104a2.d(this.f19625f); byte[] bArr = f19617x; byte[] bArr2 = new byte[bArr.length]; c0104a2.readFully(bArr2); c0104a2.c(0L); byte[] bArr3 = f19618y; byte[] bArr4 = new byte[bArr3.length]; c0104a2.readFully(bArr4); if (Arrays.equals(bArr2, bArr)) { c0104a2.c(8L); } else if (Arrays.equals(bArr4, bArr3)) { c0104a2.c(12L); } y(c0104a2, 6); b bVar2 = this.f19623d[7].get("PreviewImageStart"); b bVar3 = this.f19623d[7].get("PreviewImageLength"); if (bVar2 != null && bVar3 != null) { this.f19623d[5].put("JPEGInterchangeFormat", bVar2); this.f19623d[5].put("JPEGInterchangeFormatLength", bVar3); } b bVar4 = this.f19623d[8].get("AspectFrame"); if (bVar4 != null) { int[] iArr = (int[]) bVar4.k(this.f19625f); if (iArr != null && iArr.length == 4) { if (iArr[2] <= iArr[0] || iArr[3] <= iArr[1]) { return; } int i6 = (iArr[2] - iArr[0]) + 1; int i7 = (iArr[3] - iArr[1]) + 1; if (i6 < i7) { int i8 = i6 + i7; i7 = i8 - i7; i6 = i8 - i7; } b f6 = b.f(i6, this.f19625f); b f7 = b.f(i7, this.f19625f); this.f19623d[0].put("ImageWidth", f6); this.f19623d[0].put("ImageLength", f7); return; } Log.w("ExifInterface", "Invalid aspect frame values. frame=" + Arrays.toString(iArr)); } } } private void j(C0104a c0104a) throws IOException { c0104a.skipBytes(84); byte[] bArr = new byte[4]; byte[] bArr2 = new byte[4]; c0104a.read(bArr); c0104a.skipBytes(4); c0104a.read(bArr2); int i6 = ByteBuffer.wrap(bArr).getInt(); int i7 = ByteBuffer.wrap(bArr2).getInt(); g(c0104a, i6, 5); c0104a.c(i7); c0104a.d(ByteOrder.BIG_ENDIAN); int readInt = c0104a.readInt(); for (int i8 = 0; i8 < readInt; i8++) { int readUnsignedShort = c0104a.readUnsignedShort(); int readUnsignedShort2 = c0104a.readUnsignedShort(); if (readUnsignedShort == I.f19646a) { short readShort = c0104a.readShort(); short readShort2 = c0104a.readShort(); b f6 = b.f(readShort, this.f19625f); b f7 = b.f(readShort2, this.f19625f); this.f19623d[0].put("ImageLength", f6); this.f19623d[0].put("ImageWidth", f7); return; } c0104a.skipBytes(readUnsignedShort2); } } private void k(C0104a c0104a) throws IOException { b bVar; v(c0104a, c0104a.available()); y(c0104a, 0); C(c0104a, 0); C(c0104a, 5); C(c0104a, 4); D(c0104a); if (this.f19622c != 8 || (bVar = this.f19623d[1].get("MakerNote")) == null) { return; } C0104a c0104a2 = new C0104a(bVar.f19645c); c0104a2.d(this.f19625f); c0104a2.c(6L); y(c0104a2, 9); b bVar2 = this.f19623d[9].get("ColorSpace"); if (bVar2 != null) { this.f19623d[1].put("ColorSpace", bVar2); } } private void l(C0104a c0104a) throws IOException { k(c0104a); if (this.f19623d[0].get("JpgFromRaw") != null) { g(c0104a, this.f19635p, 5); } b bVar = this.f19623d[0].get("ISO"); b bVar2 = this.f19623d[1].get("PhotographicSensitivity"); if (bVar == null || bVar2 != null) { return; } this.f19623d[1].put("PhotographicSensitivity", bVar); } private void m(C0104a c0104a, HashMap hashMap) throws IOException { int i6; b bVar = (b) hashMap.get("JPEGInterchangeFormat"); b bVar2 = (b) hashMap.get("JPEGInterchangeFormatLength"); if (bVar == null || bVar2 == null) { return; } int i7 = bVar.i(this.f19625f); int min = Math.min(bVar2.i(this.f19625f), c0104a.available() - i7); int i8 = this.f19622c; if (i8 != 4 && i8 != 9 && i8 != 10) { if (i8 == 7) { i6 = this.f19632m; } if (i7 > 0 || min <= 0) { } this.f19626g = true; this.f19627h = i7; this.f19628i = min; if (this.f19620a == null && this.f19621b == null) { byte[] bArr = new byte[min]; c0104a.c(i7); c0104a.readFully(bArr); this.f19629j = bArr; return; } return; } i6 = this.f19631l; i7 += i6; if (i7 > 0) { } } private void n(C0104a c0104a, HashMap hashMap) throws IOException { b bVar = (b) hashMap.get("StripOffsets"); b bVar2 = (b) hashMap.get("StripByteCounts"); if (bVar == null || bVar2 == null) { return; } long[] c6 = c(bVar.k(this.f19625f)); long[] c7 = c(bVar2.k(this.f19625f)); if (c6 == null) { Log.w("ExifInterface", "stripOffsets should not be null."); return; } if (c7 == null) { Log.w("ExifInterface", "stripByteCounts should not be null."); return; } long j6 = 0; for (long j7 : c7) { j6 += j7; } int i6 = (int) j6; byte[] bArr = new byte[i6]; int i7 = 0; int i8 = 0; for (int i9 = 0; i9 < c6.length; i9++) { int i10 = (int) c6[i9]; int i11 = (int) c7[i9]; int i12 = i10 - i7; c0104a.c(i12); int i13 = i7 + i12; byte[] bArr2 = new byte[i11]; c0104a.read(bArr2); i7 = i13 + i11; System.arraycopy(bArr2, 0, bArr, i8, i11); i8 += i11; } this.f19626g = true; this.f19629j = bArr; this.f19628i = i6; } private static boolean o(byte[] bArr) throws IOException { int i6 = 0; while (true) { byte[] bArr2 = f19616w; if (i6 >= bArr2.length) { return true; } if (bArr[i6] != bArr2[i6]) { return false; } i6++; } } private boolean p(byte[] bArr) throws IOException { C0104a c0104a = new C0104a(bArr); ByteOrder w5 = w(c0104a); this.f19625f = w5; c0104a.d(w5); short readShort = c0104a.readShort(); c0104a.close(); return readShort == 20306 || readShort == 21330; } private boolean q(byte[] bArr) throws IOException { byte[] bytes = "FUJIFILMCCD-RAW".getBytes(Charset.defaultCharset()); for (int i6 = 0; i6 < bytes.length; i6++) { if (bArr[i6] != bytes[i6]) { return false; } } return true; } private boolean r(byte[] bArr) throws IOException { C0104a c0104a = new C0104a(bArr); ByteOrder w5 = w(c0104a); this.f19625f = w5; c0104a.d(w5); short readShort = c0104a.readShort(); c0104a.close(); return readShort == 85; } private boolean s(HashMap hashMap) throws IOException { b bVar; b bVar2 = (b) hashMap.get("BitsPerSample"); if (bVar2 == null) { return false; } int[] iArr = (int[]) bVar2.k(this.f19625f); int[] iArr2 = f19613t; if (Arrays.equals(iArr2, iArr)) { return true; } if (this.f19622c != 3 || (bVar = (b) hashMap.get("PhotometricInterpretation")) == null) { return false; } int i6 = bVar.i(this.f19625f); return (i6 == 1 && Arrays.equals(iArr, f19615v)) || (i6 == 6 && Arrays.equals(iArr, iArr2)); } private boolean t(HashMap hashMap) throws IOException { b bVar = (b) hashMap.get("ImageLength"); b bVar2 = (b) hashMap.get("ImageWidth"); if (bVar == null || bVar2 == null) { return false; } return bVar.i(this.f19625f) <= 512 && bVar2.i(this.f19625f) <= 512; } private void u(InputStream inputStream) throws IOException { for (int i6 = 0; i6 < N.length; i6++) { try { try { this.f19623d[i6] = new HashMap<>(); } catch (IOException unused) { this.f19636q = false; } } finally { a(); } } BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream, 5000); this.f19622c = h(bufferedInputStream); C0104a c0104a = new C0104a(bufferedInputStream); switch (this.f19622c) { case 0: case 1: case 2: case 3: case 5: case 6: case 8: case 11: k(c0104a); break; case 4: g(c0104a, 0, 0); break; case 7: i(c0104a); break; case 9: j(c0104a); break; case 10: l(c0104a); break; } A(c0104a); this.f19636q = true; } private void v(C0104a c0104a, int i6) throws IOException { ByteOrder w5 = w(c0104a); this.f19625f = w5; c0104a.d(w5); int readUnsignedShort = c0104a.readUnsignedShort(); int i7 = this.f19622c; if (i7 != 7 && i7 != 10 && readUnsignedShort != 42) { throw new IOException("Invalid start code: " + Integer.toHexString(readUnsignedShort)); } int readInt = c0104a.readInt(); if (readInt >= 8 && readInt < i6) { int i8 = readInt - 8; if (i8 <= 0 || c0104a.skipBytes(i8) == i8) { return; } throw new IOException("Couldn't jump to first Ifd: " + i8); } throw new IOException("Invalid first Ifd offset: " + readInt); } private ByteOrder w(C0104a c0104a) throws IOException { short readShort = c0104a.readShort(); if (readShort == 18761) { return ByteOrder.LITTLE_ENDIAN; } if (readShort == 19789) { return ByteOrder.BIG_ENDIAN; } throw new IOException("Invalid byte order: " + Integer.toHexString(readShort)); } private void x(byte[] bArr, int i6) throws IOException { C0104a c0104a = new C0104a(bArr); v(c0104a, bArr.length); y(c0104a, i6); } private void y(C0104a c0104a, int i6) throws IOException { short s5; String str; long j6; boolean z5; short s6; c cVar; int i7; int i8; int readUnsignedShort; long j7; this.f19624e.add(Integer.valueOf(c0104a.f19642g)); if (c0104a.f19642g + 2 > c0104a.f19641f) { return; } short readShort = c0104a.readShort(); if (c0104a.f19642g + (readShort * 12) > c0104a.f19641f || readShort <= 0) { return; } short s7 = 0; while (s7 < readShort) { int readUnsignedShort2 = c0104a.readUnsignedShort(); int readUnsignedShort3 = c0104a.readUnsignedShort(); int readInt = c0104a.readInt(); long a6 = c0104a.a() + 4; c cVar2 = R[i6].get(Integer.valueOf(readUnsignedShort2)); if (cVar2 == null) { Log.w("ExifInterface", "Skip the tag entry since tag number is not defined: " + readUnsignedShort2); } else { if (readUnsignedShort3 > 0) { if (readUnsignedShort3 < B.length) { if (!cVar2.a(readUnsignedShort3)) { Log.w("ExifInterface", "Skip the tag entry since data format (" + A[readUnsignedShort3] + ") is unexpected for tag: " + cVar2.f19647b); } else { if (readUnsignedShort3 == 7) { readUnsignedShort3 = cVar2.f19648c; } str = "ExifInterface"; s5 = s7; j6 = r6[readUnsignedShort3] * readInt; if (j6 < 0 || j6 > 2147483647L) { Log.w(str, "Skip the tag entry since the number of components is invalid: " + readInt); z5 = false; if (z5) { c0104a.c(a6); s6 = readShort; } else { if (j6 > 4) { int readInt2 = c0104a.readInt(); int i9 = this.f19622c; s6 = readShort; if (i9 == 7) { if ("MakerNote".equals(cVar2.f19647b)) { this.f19632m = readInt2; } else if (i6 == 6 && "ThumbnailImage".equals(cVar2.f19647b)) { this.f19633n = readInt2; this.f19634o = readInt; b f6 = b.f(6, this.f19625f); i7 = readUnsignedShort3; i8 = readInt; b b6 = b.b(this.f19633n, this.f19625f); j7 = a6; b b7 = b.b(this.f19634o, this.f19625f); this.f19623d[4].put("Compression", f6); this.f19623d[4].put("JPEGInterchangeFormat", b6); this.f19623d[4].put("JPEGInterchangeFormatLength", b7); } i7 = readUnsignedShort3; i8 = readInt; j7 = a6; } else { i7 = readUnsignedShort3; i8 = readInt; j7 = a6; if (i9 == 10 && "JpgFromRaw".equals(cVar2.f19647b)) { this.f19635p = readInt2; } } long j8 = readInt2; cVar = cVar2; if (j8 + j6 <= c0104a.f19641f) { c0104a.c(j8); a6 = j7; } else { Log.w(str, "Skip the tag entry since data offset is invalid: " + readInt2); c0104a.c(j7); } } else { s6 = readShort; cVar = cVar2; i7 = readUnsignedShort3; i8 = readInt; } Integer num = U.get(Integer.valueOf(readUnsignedShort2)); if (num != null) { long j9 = -1; int i10 = i7; if (i10 == 3) { readUnsignedShort = c0104a.readUnsignedShort(); } else { if (i10 == 4) { j9 = c0104a.b(); } else if (i10 == 8) { readUnsignedShort = c0104a.readShort(); } else if (i10 == 9 || i10 == 13) { readUnsignedShort = c0104a.readInt(); } if (j9 <= 0 && j9 < c0104a.f19641f) { if (!this.f19624e.contains(Integer.valueOf((int) j9))) { c0104a.c(j9); y(c0104a, num.intValue()); } else { Log.w(str, "Skip jump into the IFD since it has already been read: IfdType " + num + " (at " + j9 + ")"); } } else { Log.w(str, "Skip jump into the IFD since its offset is invalid: " + j9); } c0104a.c(a6); } j9 = readUnsignedShort; if (j9 <= 0) { } Log.w(str, "Skip jump into the IFD since its offset is invalid: " + j9); c0104a.c(a6); } else { byte[] bArr = new byte[(int) j6]; c0104a.readFully(bArr); b bVar = new b(i7, i8, bArr); c cVar3 = cVar; this.f19623d[i6].put(cVar3.f19647b, bVar); if ("DNGVersion".equals(cVar3.f19647b)) { this.f19622c = 3; } if ((("Make".equals(cVar3.f19647b) || "Model".equals(cVar3.f19647b)) && bVar.j(this.f19625f).contains("PENTAX")) || ("Compression".equals(cVar3.f19647b) && bVar.i(this.f19625f) == 65535)) { this.f19622c = 8; } if (c0104a.a() != a6) { c0104a.c(a6); } } } s7 = (short) (s5 + 1); readShort = s6; } else { z5 = true; if (z5) { } s7 = (short) (s5 + 1); readShort = s6; } } } } s5 = s7; str = "ExifInterface"; Log.w(str, "Skip the tag entry since data format is invalid: " + readUnsignedShort3); j6 = 0; z5 = false; if (z5) { } s7 = (short) (s5 + 1); readShort = s6; } s5 = s7; str = "ExifInterface"; j6 = 0; z5 = false; if (z5) { } s7 = (short) (s5 + 1); readShort = s6; } if (c0104a.a() + 4 <= c0104a.f19641f) { int readInt3 = c0104a.readInt(); long j10 = readInt3; if (j10 > 0 && readInt3 < c0104a.f19641f) { if (!this.f19624e.contains(Integer.valueOf(readInt3))) { c0104a.c(j10); if (this.f19623d[4].isEmpty()) { y(c0104a, 4); return; } else { if (this.f19623d[5].isEmpty()) { y(c0104a, 5); return; } return; } } Log.w("ExifInterface", "Stop reading file since re-reading an IFD may cause an infinite loop: " + readInt3); return; } Log.w("ExifInterface", "Stop reading file since a wrong offset may cause an infinite loop: " + readInt3); } } private void z(C0104a c0104a, int i6) throws IOException { b bVar; b bVar2 = this.f19623d[i6].get("ImageLength"); b bVar3 = this.f19623d[i6].get("ImageWidth"); if ((bVar2 == null || bVar3 == null) && (bVar = this.f19623d[i6].get("JPEGInterchangeFormat")) != null) { g(c0104a, bVar.i(this.f19625f), i6); } } public String d(String str) { b f6 = f(str); if (f6 != null) { if (!T.contains(str)) { return f6.j(this.f19625f); } if (str.equals("GPSTimeStamp")) { int i6 = f6.f19643a; if (i6 != 5 && i6 != 10) { Log.w("ExifInterface", "GPS Timestamp format is not rational. format=" + f6.f19643a); return null; } d[] dVarArr = (d[]) f6.k(this.f19625f); if (dVarArr != null && dVarArr.length == 3) { return String.format("%02d:%02d:%02d", Integer.valueOf((int) (((float) dVarArr[0].f19650a) / ((float) dVarArr[0].f19651b))), Integer.valueOf((int) (((float) dVarArr[1].f19650a) / ((float) dVarArr[1].f19651b))), Integer.valueOf((int) (((float) dVarArr[2].f19650a) / ((float) dVarArr[2].f19651b)))); } Log.w("ExifInterface", "Invalid GPS Timestamp array. array=" + Arrays.toString(dVarArr)); return null; } try { return Double.toString(f6.h(this.f19625f)); } catch (NumberFormatException unused) { } } return null; } public int e(String str, int i6) { b f6 = f(str); if (f6 == null) { return i6; } try { return f6.i(this.f19625f); } catch (NumberFormatException unused) { return i6; } } public static class C0104a extends InputStream implements DataInput { private static final ByteOrder f19637h = ByteOrder.LITTLE_ENDIAN; private static final ByteOrder f19638j = ByteOrder.BIG_ENDIAN; private DataInputStream f19639c; private ByteOrder f19640d; final int f19641f; int f19642g; public C0104a(InputStream inputStream) throws IOException { this.f19640d = ByteOrder.BIG_ENDIAN; DataInputStream dataInputStream = new DataInputStream(inputStream); this.f19639c = dataInputStream; int available = dataInputStream.available(); this.f19641f = available; this.f19642g = 0; this.f19639c.mark(available); } public int a() { return this.f19642g; } @Override public int available() throws IOException { return this.f19639c.available(); } public long b() throws IOException { return readInt() & 4294967295L; } public void c(long j6) throws IOException { int i6 = this.f19642g; if (i6 > j6) { this.f19642g = 0; this.f19639c.reset(); this.f19639c.mark(this.f19641f); } else { j6 -= i6; } int i7 = (int) j6; if (skipBytes(i7) != i7) { throw new IOException("Couldn't seek up to the byteCount"); } } public void d(ByteOrder byteOrder) { this.f19640d = byteOrder; } @Override public int read() throws IOException { this.f19642g++; return this.f19639c.read(); } @Override public boolean readBoolean() throws IOException { this.f19642g++; return this.f19639c.readBoolean(); } @Override public byte readByte() throws IOException { int i6 = this.f19642g + 1; this.f19642g = i6; if (i6 <= this.f19641f) { int read = this.f19639c.read(); if (read >= 0) { return (byte) read; } throw new EOFException(); } throw new EOFException(); } @Override public char readChar() throws IOException { this.f19642g += 2; return this.f19639c.readChar(); } @Override public double readDouble() throws IOException { return Double.longBitsToDouble(readLong()); } @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); } @Override public void readFully(byte[] bArr, int i6, int i7) throws IOException { int i8 = this.f19642g + i7; this.f19642g = i8; if (i8 <= this.f19641f) { if (this.f19639c.read(bArr, i6, i7) != i7) { throw new IOException("Couldn't read up to the length of buffer"); } return; } throw new EOFException(); } @Override public int readInt() throws IOException { int i6 = this.f19642g + 4; this.f19642g = i6; if (i6 <= this.f19641f) { int read = this.f19639c.read(); int read2 = this.f19639c.read(); int read3 = this.f19639c.read(); int read4 = this.f19639c.read(); if ((read | read2 | read3 | read4) >= 0) { ByteOrder byteOrder = this.f19640d; if (byteOrder == f19637h) { return (read4 << 24) + (read3 << 16) + (read2 << 8) + read; } if (byteOrder == f19638j) { return (read << 24) + (read2 << 16) + (read3 << 8) + read4; } throw new IOException("Invalid byte order: " + this.f19640d); } throw new EOFException(); } throw new EOFException(); } @Override public String readLine() throws IOException { return null; } @Override public long readLong() throws IOException { int i6 = this.f19642g + 8; this.f19642g = i6; if (i6 <= this.f19641f) { int read = this.f19639c.read(); int read2 = this.f19639c.read(); int read3 = this.f19639c.read(); int read4 = this.f19639c.read(); int read5 = this.f19639c.read(); int read6 = this.f19639c.read(); int read7 = this.f19639c.read(); int read8 = this.f19639c.read(); if ((read | read2 | read3 | read4 | read5 | read6 | read7 | read8) >= 0) { ByteOrder byteOrder = this.f19640d; if (byteOrder == f19637h) { return (read8 << 56) + (read7 << 48) + (read6 << 40) + (read5 << 32) + (read4 << 24) + (read3 << 16) + (read2 << 8) + read; } if (byteOrder == f19638j) { return (read << 56) + (read2 << 48) + (read3 << 40) + (read4 << 32) + (read5 << 24) + (read6 << 16) + (read7 << 8) + read8; } throw new IOException("Invalid byte order: " + this.f19640d); } throw new EOFException(); } throw new EOFException(); } @Override public short readShort() throws IOException { int i6 = this.f19642g + 2; this.f19642g = i6; if (i6 <= this.f19641f) { int read = this.f19639c.read(); int read2 = this.f19639c.read(); if ((read | read2) >= 0) { ByteOrder byteOrder = this.f19640d; if (byteOrder == f19637h) { return (short) ((read2 << 8) + read); } if (byteOrder == f19638j) { return (short) ((read << 8) + read2); } throw new IOException("Invalid byte order: " + this.f19640d); } throw new EOFException(); } throw new EOFException(); } @Override public String readUTF() throws IOException { this.f19642g += 2; return this.f19639c.readUTF(); } @Override public int readUnsignedByte() throws IOException { this.f19642g++; return this.f19639c.readUnsignedByte(); } @Override public int readUnsignedShort() throws IOException { int i6 = this.f19642g + 2; this.f19642g = i6; if (i6 <= this.f19641f) { int read = this.f19639c.read(); int read2 = this.f19639c.read(); if ((read | read2) >= 0) { ByteOrder byteOrder = this.f19640d; if (byteOrder == f19637h) { return (read2 << 8) + read; } if (byteOrder == f19638j) { return (read << 8) + read2; } throw new IOException("Invalid byte order: " + this.f19640d); } throw new EOFException(); } throw new EOFException(); } @Override public int skipBytes(int i6) throws IOException { int min = Math.min(i6, this.f19641f - this.f19642g); int i7 = 0; while (i7 < min) { i7 += this.f19639c.skipBytes(min - i7); } this.f19642g += i7; return i7; } @Override public int read(byte[] bArr, int i6, int i7) throws IOException { int read = this.f19639c.read(bArr, i6, i7); this.f19642g += read; return read; } @Override public void readFully(byte[] bArr) throws IOException { int length = this.f19642g + bArr.length; this.f19642g = length; if (length <= this.f19641f) { if (this.f19639c.read(bArr, 0, bArr.length) != bArr.length) { throw new IOException("Couldn't read up to the length of buffer"); } return; } throw new EOFException(); } public C0104a(byte[] bArr) throws IOException { this(new ByteArrayInputStream(bArr)); } } public static class c { public final int f19646a; public final String f19647b; public final int f19648c; public final int f19649d; c(String str, int i6, int i7) { this.f19647b = str; this.f19646a = i6; this.f19648c = i7; this.f19649d = -1; } boolean a(int i6) { int i7; int i8 = this.f19648c; if (i8 == 7 || i6 == 7 || i8 == i6 || (i7 = this.f19649d) == i6) { return true; } if ((i8 == 4 || i7 == 4) && i6 == 3) { return true; } if ((i8 == 9 || i7 == 9) && i6 == 8) { return true; } return (i8 == 12 || i7 == 12) && i6 == 11; } c(String str, int i6, int i7, int i8) { this.f19647b = str; this.f19646a = i6; this.f19648c = i7; this.f19649d = i8; } } }