导航菜单

页面标题

页面副标题

moonshot.企业版 v8.14.46 - C7300.java 源代码

正在查看: moonshot.企业版 v8.14.46 应用的 C7300.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package kp1AiJpjqJHu1Tcnj96z.Bu9YQKH1SoMrhmpeBGto.zSFvmU2XOpXZrEfUxlHp.IRnPlw4EC2IclzeuBbCK;

import android.annotation.TargetApi;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.YuvImage;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.media.ExifInterface;
import android.os.Build;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import android.util.Base64;
import android.view.View;
import c8sKPHc73aST6XPVbBtC.PGqkJnXjeiwrwErSxdaQ.CClEfcQBIieeSntHv4xl.C3239;
import c8sKPHc73aST6XPVbBtC.PGqkJnXjeiwrwErSxdaQ.kp1AiJpjqJHu1Tcnj96z.C3711;
import c8sKPHc73aST6XPVbBtC.RRjcOMLYdoviwy8vCfIX.zSFvmU2XOpXZrEfUxlHp.C3775;
import c8sKPHc73aST6XPVbBtC.c8sKPHc73aST6XPVbBtC.InterfaceC4401;
import c8sKPHc73aST6XPVbBtC.c8sKPHc73aST6XPVbBtC.InterfaceC4402;
import c8sKPHc73aST6XPVbBtC.c8sKPHc73aST6XPVbBtC.InterfaceC4409;
import c8sKPHc73aST6XPVbBtC.c8sKPHc73aST6XPVbBtC.InterfaceC4410;
import c8sKPHc73aST6XPVbBtC.eu1n4Vdn1yKpcNjlf7lN.c8sKPHc73aST6XPVbBtC.C4428;
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
import kp1AiJpjqJHu1Tcnj96z.Bu9YQKH1SoMrhmpeBGto.zSFvmU2XOpXZrEfUxlHp.C7374;

public class C7300 {
    public C7300() {
        throw new UnsupportedOperationException("not init lib");
    }

    public static boolean m29338(byte[] bArr) {
        return bArr.length >= 2 && bArr[0] == -1 && bArr[1] == -40;
    }

    public static Bitmap m29339(Bitmap bitmap) {
        return m29368(bitmap, false);
    }

    public static boolean m29340(File file) {
        return file != null && m29417(file.getPath());
    }

    public static Bitmap m29341(Bitmap bitmap, float f, float f2, float f3, float f4, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        Matrix matrix = new Matrix();
        matrix.setSkew(f, f2, f3, f4);
        Bitmap createBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap;
    }

    public static Bitmap m29342(Bitmap bitmap, String str, float f, @InterfaceC4409 int i, float f2, float f3, boolean z) {
        if (m29409(bitmap) || str == null) {
            return null;
        }
        Bitmap copy = bitmap.copy(bitmap.getConfig(), true);
        Paint paint = new Paint(1);
        Canvas canvas = new Canvas(copy);
        paint.setColor(i);
        paint.setTextSize(f);
        paint.getTextBounds(str, 0, str.length(), new Rect());
        canvas.drawText(str, f2, f3 + f, paint);
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return copy;
    }

    public static String m29343(File file) {
        if (file == null) {
            return null;
        }
        InputStream m28889 = C7279.m28889(file.getAbsolutePath());
        if (m28889 == null) {
            C7269.m28799(m28889);
            return null;
        }
        try {
            try {
                String m29366 = m29366(m28889);
                C7269.m28799(m28889);
                return m29366;
            } catch (Exception e) {
                e.printStackTrace();
                C7269.m28799(m28889);
                return null;
            }
        } catch (Throwable th) {
            C7269.m28799(m28889);
            throw th;
        }
    }

