APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:eSamudaay Seller
版本号:0.6.80
包名称:in.foore.mobile

MD5 校验值:63f8e52e07318fa084f03ba71262387f

反编译源代码说明

f.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package s8;

import android.content.Context;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.text.TextUtils;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;

public class f {

    private static final byte[] f16260b = "Exif\u0000\u0000".getBytes(Charset.forName("UTF-8"));

    private static final int[] f16261c = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8};

    private final b f16262a;

    public static class a {

        private final ByteBuffer f16263a;

        public a(byte[] bArr, int i10) {
            this.f16263a = (ByteBuffer) ByteBuffer.wrap(bArr).order(ByteOrder.BIG_ENDIAN).limit(i10);
        }

        public short a(int i10) {
            return this.f16263a.getShort(i10);
        }

        public int b(int i10) {
            return this.f16263a.getInt(i10);
        }

        public int c() {
            return this.f16263a.remaining();
        }

        public void d(ByteOrder byteOrder) {
            this.f16263a.order(byteOrder);
        }
    }

    public interface b {
        int a();

        int b(byte[] bArr, int i10);

        short c();

        long d(long j10);
    }

    private static class c implements b {

        private final InputStream f16264a;

        public c(InputStream inputStream) {
            this.f16264a = inputStream;
        }

        @Override
        public int a() {
            return ((this.f16264a.read() << 8) & 65280) | (this.f16264a.read() & 255);
        }

        @Override
        public int b(byte[] bArr, int i10) {
            int i11 = i10;
            while (i11 > 0) {
                int read = this.f16264a.read(bArr, i10 - i11, i11);
                if (read == -1) {
                    break;
                }
                i11 -= read;
            }
            return i10 - i11;
        }

        @Override
        public short c() {
            return (short) (this.f16264a.read() & 255);
        }

        @Override
        public long d(long j10) {
            if (j10 < 0) {
                return 0L;
            }
            long j11 = j10;
            while (j11 > 0) {
                long skip = this.f16264a.skip(j11);
                if (skip <= 0) {
                    if (this.f16264a.read() == -1) {
                        break;
                    }
                    skip = 1;
                }
                j11 -= skip;
            }
            return j10 - j11;
        }
    }

    public f(InputStream inputStream) {
        this.f16262a = new c(inputStream);
    }

    private static int a(int i10, int i11) {
        return i10 + 2 + (i11 * 12);
    }

    public static void b(Context context, int i10, int i11, Uri uri, Uri uri2) {
        ParcelFileDescriptor parcelFileDescriptor;
        InputStream openInputStream;
        if (context == null) {
            Log.d("ImageHeaderParser", "context is null");
            return;
        }
        InputStream inputStream = null;
        r1 = null;
        ParcelFileDescriptor parcelFileDescriptor2 = null;
        inputStream = null;
        try {
            try {
                openInputStream = context.getContentResolver().openInputStream(uri);
            } catch (IOException e10) {
                Log.d("ImageHeaderParser", e10.getMessage(), e10);
            }
            try {
                androidx.exifinterface.media.a aVar = new androidx.exifinterface.media.a(openInputStream);
                parcelFileDescriptor2 = context.getContentResolver().openFileDescriptor(uri2, "rw");
                f(aVar, new androidx.exifinterface.media.a(parcelFileDescriptor2.getFileDescriptor()), i10, i11);
                if (openInputStream != null) {
                    try {
                        openInputStream.close();
                    } catch (IOException e11) {
                        Log.d("ImageHeaderParser", e11.getMessage(), e11);
                    }
                }
                parcelFileDescriptor2.close();
            } catch (IOException e12) {
                e = e12;
                parcelFileDescriptor = parcelFileDescriptor2;
                inputStream = openInputStream;
                try {
                    Log.d("ImageHeaderParser", e.getMessage(), e);
                    if (inputStream != null) {
                        try {
                            inputStream.close();
                        } catch (IOException e13) {
                            Log.d("ImageHeaderParser", e13.getMessage(), e13);
                        }
                    }
                    if (parcelFileDescriptor != null) {
                        parcelFileDescriptor.close();
                    }
                } catch (Throwable th) {
                    th = th;
                    if (inputStream != null) {
                        try {
                            inputStream.close();
                        } catch (IOException e14) {
                            Log.d("ImageHeaderParser", e14.getMessage(), e14);
                        }
                    }
                    if (parcelFileDescriptor != null) {
                        throw th;
                    }
                    try {
                        parcelFileDescriptor.close();
                        throw th;
                    } catch (IOException e15) {
                        Log.d("ImageHeaderParser", e15.getMessage(), e15);
                        throw th;
                    }
                }
            } catch (Throwable th2) {
                th = th2;
                parcelFileDescriptor = parcelFileDescriptor2;
                inputStream = openInputStream;
                if (inputStream != null) {
                }
                if (parcelFileDescriptor != null) {
                }
            }
        } catch (IOException e16) {
            e = e16;
            parcelFileDescriptor = null;
        } catch (Throwable th3) {
            th = th3;
            parcelFileDescriptor = null;
        }
    }

    public static void c(Context context, int i10, int i11, Uri uri, String str) {
        if (context == null) {
            Log.d("ImageHeaderParser", "context is null");
            return;
        }
        InputStream inputStream = null;
        try {
            try {
                try {
                    inputStream = context.getContentResolver().openInputStream(uri);
                    f(new androidx.exifinterface.media.a(inputStream), new androidx.exifinterface.media.a(str), i10, i11);
                    if (inputStream != null) {
                        inputStream.close();
                    }
                } catch (IOException e10) {
                    Log.d("ImageHeaderParser", e10.getMessage(), e10);
                    if (inputStream == null) {
                    } else {
                        inputStream.close();
                    }
                }
            } catch (IOException e11) {
                Log.d("ImageHeaderParser", e11.getMessage(), e11);
            }
        } catch (Throwable th) {
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException e12) {
                    Log.d("ImageHeaderParser", e12.getMessage(), e12);
                }
            }
            throw th;
        }
    }

    public static void d(Context context, androidx.exifinterface.media.a aVar, int i10, int i11, Uri uri) {
        if (context == null) {
            Log.d("ImageHeaderParser", "context is null");
            return;
        }
        ParcelFileDescriptor parcelFileDescriptor = null;
        try {
            try {
                try {
                    parcelFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "rw");
                    f(aVar, new androidx.exifinterface.media.a(parcelFileDescriptor.getFileDescriptor()), i10, i11);
                    parcelFileDescriptor.close();
                } catch (IOException e10) {
                    Log.d("ImageHeaderParser", e10.getMessage());
                    if (parcelFileDescriptor == null) {
                    } else {
                        parcelFileDescriptor.close();
                    }
                }
            } catch (IOException e11) {
                Log.d("ImageHeaderParser", e11.getMessage(), e11);
            }
        } catch (Throwable th) {
            if (parcelFileDescriptor != null) {
                try {
                    parcelFileDescriptor.close();
                } catch (IOException e12) {
                    Log.d("ImageHeaderParser", e12.getMessage(), e12);
                }
            }
            throw th;
        }
    }

    public static void e(androidx.exifinterface.media.a aVar, int i10, int i11, String str) {
        try {
            f(aVar, new androidx.exifinterface.media.a(str), i10, i11);
        } catch (IOException e10) {
            Log.d("ImageHeaderParser", e10.getMessage());
        }
    }

    private static void f(androidx.exifinterface.media.a aVar, androidx.exifinterface.media.a aVar2, int i10, int i11) {
        String[] strArr = {"FNumber", "DateTime", "DateTimeDigitized", "ExposureTime", "Flash", "FocalLength", "GPSAltitude", "GPSAltitudeRef", "GPSDateStamp", "GPSLatitude", "GPSLatitudeRef", "GPSLongitude", "GPSLongitudeRef", "GPSProcessingMethod", "GPSTimeStamp", "PhotographicSensitivity", "Make", "Model", "SubSecTime", "SubSecTimeDigitized", "SubSecTimeOriginal", "WhiteBalance"};
        for (int i12 = 0; i12 < 22; i12++) {
            String str = strArr[i12];
            String d10 = aVar.d(str);
            if (!TextUtils.isEmpty(d10)) {
                aVar2.U(str, d10);
            }
        }
        aVar2.U("ImageWidth", String.valueOf(i10));
        aVar2.U("ImageLength", String.valueOf(i11));
        aVar2.U("Orientation", "0");
        aVar2.Q();
    }

    private static boolean h(int i10) {
        return (i10 & 65496) == 65496 || i10 == 19789 || i10 == 18761;
    }

    private boolean i(byte[] bArr, int i10) {
        boolean z10 = bArr != null && i10 > f16260b.length;
        if (z10) {
            int i11 = 0;
            while (true) {
                byte[] bArr2 = f16260b;
                if (i11 >= bArr2.length) {
                    break;
                }
                if (bArr[i11] != bArr2[i11]) {
                    return false;
                }
                i11++;
            }
        }
        return z10;
    }

    private int j() {
        short c10;
        int a10;
        long j10;
        long d10;
        do {
            short c11 = this.f16262a.c();
            if (c11 != 255) {
                if (Log.isLoggable("ImageHeaderParser", 3)) {
                    Log.d("ImageHeaderParser", "Unknown segmentId=" + ((int) c11));
                }
                return -1;
            }
            c10 = this.f16262a.c();
            if (c10 == 218) {
                return -1;
            }
            if (c10 == 217) {
                if (Log.isLoggable("ImageHeaderParser", 3)) {
                    Log.d("ImageHeaderParser", "Found MARKER_EOI in exif segment");
                }
                return -1;
            }
            a10 = this.f16262a.a() - 2;
            if (c10 == 225) {
                return a10;
            }
            j10 = a10;
            d10 = this.f16262a.d(j10);
        } while (d10 == j10);
        if (Log.isLoggable("ImageHeaderParser", 3)) {
            Log.d("ImageHeaderParser", "Unable to skip enough data, type: " + ((int) c10) + ", wanted to skip: " + a10 + ", but actually skipped: " + d10);
        }
        return -1;
    }

    private static int k(a aVar) {
        ByteOrder byteOrder;
        short a10;
        int i10;
        StringBuilder sb;
        String str;
        String sb2;
        short a11 = aVar.a(6);
        if (a11 != 19789) {
            if (a11 == 18761) {
                byteOrder = ByteOrder.LITTLE_ENDIAN;
                aVar.d(byteOrder);
                int b10 = aVar.b(10) + 6;
                a10 = aVar.a(b10);
                for (i10 = 0; i10 < a10; i10++) {
                    int a12 = a(b10, i10);
                    short a13 = aVar.a(a12);
                    if (a13 == 274) {
                        short a14 = aVar.a(a12 + 2);
                        if (a14 >= 1 && a14 <= 12) {
                            int b11 = aVar.b(a12 + 4);
                            if (b11 >= 0) {
                                if (Log.isLoggable("ImageHeaderParser", 3)) {
                                    Log.d("ImageHeaderParser", "Got tagIndex=" + i10 + " tagType=" + ((int) a13) + " formatCode=" + ((int) a14) + " componentCount=" + b11);
                                }
                                int i11 = b11 + f16261c[a14];
                                if (i11 <= 4) {
                                    int i12 = a12 + 8;
                                    if (i12 >= 0 && i12 <= aVar.c()) {
                                        if (i11 >= 0 && i11 + i12 <= aVar.c()) {
                                            return aVar.a(i12);
                                        }
                                        if (Log.isLoggable("ImageHeaderParser", 3)) {
                                            sb = new StringBuilder();
                                            sb.append("Illegal number of bytes for TI tag data tagType=");
                                            sb.append((int) a13);
                                        }
                                    } else if (Log.isLoggable("ImageHeaderParser", 3)) {
                                        sb2 = "Illegal tagValueOffset=" + i12 + " tagType=" + ((int) a13);
                                        Log.d("ImageHeaderParser", sb2);
                                    }
                                } else if (Log.isLoggable("ImageHeaderParser", 3)) {
                                    sb = new StringBuilder();
                                    str = "Got byte count > 4, not orientation, continuing, formatCode=";
                                    sb.append(str);
                                    sb.append((int) a14);
                                }
                            } else if (Log.isLoggable("ImageHeaderParser", 3)) {
                                sb2 = "Negative tiff component count";
                                Log.d("ImageHeaderParser", sb2);
                            }
                        } else if (Log.isLoggable("ImageHeaderParser", 3)) {
                            sb = new StringBuilder();
                            str = "Got invalid format code = ";
                            sb.append(str);
                            sb.append((int) a14);
                        }
                        sb2 = sb.toString();
                        Log.d("ImageHeaderParser", sb2);
                    }
                }
                return -1;
            }
            if (Log.isLoggable("ImageHeaderParser", 3)) {
                Log.d("ImageHeaderParser", "Unknown endianness = " + ((int) a11));
            }
        }
        byteOrder = ByteOrder.BIG_ENDIAN;
        aVar.d(byteOrder);
        int b102 = aVar.b(10) + 6;
        a10 = aVar.a(b102);
        while (i10 < a10) {
        }
        return -1;
    }

    private int l(byte[] bArr, int i10) {
        int b10 = this.f16262a.b(bArr, i10);
        if (b10 == i10) {
            if (i(bArr, i10)) {
                return k(new a(bArr, i10));
            }
            if (Log.isLoggable("ImageHeaderParser", 3)) {
                Log.d("ImageHeaderParser", "Missing jpeg exif preamble");
            }
            return -1;
        }
        if (Log.isLoggable("ImageHeaderParser", 3)) {
            Log.d("ImageHeaderParser", "Unable to read exif segment data, length: " + i10 + ", actually read: " + b10);
        }
        return -1;
    }

    public int g() {
        int a10 = this.f16262a.a();
        if (h(a10)) {
            int j10 = j();
            if (j10 != -1) {
                return l(new byte[j10], j10);
            }
            if (Log.isLoggable("ImageHeaderParser", 3)) {
                Log.d("ImageHeaderParser", "Failed to parse exif segment length, or exif segment not found");
            }
            return -1;
        }
        if (Log.isLoggable("ImageHeaderParser", 3)) {
            Log.d("ImageHeaderParser", "Parser doesn't handle magic number: " + a10);
        }
        return -1;
    }
}