导航菜单

页面标题

页面副标题

Minits v4.9.3.32 - DataProvider.java 源代码

正在查看: Minits v4.9.3.32 应用的 DataProvider.java JAVA 源代码文件

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


package com.xone.android.framework.providers;

import Q8.m;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Binder;
import android.os.Looper;
import android.text.TextUtils;
import com.xone.android.framework.XoneGlobalUI;
import com.xone.android.framework.providers.DataProvider;
import com.xone.android.framework.runtimeobjects.DataProviderResult;
import com.xone.android.framework.xoneApp;
import com.xone.android.utils.Utils;
import com.xone.interfaces.IXoneApp;
import com.xone.interfaces.IXoneObject;
import fa.j;
import fb.C0694g;
import fb.n;
import ha.AbstractC0751f;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.mozilla.javascript.C0893d0;
import ua.InterfaceC1036l0;
import ua.InterfaceC1046q0;
import xone.runtime.core.XoneDataObject;

public final class DataProvider extends ContentProvider {

    public static class a {
        public static final int[] a;

        static {
            int[] iArr = new int[Y7.a.values().length];
            a = iArr;
            try {
                iArr[Y7.a.NotRunning.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[Y7.a.NotLoggedInYet.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[Y7.a.Running.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
        }
    }

    public static Future b(Callable callable) {
        return j.e().submit(callable);
    }

    public static xoneApp g() {
        return xoneApp.Z0();
    }

    public static IXoneApp h() {
        return xoneApp.c1();
    }

    public static MatrixCursor j() {
        return new MatrixCursor(new String[0], 0);
    }

    public static String[] r(String[] strArr) {
        if (strArr == null || strArr.length == 0) {
            return new String[0];
        }
        ArrayList arrayList = new ArrayList();
        for (String str : strArr) {
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(str);
            }
        }
        return (String[]) arrayList.toArray(new String[0]);
    }

    public final IXoneObject c() {
        IXoneApp h = h();
        if (h == null) {
            h = q();
        }
        if (h == null) {
            return null;
        }
        try {
            return h.LogonUser(n(), "", "", true);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public final Cursor d(C0893d0 c0893d0, String str) {
        IXoneObject currentCompany;
        xoneApp g = g();
        IXoneApp h = h();
        if (g.N1() || h == null || h.getConfigFile() == null || (currentCompany = h.getCurrentCompany()) == null || currentCompany.GetNode("ondataquery") == null) {
            return null;
        }
        Utils.l("XOneAndroidFramework", "Invoking <ondataquery> node");
        return e(c0893d0, str);
    }

    @Override
    public int delete(Uri uri, String str, String[] strArr) {
        return 0;
    }

    public final Cursor e(C0893d0 c0893d0, String str) {
        xoneApp g = g();
        IXoneApp h = h();
        if (h == null) {
            return null;
        }
        try {
            IXoneObject currentCompany = h.getCurrentCompany();
            if (currentCompany == null || h() == null) {
                return null;
            }
            h.setisbusy(true);
            DataProviderResult dataProviderResult = new DataProviderResult(str);
            currentCompany.ExecuteNode("ondataquery", new Object[]{c0893d0, dataProviderResult});
            XoneDataObject xoneDataObject = (XoneDataObject) h.PopValue();
            if (xoneDataObject != null) {
                g.e(xoneDataObject);
            }
            return dataProviderResult.X();
        } catch (Exception e) {
            e.printStackTrace();
            String message = e.getMessage();
            if (TextUtils.isEmpty(message)) {
                message = "";
            }
            IXoneApp h2 = h();
            if (h2 == null) {
                return null;
            }
            InterfaceC1046q0 error = h2.getError();
            if (error != null) {
                message = error.getDescription();
            }
            InterfaceC1036l0 g2 = g.g();
            if (g2 instanceof InterfaceC1036l0) {
                if (TextUtils.isEmpty(message)) {
                    g2.b(e);
                } else {
                    g2.i0(message);
                }
            }
            return null;
        }
    }

    public final Cursor o(Uri uri, String[] strArr, String str) {
        return (uri == null || strArr == null || strArr.length == 0) ? j() : p(m.y(r(strArr)), str);
    }

    @Override
    public String getType(Uri uri) {
        return null;
    }

    public final String i() {
        try {
            String callingPackage = getCallingPackage();
            if (!TextUtils.isEmpty(callingPackage)) {
                return callingPackage;
            }
            String[] packagesForUid = xoneApp.Z0().getPackageManager().getPackagesForUid(Binder.getCallingUid());
            if (packagesForUid != null && packagesForUid.length != 0) {
                String str = packagesForUid[0];
                return !TextUtils.isEmpty(str) ? str : "";
            }
            return "";
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    @Override
    public Uri insert(Uri uri, ContentValues contentValues) {
        return null;
    }

    public final Y7.a k() {
        IXoneApp h = h();
        return h == null ? Y7.a.NotRunning : h.getUser() == null ? Y7.a.NotLoggedInYet : Y7.a.Running;
    }

    public final C0694g l() {
        File file = new File(g().getFilesDir(), "lastexecuted.ini");
        if (file.exists()) {
            return new C0694g(file);
        }
        return null;
    }

    public final String m() {
        try {
            C0694g l = l();
            if (l == null || !l.i("appname")) {
                return null;
            }
            String f = l.f("appname");
            if (TextUtils.isEmpty(f)) {
                return null;
            }
            return f;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public final String n() {
        try {
            C0694g l = l();
            if (l == null) {
                return "admin";
            }
            String str = g().Y() + "##user";
            if (!l.i(str)) {
                return "admin";
            }
            String f = l.f(str);
            return TextUtils.isEmpty(f) ? "admin" : f;
        } catch (Exception e) {
            e.printStackTrace();
            return "admin";
        }
    }

    @Override
    public boolean onCreate() {
        return true;
    }

    public Cursor p(C0893d0 c0893d0, String str) {
        Thread.currentThread().setName("DataProvider");
        int i = a.a[k().ordinal()];
        if (i == 1) {
            Utils.l("DataProvider", "run(): App is not running, creating new application scope for ondataquery node execution");
            try {
                Looper.prepare();
            } catch (Exception unused) {
            }
            if (c() == null) {
                Utils.l("DataProvider", "run(): Cannot create application scope, skipping ondataquery node execution");
                return null;
            }
            try {
                return d(c0893d0, str);
            } finally {
                g().p0("DataProvider.launch()", false);
            }
        }
        if (i != 2) {
            if (i != 3) {
                return null;
            }
            Utils.l("DataProvider", "run(): App is running and logged in");
            return d(c0893d0, str);
        }
        Utils.l("DataProvider", "run(): App is running, not logged in yet. Attempting to logon with last saved username");
        IXoneApp h = h();
        if (h == null) {
            Utils.l("DataProvider", "run(): Inconsistent state, appData is null. Skipping ondataquery node execution");
            return null;
        }
        if (h.LogonUser(n(), "", "", true) != null) {
            return d(c0893d0, str);
        }
        Utils.l("DataProvider", "run(): Cannot logon user, skipping ondataquery node execution");
        return null;
    }

    public final IXoneApp q() {
        InputStream inputStream;
        String str;
        int i;
        String str2 = "mappings.xne";
        xoneApp g = g();
        IXoneApp h = h();
        if (h == null) {
            try {
                g.W();
                String m = m();
                if (TextUtils.isEmpty(m)) {
                    Utils.l("DataProvider", "loadApp(): App is not running, cannot obtain last app name");
                    return null;
                }
                g.P(m);
                h = h();
                h.setUserInterface(new XoneGlobalUI());
                C0694g c0694g = new C0694g(new File(g.T(), "app.ini"));
                g.o(c0694g.a("UseTranslation", true));
                g.O(c0694g.a("EncryptApp", false));
            } catch (Exception e) {
                e.printStackTrace();
                return null;
            }
        }
        IXoneApp iXoneApp = h;
        iXoneApp.setDatemask("ymd");
        try {
            inputStream = g.o0(g, "license.ini");
            if (inputStream != null) {
                try {
                    int InitMasterData = iXoneApp.InitMasterData(inputStream);
                    if (InitMasterData != -1 && InitMasterData != -2) {
                        Utils.N(inputStream);
                        String d0 = g.d0("mappings.xml");
                        boolean L = g.L();
                        if (!new File(n.d(g, d0, L)).exists()) {
                            return null;
                        }
                        String T = g.T();
                        boolean isEncryptFiles = iXoneApp.isEncryptFiles();
                        if (isEncryptFiles) {
                            str = "app.xml.sec";
                        } else {
                            str = "app.xml";
                        }
                        InputStream d = new File(n.d(g, g.d0(str), L)).exists() ? g.d("app.xml", isEncryptFiles) : null;
                        try {
                            if (xoneApp.Z0().E("mappings.xne", iXoneApp.isEncryptFiles())) {
                                i = 2;
                            } else {
                                str2 = "mappings.xml";
                                i = 1;
                            }
                            InputStream d2 = g.d(str2, iXoneApp.isEncryptFiles());
                            try {
                                iXoneApp.LoadConfigFile(T, d, d2, L, i);
                                Utils.N(d2);
                                Utils.N(d);
                                iXoneApp.setObjectPrefix("gen");
                                StringBuilder sb2 = new StringBuilder("sqlite:");
                                File file = new File(g.d0(iXoneApp.getDataBasePath()));
                                if (!file.exists()) {
                                    return null;
                                }
                                sb2.append(file.getAbsolutePath());
                                iXoneApp.Initialize(sb2.toString());
                                g.f0();
                                g.f(true);
                                return iXoneApp;
                            } catch (Throwable th) {
                                th = th;
                                inputStream = d2;
                                Utils.N(inputStream);
                                Utils.N(d);
                                throw th;
                            }
                        } catch (Throwable th2) {
                            th = th2;
                        }
                    }
                } catch (Throwable th3) {
                    th = th3;
                    Utils.N(inputStream);
                    throw th;
                }
            }
            Utils.N(inputStream);
            return null;
        } catch (Throwable th4) {
            th = th4;
            inputStream = null;
        }
    }

    @Override
    public synchronized Cursor query(final Uri uri, final String[] strArr, String str, String[] strArr2, String str2) {
        final String i;
        try {
            i = i();
        } catch (Exception e) {
            e = e;
            if (e instanceof ExecutionException) {
                e = AbstractC0751f.i((ExecutionException) e);
            }
            e.printStackTrace();
            return j();
        }
        return (Cursor) b(new Callable() {
            @Override
            public final Object call() {
                Cursor o;
                o = DataProvider.this.o(uri, strArr, i);
                return o;
            }
        }).get();
    }

    @Override
    public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
        return 0;
    }
}