    public static Bitmap m29344(Bitmap bitmap, int i, boolean z) {
        int[] iArr;
        int i2 = i;
        Bitmap copy = z ? bitmap : bitmap.copy(bitmap.getConfig(), true);
        if (i2 < 1) {
            return null;
        }
        int width = copy.getWidth();
        int height = copy.getHeight();
        int i3 = width * height;
        int[] iArr2 = new int[i3];
        copy.getPixels(iArr2, 0, width, 0, 0, width, height);
        int i4 = width - 1;
        int i5 = height - 1;
        int i6 = i2 + i2 + 1;
        int[] iArr3 = new int[i3];
        int[] iArr4 = new int[i3];
        int[] iArr5 = new int[i3];
        int[] iArr6 = new int[Math.max(width, height)];
        int i7 = (i6 + 1) >> 1;
        int i8 = i7 * i7;
        int i9 = i8 * 256;
        int[] iArr7 = new int[i9];
        for (int i10 = 0; i10 < i9; i10++) {
            iArr7[i10] = i10 / i8;
        }
        int[][] iArr8 = (int[][]) Array.newInstance((Class<?>) int.class, i6, 3);
        int i11 = i2 + 1;
        int i12 = 0;
        int i13 = 0;
        int i14 = 0;
        while (i12 < height) {
            Bitmap bitmap2 = copy;
            int i15 = height;
            int i16 = 0;
            int i17 = 0;
            int i18 = 0;
            int i19 = 0;
            int i20 = 0;
            int i21 = 0;
            int i22 = 0;
            int i23 = 0;
            int i24 = -i2;
            int i25 = 0;
            while (i24 <= i2) {
                int i26 = i5;
                int[] iArr9 = iArr6;
                int i27 = iArr2[i13 + Math.min(i4, Math.max(i24, 0))];
                int[] iArr10 = iArr8[i24 + i2];
                iArr10[0] = (i27 & C3775.f12798) >> 16;
                iArr10[1] = (i27 & 65280) >> 8;
                iArr10[2] = i27 & 255;
                int abs = i11 - Math.abs(i24);
                i25 += iArr10[0] * abs;
                i16 += iArr10[1] * abs;
                i17 += iArr10[2] * abs;
                if (i24 > 0) {
                    i21 += iArr10[0];
                    i22 += iArr10[1];
                    i23 += iArr10[2];
                } else {
                    i18 += iArr10[0];
                    i19 += iArr10[1];
                    i20 += iArr10[2];
                }
                i24++;
                i5 = i26;
                iArr6 = iArr9;
            }
            int i28 = i5;
            int[] iArr11 = iArr6;
            int i29 = i2;
            int i30 = i25;
            int i31 = 0;
            while (i31 < width) {
                iArr3[i13] = iArr7[i30];
                iArr4[i13] = iArr7[i16];
                iArr5[i13] = iArr7[i17];
                int i32 = i30 - i18;
                int i33 = i16 - i19;
                int i34 = i17 - i20;
                int[] iArr12 = iArr8[((i29 - i2) + i6) % i6];
                int i35 = i18 - iArr12[0];
                int i36 = i19 - iArr12[1];
                int i37 = i20 - iArr12[2];
                if (i12 == 0) {
                    iArr = iArr7;
                    iArr11[i31] = Math.min(i31 + i2 + 1, i4);
                } else {
                    iArr = iArr7;
                }
                int i38 = iArr2[i14 + iArr11[i31]];
                iArr12[0] = (i38 & C3775.f12798) >> 16;
                iArr12[1] = (i38 & 65280) >> 8;
                iArr12[2] = i38 & 255;
                int i39 = i21 + iArr12[0];
                int i40 = i22 + iArr12[1];
                int i41 = i23 + iArr12[2];
                i30 = i32 + i39;
                i16 = i33 + i40;
                i17 = i34 + i41;
                i29 = (i29 + 1) % i6;
                int[] iArr13 = iArr8[i29 % i6];
                i18 = i35 + iArr13[0];
                i19 = i36 + iArr13[1];
                i20 = i37 + iArr13[2];
                i21 = i39 - iArr13[0];
                i22 = i40 - iArr13[1];
                i23 = i41 - iArr13[2];
                i13++;
                i31++;
                iArr7 = iArr;
            }
            i14 += width;
            i12++;
            copy = bitmap2;
            height = i15;
            i5 = i28;
            iArr6 = iArr11;
        }
        Bitmap bitmap3 = copy;
        int i42 = i5;
        int[] iArr14 = iArr6;
        int i43 = height;
        int[] iArr15 = iArr7;
        int i44 = 0;
        while (i44 < width) {
            int i45 = -i2;
            int i46 = i6;
            int[] iArr16 = iArr2;
            int i47 = 0;
            int i48 = 0;
            int i49 = 0;
            int i50 = 0;
            int i51 = 0;
            int i52 = 0;
            int i53 = 0;
            int i54 = i45;
            int i55 = i45 * width;
            int i56 = 0;
            int i57 = 0;
            while (i54 <= i2) {
                int i58 = width;
                int max = Math.max(0, i55) + i44;
                int[] iArr17 = iArr8[i54 + i2];
                iArr17[0] = iArr3[max];
                iArr17[1] = iArr4[max];
                iArr17[2] = iArr5[max];
                int abs2 = i11 - Math.abs(i54);
                i56 += iArr3[max] * abs2;
                i57 += iArr4[max] * abs2;
                i47 += iArr5[max] * abs2;
                if (i54 > 0) {
                    i51 += iArr17[0];
                    i52 += iArr17[1];
                    i53 += iArr17[2];
                } else {
                    i48 += iArr17[0];
                    i49 += iArr17[1];
                    i50 += iArr17[2];
                }
                int i59 = i42;
                if (i54 < i59) {
                    i55 += i58;
                }
                i54++;
                i42 = i59;
                width = i58;
            }
            int i60 = width;
            int i61 = i42;
            int i62 = i2;
            int i63 = i44;
            int i64 = i57;
            int i65 = i43;
            int i66 = i56;
            int i67 = 0;
            while (i67 < i65) {
                iArr16[i63] = (iArr16[i63] & (-16777216)) | (iArr15[i66] << 16) | (iArr15[i64] << 8) | iArr15[i47];
                int i68 = i66 - i48;
                int i69 = i64 - i49;
                int i70 = i47 - i50;
                int[] iArr18 = iArr8[((i62 - i2) + i46) % i46];
                int i71 = i48 - iArr18[0];
                int i72 = i49 - iArr18[1];
                int i73 = i50 - iArr18[2];
                if (i44 == 0) {
                    iArr14[i67] = Math.min(i67 + i11, i61) * i60;
                }
                int i74 = iArr14[i67] + i44;
                iArr18[0] = iArr3[i74];
                iArr18[1] = iArr4[i74];
                iArr18[2] = iArr5[i74];
                int i75 = i51 + iArr18[0];
                int i76 = i52 + iArr18[1];
                int i77 = i53 + iArr18[2];
                i66 = i68 + i75;
                i64 = i69 + i76;
                i47 = i70 + i77;
                i62 = (i62 + 1) % i46;
                int[] iArr19 = iArr8[i62];
                i48 = i71 + iArr19[0];
                i49 = i72 + iArr19[1];
                i50 = i73 + iArr19[2];
                i51 = i75 - iArr19[0];
                i52 = i76 - iArr19[1];
                i53 = i77 - iArr19[2];
                i63 += i60;
                i67++;
                i2 = i;
            }
            i44++;
            i2 = i;
            i42 = i61;
            i43 = i65;
            i6 = i46;
            iArr2 = iArr16;
            width = i60;
        }
        int i78 = width;
        bitmap3.setPixels(iArr2, 0, i78, 0, 0, i78, i43);
        return bitmap3;
    }

