导航菜单

页面标题

页面副标题

Moneyman v2.316.0.0 - S1.java 源代码

正在查看: Moneyman v2.316.0.0 应用的 S1.java JAVA 源代码文件

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


package be;

import android.content.Context;
import com.metamap.sdk_components.crash_reporter.sentry.io.sentry.clientreport.DiscardedEvent;
import com.singular.sdk.BuildConfig;
import com.uxcam.internals.bt;
import com.uxcam.service.HttpPostService;
import ee.C0932a;
import ie.C1133a;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.zip.ZipOutputStream;
import kotlin.collections.EmptyList;
import kotlin.text.Regex;
import ne.C1509a;
import org.json.JSONObject;

public final class S1 {
    public final Context a;

    public S1(Context context) {
        this.a = context;
    }

    public final void a() {
        String str = AbstractC0646h2.a;
        try {
            c(false, false);
        } catch (Exception e) {
            AbstractC0667l3.a(3, "Session upload failed with reason: " + e);
            HashMap hashMap = new HashMap();
            String replace = "[ #event# ]".replace("#event#", "Exception");
            hashMap.put("site_of_error", "SendOfflineData::uploadOfflineData()");
            hashMap.put(DiscardedEvent.JsonKeys.REASON, e.getMessage());
            Q1.A(replace, hashMap);
        }
    }

    public final void b(boolean z) {
        String str = AbstractC0646h2.a;
        try {
            c(true, z);
        } catch (Exception e) {
            AbstractC0703t2.c.getClass();
            HashMap hashMap = new HashMap();
            String replace = "[ #event# ]".replace("#event#", "Exception");
            hashMap.put("site_of_error", "SendOfflineData::deleteOfflineData()");
            hashMap.put(DiscardedEvent.JsonKeys.REASON, e.getMessage());
            Q1.A(replace, hashMap);
        }
    }

