导航菜单

页面标题

页面副标题

moonshot.企业版 v5.53.33 - C6748.java 源代码

正在查看: moonshot.企业版 v5.53.33 应用的 C6748.java JAVA 源代码文件

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


package jnksI9k6J1HFuFo5YzBf.jb4dWzI2R7xQpOgeBEx2.UBVL9U3WwxbAPwDW6rA5;

import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import android.text.TextUtils;
import android.text.format.Formatter;
import com.luck.picture.lib.config.SelectMimeType;
import com.netease.nim.uikit.common.media.picker.fragment.PickerAlbumFragment;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

public class C6748 {
    public static ArrayList<File> m31025(String str) {
        File[] listFiles = new File(str).listFiles();
        ArrayList<File> arrayList = new ArrayList<>();
        if (listFiles != null) {
            for (int i = 0; i < listFiles.length; i++) {
                if (listFiles[i].isFile()) {
                    arrayList.add(listFiles[i]);
                }
                if (listFiles[i].isDirectory()) {
                    arrayList.addAll(m31025(listFiles[i].toString()));
                }
            }
        }
        return arrayList;
    }

    public static void m31026(Closeable... closeableArr) {
        if (closeableArr == null || closeableArr.length <= 0) {
            return;
        }
        for (Closeable closeable : closeableArr) {
            if (closeable != null) {
                try {
                    closeable.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static boolean m31027(String str, boolean z) {
        String m31043 = m31043(str);
        if (m31043 == null || m31043.length() == 0 || m31043.trim().length() == 0) {
            return false;
        }
        File file = new File(m31043);
        if (!file.exists()) {
            return file.mkdirs();
        }
        if (!z) {
            return true;
        }
        m31033(m31043);
        return file.mkdirs();
    }

    public static void m31028(Context context, String str) {
        DownloadManager.Request request = new DownloadManager.Request(Uri.parse(str));
        request.setDestinationInExternalPublicDir("/Download/", str.substring(str.lastIndexOf("/") + 1));
        ((DownloadManager) context.getSystemService("download")).enqueue(request);
    }

    public static void m31029(Context context, String str) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(268435456);
        intent.setDataAndType(Uri.fromFile(new File(str)), SelectMimeType.SYSTEM_IMAGE);
        context.startActivity(intent);
    }

    public static void m31030(Context context, String str) {
        context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
    }

    public static boolean m31031(String str, String str2, boolean z) {
        BufferedWriter bufferedWriter;
        BufferedWriter bufferedWriter2 = null;
        try {
            try {
                bufferedWriter = new BufferedWriter(new FileWriter(str, z));
            } catch (IOException e) {
                e = e;
            }
        } catch (Throwable th) {
            th = th;
        }
        try {
            bufferedWriter.write(str2);
            m31026(bufferedWriter);
            return true;
        } catch (IOException e2) {
            e = e2;
            bufferedWriter2 = bufferedWriter;
            e.printStackTrace();
            m31026(bufferedWriter2);
            return false;
        } catch (Throwable th2) {
            th = th2;
            bufferedWriter2 = bufferedWriter;
            m31026(bufferedWriter2);
            throw th;
        }
    }

    public static boolean m31032(String str, String str2) {
        File file = new File(str);
        return file.exists() && file.renameTo(new File(str2));
    }

    public static boolean m31033(String str) {
        return new File(str).delete();
    }

    public static void m31034(File file, File file2) {
        ?? channel;
        FileChannel fileChannel = null;
        r0 = 0;
        r0 = 0;
        ?? r0 = 0;
        fileChannel = null;
        fileChannel = null;
        fileChannel = null;
        try {
            try {
                channel = new FileInputStream(file).getChannel();
            } catch (Throwable th) {
                th = th;
            }
            try {
                r0 = new FileOutputStream(file2).getChannel();
                channel.transferTo(0L, channel.size(), r0);
                m31026(new Closeable[]{channel, r0});
            } catch (FileNotFoundException e) {
                e = e;
                File file3 = r0;
                fileChannel = channel;
                file = file3;
                e.printStackTrace();
                m31026(new Closeable[]{fileChannel, file});
            } catch (IOException e2) {
                e = e2;
                File file4 = r0;
                fileChannel = channel;
                file = file4;
                e.printStackTrace();
                m31026(new Closeable[]{fileChannel, file});
            } catch (Throwable th2) {
                th = th2;
                File file5 = r0;
                fileChannel = channel;
                file = file5;
                m31026(new Closeable[]{fileChannel, file});
                throw th;
            }
        } catch (FileNotFoundException e3) {
            e = e3;
            file = null;
        } catch (IOException e4) {
            e = e4;
            file = null;
        } catch (Throwable th3) {
            th = th3;
            file = null;
        }
    }

    @Deprecated
    public static String m31035(String str) {
        String str2 = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + str;
        File file = new File(str2);
        if (!file.exists()) {
            file.mkdir();
        }
        return str2;
    }

    public static void m31036(File file) {
        if (file.exists() && file.isDirectory()) {
            for (File file2 : file.listFiles()) {
                file2.delete();
            }
        }
    }

    public static String m31037(Context context, long j) {
        return Formatter.formatFileSize(context, j);
    }

    public static void m31038(Context context, String str) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addFlags(67108864);
        intent.putExtra("oneshot", 0);
        intent.putExtra("configchange", 0);
        intent.setDataAndType(Uri.fromFile(new File(str)), "video/*");
        context.startActivity(intent);
    }

    public static String m31039(String str) {
        ?? r0;
        String str2;
        File file = new File(str);
        File file2 = null;
        try {
            try {
                if (file.exists()) {
                    r0 = new BufferedReader(new FileReader(str));
                    try {
                        str2 = r0.readLine();
                        file2 = r0;
                    } catch (IOException e) {
                        e = e;
                        e.printStackTrace();
                        m31026(new Closeable[]{r0});
                        return null;
                    }
                } else {
                    str2 = null;
                }
                m31026(new Closeable[]{file2});
                return str2;
            } catch (Throwable th) {
                th = th;
                file2 = file;
                m31026(new Closeable[]{file2});
                throw th;
            }
        } catch (IOException e2) {
            e = e2;
            r0 = 0;
        } catch (Throwable th2) {
            th = th2;
            m31026(new Closeable[]{file2});
            throw th;
        }
    }

    public static String m31040(Context context) {
        return context.getObbDir().getAbsolutePath();
    }

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

    public static void m31042(InputStream inputStream, OutputStream outputStream) {
        try {
            try {
                byte[] bArr = new byte[2097152];
                while (true) {
                    int read = inputStream.read(bArr);
                    if (read <= 0) {
                        m31026(inputStream, outputStream);
                        return;
                    } else {
                        outputStream.write(bArr, 0, read);
                        outputStream.flush();
                    }
                }
            } catch (IOException e) {
                e.printStackTrace();
                m31026(inputStream, outputStream);
            }
        } catch (Throwable th) {
            m31026(inputStream, outputStream);
            throw th;
        }
    }

    public static String m31043(String str) {
        if (str == null || str.length() == 0 || str.trim().length() == 0) {
            return str;
        }
        int lastIndexOf = str.lastIndexOf(File.separator);
        return lastIndexOf == -1 ? "" : str.substring(0, lastIndexOf);
    }

    public static void m31044(InputStream inputStream, OutputStream outputStream) {
        GZIPInputStream gZIPInputStream;
        GZIPInputStream gZIPInputStream2 = null;
        try {
            try {
                gZIPInputStream = new GZIPInputStream(inputStream);
            } catch (IOException e) {
                e = e;
            }
        } catch (Throwable th) {
            th = th;
        }
        try {
            byte[] bArr = new byte[1024];
            while (true) {
                int read = gZIPInputStream.read(bArr);
                if (read == -1) {
                    m31026(gZIPInputStream, outputStream);
                    return;
                }
                outputStream.write(bArr, 0, read);
            }
        } catch (IOException e2) {
            e = e2;
            gZIPInputStream2 = gZIPInputStream;
            e.printStackTrace();
            m31026(gZIPInputStream2, outputStream);
        } catch (Throwable th2) {
            th = th2;
            gZIPInputStream2 = gZIPInputStream;
            m31026(gZIPInputStream2, outputStream);
            throw th;
        }
    }

    public static void m31045(InputStream inputStream, OutputStream outputStream) {
        GZIPOutputStream gZIPOutputStream;
        int read;
        ?? r3 = 0;
        GZIPOutputStream gZIPOutputStream2 = null;
        try {
            try {
                gZIPOutputStream = new GZIPOutputStream(outputStream);
            } catch (Throwable th) {
                th = th;
            }
        } catch (IOException e) {
            e = e;
        }
        try {
            byte[] bArr = new byte[1024];
            while (true) {
                read = inputStream.read(bArr);
                if (read == -1) {
                    break;
                }
                gZIPOutputStream.write(bArr, 0, read);
                gZIPOutputStream.flush();
            }
            m31026(inputStream, gZIPOutputStream);
            r3 = read;
        } catch (IOException e2) {
            e = e2;
            gZIPOutputStream2 = gZIPOutputStream;
            e.printStackTrace();
            m31026(inputStream, gZIPOutputStream2);
            r3 = gZIPOutputStream2;
        } catch (Throwable th2) {
            th = th2;
            r3 = gZIPOutputStream;
            m31026(new Closeable[]{inputStream, r3});
            throw th;
        }
    }

    public static void m31046(InputStream inputStream, File file) {
        byte[] bArr = new byte[1024];
        ?? r4 = 0;
        FileOutputStream fileOutputStream = null;
        try {
            try {
                FileOutputStream fileOutputStream2 = new FileOutputStream(file);
                while (true) {
                    try {
                        int read = inputStream.read(bArr);
                        r4 = -1;
                        if (read == -1) {
                            break;
                        }
                        fileOutputStream2.write(bArr, 0, read);
                        fileOutputStream2.flush();
                    } catch (IOException e) {
                        e = e;
                        fileOutputStream = fileOutputStream2;
                        e.printStackTrace();
                        m31026(inputStream, fileOutputStream);
                        r4 = fileOutputStream;
                    } catch (Throwable th) {
                        th = th;
                        r4 = fileOutputStream2;
                        m31026(new Closeable[]{inputStream, r4});
                        throw th;
                    }
                }
                m31026(inputStream, fileOutputStream2);
            } catch (Throwable th2) {
                th = th2;
            }
        } catch (IOException e2) {
            e = e2;
        }
    }

    public static boolean m31047(String str) {
        return new File(str).exists();
    }

    public static long m31048(String str) {
        if (TextUtils.isEmpty(str)) {
            return -1L;
        }
        File file = new File(str);
        if (file.exists() && file.isFile()) {
            return file.length();
        }
        return -1L;
    }

    public static void m31049(Context context, String str, String str2) {
        Intent intent = new Intent("android.intent.action.SEND");
        Uri parse = Uri.parse(PickerAlbumFragment.FILE_PREFIX + str2);
        intent.setType("*/*");
        intent.putExtra("android.intent.extra.STREAM", parse);
        context.startActivity(Intent.createChooser(intent, str));
    }

    public static String m31050(String str) {
        int lastIndexOf;
        return (C6750.m31078(str) || (lastIndexOf = str.lastIndexOf(File.separator)) == -1) ? str : str.substring(lastIndexOf + 1);
    }

    public static boolean m31051(String str) {
        if (str == null || str.length() == 0 || str.trim().length() == 0) {
            return true;
        }
        File file = new File(str);
        if (!file.exists()) {
            return true;
        }
        if (file.isFile()) {
            return file.delete();
        }
        if (!file.isDirectory()) {
            return false;
        }
        for (File file2 : file.listFiles()) {
            if (file2.isFile()) {
                file2.delete();
            } else if (file2.isDirectory()) {
                m31033(file2.getAbsolutePath());
            }
        }
        return file.delete();
    }

    public static StringBuilder m31052(File file, String str) {
        StringBuilder sb = new StringBuilder("");
        BufferedReader bufferedReader = null;
        if (file == null || !file.isFile()) {
            return null;
        }
        try {
            try {
                BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(new FileInputStream(file), str));
                while (true) {
                    try {
                        String readLine = bufferedReader2.readLine();
                        if (readLine == null) {
                            m31026(bufferedReader2);
                            return sb;
                        }
                        if (!sb.toString().equals("")) {
                            sb.append("\r\n");
                        }
                        sb.append(readLine);
                    } catch (IOException e) {
                        e = e;
                        throw new RuntimeException("IOException occurred. ", e);
                    } catch (Throwable th) {
                        th = th;
                        bufferedReader = bufferedReader2;
                        m31026(bufferedReader);
                        throw th;
                    }
                }
            } catch (Throwable th2) {
                th = th2;
            }
        } catch (IOException e2) {
            e = e2;
        }
    }

    public static boolean m31053(String str) {
        return m31027(str, false);
    }
}