    public static String m29345(Bitmap bitmap, Bitmap.CompressFormat compressFormat, int i) {
        return Base64.encodeToString(m29373(bitmap, compressFormat, i), 0);
    }

    public static Bitmap m29346(Bitmap bitmap, int i) {
        return m29406(bitmap, i, false);
    }

    public static Bitmap m29347(Drawable drawable) {
        Bitmap createBitmap;
        if (drawable instanceof BitmapDrawable) {
            BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
            if (bitmapDrawable.getBitmap() != null) {
                return bitmapDrawable.getBitmap();
            }
        }
        if (drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) {
            createBitmap = Bitmap.createBitmap(1, 1, drawable.getOpacity() != -1 ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);
        } else {
            createBitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), drawable.getOpacity() != -1 ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);
        }
        Canvas canvas = new Canvas(createBitmap);
        drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
        drawable.draw(canvas);
        return createBitmap;
    }

    public static Bitmap m29348(Bitmap bitmap, float f, float f2) {
        return m29426(bitmap, f, f2, false);
    }

    public static Bitmap m29349(Bitmap bitmap, long j, boolean z) {
        byte[] byteArray;
        if (m29409(bitmap) || j <= 0) {
            return null;
        }
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        int i = 100;
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
        if (byteArrayOutputStream.size() <= j) {
            byteArray = byteArrayOutputStream.toByteArray();
        } else {
            byteArrayOutputStream.reset();
            bitmap.compress(Bitmap.CompressFormat.JPEG, 0, byteArrayOutputStream);
            if (byteArrayOutputStream.size() >= j) {
                byteArray = byteArrayOutputStream.toByteArray();
            } else {
                int i2 = 0;
                int i3 = 0;
                while (i2 < i) {
                    i3 = (i2 + i) / 2;
                    byteArrayOutputStream.reset();
                    bitmap.compress(Bitmap.CompressFormat.JPEG, i3, byteArrayOutputStream);
                    long size = byteArrayOutputStream.size();
                    if (size == j) {
                        break;
                    }
                    if (size > j) {
                        i = i3 - 1;
                    } else {
                        i2 = i3 + 1;
                    }
                }
                if (i == i3 - 1) {
                    byteArrayOutputStream.reset();
                    bitmap.compress(Bitmap.CompressFormat.JPEG, i2, byteArrayOutputStream);
                }
                byteArray = byteArrayOutputStream.toByteArray();
            }
        }
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
    }

    public static Bitmap m29350(Bitmap bitmap) {
        int[] iArr = {-1, -1, -1, -1, 9, -1, -1, -1, -1};
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Bitmap createBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        int[] iArr2 = new int[width * height];
        bitmap.getPixels(iArr2, 0, width, 0, 0, width, height);
        int i = height - 1;
        int i2 = 1;
        int i3 = 1;
        while (i3 < i) {
            int i4 = width - 1;
            int i5 = 1;
            while (i5 < i4) {
                int i6 = -1;
                int i7 = 0;
                int i8 = 0;
                int i9 = 0;
                int i10 = 0;
                while (i6 <= i2) {
                    int i11 = -1;
                    while (i11 <= i2) {
                        int i12 = iArr2[((i3 + i11) * width) + i5 + i6];
                        int red = Color.red(i12);
                        int green = Color.green(i12);
                        int blue = Color.blue(i12);
                        i7 += (int) (red * iArr[i10] * 0.3f);
                        i8 += (int) (iArr[i10] * green * 0.3f);
                        i9 += (int) (iArr[i10] * blue * 0.3f);
                        i10++;
                        i11++;
                        i2 = 1;
                    }
                    i6++;
                    i2 = 1;
                }
                iArr2[(i3 * width) + i5] = Color.argb(255, Math.min(255, Math.max(0, i7)), Math.min(255, Math.max(0, i8)), Math.min(255, Math.max(0, i9)));
                i5++;
                i2 = 1;
            }
            i3++;
            i2 = 1;
        }
        createBitmap.setPixels(iArr2, 0, width, 0, 0, width, height);
        return createBitmap;
    }

    public static byte[] m29351(Bitmap bitmap, Bitmap.CompressFormat compressFormat) {
        return m29373(bitmap, compressFormat, 100);
    }

    public static Bitmap m29352(Bitmap bitmap) {
        return m29427(bitmap, Boolean.FALSE);
    }

    public static Bitmap m29353(byte[] bArr) {
        return m29371(bArr, 0);
    }

    public static String m29354(byte[] bArr) {
        if (m29338(bArr)) {
            return "JPEG";
        }
        if (m29399(bArr)) {
            return "GIF";
        }
        if (m29369(bArr)) {
            return "PNG";
        }
        if (m29390(bArr)) {
            return "BMP";
        }
        return null;
    }

    public static Bitmap m29355(Bitmap bitmap, @InterfaceC4410(from = 1) int i, @InterfaceC4409 int i2, boolean z) {
        return m29358(bitmap, i, i2, true, 0.0f, z);
    }

    public static Bitmap m29356(InputStream inputStream) {
        if (inputStream == null) {
            return null;
        }
        return BitmapFactory.decodeStream(inputStream);
    }

    public static Bitmap m29357(byte[] bArr, int i) {
        if (bArr.length == 0) {
            return null;
        }
        return BitmapFactory.decodeByteArray(bArr, i, bArr.length);
    }

    private static Bitmap m29358(Bitmap bitmap, @InterfaceC4410(from = 1) int i, @InterfaceC4409 int i2, boolean z, float f, boolean z2) {
        if (m29409(bitmap)) {
            return null;
        }
        if (!z2) {
            bitmap = bitmap.copy(bitmap.getConfig(), true);
        }
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Canvas canvas = new Canvas(bitmap);
        Paint paint = new Paint(1);
        paint.setColor(i2);
        paint.setStyle(Paint.Style.STROKE);
        float f2 = i;
        paint.setStrokeWidth(f2);
        if (z) {
            canvas.drawCircle(width / 2.0f, height / 2.0f, (Math.min(width, height) / 2.0f) - (f2 / 2.0f), paint);
        } else {
            float f3 = i >> 1;
            canvas.drawRoundRect(new RectF(f3, f3, width - r5, height - r5), f, f, paint);
        }
        return bitmap;
    }

    public static Bitmap m29359(Bitmap bitmap, Bitmap bitmap2, int i, int i2, int i3) {
        return m29395(bitmap, bitmap2, i, i2, i3, false);
    }

    public static Bitmap m29360(Bitmap bitmap, @InterfaceC4410(from = 0) int i, @InterfaceC4409 int i2) {
        if (m29409(bitmap)) {
            return null;
        }
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        int min = Math.min(width, height);
        Paint paint = new Paint(1);
        Bitmap createBitmap = Bitmap.createBitmap(width, height, bitmap.getConfig());
        float f = min;
        float f2 = f / 2.0f;
        float f3 = width;
        float f4 = height;
        RectF rectF = new RectF(0.0f, 0.0f, f3, f4);
        rectF.inset((width - min) / 2.0f, (height - min) / 2.0f);
        Matrix matrix = new Matrix();
        matrix.setTranslate(rectF.left, rectF.top);
        matrix.preScale(f / f3, f / f4);
        Shader.TileMode tileMode = Shader.TileMode.CLAMP;
        BitmapShader bitmapShader = new BitmapShader(bitmap, tileMode, tileMode);
        bitmapShader.setLocalMatrix(matrix);
        paint.setShader(bitmapShader);
        Canvas canvas = new Canvas(createBitmap);
        canvas.drawRoundRect(rectF, f2, f2, paint);
        if (i > 0) {
            paint.setShader(null);
            paint.setColor(i2);
            paint.setStyle(Paint.Style.STROKE);
            float f5 = i;
            paint.setStrokeWidth(f5);
            canvas.drawCircle(f3 / 2.0f, f4 / 2.0f, f2 - (f5 / 2.0f), paint);
        }
        return createBitmap;
    }

    public static Bitmap m29361(Bitmap bitmap, float f, float f2, float f3, float f4) {
        return m29341(bitmap, f, f2, f3, f4, false);
    }

    public static Bitmap m29362(Bitmap bitmap, int i, int i2) {
        return m29387(bitmap, i, i2, false);
    }

    private static int m29363(BitmapFactory.Options options, int i, int i2) {
        if (i == 0 || i2 == 0) {
            return 1;
        }
        int i3 = options.outHeight;
        int i4 = options.outWidth;
        int i5 = 1;
        while (true) {
            i3 >>= 1;
            if (i3 <= i2 || (i4 = i4 >> 1) <= i) {
                break;
            }
            i5 <<= 1;
        }
        return i5;
    }

    public static Bitmap m29364(Bitmap bitmap, int i, int i2, int i3, int i4, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        Bitmap createBitmap = Bitmap.createBitmap(bitmap, i, i2, i3, i4);
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap;
    }

    public static byte[] m29365(Bitmap bitmap, int i) {
        return m29373(bitmap, Bitmap.CompressFormat.JPEG, i);
    }

    public static String m29366(InputStream inputStream) {
        if (inputStream == null) {
            return null;
        }
        try {
            byte[] bArr = new byte[8];
            if (inputStream.read(bArr, 0, 8) != -1) {
                return m29354(bArr);
            }
            return null;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static Bitmap m29367(String str) {
        if (C7279.m28960(str)) {
            return null;
        }
        return BitmapFactory.decodeFile(str);
    }

    public static Bitmap m29368(Bitmap bitmap, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        Bitmap createBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), bitmap.getConfig());
        Canvas canvas = new Canvas(createBitmap);
        Paint paint = new Paint();
        ColorMatrix colorMatrix = new ColorMatrix();
        colorMatrix.setSaturation(0.0f);
        paint.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
        canvas.drawBitmap(bitmap, 0.0f, 0.0f, paint);
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap;
    }

    public static boolean m29369(byte[] bArr) {
        return bArr.length >= 8 && bArr[0] == -119 && bArr[1] == 80 && bArr[2] == 78 && bArr[3] == 71 && bArr[4] == 13 && bArr[5] == 10 && bArr[6] == 26 && bArr[7] == 10;
    }

    public static Bitmap m29370(Bitmap bitmap, @InterfaceC4401(from = 0.0d, fromInclusive = false, to = 1.0d) float f, @InterfaceC4401(from = 0.0d, fromInclusive = false, to = 25.0d) float f2) {
        return m29392(bitmap, f, f2, false);
    }

    public static Bitmap m29371(byte[] bArr, int i) {
        if (bArr == null || bArr.length == 0) {
            return null;
        }
        return BitmapFactory.decodeByteArray(bArr, i, bArr.length);
    }

    public static String m29372(Bitmap bitmap, Bitmap.CompressFormat compressFormat) {
        return m29345(bitmap, compressFormat, 100);
    }

    public static byte[] m29373(Bitmap bitmap, Bitmap.CompressFormat compressFormat, int i) {
        if (bitmap == null) {
            return null;
        }
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        bitmap.compress(compressFormat, i, byteArrayOutputStream);
        return byteArrayOutputStream.toByteArray();
    }

    public static Bitmap m29374(Bitmap bitmap, float f, float f2) {
        return m29341(bitmap, f, f2, 0.0f, 0.0f, false);
    }

    public static Bitmap m29375(Bitmap bitmap, long j) {
        return m29349(bitmap, j, false);
    }

    public static Bitmap m29376(Bitmap bitmap, @InterfaceC4410(from = 0, to = 100) int i, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, i, byteArrayOutputStream);
        byte[] byteArray = byteArrayOutputStream.toByteArray();
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
    }

    public static Bitmap m29377(Bitmap bitmap) {
        return m29360(bitmap, 0, 0);
    }

    public static Bitmap m29378(Bitmap bitmap, int i, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inSampleSize = i;
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
        byte[] byteArray = byteArrayOutputStream.toByteArray();
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length, options);
    }

    public static Bitmap m29379(Bitmap bitmap, int i, int i2, boolean z) {
        return m29387(bitmap, i, i2, z);
    }

    public static Bitmap m29380(Bitmap bitmap, float f, @InterfaceC4410(from = 0) int i, @InterfaceC4409 int i2) {
        if (m29409(bitmap)) {
            return null;
        }
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Paint paint = new Paint(1);
        Bitmap createBitmap = Bitmap.createBitmap(width, height, bitmap.getConfig());
        Shader.TileMode tileMode = Shader.TileMode.CLAMP;
        paint.setShader(new BitmapShader(bitmap, tileMode, tileMode));
        Canvas canvas = new Canvas(createBitmap);
        RectF rectF = new RectF(0.0f, 0.0f, width, height);
        float f2 = i;
        float f3 = f2 / 2.0f;
        rectF.inset(f3, f3);
        canvas.drawRoundRect(rectF, f, f, paint);
        if (i > 0) {
            paint.setShader(null);
            paint.setColor(i2);
            paint.setStyle(Paint.Style.STROKE);
            paint.setStrokeWidth(f2);
            paint.setStrokeCap(Paint.Cap.ROUND);
            canvas.drawRoundRect(rectF, f, f, paint);
        }
        return createBitmap;
    }

    public static Bitmap m29381(Bitmap bitmap, String str, int i, @InterfaceC4409 int i2, float f, float f2) {
        return m29342(bitmap, str, i, i2, f, f2, false);
    }

    public static Bitmap m29382(Bitmap bitmap, int i, int i2) {
        return m29387(bitmap, i, i2, false);
    }

    public static Bitmap m29383(Bitmap bitmap, float f) {
        return m29380(bitmap, f, 0, 0);
    }

    public static Bitmap m29384(Bitmap bitmap, float f, float f2) {
        return m29426(bitmap, f, f2, false);
    }

    public static String m29385(Bitmap bitmap, int i) {
        return m29345(bitmap, Bitmap.CompressFormat.JPEG, i);
    }

    public static String m29386(Bitmap bitmap) {
        return m29345(bitmap, Bitmap.CompressFormat.JPEG, 100);
    }

    public static Bitmap m29387(Bitmap bitmap, int i, int i2, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        Bitmap createScaledBitmap = Bitmap.createScaledBitmap(bitmap, i, i2, true);
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createScaledBitmap;
    }

    public static Bitmap m29388(View view) {
        return m29420(view, Bitmap.Config.ARGB_8888);
    }

    public static boolean m29389(Bitmap bitmap, String str, Bitmap.CompressFormat compressFormat) {
        return m29396(bitmap, C7279.m28911(str), compressFormat, false);
    }

    public static boolean m29390(byte[] bArr) {
        return bArr.length >= 2 && bArr[0] == 66 && bArr[1] == 77;
    }

    public static byte[] m29391(byte[] bArr, int i, int i2) {
        YuvImage yuvImage = new YuvImage(bArr, 17, i, i2, null);
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        yuvImage.compressToJpeg(new Rect(0, 0, i, i2), 100, byteArrayOutputStream);
        return byteArrayOutputStream.toByteArray();
    }

    public static Bitmap m29392(Bitmap bitmap, @InterfaceC4401(from = 0.0d, fromInclusive = false, to = 1.0d) float f, @InterfaceC4401(from = 0.0d, fromInclusive = false, to = 25.0d) float f2, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Matrix matrix = new Matrix();
        matrix.setScale(f, f);
        Bitmap createBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
        Paint paint = new Paint(3);
        Canvas canvas = new Canvas();
        paint.setColorFilter(new PorterDuffColorFilter(0, PorterDuff.Mode.SRC_ATOP));
        canvas.scale(f, f);
        canvas.drawBitmap(createBitmap, 0.0f, 0.0f, paint);
        Bitmap m29394 = Build.VERSION.SDK_INT >= 17 ? m29394(createBitmap, f2, z) : m29344(createBitmap, (int) f2, z);
        if (f == 1.0f) {
            return m29394;
        }
        Bitmap createScaledBitmap = Bitmap.createScaledBitmap(m29394, width, height, true);
        if (m29394 != null && !m29394.isRecycled()) {
            m29394.recycle();
        }
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createScaledBitmap;
    }

    public static Bitmap m29393(Bitmap bitmap, @InterfaceC4410(from = 1) int i, @InterfaceC4409 int i2, @InterfaceC4401(from = 0.0d) float f) {
        return m29358(bitmap, i, i2, false, f, false);
    }

    @TargetApi(17)
    public static Bitmap m29394(Bitmap bitmap, @InterfaceC4401(from = 0.0d, fromInclusive = false, to = 25.0d) float f, boolean z) {
        RenderScript renderScript = null;
        if (m29409(bitmap)) {
            return null;
        }
        if (!z) {
            bitmap = bitmap.copy(bitmap.getConfig(), true);
        }
        try {
            renderScript = RenderScript.create(C7374.m29826());
            renderScript.setMessageHandler(new RenderScript.RSMessageHandler());
            Allocation createFromBitmap = Allocation.createFromBitmap(renderScript, bitmap, Allocation.MipmapControl.MIPMAP_NONE, 1);
            Allocation createTyped = Allocation.createTyped(renderScript, createFromBitmap.getType());
            ScriptIntrinsicBlur create = ScriptIntrinsicBlur.create(renderScript, Element.U8_4(renderScript));
            create.setInput(createFromBitmap);
            create.setRadius(f);
            create.forEach(createTyped);
            createTyped.copyTo(bitmap);
            return bitmap;
        } finally {
            if (renderScript != null) {
                renderScript.destroy();
            }
        }
    }

    public static Bitmap m29395(Bitmap bitmap, Bitmap bitmap2, int i, int i2, int i3, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        Bitmap copy = bitmap.copy(bitmap.getConfig(), true);
        if (!m29409(bitmap2)) {
            Paint paint = new Paint(1);
            Canvas canvas = new Canvas(copy);
            paint.setAlpha(i3);
            canvas.drawBitmap(bitmap2, i, i2, paint);
        }
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return copy;
    }

    public static boolean m29396(Bitmap bitmap, File file, Bitmap.CompressFormat compressFormat, boolean z) {
        boolean z2;
        if (m29409(bitmap) || !C7279.m28917(file)) {
            return false;
        }
        BufferedOutputStream bufferedOutputStream = null;
        try {
            try {
                BufferedOutputStream bufferedOutputStream2 = new BufferedOutputStream(new FileOutputStream(file));
                try {
                    try {
                        z2 = bitmap.compress(compressFormat, 100, bufferedOutputStream2);
                        if (z) {
                            try {
                                if (!bitmap.isRecycled()) {
                                    bitmap.recycle();
                                }
                            } catch (IOException e) {
                                e = e;
                                bufferedOutputStream = bufferedOutputStream2;
                                e.printStackTrace();
                                C7269.m28799(bufferedOutputStream);
                                return z2;
                            }
                        }
                        C7269.m28799(bufferedOutputStream2);
                    } catch (IOException e2) {
                        e = e2;
                        bufferedOutputStream = bufferedOutputStream2;
                        z2 = false;
                        e.printStackTrace();
                        C7269.m28799(bufferedOutputStream);
                        return z2;
                    }
                } catch (Throwable th) {
                    th = th;
                    bufferedOutputStream = bufferedOutputStream2;
                    C7269.m28799(bufferedOutputStream);
                    throw th;
                }
            } catch (IOException e3) {
                e = e3;
            }
            return z2;
        } catch (Throwable th2) {
            th = th2;
        }
    }

    public static Bitmap m29397(Bitmap bitmap, @InterfaceC4410(from = 1) int i, @InterfaceC4409 int i2) {
        return m29358(bitmap, i, i2, true, 0.0f, false);
    }

    public static boolean m29398(Bitmap bitmap, String str) {
        return m29396(bitmap, C7279.m28911(str), Bitmap.CompressFormat.JPEG, false);
    }

    public static boolean m29399(byte[] bArr) {
        return bArr.length >= 6 && bArr[0] == 71 && bArr[1] == 73 && bArr[2] == 70 && bArr[3] == 56 && (bArr[4] == 55 || bArr[4] == 57) && bArr[5] == 97;
    }

    public static Bitmap m29400(int i, Bitmap bitmap) {
        return m29419(bitmap, i, 0.0f, 0.0f, false);
    }

    @Deprecated
    public static Bitmap m29401(Bitmap bitmap, float f, @InterfaceC4410(from = 0) int i, @InterfaceC4409 int i2, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Paint paint = new Paint(1);
        Bitmap createBitmap = Bitmap.createBitmap(width, height, bitmap.getConfig());
        Shader.TileMode tileMode = Shader.TileMode.CLAMP;
        paint.setShader(new BitmapShader(bitmap, tileMode, tileMode));
        Canvas canvas = new Canvas(createBitmap);
        RectF rectF = new RectF(0.0f, 0.0f, width, height);
        float f2 = i;
        float f3 = f2 / 2.0f;
        rectF.inset(f3, f3);
        canvas.drawRoundRect(rectF, f, f, paint);
        if (i > 0) {
            paint.setShader(null);
            paint.setColor(i2);
            paint.setStyle(Paint.Style.STROKE);
            paint.setStrokeWidth(f2);
            paint.setStrokeCap(Paint.Cap.ROUND);
            canvas.drawRoundRect(rectF, f, f, paint);
        }
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap;
    }

    public static Bitmap m29402(Bitmap bitmap) {
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Bitmap copy = bitmap.copy(Bitmap.Config.ARGB_8888, true);
        for (int i = 0; i < width; i++) {
            for (int i2 = 0; i2 < height; i2++) {
                int pixel = (-16777216) & copy.getPixel(i, i2);
                int i3 = 255;
                Double.isNaN(r10);
                Double.isNaN(r7);
                double d = (r10 * 0.3d) + (r7 * 0.59d);
                Double.isNaN(r7);
                if (((int) (d + (r7 * 0.11d))) <= 110) {
                    i3 = 0;
                }
                copy.setPixel(i, i2, (i3 << 16) | pixel | (i3 << 8) | i3);
            }
        }
        return copy;
    }

    public static Bitmap m29403(Bitmap bitmap, float f, float f2, boolean z) {
        return m29341(bitmap, f, f2, 0.0f, 0.0f, z);
    }

    public static Bitmap m29404(Bitmap bitmap, @InterfaceC4410(from = 0, to = 100) int i) {
        return m29376(bitmap, i, false);
    }

    public static Bitmap m29405(Bitmap bitmap, @InterfaceC4410(from = 1) int i, @InterfaceC4409 int i2, @InterfaceC4401(from = 0.0d) float f, boolean z) {
        return m29358(bitmap, i, i2, false, f, z);
    }

    public static Bitmap m29406(Bitmap bitmap, int i, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        Matrix matrix = new Matrix();
        matrix.preScale(1.0f, -1.0f);
        Bitmap createBitmap = Bitmap.createBitmap(bitmap, 0, height - i, width, i, matrix, false);
        Bitmap createBitmap2 = Bitmap.createBitmap(width, height + i, bitmap.getConfig());
        Canvas canvas = new Canvas(createBitmap2);
        canvas.drawBitmap(bitmap, 0.0f, 0.0f, (Paint) null);
        float f = height + 0;
        canvas.drawBitmap(createBitmap, 0.0f, f, (Paint) null);
        Paint paint = new Paint(1);
        paint.setShader(new LinearGradient(0.0f, height, 0.0f, createBitmap2.getHeight() + 0, 1895825407, C3239.f11246, Shader.TileMode.MIRROR));
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
        canvas.drawRect(0.0f, f, width, createBitmap2.getHeight(), paint);
        if (!createBitmap.isRecycled()) {
            createBitmap.recycle();
        }
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap2;
    }

    @Deprecated
    public static Bitmap m29407(File file) {
        InputStream m28889;
        if (file == null || (m28889 = C7279.m28889(file.getAbsolutePath())) == null) {
            return null;
        }
        return BitmapFactory.decodeStream(new BufferedInputStream(m28889));
    }

    public static boolean m29408(Bitmap bitmap, String str, Bitmap.CompressFormat compressFormat, boolean z) {
        return m29396(bitmap, C7279.m28911(str), compressFormat, z);
    }

    public static boolean m29409(Bitmap bitmap) {
        return bitmap == null || bitmap.getWidth() == 0 || bitmap.getHeight() == 0;
    }

    public static int m29410(String str) {
        try {
            int attributeInt = new ExifInterface(str).getAttributeInt(C4428.f16730, 1);
            if (attributeInt == 3) {
                return 180;
            }
            if (attributeInt == 6) {
                return 90;
            }
            if (attributeInt != 8) {
                return 0;
            }
            return SubsamplingScaleImageView.ORIENTATION_270;
        } catch (IOException e) {
            e.printStackTrace();
            return 0;
        }
    }

    public static Bitmap m29411(Bitmap bitmap, int i, float f, float f2) {
        return m29419(bitmap, i, f, f2, false);
    }

    @Deprecated
    public static Bitmap m29412(Bitmap bitmap, @InterfaceC4410(from = 0) int i, @InterfaceC4409 int i2, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        int width = bitmap.getWidth();
        int height = bitmap.getHeight();
        int min = Math.min(width, height);
        Paint paint = new Paint(1);
        Bitmap createBitmap = Bitmap.createBitmap(width, height, bitmap.getConfig());
        float f = min;
        float f2 = f / 2.0f;
        float f3 = width;
        float f4 = height;
        RectF rectF = new RectF(0.0f, 0.0f, f3, f4);
        rectF.inset((width - min) / 2.0f, (height - min) / 2.0f);
        Matrix matrix = new Matrix();
        matrix.setTranslate(rectF.left, rectF.top);
        matrix.preScale(f / f3, f / f4);
        Shader.TileMode tileMode = Shader.TileMode.CLAMP;
        BitmapShader bitmapShader = new BitmapShader(bitmap, tileMode, tileMode);
        bitmapShader.setLocalMatrix(matrix);
        paint.setShader(bitmapShader);
        Canvas canvas = new Canvas(createBitmap);
        canvas.drawRoundRect(rectF, f2, f2, paint);
        if (i > 0) {
            paint.setShader(null);
            paint.setColor(i2);
            paint.setStyle(Paint.Style.STROKE);
            float f5 = i;
            paint.setStrokeWidth(f5);
            canvas.drawCircle(f3 / 2.0f, f4 / 2.0f, f2 - (f5 / 2.0f), paint);
        }
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap;
    }

    public static String m29413(String str) {
        return m29343(C7279.m28911(str));
    }

    public static Bitmap m29414(Bitmap bitmap, float f, float f2, boolean z) {
        return m29426(bitmap, f, f2, z);
    }

    public static Drawable m29415(Bitmap bitmap) {
        if (bitmap == null) {
            return null;
        }
        return new BitmapDrawable(C7374.m29826().getResources(), bitmap);
    }

    public static Bitmap m29416(@InterfaceC4402 int i) {
        Drawable m17766 = C3711.m17766(C7374.m29826(), i);
        Canvas canvas = new Canvas();
        Bitmap createBitmap = Bitmap.createBitmap(m17766.getIntrinsicWidth(), m17766.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
        canvas.setBitmap(createBitmap);
        m17766.setBounds(0, 0, m17766.getIntrinsicWidth(), m17766.getIntrinsicHeight());
        m17766.draw(canvas);
        return createBitmap;
    }

    public static boolean m29417(String str) {
        String upperCase = str.toUpperCase();
        return upperCase.endsWith(".PNG") || upperCase.endsWith(".JPG") || upperCase.endsWith(".JPEG") || upperCase.endsWith(".BMP") || upperCase.endsWith(".GIF");
    }

    public static Bitmap m29418(Bitmap bitmap, int i) {
        return m29378(bitmap, i, false);
    }

    public static Bitmap m29419(Bitmap bitmap, int i, float f, float f2, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        if (i == 0) {
            return bitmap;
        }
        Matrix matrix = new Matrix();
        matrix.setRotate(i, f, f2);
        Bitmap createBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap;
    }

    public static Bitmap m29420(View view, Bitmap.Config config) {
        if (view == null) {
            return null;
        }
        Bitmap createBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), config);
        Canvas canvas = new Canvas(createBitmap);
        Drawable background = view.getBackground();
        if (background != null) {
            background.draw(canvas);
        } else {
            canvas.drawColor(-1);
        }
        view.draw(canvas);
        return createBitmap;
    }

    public static byte[] m29421(Bitmap bitmap) {
        return m29373(bitmap, Bitmap.CompressFormat.JPEG, 100);
    }

    public static Bitmap m29422(Bitmap bitmap, int i, int i2, int i3, int i4) {
        return m29364(bitmap, i, i2, i3, i4, false);
    }

    public static boolean m29423(Bitmap bitmap, File file, Bitmap.CompressFormat compressFormat) {
        return m29396(bitmap, file, compressFormat, false);
    }

    @TargetApi(17)
    public static Bitmap m29424(Bitmap bitmap, @InterfaceC4401(from = 0.0d, fromInclusive = false, to = 25.0d) float f) {
        return m29394(bitmap, f, false);
    }

    public static Bitmap m29425(Bitmap bitmap, int i) {
        return m29344(bitmap, i, false);
    }

    public static Bitmap m29426(Bitmap bitmap, float f, float f2, boolean z) {
        if (m29409(bitmap)) {
            return null;
        }
        Matrix matrix = new Matrix();
        matrix.setScale(f, f2);
        Bitmap createBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
        if (z && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return createBitmap;
    }

    public static Bitmap m29427(Bitmap bitmap, Boolean bool) {
        if (m29409(bitmap)) {
            return null;
        }
        Bitmap extractAlpha = bitmap.extractAlpha();
        if (bool.booleanValue() && !bitmap.isRecycled()) {
            bitmap.recycle();
        }
        return extractAlpha;
    }

    public static Bitmap m29428(FileDescriptor fileDescriptor) {
        if (fileDescriptor == null) {
            return null;
        }
        return BitmapFactory.decodeFileDescriptor(fileDescriptor);
    }
}