    public final void c(boolean z, boolean z2) {
        String str;
        int i;
        File[] listFiles;
        String str2;
        String str3;
        int i2 = 1;
        String str4 = BuildConfig.FLAVOR;
        try {
            String str5 = AbstractC0646h2.a;
            File[] listFiles2 = new File(ie.b.a(true)).listFiles();
            if (listFiles2 == null) {
                HashMap hashMap = new HashMap();
                String replace = "[ #event# ]".replace("#event#", "Process offline files on session");
                hashMap.put("site_of_error", "SendOfflineData::ProcessFilesInSDCard()");
                hashMap.put(DiscardedEvent.JsonKeys.REASON, "Folder is empty");
                Q1.z(replace, hashMap);
                return;
            }
            Arrays.sort(listFiles2, new R1());
            HashMap hashMap2 = new HashMap();
            String replace2 = "[ #event# ]".replace("#event#", "Processing Previous Session");
            hashMap2.put("site_of_error", "SendOfflineData::ProcessFilesInSDCard()");
            hashMap2.put("sessionCount", BuildConfig.FLAVOR + (listFiles2.length - 1));
            Q1.z(replace2, hashMap2);
            String message = "Session await upload remained: " + (listFiles2.length - 1);
            kotlin.jvm.internal.i.g(message, "message");
            C0662k3.a(4, 3, message);
            int length = listFiles2.length;
            int i3 = 0;
            while (i3 < length) {
                File file = listFiles2[i3];
                if (file.getName().equals(AbstractC0646h2.a) || (listFiles = file.listFiles()) == null) {
                    str = str4;
                    i = i2;
                } else if (listFiles.length == 0) {
                    file.delete();
                    i = i2;
                    str = str4;
                } else {
                    if (z) {
                        String[] strArr = ie.d.b;
                        if (file.isDirectory()) {
                            File[] listFiles3 = file.listFiles();
                            int length2 = listFiles3.length;
                            int i4 = 0;
                            while (i4 < length2) {
                                int i5 = i2;
                                if (listFiles3[i4].getName().contains("data")) {
                                    if (file.isDirectory()) {
                                        File[] listFiles4 = file.listFiles();
                                        int length3 = listFiles4.length;
                                        int i6 = 0;
                                        while (i6 < length3) {
                                            File file2 = listFiles4[i6];
                                            File[] fileArr = listFiles4;
                                            if (file2.getName().contains("data")) {
                                                str3 = str4;
                                            } else {
                                                str3 = str4;
                                                if (!file2.getName().contains("video")) {
                                                    i6++;
                                                    listFiles4 = fileArr;
                                                    str4 = str3;
                                                }
                                            }
                                            file2.getAbsolutePath();
                                            file2.delete();
                                            i6++;
                                            listFiles4 = fileArr;
                                            str4 = str3;
                                        }
                                    }
                                    str = str4;
                                    if (z2) {
                                        try {
                                            File[] listFiles5 = file.listFiles();
                                            int length4 = listFiles5.length;
                                            int i10 = 0;
                                            while (true) {
                                                if (i10 >= length4) {
                                                    str2 = str;
                                                    break;
                                                }
                                                File file3 = listFiles5[i10];
                                                if (file3.getName().endsWith(".usid")) {
                                                    str2 = file3.getName();
                                                    break;
                                                }
                                                i10++;
                                            }
                                            String str6 = str2.split(".usid")[0];
                                            if (!str6.isEmpty()) {
                                                if (bt.K == null) {
                                                    C1509a.s.getClass();
                                                    C1509a a = C1509a.C0238a.a();
                                                    C0932a.i.getClass();
                                                    bt.K = new bt(a, C0932a.C0104a.a());
                                                }
                                                bt btVar = bt.K;
                                                kotlin.jvm.internal.i.d(btVar);
                                                new P(btVar.d()).c = -1;
                                                new C0670m1(ie.d.j()).b(i5, str6);
                                            }
                                        } catch (Exception unused) {
                                        }
                                    }
                                } else {
                                    i4++;
                                    i2 = 1;
                                }
                            }
                        }
                        str = str4;
                        ie.d.a(file);
                    } else {
                        str = str4;
                        if (C1133a.a(this.a)) {
                            if (bt.K == null) {
                                C1509a.s.getClass();
                                C1509a a2 = C1509a.C0238a.a();
                                C0932a.i.getClass();
                                bt.K = new bt(a2, C0932a.C0104a.a());
                            }
                            bt btVar2 = bt.K;
                            kotlin.jvm.internal.i.d(btVar2);
                            C0612a3 p = btVar2.p();
                            String name = file.getName();
                            String str7 = p.a().b;
                            Iterator it = Q1.g().iterator();
                            while (true) {
                                if (!it.hasNext()) {
                                    break;
                                }
                                String str8 = (String) it.next();
                                if (name.endsWith(String.valueOf(str8.hashCode()))) {
                                    str7 = str8;
                                    break;
                                }
                            }
                            d(file, str7);
                        }
                    }
                    i = 1;
                }
                i3++;
                i2 = i;
                str4 = str;
            }
        } catch (Exception e) {
            AbstractC0667l3.a(3, "Session upload failed with reason: " + e);
            HashMap hashMap3 = new HashMap();
            String replace3 = "[ #event# ]".replace("#event#", "Exception");
            hashMap3.put("site_of_error", "SendOfflineData::ProcessFilesInSDCard()");
            hashMap3.put(DiscardedEvent.JsonKeys.REASON, e.getMessage());
            Q1.A(replace3, hashMap3);
        }
    }

