正在查看: moonshot.企业版 v8.14.46 应用的 C1279.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: moonshot.企业版 v8.14.46 应用的 C1279.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package kp1AiJpjqJHu1Tcnj96z.l9DIbgbSEsWEHUgGqnur.zSFvmU2XOpXZrEfUxlHp;
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 kp1AiJpjqJHu1Tcnj96z.l9DIbgbSEsWEHUgGqnur.zSFvmU2XOpXZrEfUxlHp.TFXzgpZxQae9rz6JPuPF.C1257;
import kp1AiJpjqJHu1Tcnj96z.l9DIbgbSEsWEHUgGqnur.zSFvmU2XOpXZrEfUxlHp.TFXzgpZxQae9rz6JPuPF.C1258;
public class C1279 {
public static final String f4551 = ".";
private static Integer f4552 = 10485760;
private C1279() {
throw new AssertionError();
}
public static boolean m6559(String str, List<String> list, boolean z) {
FileWriter fileWriter;
int i = 0;
if (C1268.m6487(list)) {
return false;
}
FileWriter fileWriter2 = null;
try {
try {
m6606(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;
}
C1302.m6752(fileWriter);
return true;
} catch (IOException e2) {
e = e2;
throw new RuntimeException("IOException occurred. ", e);
} catch (Throwable th2) {
th = th2;
fileWriter2 = fileWriter;
C1302.m6752(fileWriter2);
throw th;
}
}
public static boolean m6560(String str, String str2) {
return m6602(new File(str), str2);
}
public static boolean m6561(File file, InputStream inputStream) {
return m6577(file, inputStream, false);
}
public static String m6562(File file) {
return C1257.m6369(file);
}
public static boolean m6563(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 Date m6564(File file) {
return new Date(file.lastModified());
}
public static List<File> m6565(File file) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1262.m6436(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m6565(file2));
} else {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static String m6566(File file) {
try {
return C1258.m6378(file.toURL());
} catch (MalformedURLException e) {
e.printStackTrace();
return null;
}
}
public static String m6567(String str) {
if (C1315.m6880(str)) {
return str;
}
int lastIndexOf = str.lastIndexOf(f4551);
return (lastIndexOf != -1 && str.lastIndexOf(File.separator) < lastIndexOf) ? str.substring(lastIndexOf + 1) : "";
}
public static boolean m6568(String str, InputStream inputStream, boolean z) {
return m6577(str != null ? new File(str) : null, inputStream, z);
}
public static List<String> m6569(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 List<String> m6570(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) {
C1302.m6752(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;
C1302.m6752(bufferedReader);
throw th;
}
}
} catch (IOException e2) {
e = e2;
}
} catch (Throwable th2) {
th = th2;
}
}
public static List<File> m6571(File file, String str) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1262.m6436(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m6578(file2, str));
} else if (C1296.m6725(file2.getName(), str)) {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static List<String> m6572(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 m6573(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 String m6574(String str) {
if (C1315.m6880(str)) {
return str;
}
int lastIndexOf = str.lastIndexOf(f4551);
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 String m6575(String str) {
if (C1315.m6880(str)) {
return str;
}
int lastIndexOf = str.lastIndexOf(File.separator);
return lastIndexOf == -1 ? "" : str.substring(0, lastIndexOf);
}
public static int m6576(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[f4552.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 m6577(File file, InputStream inputStream, boolean z) {
FileOutputStream fileOutputStream;
FileOutputStream fileOutputStream2 = null;
try {
try {
m6606(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();
C1302.m6752(fileOutputStream);
C1302.m6752(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;
C1302.m6752(fileOutputStream2);
C1302.m6752(inputStream);
throw th;
}
}
public static List<File> m6578(File file, String str) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1262.m6436(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m6578(file2, str));
} else if (file2.getName().toLowerCase().equals(str)) {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static void m6579(File file, File file2) {
if (file.renameTo(file2)) {
return;
}
m6610(file.getAbsolutePath(), file2.getAbsolutePath());
m6581(file.getAbsolutePath());
}
public static String m6580(String str) {
int lastIndexOf;
return (C1315.m6880(str) || (lastIndexOf = str.lastIndexOf(File.separator)) == -1) ? str : str.substring(lastIndexOf + 1);
}
public static boolean m6581(String str) {
if (C1315.m6880(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()) {
m6581(file2.getAbsolutePath());
}
}
return file.delete();
}
public static boolean m6582(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 boolean m6583(String str) {
if (C1315.m6880(str)) {
return false;
}
File file = new File(str);
return file.exists() && file.isDirectory();
}
public static boolean m6584(String str) {
if (C1315.m6880(str)) {
return false;
}
File file = new File(str);
return file.exists() && file.isFile();
}
public static boolean m6585(File file) {
if (m6563(file)) {
return file.delete();
}
return false;
}
public static List<File> m6586(File file) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1262.m6436(listFiles)) {
for (File file2 : listFiles) {
arrayList.add(file2);
if (file2.isDirectory()) {
arrayList.addAll(m6586(file2));
}
}
}
return arrayList;
}
public static String m6587(String str) throws IOException {
return URLConnection.getFileNameMap().getContentTypeFor(str);
}
public static void m6588(File file, String str) {
if (!new File(str).exists()) {
m6607(str);
}
File[] listFiles = file.listFiles();
if (C1262.m6436(listFiles)) {
for (File file2 : listFiles) {
String name = file2.getName();
if (file2.isDirectory()) {
m6588(file2, str + "/" + name);
} else {
m6602(file2, str + "/" + name);
}
}
}
}
public static boolean m6589(String str) {
return m6606(str);
}
public static List<File> m6590(File file, String str) {
ArrayList arrayList = new ArrayList();
File[] listFiles = file.listFiles();
if (C1262.m6436(listFiles)) {
for (File file2 : listFiles) {
if (file2.isDirectory()) {
arrayList.addAll(m6590(file2, str));
} else if (file2.getName().toLowerCase().endsWith(str.toLowerCase())) {
arrayList.add(file2);
}
}
}
return arrayList;
}
public static boolean m6591(File file) {
return file.delete();
}
public static boolean m6592(File file) {
List<File> m6586 = m6586(file);
if (C1262.m6434(m6586)) {
for (File file2 : m6586) {
if (file2.isDirectory()) {
m6592(file2);
} else {
m6591(file2);
}
}
}
return file.delete();
}
public static boolean m6593(String str, String str2) {
return m6604(str, str2, false);
}
public static void m6594(String str, String str2) {
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
throw new RuntimeException("Both sourceFilePath and destFilePath cannot be null.");
}
m6579(new File(str), new File(str2));
}
public static List<String> m6595(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 boolean m6596(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> m6597(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 m6598(String str, List<String> list) {
return m6559(str, list, false);
}
public static void m6599(String str, String str2) {
m6588(new File(str), str2);
}
public static String m6600(File file) {
return C1297.m6730(file);
}
public static String m6601(String str) {
try {
return C1258.m6377(str);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static boolean m6602(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(f4552.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 void m6603(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 boolean m6604(String str, String str2, boolean z) {
FileWriter fileWriter;
if (C1315.m6880(str2)) {
return false;
}
FileWriter fileWriter2 = null;
try {
try {
m6606(str);
fileWriter = new FileWriter(str, z);
} catch (IOException e) {
e = e;
}
} catch (Throwable th) {
th = th;
}
try {
fileWriter.write(str2);
C1302.m6752(fileWriter);
return true;
} catch (IOException e2) {
e = e2;
fileWriter2 = fileWriter;
throw new RuntimeException("IOException occurred. ", e);
} catch (Throwable th2) {
th = th2;
fileWriter2 = fileWriter;
C1302.m6752(fileWriter2);
throw th;
}
}
public static boolean m6605(String str, InputStream inputStream) {
return m6568(str, inputStream, false);
}
public static boolean m6606(String str) {
String m6575 = m6575(str);
if (C1315.m6880(m6575)) {
return false;
}
File file = new File(m6575);
if (file.exists() && file.isDirectory()) {
return true;
}
return file.mkdirs();
}
public static void m6607(String str) {
File file = new File(str);
if (file.exists()) {
return;
}
file.mkdirs();
}
public static void m6608(Context context, String str) {
context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
}
public static List<File> m6609(String str) {
return m6565(new File(str));
}
public static boolean m6610(String str, String str2) {
try {
return m6605(str2, new FileInputStream(str));
} catch (FileNotFoundException e) {
throw new RuntimeException("FileNotFoundException occurred. ", e);
}
}
public static long m6611(String str) {
if (C1315.m6880(str)) {
return -1L;
}
File file = new File(str);
if (file.exists() && file.isFile()) {
return file.length();
}
return -1L;
}
public static StringBuilder m6612(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) {
C1302.m6752(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;
C1302.m6752(bufferedReader);
throw th;
}
}
} catch (IOException e2) {
e = e2;
}
} catch (Throwable th2) {
th = th2;
}
}
}