APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Breathe - People Portal
版本号:2.19.0
包名称:com.elmo.rta.breathe

MD5 校验值:2a432003868ccf5f53c7a8e745fc59ec

反编译源代码说明

a0.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package bm;

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 a0 {

    public static final em.e f2584c = new em.e("AssetPackStorage", 0);

    public final Context f2585a;

    public final v1 f2586b;

    static {
        TimeUnit timeUnit = TimeUnit.DAYS;
        timeUnit.toMillis(14L);
        timeUnit.toMillis(28L);
    }

    public a0(Context context, v1 v1Var) {
        this.f2585a = context;
        this.f2586b = v1Var;
    }

    public static long b(File file, boolean z10) {
        if (!file.exists()) {
            return -1L;
        }
        ArrayList arrayList = new ArrayList();
        em.e eVar = f2584c;
        if (z10 && file.listFiles().length > 1) {
            eVar.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 e10) {
            eVar.c("Corrupt asset pack directories.", e10, 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 b10 = b(file, false);
        for (File file2 : file.listFiles()) {
            if (!file2.getName().equals(String.valueOf(b10)) && !file2.getName().equals("stale.tmp")) {
                g(file2);
            }
        }
    }

    public static boolean g(File file) {
        File[] listFiles = file.listFiles();
        boolean z10 = true;
        if (listFiles != null) {
            for (File file2 : listFiles) {
                z10 &= g(file2);
            }
        }
        if (file.delete()) {
            return z10;
        }
        return false;
    }

    public final void a(int i10, long j5, String str) {
        File file = new File(d(), str);
        if (!file.exists()) {
            return;
        }
        for (File file2 : file.listFiles()) {
            if (!file2.getName().equals(String.valueOf(i10)) && !file2.getName().equals("stale.tmp")) {
                g(file2);
            } else if (file2.getName().equals(String.valueOf(i10))) {
                for (File file3 : file2.listFiles()) {
                    if (!file3.getName().equals(String.valueOf(j5))) {
                        g(file3);
                    }
                }
            }
        }
    }

    public final File c(int i10, long j5, String str) {
        return new File(new File(new File(new File(d(), "_tmp"), str), String.valueOf(i10)), String.valueOf(j5));
    }

    public final File d() {
        return new File(this.f2585a.getFilesDir(), "assetpacks");
    }

    public final ArrayList e() {
        ArrayList arrayList = new ArrayList();
        try {
        } catch (IOException e10) {
            f2584c.b("Could not process directory while scanning installed packs. %s", e10);
        }
        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(int i10, long j5, String str) {
        File file = new File(new File(c(i10, j5, str), "_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) {
                try {
                    return Integer.parseInt(properties.getProperty("numberOfMerges"));
                } catch (NumberFormatException e10) {
                    throw new u0("Merge checkpoint file corrupt.", e10);
                }
            }
            throw new u0("Merge checkpoint file corrupt.");
        } catch (Throwable th2) {
            try {
                fileInputStream.close();
            } catch (Throwable unused) {
            }
            throw th2;
        }
    }

    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(int i10, long j5, String str) {
        return new File(new File(new File(d(), str), String.valueOf(i10)), String.valueOf(j5));
    }

    public final File k(int i10, long j5, String str, String str2) {
        return new File(new File(new File(c(i10, j5, str), "_slices"), "_unverified"), str2);
    }

    public final File l(int i10, long j5, String str, String str2) {
        return new File(new File(new File(c(i10, j5, str), "_slices"), "_verified"), str2);
    }

    public final String m(String str) {
        int length;
        File file = new File(d(), str);
        boolean exists = file.exists();
        em.e eVar = f2584c;
        if (!exists) {
            eVar.a("Pack not found with pack name: %s", str);
            return null;
        }
        v1 v1Var = this.f2586b;
        File file2 = new File(file, String.valueOf(v1Var.a()));
        if (!file2.exists()) {
            eVar.a("Pack not found with pack name: %s app version: %s", str, Integer.valueOf(v1Var.a()));
            return null;
        }
        File[] listFiles = file2.listFiles();
        if (listFiles == null || (length = listFiles.length) == 0) {
            eVar.a("No pack version found for pack name: %s app version: %s", str, Integer.valueOf(v1Var.a()));
            return null;
        }
        if (length <= 1) {
            return listFiles[0].getCanonicalPath();
        }
        eVar.b("Multiple pack versions found for pack name: %s app version: %s", str, Integer.valueOf(v1Var.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 b10 = (int) b(new File(d(), name), true);
            long b11 = b(new File(new File(d(), name), String.valueOf(b10)), true);
            if (j(b10, b11, name).exists()) {
                hashMap.put(name, Long.valueOf(b11));
            }
        }
        return hashMap;
    }
}