正在查看: Minits v4.9.3.32 应用的 xoneApp.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Minits v4.9.3.32 应用的 xoneApp.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.xone.android.framework;
import C8.o;
import ab.AbstractC0401c;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.Application;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.ComponentCallbacks2;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.TrafficStats;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Process;
import android.os.StrictMode;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.util.Pair;
import android.view.inputmethod.InputMethodManager;
import android.webkit.CookieManager;
import android.webkit.WebView;
import androidx.annotation.Keep;
import androidx.lifecycle.h;
import bb.AbstractC0515a;
import com.xone.android.framework.activities.LoadAppActivity;
import com.xone.android.framework.activities.XoneBaseActivity;
import com.xone.android.hotswap.transports.HotswapServerTransportWebSocket;
import com.xone.android.javascript.ScriptBundleWrapper;
import com.xone.android.javascript.XOneJavascript;
import com.xone.android.javascript.objects.XOneKeyStore;
import com.xone.android.script.runtimeobjects.AmazonAppStore;
import com.xone.android.script.runtimeobjects.AndroidIntent;
import com.xone.android.script.runtimeobjects.Animation;
import com.xone.android.script.runtimeobjects.AppBroadcastManager;
import com.xone.android.script.runtimeobjects.BeaconyManager;
import com.xone.android.script.runtimeobjects.BleManager;
import com.xone.android.script.runtimeobjects.BleSerialPort;
import com.xone.android.script.runtimeobjects.BluetoothSerialPort;
import com.xone.android.script.runtimeobjects.DeviceInfo;
import com.xone.android.script.runtimeobjects.DeviceManager;
import com.xone.android.script.runtimeobjects.GpsTools;
import com.xone.android.script.runtimeobjects.HttpRuntimeObject;
import com.xone.android.script.runtimeobjects.ImageDrawing;
import com.xone.android.script.runtimeobjects.IniParser;
import com.xone.android.script.runtimeobjects.IrManager;
import com.xone.android.script.runtimeobjects.ItronDeviceManager;
import com.xone.android.script.runtimeobjects.NativeObjectWrapper;
import com.xone.android.script.runtimeobjects.PaymentManager;
import com.xone.android.script.runtimeobjects.PushMessage;
import com.xone.android.script.runtimeobjects.ScriptAccountManager;
import com.xone.android.script.runtimeobjects.ScriptCrypto;
import com.xone.android.script.runtimeobjects.ScriptOauth2;
import com.xone.android.script.runtimeobjects.ScriptSensorManager;
import com.xone.android.script.runtimeobjects.SoundManager;
import com.xone.android.script.runtimeobjects.SqlManager;
import com.xone.android.script.runtimeobjects.SystemDebug;
import com.xone.android.script.runtimeobjects.SystemSettings;
import com.xone.android.script.runtimeobjects.VibrationManager;
import com.xone.android.script.runtimeobjects.WearableConnection;
import com.xone.android.script.runtimeobjects.WebWorker;
import com.xone.android.script.runtimeobjects.XOneAccessibilityManager;
import com.xone.android.script.runtimeobjects.XOneBiometricsManager;
import com.xone.android.script.runtimeobjects.XOneClipboard;
import com.xone.android.script.runtimeobjects.XOneDebugTools;
import com.xone.android.script.runtimeobjects.XOneFileManager;
import com.xone.android.script.runtimeobjects.XOneFingerprintManager;
import com.xone.android.script.runtimeobjects.XOnePackageManager;
import com.xone.android.script.runtimeobjects.XOneSocket;
import com.xone.android.script.runtimeobjects.XOneWebSocket;
import com.xone.android.script.runtimeobjects.XOneWifiConfiguration;
import com.xone.android.script.runtimeobjects.XOneWifiManager;
import com.xone.android.script.runtimeobjects.XoneCreateObject;
import com.xone.android.script.runtimeobjects.XoneFileObject;
import com.xone.android.script.runtimeobjects.XoneFileSystemObject;
import com.xone.android.script.runtimeobjects.XoneLiveScriptObject;
import com.xone.android.script.runtimeobjects.XoneReplicaConsole;
import com.xone.android.sms.SmsSenderService;
import com.xone.android.sms.SmsService;
import com.xone.android.utils.Utils;
import com.xone.interfaces.IRuntimeObject;
import com.xone.interfaces.IXoneApp;
import com.xone.interfaces.IXoneCollection;
import com.xone.interfaces.IXoneObject;
import com.xone.interfaces.IXoneView;
import com.xone.maps.services.XoneGPSService;
import com.xone.maps.services.XoneGPSServiceV2;
import db.C0601f;
import db.RunnableC0599d;
import f8.C0670e;
import f8.C0672g;
import f8.EnumC0667b;
import fb.AbstractC0692e;
import fb.AbstractC0698k;
import gb.AbstractC0734d;
import ha.AbstractC0751f;
import ha.AbstractC0752g;
import j$.util.concurrent.ConcurrentHashMap;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.Thread;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.net.CookieHandler;
import java.net.CookiePolicy;
import java.net.HttpCookie;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.Timer;
import java.util.Vector;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import ka.EnumC0821f;
import m8.C0847b;
import o8.C0874b;
import org.json.JSONObject;
import org.mozilla.javascript.C0932x0;
import p8.C0948l;
import ua.InterfaceC1032j0;
import ua.InterfaceC1036l0;
import ua.InterfaceC1038m0;
import ua.InterfaceC1039n;
import ua.InterfaceC1041o;
import ua.InterfaceC1046q0;
import ua.InterfaceC1051t0;
import ua.w0;
import w8.C1073c;
import w8.C1075e;
import xone.runtime.core.XoneApplication;
import xone.runtime.core.XoneDataObject;
import xone.runtime.core.XoneEncodingUtils;
public final class xoneApp extends Application implements InterfaceC1038m0, InterfaceC1051t0, w0, E2.a, Thread.UncaughtExceptionHandler, androidx.lifecycle.k, ua.F {
public static xoneApp K0;
public static AtomicInteger L0;
public static Class M0;
public IRuntimeObject A0;
public IRuntimeObject B0;
public int C;
public IRuntimeObject C0;
public String D;
public BleManager D0;
public boolean E;
public IRuntimeObject E0;
public boolean F;
public IRuntimeObject F0;
public Vector G;
public IRuntimeObject G0;
public Timer H;
public PaymentManager H0;
public Calendar I;
public IRuntimeObject I0;
public int J;
public IRuntimeObject J0;
public SecureRandom K;
public boolean L;
public String M;
public boolean N;
public Handler O;
public WeakReference P;
public WeakReference Q;
public WeakReference R;
public boolean S;
public boolean T;
public boolean U;
public boolean W;
public String X;
public String Y;
public EnumC0821f Z;
public boolean a0;
public boolean b0;
public int c0;
public int d0;
public String e0;
public boolean f0;
public boolean g0;
public byte[] h0;
public Map i0;
public Thread.UncaughtExceptionHandler j0;
public boolean k0;
public ua.L l;
public EnumC0667b m;
public boolean m0;
public String n;
public boolean n0;
public IXoneApp o;
public int o0;
public String p;
public XoneLiveScriptObject p0;
public String q;
public SystemSettings q0;
public String r;
public DeviceInfo r0;
public boolean s;
public PushMessage s0;
public List t;
public IRuntimeObject t0;
public HttpRuntimeObject u0;
public XOneFingerprintManager v0;
public XOneBiometricsManager w0;
public Future x;
public XOneClipboard x0;
public boolean y;
public XOnePackageManager y0;
public boolean z;
public SmsService z0;
public final Map u = new ConcurrentHashMap();
public final Map v = new ConcurrentHashMap();
public final Map w = new ConcurrentHashMap();
public String A = "#FFB22C1B,#FFFFFFFF";
public String B = "#FFFFFFFF";
public float V = 7.0f;
public boolean l0 = true;
public static class a {
public static final int[] a;
public static final int[] b;
static {
int[] iArr = new int[h.a.values().length];
b = iArr;
try {
iArr[h.a.ON_START.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
b[h.a.ON_STOP.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
int[] iArr2 = new int[EnumC0667b.values().length];
a = iArr2;
try {
iArr2[EnumC0667b.l.ordinal()] = 1;
} catch (NoSuchFieldError unused3) {
}
try {
a[EnumC0667b.m.ordinal()] = 2;
} catch (NoSuchFieldError unused4) {
}
}
}
public static NotificationManager A1() {
Object systemService = Z0().getSystemService("notification");
if (systemService == null) {
throw new NullPointerException("Cannot obtain NotificationManager service instance");
}
if (systemService instanceof NotificationManager) {
return (NotificationManager) systemService;
}
throw new NullPointerException("Returned service is not an instance of NotificationManager");
}
public static List C1() {
ArrayList arrayList = new ArrayList();
List<ApplicationInfo> installedApplications = Z0().getPackageManager().getInstalledApplications(128);
if (installedApplications != null) {
for (ApplicationInfo applicationInfo : installedApplications) {
Bundle bundle = applicationInfo.metaData;
if (bundle != null) {
boolean a2 = AbstractC0692e.a(bundle, "isXOneLive", false);
boolean a3 = AbstractC0692e.a(bundle, "isXOneFramework", false);
if (a2 && !a3) {
arrayList.add(applicationInfo);
}
}
}
}
return arrayList;
}
public static void O0() {
try {
TrafficStats.setThreadStatsTag(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void P0() {
Q0(false, false);
}
public static void Q0(boolean z, boolean z2) {
Intent intent = new Intent("com.xone.android.framework.FINISH_ALL_ACTIVITIES_ACTIVITY_ACTION");
intent.putExtra("bExcludeEntryPoint", z);
intent.putExtra("bExcludeMainEntry", z2);
m1.a.b(getContext()).d(intent);
}
public static void W0() {
if (Utils.d3(getContext())) {
StrictMode.VmPolicy vmPolicy = StrictMode.getVmPolicy();
StrictMode.VmPolicy.Builder builder = vmPolicy != null ? new StrictMode.VmPolicy.Builder(vmPolicy) : new StrictMode.VmPolicy.Builder();
builder.detectLeakedSqlLiteObjects();
builder.detectLeakedClosableObjects();
builder.detectLeakedRegistrationObjects();
int i = Build.VERSION.SDK_INT;
builder.detectFileUriExposure();
if (i >= 26) {
builder.detectContentUriWithoutPermission();
builder.detectUntaggedSockets();
}
if (i >= 31) {
builder.detectUnsafeIntentLaunch();
}
builder.penaltyLog();
StrictMode.setVmPolicy(builder.build());
}
}
public static boolean X0(C0672g c0672g, IXoneObject iXoneObject) {
if (c0672g == null || iXoneObject == null) {
return false;
}
List d = c0672g.d();
if (d.isEmpty()) {
return false;
}
boolean z = false;
for (int i = 0; i < d.size(); i++) {
Pair pair = (Pair) d.get(0);
String str = (String) pair.first;
if (!TextUtils.isEmpty(str)) {
String str2 = (String) pair.second;
if (!TextUtils.isEmpty(str2) && !TextUtils.equals(str2, iXoneObject.GetRawStringField(str))) {
return false;
}
z = true;
}
}
return z;
}
public static boolean X1(Class cls) {
ComponentName componentName;
String packageName = Z0().getPackageName();
String name = cls.getName();
List<ActivityManager.RunningServiceInfo> runningServices = a1().getRunningServices(Integer.MAX_VALUE);
if (runningServices != null && !runningServices.isEmpty()) {
for (int i = 0; i < runningServices.size(); i++) {
ActivityManager.RunningServiceInfo runningServiceInfo = runningServices.get(i);
if (runningServiceInfo != null && (componentName = runningServiceInfo.service) != null && TextUtils.equals(packageName, componentName.getPackageName()) && TextUtils.equals(name, componentName.getClassName())) {
return true;
}
}
}
return false;
}
public static void Y2(String str) {
IXoneObject f1 = f1();
if (f1 == null) {
return;
}
try {
InterfaceC1032j0 GetNode = f1.GetNode("oncallstart");
InterfaceC1032j0 GetNode2 = f1.GetNode("oncallend");
if (GetNode != null) {
f1.setVariables("##NUMERO##", str);
f1.ExecuteNode("oncallstart");
}
if (GetNode2 != null) {
Thread.sleep(1000L);
C0948l.e(str);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static xoneApp Z0() {
xoneApp xoneapp = K0;
if (xoneapp != null) {
return xoneapp;
}
throw new NullPointerException("Error. instance == null");
}
public static boolean Z2(URI uri, HttpCookie httpCookie) {
if (httpCookie == null) {
return true;
}
CookieManager.getInstance().setCookie(httpCookie.getDomain(), httpCookie.getName() + "=" + httpCookie.getValue() + ";");
return true;
}
public static ActivityManager a1() {
Object systemService = Z0().getSystemService("activity");
if (systemService == null) {
throw new NullPointerException("Cannot obtain ActivityManager service instance");
}
if (systemService instanceof ActivityManager) {
return (ActivityManager) systemService;
}
throw new NullPointerException("Returned service is not an instance of ActivityManager");
}
public static void b2() {
Process.killProcess(Process.myPid());
}
public static IXoneApp c1() {
return Z0().o;
}
public static Resources d1() {
return Z0().getResources();
}
private static IXoneObject f1() {
IXoneApp c1 = c1();
if (c1 == null) {
return null;
}
return c1.getCompany();
}
@Keep
public static Context getContext() {
return Z0();
}
public static long n1(InterfaceC1032j0 interfaceC1032j0) {
String b = AbstractC0734d.b(interfaceC1032j0, "frequency", null);
if (TextUtils.isEmpty(b)) {
b = AbstractC0734d.b(interfaceC1032j0, "frecuency", null);
}
if (TextUtils.isEmpty(b)) {
return 300L;
}
return fb.q.t(b, 300L);
}
public static InputMethodManager r1() {
Object systemService = Z0().getSystemService("input_method");
if (systemService instanceof InputMethodManager) {
return (InputMethodManager) systemService;
}
throw new NullPointerException("Cannot obtain InputMethodManager instance");
}
@Override
public void A(boolean z) {
this.g0 = z;
}
public void A2(int i) {
this.C = i;
}
@Override
public void B() {
this.o.setUserInterface(new XoneGlobalUI());
}
public Vector B1() {
return this.G;
}
public void B2(boolean z) {
this.E = z;
}
@Override
public void C() {
mainEntry S = S();
if (S != null) {
androidx.fragment.app.j jVar = (XoneBaseActivity) g();
if (jVar == null) {
throw new NullPointerException("Cannot find EditView");
}
if (AbstractC0698k.g(jVar, "requestCode", 0) == 502) {
jVar.s(10, null);
jVar.k(-255);
}
Z0().z = true;
if (S.g1()) {
S.o1();
} else {
S.n1();
}
}
}
public void C2(boolean z) {
this.T = z;
}
@Override
public EnumC0821f D() {
return this.Z;
}
public Random D1() {
if (this.K == null) {
this.K = new SecureRandom();
}
return this.K;
}
public void D2(String str) {
this.D = str;
}
@Override
public boolean E(String str, boolean z) {
File file = new File(fb.n.d(this, this.p + fb.n.a(str, z), L()));
if (file.exists() && file.isFile()) {
return true;
}
if (z && str.toLowerCase().endsWith(".sec")) {
File file2 = new File(fb.n.d(getApplicationContext(), this.p + str, L()));
if (file2.exists() && file2.isFile()) {
return true;
}
}
return false;
}
public String E1() {
return this.X;
}
public void E2(float f) {
this.V = f;
}
public boolean F1() {
return this.N;
}
public void F2(String str) {
if (str.compareToIgnoreCase("v1") == 0) {
this.m = EnumC0667b.l;
return;
}
if (str.compareToIgnoreCase("v2") != 0) {
throw new IllegalArgumentException("Unsupported GPS service version " + str);
}
if (q3.j.o().g(getContext()) == 0) {
this.m = EnumC0667b.m;
} else {
this.m = EnumC0667b.l;
}
}
@Override
public boolean G() {
int i = a.a[o1().ordinal()];
if (i == 1) {
return m3();
}
if (i == 2) {
return n3();
}
throw new IncompatibleClassChangeError();
}
@Override
public IXoneApp G0() {
return c1();
}
public final String G1(String str) {
if (str == null) {
return null;
}
String[] split = str.split(",");
return split.length == 1 ? str : split[1];
}
public void G2(boolean z) {
this.L = z;
}
@Override
public String H() {
return this.B;
}
public final String H1() {
return this.q;
}
public synchronized void H2(int i) {
this.J = i;
}
@Override
public Activity I0() {
Activity activity;
WeakReference weakReference = this.R;
if (weakReference == null || (activity = (Activity) weakReference.get()) == 0) {
return null;
}
if ((activity instanceof InterfaceC1036l0) && ((InterfaceC1036l0) activity).c()) {
return null;
}
if ((activity instanceof ua.O) && ((ua.O) activity).c()) {
return null;
}
return activity;
}
public final void I1() {
File[] i = A0.b.i(this, (String) null);
if (i == null || i.length == 0) {
Utils.l("XOneAndroidFramework", "No external/shared/removable directories found.");
return;
}
for (File file : i) {
if (file != null) {
Utils.l("XOneAndroidFramework", "Found external/shared/removable directory: " + file.getAbsolutePath());
}
}
}
public void I2(boolean z) {
this.m0 = z;
}
@Override
public String J0(String str, boolean z) {
String d = fb.n.d(this, this.p + fb.n.a(str, z), L());
if (TextUtils.isEmpty(d)) {
throw new NullPointerException("sPath == null");
}
File file = new File(d);
if (file.exists() && file.isFile()) {
return d;
}
throw AbstractC0751f.b("File " + file.getAbsolutePath() + " not found");
}
public final void J1() {
p8.q.a();
SmsSenderService.l(this, true, 0L);
Ja.k.b(this).e();
f2();
}
public void J2(boolean z) {
}
@Override
public boolean K() {
return this.U;
}
public final void K1() {
try {
M0 = Class.forName("com.xone.live.services.CheckServiceStatus");
} catch (ClassNotFoundException unused) {
Utils.l("XOneAndroidFramework", "XOneLiveServices is not embedded on XOneAndroidFramework. Skipping initialization.");
} catch (Exception e) {
e.printStackTrace();
}
}
public void K2(InterfaceC1036l0 interfaceC1036l0) {
if (interfaceC1036l0 == null) {
this.Q = null;
} else {
this.Q = new WeakReference(interfaceC1036l0);
}
}
@Override
public boolean L() {
return this.a0;
}
public IRuntimeObject L0(String str, Object[] objArr) {
String lowerCase = str.toLowerCase(Locale.US);
lowerCase.getClass();
switch (lowerCase) {
case "devicemanager":
return new DeviceManager(this, G0());
case "xonenfc":
return c2("com.xone.android.nfc.runtimeobjects.XoneNFCRuntime", AbstractC0568j.Q);
case "xoneocr":
return h2("com.xone.android.ocr", "com.xone.android.ocr.XOneOCR", AbstractC0568j.W);
case "xonepdf":
return h2("com.xone.android.pdf", "com.xone.android.pdf.XOnePDF", AbstractC0568j.Z);
case "filectl.file":
case "fileobject":
return new XoneFileObject(this, (ua.X) G0());
case "qrgenerator":
return h2("com.xone.android.plugin.barcode", "com.xone.android.barcodeplugin.QRGenerator", AbstractC0568j.e0);
case "debugtools":
return new XOneDebugTools(this, G0());
case "system.debug":
return new SystemDebug(this, c1());
case "nativeobjectwrapper":
return new NativeObjectWrapper(this, (ua.X) G0());
case "bundle":
return new ScriptBundleWrapper((Bundle) null);
case "gpstools":
return new GpsTools(this, G0());
case "loomis":
return h2("com.xone.android.loomis", "com.xone.android.loomis.LoomisManager", AbstractC0568j.J);
case "oauth2":
return new ScriptOauth2(this, G0());
case "socket":
return new XOneSocket(this, (ua.X) G0());
case "worker":
return new WebWorker();
case "mobbsign":
return h2("com.xone.mobbsign", "com.xone.mobbsign.MobbSignScript", AbstractC0568j.M);
case "serialport":
if (this.A0 == null) {
this.A0 = g2("com.xone.android.serialport", "com.xone.android.serialport.SerialPort");
}
return this.A0;
case "encodingutils":
return new XoneEncodingUtils(G0());
case "wificonfiguration":
return new XOneWifiConfiguration(this);
case "androidintent":
return new AndroidIntent(this, (ua.X) G0());
case "iniparser":
return new IniParser(this, G0());
case "amazonappstore":
return new AmazonAppStore(this, (ua.X) G0());
case "pinpadpayment":
return h2("com.xone.android.pinpad", "com.xone.android.pinpad.PinpadPayment", AbstractC0568j.b0);
case "websocket":
return objArr == null ? new XOneWebSocket(this) : new XOneWebSocket(this, objArr);
case "xonesumup":
return h2("com.xone.android.sumup", "com.xone.android.sumup.XOneSumUp", AbstractC0568j.q0);
case "accountmanager":
return new ScriptAccountManager(this, (ua.X) G0());
case "beaconymanager":
return new BeaconyManager(this, G0());
case "geotabkeyless":
return h2("com.xone.android.geotab.keyless", "com.xone.android.geotab.keyless.GeoTabKeylessManager", AbstractC0568j.C);
case "filectl.filesystem":
case "filesystemobject":
case "scripting.filesystemobject":
return new XoneFileSystemObject((ua.X) G0());
case "xonesigner":
return h2("com.xone.android.signer", "com.xone.android.signer.SignerHelper", AbstractC0568j.p0);
case "keystore":
return new XOneKeyStore(this, G0());
case "soundmanager":
return new SoundManager(this, G0());
case "barcodegenerator":
return h2("com.xone.android.plugin.barcode", "com.xone.android.barcodeplugin.BarcodeGeneratorPlugin", AbstractC0568j.d);
case "veridasmanager":
return h2("com.xone.android.veridas", "com.xone.android.veridas.VeridasManager", AbstractC0568j.v0);
case "itrondevicemanager":
return new ItronDeviceManager(this, G0());
case "xonetwitter":
return h2("com.xone.android.twitter", "com.xone.db.twitter.TwitterRuntimeObject", AbstractC0568j.s0);
case "imagedrawing":
return new ImageDrawing(this);
case "vibrationmanager":
return new VibrationManager(this, G0());
case "sqlmanager":
return new SqlManager(this, G0());
case "rtcclient":
return h2("com.xone.android.rtcclient", "com.xone.android.webrtc.ScriptRtcClient", AbstractC0568j.A0);
case "filemanager":
return new XOneFileManager(this, G0());
case "animation":
return new Animation(this, G0());
case "irmanager":
return new IrManager(this, G0());
case "wifimanager":
return new XOneWifiManager(this);
case "wifip2p":
return new Z9.d(this, G0());
case "xoneprinter":
return h2("com.xone.android.printer", "com.xone.android.printer.XOnePrinter", AbstractC0568j.d0);
case "tensorflow":
return h2("com.xone.android.tensorflowlite", "com.xone.android.tensorflowlite.TensorFlowScript", AbstractC0568j.r0);
case "wearableconnection":
return new WearableConnection(this, G0());
case "xonevoip":
return h2("com.xone.android.voip", "com.xone.android.voip.XOneVoIP", AbstractC0568j.x0);
case "bluetoothserialport":
return new BluetoothSerialPort(this, G0());
case "accessibilitymanager":
return new XOneAccessibilityManager(this);
case "xonereplicaconsole":
return new XoneReplicaConsole(this, (ua.X) G0());
default:
if (!str.contains(",")) {
L9.g e = R9.a.e(this, str);
if (e != null) {
return g2(e.c(), e.b());
}
throw new ra.c(String.format(getString(AbstractC0568j.c0), str));
}
String[] split = str.replaceAll(" ", "").split(",");
if (split.length != 2 && split.length != 3) {
throw new IllegalArgumentException("Invalid parameter count");
}
if (Utils.l3(this, split[0])) {
return g2(split[0], split[1]);
}
throw new ra.c(String.format(getString(AbstractC0568j.c0), split[0]));
}
}
public final void L1() {
try {
if (S1()) {
i4.a.a(this);
}
} catch (q3.l | q3.m e) {
e.printStackTrace();
}
}
public synchronized void L2(Calendar calendar) {
this.I = calendar;
}
public void M0(InterfaceC1036l0 interfaceC1036l0, Integer num) {
this.w.put(num, new WeakReference(interfaceC1036l0));
}
public final void M1(String str) {
IXoneObject currentCompany;
try {
IXoneApp c1 = c1();
if (c1 != null && (currentCompany = c1.getCurrentCompany()) != null && currentCompany.GetNode(str) != null) {
InterfaceC1036l0 g = g();
if (g instanceof InterfaceC1036l0) {
new o.a().b(g).d(currentCompany).e(null).f(str).a().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, new Void[0]);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void M2(Future future) {
this.x = future;
}
public final void N0() {
this.Y = "1.0";
q2(H1() + "/files/");
this.t = null;
this.G = new Vector();
G2(false);
this.J = 3;
this.O = null;
this.S = false;
K2(null);
A(false);
}
public boolean N1() {
return !this.s;
}
public void N2(String str) {
this.e0 = str;
}
@Override
public void O(boolean z) {
this.b0 = z;
}
public boolean O1() {
return this.F;
}
public void O2(boolean z) {
this.f0 = z;
}
@Override
public void P(String str) {
String str2;
if (TextUtils.isEmpty(str)) {
throw new NullPointerException("sAppName == null");
}
this.n = str;
this.p = getApplicationContext().getFilesDir().getParent() + "/app_" + this.n + "/";
if (Utils.g3(this)) {
File file = new File(getFilesDir().getParentFile(), "app_" + this.n);
File file2 = new File(file, "files");
X2(file.getAbsolutePath());
q2(file2.getAbsolutePath() + "/");
str2 = "";
} else if ("mounted".equals(Environment.getExternalStorageState())) {
str2 = Environment.getExternalStorageDirectory().getAbsolutePath();
X2(Environment.getExternalStorageDirectory().getAbsolutePath() + "/xone/app_" + this.n);
StringBuilder sb2 = new StringBuilder();
sb2.append(H1());
sb2.append("/files/");
q2(sb2.toString());
File file3 = new File(getFilesPath());
if (!file3.exists() && C9.e.q(this, "android.permission.WRITE_EXTERNAL_STORAGE") && !file3.mkdirs()) {
throw new IOException("Cannot create directory " + file3.getAbsolutePath());
}
} else {
X2(this.p);
q2(this.p + "/files/");
str2 = null;
}
IXoneApp iXoneApp = this.o;
if (iXoneApp == null) {
throw new NullPointerException("appData == null");
}
iXoneApp.setAppPath(this.p);
this.o.setApplicationName(str);
this.o.setFilesPath(getFilesPath());
this.o.setSDCardPath(str2);
}
public boolean P1() {
return this.E;
}
public void P2(mainEntry mainentry) {
if (mainentry == null) {
this.P = null;
} else {
this.P = new WeakReference(mainentry);
}
}
public boolean Q1() {
return this.b0;
}
public void Q2(Handler handler) {
this.O = handler;
}
public com.evernote.android.job.a R(String str) {
if (str.startsWith("maintenanceJob")) {
return new C0874b();
}
return null;
}
public void R0(String str) {
if (TextUtils.isEmpty(str)) {
Utils.l("XOneAndroidFramework", "No connection string sent to broadcast receiver, cancelling");
return;
}
Utils.l("XOneAndroidFramework", "Force closing connection to " + str);
File file = new File(str);
File file2 = new File(str + "-wal");
File file3 = new File(str + "-shm");
if (file.exists() && file.isFile()) {
d2.a.a(file);
Utils.m0(file, file2, file3);
Utils.k4(this, "XOneBroadcastReceiver", "clean-restart", null);
}
}
public boolean R1() {
return this.g0;
}
public void R2(C0672g c0672g) {
if (this.t == null) {
this.t = new ArrayList();
}
this.t.add(c0672g);
}
public void S0(String str, String str2, int i) {
IXoneCollection iXoneCollection;
InterfaceC1032j0 interfaceC1032j0;
mainEntry S = S();
if (S == null) {
return;
}
try {
IXoneApp c1 = c1();
if (c1 == null) {
return;
}
String loginCollectionName = c1.getLoginCollectionName(c1.GetCurrentVisualConditions());
if (TextUtils.isEmpty(loginCollectionName)) {
iXoneCollection = null;
interfaceC1032j0 = null;
} else {
iXoneCollection = c1.GetCollection(loginCollectionName);
interfaceC1032j0 = iXoneCollection.getProperties();
}
if (interfaceC1032j0 == null) {
return;
}
String string = getString(AbstractC0568j.t0);
if (c1.LogonUser(str, str2, string) == null) {
U0(S, iXoneCollection, i, string);
} else {
T0(S, iXoneCollection, i, str);
}
} catch (Exception e) {
S.D2(e);
}
}
public final boolean S1() {
int g = q3.j.o().g(this);
return g == 0 || g == 2 || g == 4 || g == 14 || g == 17;
}
public void S2(boolean z) {
this.W = z;
}
@Override
public String T() {
return this.p;
}
public final void T0(mainEntry mainentry, IXoneCollection iXoneCollection, int i, String str) {
if (!TextUtils.isEmpty(str)) {
Utils.Y3(this, G1(str), Y() + "##user");
}
if (iXoneCollection.getProperties().W0("login-ok") != null) {
new C8.x(mainentry, iXoneCollection, i).runSeriallyAsyncTask();
return;
}
Z0().z = true;
if (mainentry.g1()) {
mainentry.o1();
} else {
mainentry.n1();
}
}
public boolean T1() {
return this.m0;
}
public void T2(String str) {
EnumC0821f enumC0821f;
if (TextUtils.isEmpty(str)) {
str = "manual";
}
str.getClass();
switch (str) {
case "full-auto":
enumC0821f = EnumC0821f.FullAuto;
break;
case "manual":
enumC0821f = EnumC0821f.Manual;
break;
case "auto":
enumC0821f = EnumC0821f.Auto;
break;
default:
throw new IllegalArgumentException("Invalid refresh mode attribute value " + str);
}
this.Z = enumC0821f;
}
public final void U0(mainEntry mainentry, IXoneCollection iXoneCollection, int i, String str) {
IXoneObject iXoneObject;
mainEntry mainentry2;
Exception exc;
InterfaceC1046q0 error;
String description;
if (iXoneCollection.getCount() <= 0 || (iXoneObject = iXoneCollection.get(i)) == null) {
return;
}
try {
mainentry.B2(true);
error = iXoneObject.getOwnerApp().getError();
} catch (Exception e) {
e = e;
mainentry2 = mainentry;
}
try {
if (error != null) {
try {
if (!TextUtils.isEmpty(error.getDescription())) {
description = error.getDescription();
iXoneObject.putVariables("##LOGIN_ERRORDESCRIPTION##", description);
mainentry2 = mainentry;
new C8.v(mainentry2, iXoneCollection, i, str).runSeriallyAsyncTask();
return;
}
} catch (Exception e2) {
exc = e2;
mainentry2 = mainentry;
AbstractC0515a.b(mainentry2.E1(), "Error", exc, this.o);
return;
}
}
new C8.v(mainentry2, iXoneCollection, i, str).runSeriallyAsyncTask();
return;
} catch (Exception e3) {
e = e3;
exc = e;
AbstractC0515a.b(mainentry2.E1(), "Error", exc, this.o);
return;
}
description = str;
iXoneObject.putVariables("##LOGIN_ERRORDESCRIPTION##", description);
mainentry2 = mainentry;
}
public boolean U1() {
return !this.n0;
}
public void U2(boolean z) {
this.U = z;
}
@Override
public int V() {
return this.c0;
}
public final void V0() {
try {
if (Z1()) {
CookieManager.setAcceptFileSchemeCookies(true);
CookieManager.getInstance().setAcceptCookie(true);
java.net.CookieManager cookieManager = new java.net.CookieManager();
cookieManager.setCookiePolicy(new CookiePolicy() {
@Override
public final boolean shouldAccept(URI uri, HttpCookie httpCookie) {
boolean Z2;
Z2 = xoneApp.Z2(uri, httpCookie);
return Z2;
}
});
CookieHandler.setDefault(cookieManager);
}
} catch (Exception e) {
Utils.l("XOneAndroidFramework", "Exception while checking installed WebView");
e.printStackTrace();
}
}
public boolean V1() {
return this.n0;
}
public void V2(String str) {
this.X = str;
}
@Override
public void W() {
this.X = null;
this.s = false;
this.n = "";
this.o = new XoneApplication(this, getApplicationContext(), this);
if (Utils.g3(this)) {
File file = new File(getFilesDir().getParentFile(), "app_" + this.n);
File file2 = new File(file, "files");
X2(file.getAbsolutePath());
q2(file2.getAbsolutePath() + "/");
} else if ("mounted".equals(Environment.getExternalStorageState())) {
this.p = Environment.getExternalStorageDirectory().getAbsolutePath() + "/xone/" + this.n;
X2(Environment.getExternalStorageDirectory().getAbsolutePath() + "/xone/app_" + this.n);
} else {
this.p = "";
}
N0();
}
public boolean W1() {
return !this.W;
}
public void W2(boolean z) {
this.N = z;
}
public final void X2(String str) {
this.q = str;
}
@Override
public String Y() {
return this.n;
}
public final void Y0() {
ha.r.a(false);
System.gc();
}
public boolean Y1() {
return this.k0;
}
@Override
public IRuntimeObject Z(String str) {
return L0(str, null);
}
public boolean Z1() {
PackageInfo currentWebViewPackage;
if (Y1()) {
return false;
}
int i = Build.VERSION.SDK_INT;
if (!getPackageManager().hasSystemFeature("android.software.webview")) {
return false;
}
if (i < 26) {
return true;
}
currentWebViewPackage = WebView.getCurrentWebViewPackage();
return currentWebViewPackage != null;
}
@Override
public IRuntimeObject a(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
String lowerCase = str.toLowerCase(Locale.US);
lowerCase.getClass();
switch (lowerCase) {
case "paymentmanager":
if (this.H0 == null) {
this.H0 = new PaymentManager(this);
}
break;
case "clipboard":
if (this.x0 == null) {
this.x0 = new XOneClipboard(this, G0());
}
break;
case "sensormanager":
if (this.F0 == null) {
this.F0 = new ScriptSensorManager(this, G0());
}
break;
case "fingerprintmanager":
if (this.v0 == null) {
this.v0 = new XOneFingerprintManager(this, G0());
}
break;
case "crypto":
if (this.E0 == null) {
this.E0 = new ScriptCrypto(this, G0());
}
break;
case "bluetoothserial":
if (this.B0 == null) {
this.B0 = new BluetoothSerialPort(this, G0());
}
break;
case "serial":
if (this.A0 == null) {
this.A0 = g2("com.xone.android.serialport", "com.xone.android.serialport.SerialPort");
}
break;
case "packagemanager":
if (this.y0 == null) {
this.y0 = new XOnePackageManager(this, G0());
}
break;
case "biometricsmanager":
if (this.w0 == null) {
this.w0 = new XOneBiometricsManager(this, G0());
}
break;
case "pushmessage":
case "push":
if (this.s0 == null) {
this.s0 = new PushMessage(this, G0());
}
break;
case "codescanner":
if (this.t0 == null) {
this.t0 = g2("com.xone.android.plugin.barcode", "com.xone.android.barcodeplugin.CodeScanner");
}
break;
case "appbroadcastmanager":
if (this.I0 == null) {
this.I0 = new AppBroadcastManager(this, (ua.X) G0());
}
break;
case "systemsettings":
if (this.q0 == null) {
this.q0 = new SystemSettings(this, (ua.X) G0());
}
break;
case "smsservice":
if (this.z0 == null) {
this.z0 = new SmsService(this, G0());
}
break;
case "ml":
if (this.J0 == null) {
this.J0 = g2("com.xone.android.tensorflowlite", "com.xone.android.tensorflowlite.AppMachineLearningScript");
}
break;
case "live":
if (this.p0 == null) {
this.p0 = new XoneLiveScriptObject(this, (ua.X) G0());
}
break;
case "$http":
if (this.u0 == null) {
this.u0 = new HttpRuntimeObject(this, G0());
}
break;
case "deviceinfo":
if (this.r0 == null) {
this.r0 = new DeviceInfo(this, null);
}
break;
case "bleserial":
if (this.C0 == null) {
this.C0 = new BleSerialPort(this);
}
break;
case "blemanager":
if (this.D0 == null) {
this.D0 = new BleManager(this);
}
break;
case "efidiagitv":
if (this.G0 == null) {
this.G0 = g2("com.xone.android.efidiagitv", "com.xone.android.efidiagitv.EfiDiagItv");
}
break;
}
return null;
}
public boolean a2() {
return M0 != null;
}
public void a3(int i, String str, String str2, String str3, String str4, int i2) {
LoadAppActivity s;
InterfaceC1036l0 g = g();
if (g != null) {
Handler handler = g.getHandler();
Message obtainMessage = handler.obtainMessage(705);
obtainMessage.what = 705;
Bundle bundle = new Bundle();
bundle.putInt("options", i);
bundle.putString("title", str);
bundle.putString("message", str2);
bundle.putString("sound", str3);
bundle.putString("vibrate", str4);
bundle.putInt("repeat", i2);
obtainMessage.setData(bundle);
handler.sendMessage(obtainMessage);
return;
}
B8.g k = new B8.g().m(str4).k(i2);
try {
k.b(str3);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
if (s1() != null && (s = LoadAppActivity.s()) != null) {
s.E(i, str, str2, k);
return;
}
mainEntry S = S();
if (S == null) {
throw new NullPointerException("No edit view is visible");
}
S.h2(i, str, str2, k);
}
@Override
public void attachBaseContext(Context context) {
super.attachBaseContext(context);
n1.a.l(context);
k5.a.a(context);
if (K0 == null) {
K0 = this;
}
}
@Override
public void b(Throwable th) {
if (th == null) {
return;
}
ua.F g = g();
if (g instanceof ua.F) {
g.b(th);
return;
}
ComponentCallbacks2 I0 = I0();
if (I0 instanceof ua.F) {
((ua.F) I0).b(th);
} else {
th.printStackTrace();
}
}
@Override
public InterfaceC1039n b0() {
if (!Utils.d3(this)) {
return null;
}
new HotswapServerTransportWebSocket(this);
throw null;
}
public List b1() {
ArrayList arrayList = new ArrayList();
if (!this.w.isEmpty()) {
Set<Map.Entry> entrySet = this.w.entrySet();
ArrayList arrayList2 = new ArrayList();
for (Map.Entry entry : entrySet) {
Integer num = (Integer) entry.getKey();
WeakReference weakReference = (WeakReference) entry.getValue();
if (weakReference == null) {
arrayList2.add(num);
} else {
InterfaceC1036l0 interfaceC1036l0 = (InterfaceC1036l0) weakReference.get();
if (interfaceC1036l0 == null || interfaceC1036l0.c()) {
arrayList2.add(num);
} else {
arrayList.add(interfaceC1036l0);
}
}
}
int size = arrayList2.size();
int i = 0;
while (i < size) {
Object obj = arrayList2.get(i);
i++;
this.w.remove((Integer) obj);
}
}
return arrayList;
}
public void b3(IXoneObject iXoneObject, String str, String str2, String str3) {
InterfaceC1036l0 g = g();
if (g == null) {
throw new IllegalStateException("No activity found");
}
if (R1()) {
return;
}
Message obtainMessage = g.getHandler().obtainMessage(705);
obtainMessage.what = 705;
Bundle bundle = new Bundle();
if (iXoneObject != null) {
j2(iXoneObject, Integer.valueOf(iXoneObject.hashCode()));
bundle.putInt("objectId", iXoneObject.hashCode());
} else {
bundle.putString("templatename", str);
}
bundle.putString("title", str2);
bundle.putString("message", str3);
obtainMessage.setData(bundle);
g.getHandler().sendMessage(obtainMessage);
}
public final IRuntimeObject c2(String str, int i) {
IRuntimeObject iRuntimeObject = (IRuntimeObject) ha.M.t(ha.M.e(ha.M.d(str), Context.class, IXoneApp.class), this, G0());
if (iRuntimeObject != null) {
return iRuntimeObject;
}
throw new ra.c(getString(i));
}
public void c3(C0932x0 c0932x0) {
int i = a.a[o1().ordinal()];
if (i == 1) {
e3(c0932x0);
} else {
if (i != 2) {
return;
}
g3(c0932x0);
}
}
@Override
public java.io.InputStream d(java.lang.String r5, boolean r6) {
throw new UnsupportedOperationException("Method not decompiled: com.xone.android.framework.xoneApp.d(java.lang.String, boolean):java.io.InputStream");
}
@Override
public String d0(String str) {
StringBuilder sb2 = new StringBuilder(this.p);
if (str == null) {
return null;
}
if (str.startsWith("./")) {
sb2.append(str.substring(2));
return sb2.toString();
}
if (str.startsWith("/")) {
return str;
}
if (str.startsWith("../")) {
sb2.append(str.substring(3));
return sb2.toString();
}
sb2.append(str);
return sb2.toString();
}
public Drawable d2(Context context, String str, int i, int i2, int i3, boolean z) {
Drawable g;
if (!TextUtils.isEmpty(str)) {
try {
URL url = new URL(str);
if (url.getProtocol().startsWith("http")) {
return new BitmapDrawable(ha.r.p(url, i2, i3));
}
} catch (MalformedURLException unused) {
}
if (AbstractC0752g.d(d0(str))) {
try {
String d = fb.n.d(context, d0(str), L());
String lowerCase = d.toLowerCase(Locale.US);
try {
if (lowerCase.endsWith(".gif")) {
return new RunnableC0599d(d, i2, i3);
}
} catch (C0601f e) {
e.printStackTrace();
}
if (lowerCase.endsWith(".9.png")) {
return ha.o.b(getResources(), BitmapFactory.decodeFile(d));
}
if (lowerCase.endsWith(".svg")) {
return new ea.Z(d);
}
if (!lowerCase.endsWith(".json") && !lowerCase.endsWith(".lottie")) {
return new BitmapDrawable(context.getResources(), ha.r.n(new File(d), i2, i3, false));
}
return AbstractC0401c.f(context, d);
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
if (i == 0 || (g = A0.b.g(this, i)) == null) {
return null;
}
Bitmap bitmap = g instanceof BitmapDrawable ? ((BitmapDrawable) g).getBitmap() : null;
if (bitmap == null) {
return null;
}
int width = bitmap.getWidth();
int height = bitmap.getHeight();
if (i2 == 0 && i3 > 0) {
i2 = (width * i3) / height;
} else if (i2 <= 0 || i3 != 0) {
i2 = width;
i3 = height;
} else {
i3 = (height * i2) / width;
}
return new BitmapDrawable(Bitmap.createScaledBitmap(bitmap, i2, i3, false));
}
public void d3() {
if (X1(XoneGPSService.class)) {
new e2.a(getApplicationContext()).start();
return;
}
Intent intent = new Intent();
intent.setClass(getApplicationContext(), XoneGPSService.class);
startService(intent);
}
@Override
public void e(IXoneObject iXoneObject) {
if (iXoneObject == null) {
return;
}
g.c S = S();
if (S == null) {
Utils.l("XOneAndroidFramework", "Error, mainEntryActivity == null");
return;
}
try {
ActivityManager a1 = a1();
if (C9.e.q(this, "android.permission.REORDER_TASKS")) {
a1.moveTaskToFront(S.getTaskId(), 0);
} else {
Utils.l("XOneAndroidFramework", "xoneApp.editCustomObject(): Permission Manifest.permission.REORDER_TASKS is not granted, cannot move mainEntry to the foreground.");
}
IXoneCollection ownerCollection = iXoneObject.getOwnerCollection();
if (ownerCollection == null) {
return;
}
Intent y3 = XoneBaseActivity.y3(ownerCollection);
y3.putExtra("collname", ownerCollection.getName());
y3.putExtra("saveandquit", true);
int ObjectIndex = ownerCollection.ObjectIndex(iXoneObject);
y3.putExtra("index", ObjectIndex);
if (ObjectIndex == -1) {
int hashCode = iXoneObject.hashCode();
y3.putExtra("orphanObjectHashCode", hashCode);
Z0().k2(iXoneObject, Integer.valueOf(hashCode));
}
if (ownerCollection.getOwnerObject() != null) {
y3.putExtra("pushobject", true);
Integer valueOf = Integer.valueOf(D1().nextInt());
y3.putExtra("parentID", valueOf);
k2(iXoneObject, valueOf);
}
XoneBaseActivity.P1(y3, ownerCollection);
S.startActivity(y3);
} catch (Exception e) {
S.b(e);
}
}
@Override
public void e0(ua.L l) {
this.l = l;
}
public String e1() {
return this.Y;
}
public Drawable e2(Context context, String str, int i) {
String d = fb.n.d(context, d0(str), L());
if (AbstractC0752g.d(d)) {
return new BitmapDrawable(context.getResources(), d);
}
if (i == 0) {
return null;
}
return B0.h.e(context.getResources(), i, (Resources.Theme) null);
}
public void e3(C0932x0 c0932x0) {
if (X1(XoneGPSService.class)) {
new e2.a(getApplicationContext()).start();
return;
}
Intent intent = new Intent();
intent.setClass(getApplicationContext(), XoneGPSService.class);
int o = Q8.k.o(c0932x0, "timeBetweenUpdates", 0);
int o2 = Q8.k.o(c0932x0, "minimumMetersDistanceRange", 3);
intent.putExtra("time_between_updates", o);
intent.putExtra("meters_distance_range", o2);
startService(intent);
}
@Override
public void f(boolean z) {
this.s = z;
}
@Override
public void f0() {
if ((getApplicationInfo().flags & 2) == 0 || !i1()) {
Utils.l("XOneAndroidFramework", "Debugguing is disabled");
return;
}
Utils.l("XOneAndroidFramework", "Starting debugguer");
IXoneApp G0 = G0();
if (G0 == null) {
Utils.l("XOneAndroidFramework", "Error while starting debugger, appData is null");
} else {
G0.StartDebugging();
}
}
public final void f2() {
Method k;
Class d = ha.M.d("com.xone.android.honeywell.scanner.HoneywellScannerManager");
if (d == null || (k = ha.M.k(d, "getInstance", Context.class)) == null) {
return;
}
ha.M.v(k, this);
}
public void f3(String str, long j, int i) {
if (TextUtils.isEmpty(str)) {
str = "";
}
if (j == -1) {
j = 60000;
}
if (i == -1) {
i = 0;
}
Intent intent = new Intent();
intent.setClass(getApplicationContext(), XoneGPSServiceV2.class);
intent.putExtra("callback_nodename", str);
intent.putExtra("gps_interval", j);
intent.putExtra("gps_flag", i);
if (startService(intent) == null) {
Utils.l("XOneAndroidFramework", "Cannot start gps v2 service");
}
}
@Override
public androidx.fragment.app.j g() {
androidx.fragment.app.j jVar;
WeakReference weakReference = this.Q;
if (weakReference == null || (jVar = (InterfaceC1036l0) weakReference.get()) == null || jVar.c()) {
return null;
}
return jVar;
}
@Override
public Drawable g0(String str, int i) {
return e2(this, str, i);
}
public IXoneView g1(IXoneObject iXoneObject) {
if (iXoneObject == null) {
return null;
}
IXoneObject iXoneObject2 = (IXoneObject) iXoneObject.getVariables("INTERNAL_EMBEDDING_OBJECT");
String str = (String) iXoneObject.getVariables("INTERNAL_EMBEDDING_PROPERTY_NAME");
if (iXoneObject2 != null && !TextUtils.isEmpty(str)) {
for (InterfaceC1036l0 interfaceC1036l0 : b1()) {
IXoneObject dataObject = interfaceC1036l0.getDataObject();
if (dataObject != null && iXoneObject2.equals(dataObject)) {
return (IXoneView) interfaceC1036l0.j(str);
}
}
}
return null;
}
public IRuntimeObject g2(String str, String str2) {
return h2(str, str2, 0);
}
public void g3(C0932x0 c0932x0) {
f3(Q8.k.E(c0932x0, "nodeName", ""), Q8.k.t(c0932x0, "timeBetweenUpdates", 0L), Q8.k.o(c0932x0, "flag", 0));
}
@Override
public String getFilesPath() {
return this.r;
}
@Override
public int getId() {
if (L0 == null) {
L0 = new AtomicInteger(1610612736);
}
return L0.addAndGet(1);
}
@Override
public void h0() {
Q0(false, true);
mainEntry S = S();
if (S != null) {
S.j1();
}
}
public Calendar h1() {
return this.I;
}
public IRuntimeObject h2(String str, String str2, int i) {
try {
String str3 = str + "," + str2;
if (this.i0 == null) {
this.i0 = new HashMap();
}
R9.a aVar = (R9.a) this.i0.get(str3);
if (aVar != null) {
aVar.A();
} else {
aVar = new R9.a(this, str, str2);
if (!aVar.w()) {
if (i == 0) {
return null;
}
throw new ra.c(getString(i));
}
this.i0.put(str3, aVar);
}
IRuntimeObject l = aVar.l(this, G0());
if (l == null && i != 0) {
throw new ra.c(getString(i));
}
return l;
} catch (M9.c e) {
throw e;
} catch (Exception e2) {
Utils.l("XOneAndroidFramework", getString(AbstractC0568j.t, str));
e2.printStackTrace();
if (i == 0) {
return null;
}
throw new ra.c(getString(i), e2);
}
}
public boolean h3(String str, Object obj, JSONObject jSONObject) {
InterfaceC1036l0 g = g();
if (g instanceof XoneBaseActivity) {
((XoneBaseActivity) g).O5(str, obj, jSONObject);
return true;
}
Utils.l("XOneAndroidFramework", "No last edit view found");
return false;
}
public boolean i1() {
return this.l0;
}
public IXoneObject i2(Integer num) {
return (IXoneObject) this.v.remove(num);
}
public boolean i3(String str, String str2, JSONObject jSONObject) {
InterfaceC1036l0 g = g();
if (g instanceof XoneBaseActivity) {
((XoneBaseActivity) g).P5(str, str2, jSONObject);
return true;
}
Utils.l("XOneAndroidFramework", "No last edit view found");
return false;
}
@Override
public Drawable j(Context context, String str, int i, int i2, int i3) {
return d2(context, str, i, i2, i3, true);
}
@Override
public String j0() {
return this.A;
}
public int j1() {
return this.C;
}
public void j2(IXoneObject iXoneObject, Integer num) {
if (iXoneObject == null) {
return;
}
this.v.put(num, iXoneObject);
}
public void j3() {
k3(this.J);
}
@Override
public ua.L k0() {
return this.l;
}
public IXoneObject k1(Integer num) {
return (IXoneObject) this.u.get(num);
}
public void k2(IXoneObject iXoneObject, Integer num) {
if (iXoneObject == null) {
return;
}
this.u.put(num, iXoneObject);
}
public void k3(int i) {
if (this.H == null) {
this.H = new Timer(true);
}
this.H.schedule(new C0847b(), i * 60000);
}
@Override
public int l() {
return this.d0;
}
@Override
public File l0(String str) {
if (str.startsWith("./")) {
return new File(getFilesPath() + str.substring(2));
}
if (str.startsWith("/")) {
return new File(str);
}
if (str.startsWith("../")) {
return new File(getFilesPath() + str.substring(3));
}
return new File(getFilesPath() + str);
}
public String l1() {
return this.D;
}
public final void l2(BroadcastReceiver broadcastReceiver, IntentFilter intentFilter) {
if (Build.VERSION.SDK_INT < 26) {
registerReceiver(broadcastReceiver, intentFilter);
} else {
registerReceiver(broadcastReceiver, intentFilter, Utils.K0(true, 0));
}
}
public boolean l3(int i) {
try {
if (a2()) {
Intent intent = new Intent(getContext(), (Class<?>) M0);
intent.setFlags(268435456);
intent.putExtra("reason", i != 0 ? getString(i) : "");
intent.putExtra("launch_setup", true);
getContext().startActivity(intent);
return true;
}
List<ApplicationInfo> C1 = C1();
if (C1.isEmpty()) {
return false;
}
for (ApplicationInfo applicationInfo : C1) {
Intent intent2 = new Intent();
intent2.setClassName(applicationInfo.packageName, "com.xone.live.services.CheckServiceStatus");
intent2.setFlags(268435456);
intent2.putExtra("reason", i != 0 ? getString(i) : "");
intent2.putExtra("launch_setup", true);
try {
getContext().startActivity(intent2);
} catch (SecurityException unused) {
}
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override
public float m() {
return this.V;
}
@Override
public InterfaceC1036l0 m0(IXoneObject iXoneObject) {
if (iXoneObject == null) {
return null;
}
for (InterfaceC1036l0 interfaceC1036l0 : b1()) {
IXoneObject dataObject = interfaceC1036l0.getDataObject();
if (dataObject != null && iXoneObject.equals(dataObject)) {
return interfaceC1036l0;
}
}
return null;
}
public File m1(String str) {
return new File(this.p, str);
}
public final void m2() {
C1073c c1073c = new C1073c();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("unitech.scanservice.data");
l2(c1073c, intentFilter);
IntentFilter intentFilter2 = new IntentFilter();
intentFilter2.addAction("android.intent.ACTION_DECODE_DATA");
l2(c1073c, intentFilter2);
IntentFilter intentFilter3 = new IntentFilter();
intentFilter3.addAction("com.barcode.sendBroadcast");
l2(c1073c, intentFilter3);
IntentFilter intentFilter4 = new IntentFilter();
intentFilter4.addAction("com.symbol.datawedge.DWDEMO");
intentFilter4.addCategory("android.intent.category.DEFAULT");
l2(c1073c, intentFilter4);
IntentFilter intentFilter5 = new IntentFilter();
intentFilter5.addAction("com.android.tdc.uart.answer");
l2(c1073c, intentFilter5);
IntentFilter intentFilter6 = new IntentFilter();
intentFilter6.addAction("com.datalogic.decodewedge.decode_action");
intentFilter6.addCategory("com.datalogic.decodewedge.decode_category");
l2(c1073c, intentFilter6);
IntentFilter intentFilter7 = new IntentFilter();
intentFilter7.addAction("com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED");
l2(c1073c, intentFilter7);
}
public boolean m3() {
Intent intent = new Intent();
intent.setClass(getApplicationContext(), XoneGPSService.class);
return stopService(intent);
}
@Override
public InterfaceC1039n n() {
return null;
}
@Override
public int n0() {
if (TextUtils.isEmpty(this.A)) {
return -1;
}
String[] split = this.A.split(",");
if (split.length == 0) {
return -1;
}
String str = split[0];
if (TextUtils.isEmpty(str)) {
return -1;
}
try {
return Color.parseColor(str);
} catch (Exception unused) {
Utils.l("XOneAndroidFramework", "Unknown company color: " + str + ". Defaulting to white.");
return -1;
}
}
public final void n2() {
registerReceiver(new C1075e(), new IntentFilter("android.intent.action.USER_PRESENT"));
}
public boolean n3() {
Intent intent = new Intent();
intent.setClass(getApplicationContext(), XoneGPSServiceV2.class);
return stopService(intent);
}
@Override
public void o(boolean z) {
this.a0 = z;
}
@Override
public InputStream o0(Context context, String str) {
try {
return new FileInputStream(fb.n.d(context, this.p + str, L()));
} catch (FileNotFoundException e) {
throw e;
} catch (Exception e2) {
e2.printStackTrace();
return null;
}
}
public EnumC0667b o1() {
if (this.m == null) {
this.m = EnumC0667b.m;
}
return this.m;
}
public void o2(Integer num) {
this.w.remove(num);
}
@Override
public void onCreate() {
super.onCreate();
Utils.l("XOneAndroidFramework", "xoneApp.onCreate() event fired");
K0 = this;
androidx.lifecycle.v.l().getLifecycle().a(this);
XOneJavascript.k(this);
fb.v.g(this);
Utils.W3("standalone");
Utils.V3("release");
Utils.X3(getFilesDir());
this.k0 = Utils.t3(this);
L1();
K1();
W0();
J1();
I1();
V0();
try {
b0();
} catch (Exception e) {
e.printStackTrace();
}
n2();
m2();
E2.c.h(this).a(this);
this.j0 = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(this);
}
public void onStateChanged(androidx.lifecycle.m mVar, h.a aVar) {
int i = a.b[aVar.ordinal()];
if (i == 1) {
this.n0 = true;
M1("on-app-foreground");
} else {
if (i != 2) {
return;
}
this.n0 = false;
M1("on-app-background");
}
}
@Override
public void onTrimMemory(int i) {
super.onTrimMemory(i);
this.o0 = i;
Utils.l("XOneAndroidFramework", "onTrimMemory(): " + Utils.W1(this.o0));
try {
if (i == 15) {
Utils.l("XOneAndroidFramework", "Device memory is extremely low! Trying to free up resources (TRIM_MEMORY_RUNNING_CRITICAL)");
Y0();
} else {
if (i != 80) {
return;
}
Utils.l("XOneAndroidFramework", "Device memory is extremely low! Trying to free up resources (TRIM_MEMORY_COMPLETE)");
Y0();
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public Handler p() {
InterfaceC1036l0 g = g();
return g != null ? g.getHandler() : this.O;
}
@Override
public void p0(String str, boolean z) {
Utils.l("XOneAndroidFramework", "xoneApp.closeApplication() invoked by " + str);
G();
this.y = false;
this.z = false;
try {
Timer timer = this.H;
if (timer != null) {
timer.cancel();
this.H.purge();
}
this.H = null;
if (E2.c.u()) {
Utils.l("XOneAndroidFramework", "Cancelled " + E2.c.t().c() + " pending and running jobs with JobManager");
}
for (IXoneObject iXoneObject : this.u.values()) {
if (iXoneObject instanceof XoneDataObject) {
((XoneDataObject) iXoneObject).r();
}
}
this.u.clear();
this.v.clear();
this.w.clear();
Vector vector = this.G;
if (vector != null) {
vector.clear();
}
List list = this.t;
if (list != null) {
list.clear();
this.t = null;
}
if (this.o != null) {
Utils.l("XOneAndroidFramework", "Terminating and disposing appData.");
this.o.TerminateApp();
this.o = null;
} else {
Utils.l("XOneAndroidFramework", "Not terminating appData because it is already null");
}
this.s = false;
this.G = null;
this.t = null;
A(false);
if (z) {
b2();
}
} catch (Throwable th) {
this.H = null;
throw th;
}
}
public boolean p1() {
return this.L;
}
public void p2(Integer num) {
this.u.remove(num);
}
@Override
public int q() {
return this.o0;
}
public int q1() {
return this.J;
}
public final void q2(String str) {
this.r = str;
}
@Override
public InterfaceC1041o r0() {
return null;
}
public void r2(String str) {
if (TextUtils.isEmpty(str)) {
this.M = "";
} else {
this.M = str;
}
}
@Override
public String s0() {
return this.M;
}
public Future s1() {
return this.x;
}
public void s2(String str) {
this.Y = str;
}
@Override
public void startActivity(Intent intent) {
super.startActivity(intent);
}
@Override
public boolean t() {
return this.T;
}
@Override
public boolean t0() {
ServiceState b;
p8.q a2 = p8.q.a();
return (a2 == null || (b = a2.b()) == null || b.getState() != 0) ? false : true;
}
public String t1() {
return this.e0;
}
public void t2(boolean z) {
this.F = z;
}
public boolean u1() {
return this.f0;
}
public void u2(int i, int i2) {
this.c0 = i;
this.d0 = i2;
}
@Override
public void uncaughtException(Thread thread, Throwable th) {
th.printStackTrace();
try {
w7.s sVar = new w7.s(this, (WeakReference) null, Utils.M2(th), Utils.N2(th));
Utils.l("XOneAndroidFramework", "An error has happened, sending bug report...");
O0();
sVar.f(sVar.u());
} catch (Exception e) {
e.printStackTrace();
}
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = this.j0;
if (uncaughtExceptionHandler != null) {
uncaughtExceptionHandler.uncaughtException(thread, th);
}
}
@Override
public IRuntimeObject v(Object[] objArr) {
if (objArr == null || objArr.length < 1) {
return null;
}
return new XoneCreateObject((ua.X) G0(), objArr);
}
@Override
public Drawable v0(String str, int i, int i2, int i3, boolean z) {
return d2(this, str, i, i2, i3, z);
}
@Override
public mainEntry S() {
mainEntry mainentry;
WeakReference weakReference = this.P;
if (weakReference == null || (mainentry = (mainEntry) weakReference.get()) == null || mainentry.c()) {
return null;
}
return mainentry;
}
public void v2(String str) {
this.A = str;
}
@Override
public boolean w0() {
return false;
}
public Handler w1() {
return this.O;
}
public void w2(String str) {
this.B = str;
}
@Override
public boolean x() {
return this.S;
}
public C0670e x1(InterfaceC1032j0 interfaceC1032j0, IXoneCollection iXoneCollection) {
List p;
long j;
if (interfaceC1032j0 == null || (p = interfaceC1032j0.p()) == null || p.isEmpty()) {
return null;
}
String b = AbstractC0734d.b(interfaceC1032j0, "period", "X");
long n1 = n1(interfaceC1032j0);
if ("X".equals(b)) {
j = 60000;
} else {
if (!"S".equals(b)) {
if ("H".equals(b)) {
j = 3600000;
}
return new C0670e.a().e(AbstractC0734d.a(interfaceC1032j0, "name")).c(n1).b(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "executealways", "true"), true)).h(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "show-errors", "false"), false)).g(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "serialize", "false"), false)).f(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "refresh", "false"), false)).d(iXoneCollection.getName()).a();
}
j = 1000;
}
n1 *= j;
return new C0670e.a().e(AbstractC0734d.a(interfaceC1032j0, "name")).c(n1).b(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "executealways", "true"), true)).h(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "show-errors", "false"), false)).g(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "serialize", "false"), false)).f(fb.t.l(AbstractC0734d.b(interfaceC1032j0, "refresh", "false"), false)).d(iXoneCollection.getName()).a();
}
public void x2(boolean z) {
this.S = z;
}
@Override
public void y(String str, long j, int i) {
int i2 = a.a[o1().ordinal()];
if (i2 == 1) {
d3();
} else {
if (i2 != 2) {
return;
}
f3(str, j, i);
}
}
public byte[] y1() {
if (this.h0 == null) {
this.h0 = new byte[17];
new SecureRandom().nextBytes(this.h0);
}
return this.h0;
}
public void y2(Activity activity) {
if (activity == null) {
this.R = null;
} else {
this.R = new WeakReference(activity);
}
}
public C0672g z1(IXoneObject iXoneObject) {
List list = this.t;
if (list == null || list.isEmpty()) {
return null;
}
if (this.t.size() == 1) {
return (C0672g) this.t.get(0);
}
for (int i = 0; i < this.t.size(); i++) {
C0672g c0672g = (C0672g) this.t.get(i);
if (X0(c0672g, iXoneObject)) {
return c0672g;
}
}
return (C0672g) this.t.get(0);
}
public void z2(boolean z) {
this.l0 = z;
}
}