导航菜单

页面标题

页面副标题

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

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

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


package kp1AiJpjqJHu1Tcnj96z.Bu9YQKH1SoMrhmpeBGto.zSFvmU2XOpXZrEfUxlHp.IRnPlw4EC2IclzeuBbCK;

import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.os.StatFs;
import c8sKPHc73aST6XPVbBtC.c8sKPHc73aST6XPVbBtC.InterfaceC4418;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import kp1AiJpjqJHu1Tcnj96z.Bu9YQKH1SoMrhmpeBGto.zSFvmU2XOpXZrEfUxlHp.C7374;

public class C7270 {

    public static class C7271 {

        public long f27388;

        public long f27389;

        public boolean f27390;

        public long f27391;

        public long f27392;

        public long f27393;

        public long f27394;

        public long f27395;

        public String toString() {
            return "isExist=" + this.f27390 + "\ntotalBlocks=" + this.f27394 + "\nfreeBlocks=" + this.f27389 + "\navailableBlocks=" + this.f27392 + "\nblockByteSize=" + this.f27395 + "\ntotalBytes=" + this.f27391 + "\nfreeBytes=" + this.f27393 + "\navailableBytes=" + this.f27388;
        }
    }

    public C7270() {
        throw new UnsupportedOperationException("UnInit this Lib");
    }

