正在查看: Meine NEW v2.0.3616 应用的 w.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Meine NEW v2.0.3616 应用的 w.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package c4;
import android.content.Context;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
public final class w {
public static final b4.j c = new b4.j("AssetPackStorage");
public final Context f2530a;
public final r1 f2531b;
static {
TimeUnit timeUnit = TimeUnit.DAYS;
timeUnit.toMillis(14L);
timeUnit.toMillis(28L);
}
public w(Context context, r1 r1Var) {
this.f2530a = context;
this.f2531b = r1Var;
}
public static long b(File file, boolean z) {
if (!file.exists()) {
return -1L;
}
ArrayList arrayList = new ArrayList();
b4.j jVar = c;
if (z && file.listFiles().length > 1) {
jVar.e("Multiple pack versions found, using highest version code.", new Object[0]);
}
try {
for (File file2 : file.listFiles()) {
if (!file2.getName().equals("stale.tmp")) {
arrayList.add(Long.valueOf(file2.getName()));
}
}
} catch (NumberFormatException e6) {
jVar.c(e6, "Corrupt asset pack directories.", new Object[0]);
}
if (arrayList.isEmpty()) {
return -1L;
}
Collections.sort(arrayList);
return ((Long) arrayList.get(arrayList.size() - 1)).longValue();
}
public static void f(File file) {
if (file.listFiles() == null || file.listFiles().length <= 1) {
return;
}
long b6 = b(file, false);
for (File file2 : file.listFiles()) {
if (!file2.getName().equals(String.valueOf(b6)) && !file2.getName().equals("stale.tmp")) {
g(file2);
}
}
}
public static boolean g(File file) {
File[] listFiles = file.listFiles();
boolean z = true;
if (listFiles != null) {
for (File file2 : listFiles) {
z &= g(file2);
}
}
if (file.delete()) {
return z;
}
return false;
}
public final void a(String str, int i5, long j5) {
File file = new File(d(), str);
if (file.exists()) {
for (File file2 : file.listFiles()) {
if (!file2.getName().equals(String.valueOf(i5)) && !file2.getName().equals("stale.tmp")) {
g(file2);
} else if (file2.getName().equals(String.valueOf(i5))) {
for (File file3 : file2.listFiles()) {
if (!file3.getName().equals(String.valueOf(j5))) {
g(file3);
}
}
}
}
}
}
public final File c(String str, int i5, long j5) {
return new File(new File(new File(new File(d(), "_tmp"), str), String.valueOf(i5)), String.valueOf(j5));
}
public final File d() {
return new File(this.f2530a.getFilesDir(), "assetpacks");
}
public final ArrayList e() {
ArrayList arrayList = new ArrayList();
try {
} catch (IOException e6) {
c.b("Could not process directory while scanning installed packs. %s", e6);
}
if (d().exists() && d().listFiles() != null) {
for (File file : d().listFiles()) {
if (!file.getCanonicalPath().equals(new File(d(), "_tmp").getCanonicalPath())) {
arrayList.add(file);
}
}
return arrayList;
}
return arrayList;
}
public final int h(String str, int i5, long j5) {
File file = new File(new File(c(str, i5, j5), "_packs"), "merge.tmp");
if (!file.exists()) {
return 0;
}
Properties properties = new Properties();
FileInputStream fileInputStream = new FileInputStream(file);
try {
properties.load(fileInputStream);
fileInputStream.close();
if (properties.getProperty("numberOfMerges") == null) {
throw new o0("Merge checkpoint file corrupt.");
}
try {
return Integer.parseInt(properties.getProperty("numberOfMerges"));
} catch (NumberFormatException e6) {
throw new o0("Merge checkpoint file corrupt.", e6);
}
} catch (Throwable th) {
try {
fileInputStream.close();
} catch (Throwable unused) {
}
throw th;
}
}
public final long i(String str) {
return b(new File(new File(d(), str), String.valueOf((int) b(new File(d(), str), true))), true);
}
public final File j(String str, int i5, long j5) {
return new File(new File(new File(d(), str), String.valueOf(i5)), String.valueOf(j5));
}
public final File k(String str, int i5, long j5, String str2) {
return new File(new File(new File(c(str, i5, j5), "_slices"), "_unverified"), str2);
}
public final File l(String str, int i5, long j5, String str2) {
return new File(new File(new File(c(str, i5, j5), "_slices"), "_verified"), str2);
}
public final String m(String str) {
int length;
File file = new File(d(), str);
boolean exists = file.exists();
b4.j jVar = c;
if (!exists) {
jVar.a("Pack not found with pack name: %s", str);
return null;
}
r1 r1Var = this.f2531b;
File file2 = new File(file, String.valueOf(r1Var.a()));
if (!file2.exists()) {
jVar.a("Pack not found with pack name: %s app version: %s", str, Integer.valueOf(r1Var.a()));
return null;
}
File[] listFiles = file2.listFiles();
if (listFiles == null || (length = listFiles.length) == 0) {
jVar.a("No pack version found for pack name: %s app version: %s", str, Integer.valueOf(r1Var.a()));
return null;
}
if (length <= 1) {
return listFiles[0].getCanonicalPath();
}
jVar.b("Multiple pack versions found for pack name: %s app version: %s", str, Integer.valueOf(r1Var.a()));
return null;
}
public final HashMap n() {
HashMap hashMap = new HashMap();
Iterator it = e().iterator();
while (it.hasNext()) {
String name = ((File) it.next()).getName();
int b6 = (int) b(new File(d(), name), true);
long b7 = b(new File(new File(d(), name), String.valueOf(b6)), true);
if (j(name, b6, b7).exists()) {
hashMap.put(name, Long.valueOf(b7));
}
}
return hashMap;
}
}