    public final void d(File file, String str) {
        int i;
        String str2;
        Collection collection;
        File[] fileArr;
        int i2;
        int i3;
        z3 z3Var;
        File file2;
        FileOutputStream fileOutputStream;
        ZipOutputStream zipOutputStream;
        File[] listFiles = file.listFiles((FilenameFilter) new B5.c(4));
        if (listFiles == null || listFiles.length == 0) {
            ie.d.a(file);
            return;
        }
        int i4 = 3;
        if (!HttpPostService.a(file)) {
            String message = "Sending offline data File is already being posted :: " + file;
            kotlin.jvm.internal.i.g(message, "message");
            C0662k3.a(3, 5, message);
            return;
        }
        int length = listFiles.length;
        int i5 = 0;
        while (true) {
            if (i5 >= length) {
                i = 0;
                break;
            }
            File file3 = listFiles[i5];
            if (file3.length() == 0) {
                i = 0;
                if (file3.getName().startsWith("data")) {
                    ie.d.a(file3.getParentFile());
                    HashMap hashMap = new HashMap();
                    String replace = "[ #event# ]".replace("#event#", "Unexpected Session End, TECH_FAULT");
                    hashMap.put("site_of_error", "SendOfflineData::deleteSessionIfUnexpectedlyClosed");
                    hashMap.put("directory", file3.getParentFile().getName());
                    hashMap.put("event_happened", BuildConfig.FLAVOR + System.currentTimeMillis());
                    Q1.A(replace, hashMap);
                    if (bt.K == null) {
                        C1509a.s.getClass();
                        C1509a a = C1509a.C0238a.a();
                        C0932a.i.getClass();
                        bt.K = new bt(a, C0932a.C0104a.a());
                    }
                    bt btVar = bt.K;
                    kotlin.jvm.internal.i.d(btVar);
                    P p = new P(btVar.d());
                    AbstractC0646h2.n = true;
                    String str3 = AbstractC0646h2.I;
                    p.c = -1;
                    new C0670m1(ie.d.j()).b(i4, str3);
                }
            }
            if (file3.length() == 0 && ie.b.d(file3.getName())) {
                ie.d.a(file3);
                HashMap hashMap2 = new HashMap();
                String replace2 = "[ #event# ]".replace("#event#", "Unexpected File found");
                hashMap2.put("site_of_error", "SendOfflineData::deleteSessionIfUnexpectedlyClosed");
                hashMap2.put("desc", "video file is empty");
                hashMap2.put("directory", file3.getPath());
                hashMap2.put("event_happened", BuildConfig.FLAVOR + System.currentTimeMillis());
                Q1.q(replace2, hashMap2);
            } else if (file3.getName().contains(".aes")) {
                ie.d.a(file3);
                HashMap hashMap3 = new HashMap();
                String replace3 = "[ #event# ]".replace("#event#", "Unexpected File found");
                hashMap3.put("site_of_error", "SendOfflineData::deleteSessionIfUnexpectedlyClosed");
                hashMap3.put("desc", "delete .aes file");
                hashMap3.put("directory", file3.getPath());
                hashMap3.put("event_happened", BuildConfig.FLAVOR + System.currentTimeMillis());
                Q1.q(replace3, hashMap3);
            } else if (file3.getName().contains(".mp4")) {
                try {
                    z3Var = new z3(file3);
                    file2 = z3Var.a;
                    fileArr = listFiles;
                } catch (Exception | OutOfMemoryError unused) {
                    fileArr = listFiles;
                }
                try {
                    i2 = length;
                } catch (Exception | OutOfMemoryError unused2) {
                    i2 = length;
                    i3 = i5;
                    HashMap hashMap4 = new HashMap();
                    String replace4 = "[ #event# ]".replace("#event#", "Unexpected File found");
                    hashMap4.put("site_of_error", "SendOfflineData::deleteSessionIfUnexpectedlyClosed");
                    hashMap4.put("desc", "re-encrypt video file");
                    hashMap4.put("directory", file3.getPath());
                    hashMap4.put("event_happened", BuildConfig.FLAVOR + System.currentTimeMillis());
                    Q1.q(replace4, hashMap4);
                    i5 = i3 + 1;
                    listFiles = fileArr;
                    length = i2;
                    i4 = 3;
                }
                try {
                    i3 = i5;
                } catch (Exception | OutOfMemoryError unused3) {
                    i3 = i5;
                    HashMap hashMap42 = new HashMap();
                    String replace42 = "[ #event# ]".replace("#event#", "Unexpected File found");
                    hashMap42.put("site_of_error", "SendOfflineData::deleteSessionIfUnexpectedlyClosed");
                    hashMap42.put("desc", "re-encrypt video file");
                    hashMap42.put("directory", file3.getPath());
                    hashMap42.put("event_happened", BuildConfig.FLAVOR + System.currentTimeMillis());
                    Q1.q(replace42, hashMap42);
                    i5 = i3 + 1;
                    listFiles = fileArr;
                    length = i2;
                    i4 = 3;
                }
                try {
                    fileOutputStream = new FileOutputStream(new File(file2.getParentFile(), "video.zip"));
                    try {
                        zipOutputStream = new ZipOutputStream(fileOutputStream);
                    } catch (Throwable th2) {
                        try {
                            throw th2;
                        } catch (Throwable th3) {
                            l5.j.r(fileOutputStream, th2);
                            throw th3;
                        }
                    }
                } catch (Exception | OutOfMemoryError unused4) {
                    HashMap hashMap422 = new HashMap();
                    String replace422 = "[ #event# ]".replace("#event#", "Unexpected File found");
                    hashMap422.put("site_of_error", "SendOfflineData::deleteSessionIfUnexpectedlyClosed");
                    hashMap422.put("desc", "re-encrypt video file");
                    hashMap422.put("directory", file3.getPath());
                    hashMap422.put("event_happened", BuildConfig.FLAVOR + System.currentTimeMillis());
                    Q1.q(replace422, hashMap422);
                    i5 = i3 + 1;
                    listFiles = fileArr;
                    length = i2;
                    i4 = 3;
                }
                try {
                    z3Var.a(z3Var.c);
                    z3Var.b(zipOutputStream);
                    z3Var.c(zipOutputStream);
                    zipOutputStream.close();
                    fileOutputStream.close();
                    ie.d.a(file2);
                    ie.d.a(z3Var.b);
                    i5 = i3 + 1;
                    listFiles = fileArr;
                    length = i2;
                    i4 = 3;
                } catch (Throwable th4) {
                    try {
                        throw th4;
                    } catch (Throwable th5) {
                        l5.j.r(zipOutputStream, th4);
                        throw th5;
                    }
                }
            }
            fileArr = listFiles;
            i2 = length;
            i3 = i5;
            i5 = i3 + 1;
            listFiles = fileArr;
            length = i2;
            i4 = 3;
        }
        C0689q0 c0689q0 = new C0689q0();
        c0689q0.e = true;
        Context context = this.a;
        c0689q0.a = context;
        c0689q0.b = file;
        if (file.exists()) {
            if (bt.K == null) {
                C1509a.s.getClass();
                C1509a a2 = C1509a.C0238a.a();
                C0932a.i.getClass();
                bt.K = new bt(a2, C0932a.C0104a.a());
            }
            bt btVar2 = bt.K;
            kotlin.jvm.internal.i.d(btVar2);
            C0612a3 p2 = btVar2.p();
            if (bt.K == null) {
                C1509a.s.getClass();
                C1509a a3 = C1509a.C0238a.a();
                C0932a.i.getClass();
                bt.K = new bt(a3, C0932a.C0104a.a());
            }
            bt btVar3 = bt.K;
            kotlin.jvm.internal.i.d(btVar3);
            X d = btVar3.d();
            kotlin.jvm.internal.i.g(context, "context");
            C0672m3 c0672m3 = new C0672m3();
            kotlin.jvm.internal.i.d(d);
            s3 s3Var = new s3(context, d, p2);
            C0692q3 c0692q3 = new C0692q3(context, s3Var, new C0648i(new C0625d1()), c0672m3);
            y3 y3Var = new y3();
            JSONObject jSONObject = s3Var.a;
            if (bt.K == null) {
                C1509a.s.getClass();
                C1509a a4 = C1509a.C0238a.a();
                C0932a.i.getClass();
                bt.K = new bt(a4, C0932a.C0104a.a());
            }
            bt btVar4 = bt.K;
            kotlin.jvm.internal.i.d(btVar4);
            C0621c2 i6 = btVar4.i();
            if (bt.K == null) {
                C1509a.s.getClass();
                C1509a a5 = C1509a.C0238a.a();
                C0932a.i.getClass();
                bt.K = new bt(a5, C0932a.C0104a.a());
            }
            bt btVar5 = bt.K;
            kotlin.jvm.internal.i.d(btVar5);
            new w3(context, jSONObject, i6, btVar5.h(), y3Var);
            if (bt.K == null) {
                C1509a.s.getClass();
                C1509a a6 = C1509a.C0238a.a();
                C0932a.i.getClass();
                bt.K = new bt(a6, C0932a.C0104a.a());
            }
            bt btVar6 = bt.K;
            kotlin.jvm.internal.i.d(btVar6);
            u3 u3Var = new u3(context, s3Var, c0689q0, btVar6.i(), y3Var);
            File[] listFiles2 = c0689q0.b.listFiles((FilenameFilter) new B5.c(y3Var));
            if (listFiles2 == null || listFiles2.length == 0) {
                str2 = null;
            } else {
                String name = listFiles2[i].getName();
                kotlin.jvm.internal.i.f(name, "videoArray[0].name");
                List i10 = new Regex("\\.").i(name);
                if (!i10.isEmpty()) {
                    ListIterator listIterator = i10.listIterator(i10.size());
                    while (listIterator.hasPrevious()) {
                        if (((String) listIterator.previous()).length() != 0) {
                            collection = Wf.K.m0(listIterator.nextIndex() + 1, i10);
                            break;
                        }
                    }
                }
                collection = EmptyList.a;
                int i11 = i;
                str2 = ((String[]) collection.toArray(new String[i11]))[i11];
                StringBuilder sb2 = new StringBuilder();
                kotlin.jvm.internal.a a7 = kotlin.jvm.internal.h.a(listFiles2);
                while (a7.hasNext()) {
                    File file4 = (File) a7.next();
                    sb2.append(" | ");
                    sb2.append(file4);
                }
                HashMap hashMap5 = new HashMap();
                hashMap5.put("data_size", BuildConfig.FLAVOR + listFiles2.length);
                hashMap5.put("files", BuildConfig.FLAVOR + ((Object) sb2));
                Q1.z("getOldAppId", hashMap5);
            }
            kotlin.jvm.internal.i.d(str);
            c0692q3.a(u3Var, str, str2);
        }
    }
}