正在查看: moonshot.企业版 v5.53.33 应用的 C1482.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: moonshot.企业版 v5.53.33 应用的 C1482.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package jnksI9k6J1HFuFo5YzBf.pSr7Go6RrgekNCYHzK57.UBVL9U3WwxbAPwDW6rA5;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
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.RandomAccessFile;
import java.net.MalformedURLException;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import jnksI9k6J1HFuFo5YzBf.pSr7Go6RrgekNCYHzK57.UBVL9U3WwxbAPwDW6rA5.HemIPoFOGh7dX3KJunUU.C1393;
import jnksI9k6J1HFuFo5YzBf.pSr7Go6RrgekNCYHzK57.UBVL9U3WwxbAPwDW6rA5.HemIPoFOGh7dX3KJunUU.C1396;
public class C1482 {
private static Integer f5216 = 10485760;
public static final String f5217 = ".";
private C1482() {
throw new AssertionError();
}
public static boolean m7549(File file, InputStream inputStream, boolean z) {
FileOutputStream fileOutputStream;
FileOutputStream fileOutputStream2 = null;
try {
try {
m7561(file.getAbsolutePath());
fileOutputStream = new FileOutputStream(file, z);
} catch (Throwable th) {
th = th;
}
} catch (FileNotFoundException e) {
e = e;
} catch (IOException e2) {
e = e2;
}
try {
byte[] bArr = new byte[1024];
while (true) {
int read = inputStream.read(bArr);
if (read == -1) {
fileOutputStream.flush();
C1460.m7390(fileOutputStream);
C1460.m7390(inputStream);
return true;
}
fileOutputStream.write(bArr, 0, read);
}
} catch (FileNotFoundException e3) {
e = e3;
throw new RuntimeException("FileNotFoundException occurred. ", e);
} catch (IOException e4) {
e = e4;
throw new RuntimeException("IOException occurred. ", e);
} catch (Throwable th2) {
th = th2;
fileOutputStream2 = fileOutputStream;
C1460.m7390(fileOutputStream2);
C1460.m7390(inputStream);
throw th;
}
}
public static boolean m7550(String str) {
File file = new File(str);
File parentFile = file.getParentFile();
if (!parentFile.exists()) {
parentFile.mkdirs();
}
try {
file.createNewFile();
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
public static List<String> m7551(File file, int i) {
ArrayList arrayList = new ArrayList();
BufferedReader bufferedReader = null;
try {
try {
try {
BufferedReader bufferedReader2 = new BufferedReader(new FileReader(file));
do {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
break;
}
arrayList.add(readLine);
} catch (IOException e) {
e = e;
bufferedReader = bufferedReader2;
e.printStackTrace();
bufferedReader.close();
return arrayList;
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
try {
bufferedReader.close();
} catch (IOException e2) {
e2.printStackTrace();
}
throw th;
}
} while (arrayList.size() != i);
bufferedReader2.close();
} catch (IOException e3) {
e3.printStackTrace();
}
} catch (IOException e4) {
e = e4;
}
return arrayList;
} catch (Throwable th2) {
th = th2;
}
}
public static boolean m7552(File file, String str) {
RandomAccessFile randomAccessFile;
String property = System.getProperty("line.separator", "\n");
RandomAccessFile randomAccessFile2 = null;
try {
try {
try {
randomAccessFile = new RandomAccessFile(file, "rw");
} catch (Throwable th) {
th = th;
}
} catch (IOException e) {
e = e;
}
try {
randomAccessFile.seek(randomAccessFile.length());
randomAccessFile.writeBytes(property + str);
randomAccessFile.close();
} catch (IOException e2) {
e = e2;
randomAccessFile2 = randomAccessFile;
e.printStackTrace();
randomAccessFile2.close();
return false;
} catch (Throwable th2) {
th = th2;
randomAccessFile2 = randomAccessFile;
try {
randomAccessFile2.close();
} catch (IOException e3) {
e3.printStackTrace();
}
throw th;
}
return false;
} catch (IOException e4) {
e4.printStackTrace();
return false;
}
}
public static boolean m7553(String str, String str2) {
return m7597(new File(str), str2);
}
public static boolean m7554(File file) {
return file.delete();
}
public static void m7555(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 List<File> m7556(File file, String str) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1483.m7604(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m7556(file2, str));
} else if (file2.getName().toLowerCase().equals(str)) {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static List<File> m7557(File file) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1483.m7604(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m7557(file2));
} else {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static boolean m7558(String str) {
if (C1436.m7182(str)) {
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()) {
m7558(file2.getAbsolutePath());
}
}
return file.delete();
}
public static void m7559(Context context, String str) {
context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
}
public static boolean m7560(String str, String str2) {
return m7571(str, str2, false);
}
public static boolean m7561(String str) {
String m7582 = m7582(str);
if (C1436.m7182(m7582)) {
return false;
}
File file = new File(m7582);
if (file.exists() && file.isDirectory()) {
return true;
}
return file.mkdirs();
}
public static boolean m7562(String str, InputStream inputStream, boolean z) {
return m7549(str != null ? new File(str) : null, inputStream, z);
}
public static String m7563(File file) {
return C1446.m7283(file);
}
public static String m7564(String str) throws IOException {
return URLConnection.getFileNameMap().getContentTypeFor(str);
}
public static String m7565(String str) {
if (C1436.m7182(str)) {
return str;
}
int lastIndexOf = str.lastIndexOf(f5217);
int lastIndexOf2 = str.lastIndexOf(File.separator);
return lastIndexOf2 == -1 ? lastIndexOf == -1 ? str : str.substring(0, lastIndexOf) : lastIndexOf == -1 ? str.substring(lastIndexOf2 + 1) : lastIndexOf2 < lastIndexOf ? str.substring(lastIndexOf2 + 1, lastIndexOf) : str.substring(lastIndexOf2 + 1);
}
public static boolean m7566(File file, String str, String str2) {
RandomAccessFile randomAccessFile;
String property = System.getProperty("line.separator", "\n");
RandomAccessFile randomAccessFile2 = null;
try {
try {
try {
randomAccessFile = new RandomAccessFile(file, "rw");
} catch (IOException e) {
e = e;
}
} catch (Throwable th) {
th = th;
}
try {
randomAccessFile.seek(randomAccessFile.length());
randomAccessFile.write((property + str).getBytes(str2));
randomAccessFile.close();
} catch (IOException e2) {
e = e2;
randomAccessFile2 = randomAccessFile;
e.printStackTrace();
randomAccessFile2.close();
return false;
} catch (Throwable th2) {
th = th2;
randomAccessFile2 = randomAccessFile;
try {
randomAccessFile2.close();
} catch (IOException e3) {
e3.printStackTrace();
}
throw th;
}
return false;
} catch (IOException e4) {
e4.printStackTrace();
return false;
}
}
public static List<String> m7567(File file, String str) {
ArrayList arrayList = new ArrayList();
BufferedReader bufferedReader = null;
try {
try {
try {
BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(new FileInputStream(file), str));
while (true) {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
break;
}
arrayList.add(readLine);
} catch (IOException e) {
e = e;
bufferedReader = bufferedReader2;
e.printStackTrace();
bufferedReader.close();
return arrayList;
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
try {
bufferedReader.close();
} catch (IOException e2) {
e2.printStackTrace();
}
throw th;
}
}
bufferedReader2.close();
} catch (IOException e3) {
e3.printStackTrace();
}
} catch (IOException e4) {
e = e4;
}
return arrayList;
} catch (Throwable th2) {
th = th2;
}
}
public static List<String> m7568(String str, String str2) {
File file = new File(str);
ArrayList arrayList = new ArrayList();
BufferedReader bufferedReader = null;
if (!file.isFile()) {
return null;
}
try {
try {
BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(new FileInputStream(file), str2));
while (true) {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
C1460.m7390(bufferedReader2);
return arrayList;
}
arrayList.add(readLine);
} catch (IOException e) {
e = e;
bufferedReader = bufferedReader2;
throw new RuntimeException("IOException occurred. ", e);
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
C1460.m7390(bufferedReader);
throw th;
}
}
} catch (IOException e2) {
e = e2;
}
} catch (Throwable th2) {
th = th2;
}
}
public static boolean m7569(String str, String str2) {
try {
return m7589(str2, new FileInputStream(str));
} catch (FileNotFoundException e) {
throw new RuntimeException("FileNotFoundException occurred. ", e);
}
}
public static boolean m7570(File file) {
FileWriter fileWriter;
FileWriter fileWriter2 = null;
try {
try {
fileWriter = new FileWriter(file);
} catch (Throwable th) {
th = th;
}
} catch (IOException e) {
e = e;
}
try {
fileWriter.write("");
try {
fileWriter.close();
} catch (Exception e2) {
e2.printStackTrace();
}
return true;
} catch (IOException e3) {
e = e3;
fileWriter2 = fileWriter;
e.printStackTrace();
try {
fileWriter2.close();
return false;
} catch (Exception e4) {
e4.printStackTrace();
return false;
}
} catch (Throwable th2) {
th = th2;
fileWriter2 = fileWriter;
try {
fileWriter2.close();
} catch (Exception e5) {
e5.printStackTrace();
}
throw th;
}
}
public static boolean m7571(String str, String str2, boolean z) {
FileWriter fileWriter;
if (C1436.m7182(str2)) {
return false;
}
FileWriter fileWriter2 = null;
try {
try {
m7561(str);
fileWriter = new FileWriter(str, z);
} catch (IOException e) {
e = e;
}
} catch (Throwable th) {
th = th;
}
try {
fileWriter.write(str2);
C1460.m7390(fileWriter);
return true;
} catch (IOException e2) {
e = e2;
fileWriter2 = fileWriter;
throw new RuntimeException("IOException occurred. ", e);
} catch (Throwable th2) {
th = th2;
fileWriter2 = fileWriter;
C1460.m7390(fileWriter2);
throw th;
}
}
public static void m7572(File file, String str) {
if (!new File(str).exists()) {
m7578(str);
}
File[] listFiles = file.listFiles();
if (C1483.m7604(listFiles)) {
for (File file2 : listFiles) {
String name = file2.getName();
if (file2.isDirectory()) {
m7572(file2, str + "/" + name);
} else {
m7597(file2, str + "/" + name);
}
}
}
}
public static String m7573(File file) {
return C1396.m6970(file);
}
public static String m7574(String str) {
if (C1436.m7182(str)) {
return str;
}
int lastIndexOf = str.lastIndexOf(f5217);
return (lastIndexOf != -1 && str.lastIndexOf(File.separator) < lastIndexOf) ? str.substring(lastIndexOf + 1) : "";
}
public static void m7575(String str, String str2) {
m7572(new File(str), str2);
}
public static boolean m7576(File file) {
List<File> m7600 = m7600(file);
if (C1483.m7605(m7600)) {
for (File file2 : m7600) {
if (file2.isDirectory()) {
m7576(file2);
} else {
m7554(file2);
}
}
}
return file.delete();
}
public static List<String> m7577(File file, int i, String str) {
ArrayList arrayList = new ArrayList();
BufferedReader bufferedReader = null;
try {
try {
try {
BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(new FileInputStream(file), str));
do {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
break;
}
arrayList.add(readLine);
} catch (IOException e) {
e = e;
bufferedReader = bufferedReader2;
e.printStackTrace();
bufferedReader.close();
return arrayList;
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
try {
bufferedReader.close();
} catch (IOException e2) {
e2.printStackTrace();
}
throw th;
}
} while (arrayList.size() != i);
bufferedReader2.close();
} catch (IOException e3) {
e3.printStackTrace();
}
} catch (IOException e4) {
e = e4;
}
return arrayList;
} catch (Throwable th2) {
th = th2;
}
}
public static void m7578(String str) {
File file = new File(str);
if (file.exists()) {
return;
}
file.mkdirs();
}
public static StringBuilder m7579(String str, String str2) {
File file = new File(str);
StringBuilder sb = new StringBuilder("");
BufferedReader bufferedReader = null;
if (!file.isFile()) {
return null;
}
try {
try {
BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(new FileInputStream(file), str2));
while (true) {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
C1460.m7390(bufferedReader2);
return sb;
}
if (!sb.toString().equals("")) {
sb.append("\r\n");
}
sb.append(readLine);
} catch (IOException e) {
e = e;
bufferedReader = bufferedReader2;
throw new RuntimeException("IOException occurred. ", e);
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
C1460.m7390(bufferedReader);
throw th;
}
}
} catch (IOException e2) {
e = e2;
}
} catch (Throwable th2) {
th = th2;
}
}
public static boolean m7580(String str, List<String> list) {
return m7595(str, list, false);
}
public static Date m7581(File file) {
return new Date(file.lastModified());
}
public static String m7582(String str) {
if (C1436.m7182(str)) {
return str;
}
int lastIndexOf = str.lastIndexOf(File.separator);
return lastIndexOf == -1 ? "" : str.substring(0, lastIndexOf);
}
public static boolean m7583(String str) {
if (C1436.m7182(str)) {
return false;
}
File file = new File(str);
return file.exists() && file.isFile();
}
public static List<File> m7584(File file, String str) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1483.m7604(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m7584(file2, str));
} else if (file2.getName().toLowerCase().endsWith(str.toLowerCase())) {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static void m7585(String str, String str2) {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
throw new RuntimeException("Both sourceFilePath and destFilePath cannot be null.");
}
m7599(new File(str), new File(str2));
}
public static List<String> m7586(File file) {
ArrayList arrayList = new ArrayList();
BufferedReader bufferedReader = null;
try {
try {
try {
BufferedReader bufferedReader2 = new BufferedReader(new FileReader(file));
while (true) {
try {
String readLine = bufferedReader2.readLine();
if (readLine == null) {
break;
}
arrayList.add(readLine);
} catch (IOException e) {
e = e;
bufferedReader = bufferedReader2;
e.printStackTrace();
bufferedReader.close();
return arrayList;
} catch (Throwable th) {
th = th;
bufferedReader = bufferedReader2;
try {
bufferedReader.close();
} catch (IOException e2) {
e2.printStackTrace();
}
throw th;
}
}
bufferedReader2.close();
} catch (Throwable th2) {
th = th2;
}
} catch (IOException e3) {
e = e3;
}
} catch (IOException e4) {
e4.printStackTrace();
}
return arrayList;
}
public static boolean m7587(File file) {
if (m7570(file)) {
return file.delete();
}
return false;
}
public static String m7588(File file) {
try {
return C1393.m6968(file.toURL());
} catch (MalformedURLException e) {
e.printStackTrace();
return null;
}
}
public static boolean m7589(String str, InputStream inputStream) {
return m7562(str, inputStream, false);
}
public static boolean m7590(String str) {
if (C1436.m7182(str)) {
return false;
}
File file = new File(str);
return file.exists() && file.isDirectory();
}
public static List<File> m7591(File file, String str) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1483.m7604(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m7556(file2, str));
} else if (C1487.m7639(file2.getName(), str)) {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static long m7592(String str) {
if (C1436.m7182(str)) {
return -1L;
}
File file = new File(str);
if (file.exists() && file.isFile()) {
return file.length();
}
return -1L;
}
public static boolean m7593(String str) {
return m7561(str);
}
public static int m7594(File file) throws IOException {
BufferedInputStream bufferedInputStream;
BufferedInputStream bufferedInputStream2 = null;
try {
bufferedInputStream = new BufferedInputStream(new FileInputStream(file));
} catch (Throwable th) {
th = th;
}
try {
byte[] bArr = new byte[f5216.intValue()];
int i = 0;
while (true) {
int read = bufferedInputStream.read(bArr);
if (read == -1) {
bufferedInputStream.close();
return i;
}
for (int i2 = 0; i2 < read; i2++) {
if (bArr[i2] == 10) {
i++;
}
}
}
} catch (Throwable th2) {
th = th2;
bufferedInputStream2 = bufferedInputStream;
bufferedInputStream2.close();
throw th;
}
}
public static boolean m7595(String str, List<String> list, boolean z) {
FileWriter fileWriter;
int i = 0;
if (C1458.m7366(list)) {
return false;
}
FileWriter fileWriter2 = null;
try {
try {
m7561(str);
fileWriter = new FileWriter(str, z);
} catch (Throwable th) {
th = th;
}
} catch (IOException e) {
e = e;
}
try {
for (String str2 : list) {
int i2 = i + 1;
if (i > 0) {
fileWriter.write("\r\n");
}
fileWriter.write(str2);
i = i2;
}
C1460.m7390(fileWriter);
return true;
} catch (IOException e2) {
e = e2;
throw new RuntimeException("IOException occurred. ", e);
} catch (Throwable th2) {
th = th2;
fileWriter2 = fileWriter;
C1460.m7390(fileWriter2);
throw th;
}
}
public static boolean m7596(File file, InputStream inputStream) {
return m7549(file, inputStream, false);
}
public static boolean m7597(File file, String str) {
FileInputStream fileInputStream;
FileOutputStream fileOutputStream = null;
try {
try {
fileInputStream = new FileInputStream(file);
try {
FileOutputStream fileOutputStream2 = new FileOutputStream(new File(str));
try {
FileChannel channel = fileInputStream.getChannel();
FileChannel channel2 = fileOutputStream2.getChannel();
ByteBuffer allocate = ByteBuffer.allocate(f5216.intValue());
while (channel.read(allocate) != -1) {
allocate.flip();
channel2.write(allocate);
allocate.clear();
}
fileOutputStream2.close();
} catch (Throwable th) {
th = th;
fileOutputStream = fileOutputStream2;
try {
th.printStackTrace();
fileOutputStream.close();
fileInputStream.close();
return false;
} catch (Throwable th2) {
try {
fileOutputStream.close();
fileInputStream.close();
} catch (Exception unused) {
}
throw th2;
}
}
} catch (Throwable th3) {
th = th3;
}
} catch (Exception unused2) {
return false;
}
} catch (Throwable th4) {
th = th4;
fileInputStream = null;
}
fileInputStream.close();
return false;
}
public static List<File> m7598(String str) {
return m7557(new File(str));
}
public static void m7599(File file, File file2) {
if (file.renameTo(file2)) {
return;
}
m7569(file.getAbsolutePath(), file2.getAbsolutePath());
m7558(file.getAbsolutePath());
}
public static List<File> m7600(File file) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1483.m7604(listFiles)) {
for (File file2 : listFiles) {
arrayList.add(file2);
if (file2.isDirectory()) {
arrayList.addAll(m7600(file2));
}
}
}
return arrayList;
}
public static String m7601(String str) {
int lastIndexOf;
return (C1436.m7182(str) || (lastIndexOf = str.lastIndexOf(File.separator)) == -1) ? str : str.substring(lastIndexOf + 1);
}
public static String m7602(String str) {
try {
return C1393.m6959(str);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}