    @InterfaceC4418(api = 18)
    public static long m28800() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong();
    }

    @InterfaceC4418(api = 18)
    public static long m28801() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return statFs.getBlockCountLong() * statFs.getBlockSizeLong();
    }

    public static String m28802() {
        return Environment.getDownloadCacheDirectory().toString();
    }

    public static boolean m28803(String str) {
        File file = new File(str);
        if (file.exists()) {
            try {
                file.delete();
                return true;
            } catch (Exception unused) {
            }
        }
        return false;
    }

    @InterfaceC4418(api = 18)
    public static long m28804() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return (statFs.getFreeBlocksLong() * statFs.getBlockSizeLong()) / 1024;
    }

    @InterfaceC4418(api = 18)
    public static long m28805() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return (statFs.getBlockCountLong() * statFs.getBlockSizeLong()) / 1024;
    }

    public static String m28806() {
        return C7374.m29826().getExternalCacheDir().toString();
    }

    public static String m28807() {
        return C7374.m29826().getCacheDir().toString();
    }

    public static String m28808() {
        return C7374.m29826().getFilesDir().toString();
    }

    public static boolean m28809() {
        return Environment.getExternalStorageState().equals("mounted");
    }

    public static boolean m28810() {
        return "mounted".equals(Environment.getExternalStorageState());
    }

    @InterfaceC4418(api = 18)
    public static long m28811() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return statFs.getFreeBlocksLong() * statFs.getBlockSizeLong();
    }

    @InterfaceC4418(api = 18)
    public static long m28812() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return ((statFs.getBlockCountLong() * statFs.getBlockSizeLong()) / 1024) / 1024;
    }

    public static String m28813(String str) {
        return Environment.getExternalStoragePublicDirectory(str).toString();
    }

    @InterfaceC4418(api = 18)
    public static long m28814() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return ((statFs.getFreeBlocksLong() * statFs.getBlockSizeLong()) / 1024) / 1024;
    }

    public static byte[] m28815(String str) {
        BufferedInputStream bufferedInputStream;
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        BufferedInputStream bufferedInputStream2 = null;
        try {
            bufferedInputStream = new BufferedInputStream(new FileInputStream(new File(str)));
            try {
                try {
                    byte[] bArr = new byte[8192];
                    while (true) {
                        int read = bufferedInputStream.read(bArr);
                        if (read == -1) {
                            break;
                        }
                        byteArrayOutputStream.write(bArr, 0, read);
                        byteArrayOutputStream.flush();
                    }
                    byte[] byteArray = byteArrayOutputStream.toByteArray();
                    try {
                        byteArrayOutputStream.close();
                        bufferedInputStream.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    return byteArray;
                } catch (Exception e2) {
                    e = e2;
                    e.printStackTrace();
                    try {
                        byteArrayOutputStream.close();
                        bufferedInputStream.close();
                    } catch (IOException e3) {
                        e3.printStackTrace();
                    }
                    return null;
                }
            } catch (Throwable th) {
                th = th;
                bufferedInputStream2 = bufferedInputStream;
                try {
                    byteArrayOutputStream.close();
                    bufferedInputStream2.close();
                } catch (IOException e4) {
                    e4.printStackTrace();
                }
                throw th;
            }
        } catch (Exception e5) {
            e = e5;
            bufferedInputStream = null;
        } catch (Throwable th2) {
            th = th2;
            byteArrayOutputStream.close();
            bufferedInputStream2.close();
            throw th;
        }
    }

    public static String m28816() {
        String str = null;
        if (!m28810()) {
            return null;
        }
        try {
            try {
                Process exec = Runtime.getRuntime().exec("cat /proc/mounts");
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new BufferedInputStream(exec.getInputStream())));
                while (true) {
                    try {
                        String readLine = bufferedReader.readLine();
                        if (readLine != null) {
                            if (readLine.contains("sdcard") && readLine.contains(".android_secure")) {
                                String[] split = readLine.split(" ");
                                if (split.length >= 5) {
                                    String str2 = split[1].replace("/.android_secure", "") + File.separator;
                                    C7269.m28799(bufferedReader);
                                    return str2;
                                }
                            }
                            if (exec.waitFor() != 0 && exec.exitValue() == 1) {
                                break;
                            }
                        } else {
                            break;
                        }
                    } catch (Exception e) {
                        e = e;
                        str = bufferedReader;
                        e.printStackTrace();
                        C7269.m28799(str);
                        StringBuilder sb = new StringBuilder();
                        sb.append(Environment.getExternalStorageDirectory().getPath());
                        str = File.separator;
                        sb.append(str);
                        return sb.toString();
                    } catch (Throwable th) {
                        th = th;
                        str = bufferedReader;
                        C7269.m28799(str);
                        throw th;
                    }
                }
                C7269.m28799(bufferedReader);
            } catch (Throwable th2) {
                th = th2;
            }
        } catch (Exception e2) {
            e = e2;
        }
        StringBuilder sb2 = new StringBuilder();
        sb2.append(Environment.getExternalStorageDirectory().getPath());
        str = File.separator;
        sb2.append(str);
        return sb2.toString();
    }

    public static boolean m28817(byte[] bArr, String str, String str2) {
        BufferedOutputStream bufferedOutputStream;
        if (!m28810()) {
            return false;
        }
        File file = new File(m28833() + File.separator + str);
        if (!file.exists()) {
            file.mkdirs();
        }
        BufferedOutputStream bufferedOutputStream2 = null;
        try {
            try {
                bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(file, str2)));
            } catch (Throwable th) {
                th = th;
            }
        } catch (Exception e) {
            e = e;
        }
        try {
            bufferedOutputStream.write(bArr);
            bufferedOutputStream.flush();
            try {
                bufferedOutputStream.close();
            } catch (IOException e2) {
                e2.printStackTrace();
            }
            return true;
        } catch (Exception e3) {
            e = e3;
            bufferedOutputStream2 = bufferedOutputStream;
            e.printStackTrace();
            try {
                bufferedOutputStream2.close();
                return false;
            } catch (IOException e4) {
                e4.printStackTrace();
                return false;
            }
        } catch (Throwable th2) {
            th = th2;
            bufferedOutputStream2 = bufferedOutputStream;
            try {
                bufferedOutputStream2.close();
            } catch (IOException e5) {
                e5.printStackTrace();
            }
            throw th;
        }
    }

    @InterfaceC4418(api = 18)
    public static long m28818() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return (statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong()) / 1024;
    }

    public static boolean m28819(byte[] bArr, String str, String str2) {
        BufferedOutputStream bufferedOutputStream;
        if (!m28810()) {
            return false;
        }
        BufferedOutputStream bufferedOutputStream2 = null;
        try {
            try {
                bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(Environment.getExternalStoragePublicDirectory(str), str2)));
            } catch (Throwable th) {
                th = th;
            }
        } catch (Exception e) {
            e = e;
        }
        try {
            bufferedOutputStream.write(bArr);
            bufferedOutputStream.flush();
            try {
                bufferedOutputStream.close();
            } catch (IOException e2) {
                e2.printStackTrace();
            }
            return true;
        } catch (Exception e3) {
            e = e3;
            bufferedOutputStream2 = bufferedOutputStream;
            e.printStackTrace();
            try {
                bufferedOutputStream2.close();
                return false;
            } catch (IOException e4) {
                e4.printStackTrace();
                return false;
            }
        } catch (Throwable th2) {
            th = th2;
            bufferedOutputStream2 = bufferedOutputStream;
            try {
                bufferedOutputStream2.close();
            } catch (IOException e5) {
                e5.printStackTrace();
            }
            throw th;
        }
    }

    public static boolean m28820(byte[] bArr, String str, Context context) {
        BufferedOutputStream bufferedOutputStream;
        if (!m28810()) {
            return false;
        }
        BufferedOutputStream bufferedOutputStream2 = null;
        try {
            try {
                bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(context.getExternalCacheDir(), str)));
            } catch (Throwable th) {
                th = th;
            }
        } catch (Exception e) {
            e = e;
        }
        try {
            bufferedOutputStream.write(bArr);
            bufferedOutputStream.flush();
            try {
                bufferedOutputStream.close();
            } catch (IOException e2) {
                e2.printStackTrace();
            }
            return true;
        } catch (Exception e3) {
            e = e3;
            bufferedOutputStream2 = bufferedOutputStream;
            e.printStackTrace();
            try {
                bufferedOutputStream2.close();
                return false;
            } catch (IOException e4) {
                e4.printStackTrace();
                return false;
            }
        } catch (Throwable th2) {
            th = th2;
            bufferedOutputStream2 = bufferedOutputStream;
            try {
                bufferedOutputStream2.close();
            } catch (IOException e5) {
                e5.printStackTrace();
            }
            throw th;
        }
    }

    public static String m28821(String str) {
        return C7374.m29826().getExternalFilesDir(str).getAbsolutePath();
    }

    public static String m28822() {
        return C7374.m29826().getExternalCacheDir().getAbsolutePath();
    }

    public static String m28823() {
        return C7374.m29826().getExternalFilesDir(Environment.DIRECTORY_MOVIES).toString();
    }

    public static String m28824() {
        if (!m28810()) {
            return null;
        }
        StringBuilder sb = new StringBuilder();
        sb.append(Environment.getExternalStorageDirectory().getPath());
        String str = File.separator;
        sb.append(str);
        sb.append("data");
        sb.append(str);
        return sb.toString();
    }

    public static String m28825(String str) {
        return C7374.m29826().getDatabasePath(str).toString();
    }

    @InterfaceC4418(api = 18)
    public static long m28826() {
        if (!m28810()) {
            return 0L;
        }
        StatFs statFs = new StatFs(m28833());
        return ((statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong()) / 1024) / 1024;
    }

    public static boolean m28827() {
        return Environment.isExternalStorageRemovable();
    }

    public static String m28828() {
        return C7374.m29826().getPackageResourcePath();
    }

    public static String m28829() {
        return Environment.getExternalStorageState();
    }

    public static boolean m28830(byte[] bArr, String str, String str2, Context context) {
        BufferedOutputStream bufferedOutputStream;
        if (!m28810()) {
            return false;
        }
        File externalFilesDir = context.getExternalFilesDir(str);
        BufferedOutputStream bufferedOutputStream2 = null;
        try {
            try {
                bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(externalFilesDir, str2)));
            } catch (Throwable th) {
                th = th;
            }
        } catch (Exception e) {
            e = e;
        }
        try {
            bufferedOutputStream.write(bArr);
            bufferedOutputStream.flush();
            try {
                bufferedOutputStream.close();
            } catch (IOException e2) {
                e2.printStackTrace();
            }
            return true;
        } catch (Exception e3) {
            e = e3;
            bufferedOutputStream2 = bufferedOutputStream;
            e.printStackTrace();
            try {
                bufferedOutputStream2.close();
                return false;
            } catch (IOException e4) {
                e4.printStackTrace();
                return false;
            }
        } catch (Throwable th2) {
            th = th2;
            bufferedOutputStream2 = bufferedOutputStream;
            try {
                bufferedOutputStream2.close();
            } catch (IOException e5) {
                e5.printStackTrace();
            }
            throw th;
        }
    }

    @TargetApi(18)
    public static String m28831() {
        if (!m28810()) {
            return null;
        }
        C7271 c7271 = new C7271();
        c7271.f27390 = true;
        StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
        c7271.f27394 = statFs.getBlockCountLong();
        c7271.f27395 = statFs.getBlockSizeLong();
        c7271.f27392 = statFs.getAvailableBlocksLong();
        c7271.f27388 = statFs.getAvailableBytes();
        c7271.f27389 = statFs.getFreeBlocksLong();
        c7271.f27393 = statFs.getFreeBytes();
        c7271.f27391 = statFs.getTotalBytes();
        return c7271.toString();
    }

    public static boolean m28832(Bitmap bitmap, String str, Context context) {
        BufferedOutputStream bufferedOutputStream;
        boolean z;
        if (!m28810()) {
            return false;
        }
        ?? r0 = 0;
        boolean z2 = false;
        BufferedOutputStream bufferedOutputStream2 = null;
        try {
            try {
                try {
                    bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(context.getExternalCacheDir(), str)));
                } catch (Throwable th) {
                    th = th;
                }
            } catch (Exception e) {
                e = e;
            }
            if (str != null) {
                try {
                    boolean contains = str.contains(".png");
                    boolean z3 = contains;
                    if (!contains) {
                        ?? r02 = ".PNG";
                        z2 = r02;
                        z3 = r02;
                    }
                    bitmap.compress(Bitmap.CompressFormat.PNG, 100, bufferedOutputStream);
                    z = z3;
                    bufferedOutputStream.flush();
                    bufferedOutputStream.close();
                    r0 = z;
                } catch (Exception e2) {
                    e = e2;
                    bufferedOutputStream2 = bufferedOutputStream;
                    e.printStackTrace();
                    if (bufferedOutputStream2 == null) {
                        return true;
                    }
                    bufferedOutputStream2.close();
                    r0 = bufferedOutputStream2;
                    return true;
                } catch (Throwable th2) {
                    th = th2;
                    r0 = bufferedOutputStream;
                    if (r0 != 0) {
                        try {
                            r0.close();
                        } catch (IOException e3) {
                            e3.printStackTrace();
                        }
                    }
                    throw th;
                }
                return true;
            }
            bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bufferedOutputStream);
            z = z2;
            bufferedOutputStream.flush();
            bufferedOutputStream.close();
            r0 = z;
            return true;
        } catch (IOException e4) {
            e4.printStackTrace();
            return true;
        }
    }

    public static String m28833() {
        if (m28810()) {
            return Environment.getExternalStorageDirectory().getAbsolutePath();
        }
        return null;
    }

    public static boolean m28834(String str) {
        return new File(str).isFile();
    }

    public Bitmap m28835(String str) {
        Bitmap decodeByteArray;
        byte[] m28815 = m28815(str);
        if (m28815 == null || (decodeByteArray = BitmapFactory.decodeByteArray(m28815, 0, m28815.length)) == null) {
            return null;
        }
        return decodeByteArray;
    }
}