导航菜单

页面标题

页面副标题

Minits v4.9.3.32 - XoneGlobalUI.java 源代码

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

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


package com.xone.android.framework;

import B6.b;
import B6.d;
import C9.h;
import La.a;
import android.R;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Color;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.media.AudioManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.os.DeadObjectException;
import android.os.Debug;
import android.os.Environment;
import android.os.IBinder;
import android.os.Message;
import android.os.Parcelable;
import android.os.Vibrator;
import android.provider.ContactsContract;
import android.telephony.TelephonyManager;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.MimeTypeMap;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TimePicker;
import androidx.activity.result.e;
import androidx.annotation.Keep;
import b4.g;
import com.google.android.gms.location.LocationRequest;
import com.google.android.material.tabs.TabLayout;
import com.xone.android.framework.XoneGlobalUI;
import com.xone.android.framework.activities.CameraActivity;
import com.xone.android.framework.activities.EditViewHyper;
import com.xone.android.framework.activities.ReplicaConsoleActivity;
import com.xone.android.framework.activities.XoneBaseActivity;
import com.xone.android.framework.activities.XoneSignActivity;
import com.xone.android.framework.services.AppForegroundService;
import com.xone.android.framework.views.EditFramePage;
import com.xone.android.javascript.XOneJavascript;
import com.xone.android.nfc.runtimeobjects.XoneNFCRuntime;
import com.xone.android.script.runtimeobjects.AmazonAppStore;
import com.xone.android.utils.Utils;
import com.xone.annotations.ScriptAllowed;
import com.xone.interfaces.IRuntimeObject;
import com.xone.interfaces.IXoneApp;
import com.xone.interfaces.IXoneCollection;
import com.xone.interfaces.IXoneObject;
import com.xone.replicator.helpers.DatabaseFilesHelper;
import eb.AbstractC0665a;
import fb.AbstractC0698k;
import gb.C0731a;
import gb.C0732b;
import h8.C0736a;
import ha.AbstractC0751f;
import ha.AbstractC0752g;
import i8.C0767c;
import j8.C0786e;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import ka.EnumC0821f;
import m8.CallableC0846a;
import org.json.JSONObject;
import org.mozilla.javascript.C0893d0;
import org.mozilla.javascript.C0907k0;
import org.mozilla.javascript.C0932x0;
import org.mozilla.javascript.Q0;
import p8.C0944h;
import p8.C0945i;
import qa.EnumC0975b;
import s.d;
import s8.d;
import ta.FutureC0996a;
import ua.InterfaceC1016b0;
import ua.InterfaceC1018c0;
import ua.InterfaceC1034k0;
import ua.InterfaceC1036l0;
import ua.InterfaceC1038m0;
import ua.O0;
import ua.U0;
import va.C1066a;
import w8.C1073c;
import xone.runtime.core.XoneDataObject;

@ScriptAllowed
@Keep
public final class XoneGlobalUI implements IRuntimeObject {
    private static final int MESSAGEBOX_TIMEOUT = 1000;
    private boolean bIsExecuting;
    private boolean bWasStartPrintInvoked;
    private b connPrinter;
    a enableLocationCallback;
    private int nResponseButton;
    La.a remotePrintService;
    private CharSequence sResponseText;
    String sResultAux = null;
    private static final Map<String, ua.W> mapTypeInfo = createTypeInfoData();
    private static final Map<String, ua.U> mapPropManagers = new Hashtable();

    public static class a implements InterfaceC1018c0 {
        public final XoneGlobalUI l;
        public final Object m;
        public final Object n;
        public boolean o;

        public a(XoneGlobalUI xoneGlobalUI, Object obj, Object obj2) {
            this.l = xoneGlobalUI;
            this.m = obj;
            this.n = obj2;
        }

        public final void b() {
            Object obj;
            try {
                boolean z = this.o;
                if (z && this.m != null) {
                    Thread.sleep(2000L);
                    XOneJavascript.x(this.m, new Object[0]);
                } else {
                    if (z || (obj = this.n) == null) {
                        return;
                    }
                    XOneJavascript.x(obj, new Object[0]);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        @Override
        public int getRequestCode() {
            return 8011;
        }

        @Override
        public void onActivityResult(int i, Intent intent) {
            this.l.enableLocationCallback = null;
            if (this.m == null && this.n == null) {
                return;
            }
            try {
                int checkGpsStatus = XoneGlobalUI.checkGpsStatus();
                this.o = (checkGpsStatus == 3 || checkGpsStatus == -1) ? false : true;
                new Thread(new Runnable() {
                    @Override
                    public final void run() {
                        XoneGlobalUI.a.this.b();
                    }
                }, "EnableLocationCallback").start();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public class b implements ServiceConnection {
        public b() {
        }

        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
            XoneGlobalUI.this.remotePrintService = a.AbstractBinderC0003a.F(iBinder);
            Log.d(getClass().getSimpleName(), "onServiceConnected()");
        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {
            XoneGlobalUI.this.remotePrintService = null;
            Log.d(getClass().getSimpleName(), "onServiceDisconnected()");
        }
    }

    private boolean askUserForGpsPermissionGoogle(Object obj, Object obj2) {
        if (!isGooglePlayServicesAvailable()) {
            return false;
        }
        androidx.fragment.app.j g = getApp().g();
        if (!(g instanceof InterfaceC1016b0)) {
            return false;
        }
        g.a aVar = new g.a();
        aVar.a(new LocationRequest.a(3600000L).a());
        try {
            return ((b4.h) m4.o.a(b4.f.b(g).a(aVar.b()))) != null;
        } catch (InterruptedException e) {
            throw AbstractC0751f.e(e);
        } catch (ExecutionException e2) {
            r3.k i = AbstractC0751f.i(e2);
            if (!(i instanceof r3.k)) {
                throw AbstractC0751f.e(i);
            }
            r3.k kVar = i;
            if (kVar.b() == 6) {
                try {
                    if (this.enableLocationCallback == null) {
                        a aVar2 = new a(this, obj, obj2);
                        this.enableLocationCallback = aVar2;
                        ((InterfaceC1016b0) g).q(aVar2);
                        kVar.c(g, 8011);
                    }
                } catch (IntentSender.SendIntentException e3) {
                    throw AbstractC0751f.e(e3);
                }
            }
            return true;
        }
    }

    private void bindPrinterServer(java.lang.String r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.xone.android.framework.XoneGlobalUI.bindPrinterServer(java.lang.String):void");
    }

    @ScriptAllowed
    @Deprecated
    public static int checkGPSStatus() {
        return checkGpsStatus();
    }

    @ScriptAllowed
    public static int checkGpsStatus() {
        try {
            if (!getPackageManager().hasSystemFeature("android.hardware.location")) {
                return 0;
            }
            LocationManager locationManager = getLocationManager();
            boolean isProviderEnabled = locationManager.isProviderEnabled("gps");
            boolean isProviderEnabled2 = locationManager.isProviderEnabled("network");
            if (isProviderEnabled && isProviderEnabled2) {
                return 4;
            }
            if (isProviderEnabled) {
                return 1;
            }
            return isProviderEnabled2 ? 2 : 3;
        } catch (Exception e) {
            Utils.l("XOneAndroidFramework", "CheckGpsStatus()");
            e.printStackTrace();
            return -1;
        }
    }

    public static String cleanScriptStringValue(String str) {
        return TextUtils.isEmpty(str) ? str : ((str.startsWith("\"") && str.endsWith("\"")) || (str.startsWith("'") && str.endsWith("'"))) ? str.substring(1, str.length() - 1) : str;
    }

    @ScriptAllowed
    public static boolean clearDrawing(Object... objArr) {
        Utils.j("ClearDrawing", objArr);
        Utils.g("ClearDrawing", objArr, 1);
        ua.C gestureProperty = getGestureProperty(fb.t.y(objArr[0]));
        if (gestureProperty == null) {
            return false;
        }
        gestureProperty.clearDrawing();
        return true;
    }

    @ScriptAllowed
    public static boolean createShortcut(Object... objArr) {
        String str;
        boolean z;
        xoneApp Z0 = xoneApp.Z0();
        String Y = Z0.Y();
        Bundle bundle = new Bundle();
        File file = null;
        if (objArr != null) {
            String y = fb.t.y(objArr[0]);
            boolean l = fb.t.l(fb.t.y(objArr[1]), true);
            String y2 = fb.t.y(objArr[2]);
            File q1 = Utils.q1(y, Z0.T(), fb.t.y(objArr[3]), false, 2);
            for (int i = 4; i < objArr.length; i++) {
                String z2 = fb.t.z(objArr[i], null);
                if (z2 != null) {
                    String[] split = z2.split("=", 2);
                    bundle.putString(split[0], split[1]);
                }
            }
            Y = y;
            z = l;
            str = y2;
            file = q1;
        } else {
            str = Y;
            z = true;
        }
        return Utils.g0(Z0, Y, str, file, z, bundle);
    }

    private static Map<String, ua.W> createTypeInfoData() {
        Hashtable hashtable = new Hashtable();
        Wa.d dVar = new Wa.d("MsgBox", O0.a);
        dVar.c("MessageText", 1, true);
        dVar.c("Caption", 1, true);
        dVar.c("Options", 3, true);
        dVar.c("Template", 8, true);
        String name = dVar.getName();
        Locale locale = Locale.US;
        hashtable.put(name.toLowerCase(locale), dVar);
        Wa.d dVar2 = new Wa.d("MsgBoxEx", O0.a);
        dVar2.c("MessageText", 1, false);
        dVar2.c("Caption", 1, false);
        dVar2.c("Options", 3, false);
        hashtable.put(dVar2.getName().toLowerCase(locale), dVar2);
        Wa.d dVar3 = new Wa.d("ShowToast", O0.a);
        dVar3.c("MessageText", 1, false);
        hashtable.put(dVar3.getName().toLowerCase(locale), dVar3);
        Wa.d dVar4 = new Wa.d("Confirm", O0.a);
        dVar4.c("Text", 1, false);
        hashtable.put(dVar4.getName().toLowerCase(locale), dVar4);
        Wa.d dVar5 = new Wa.d("Prompt", O0.a);
        dVar5.c("Text", 1, false);
        dVar5.c("DefaultText", 1, false);
        hashtable.put(dVar5.getName().toLowerCase(locale), dVar5);
        Wa.d dVar6 = new Wa.d("ShowSnackbar", O0.a);
        dVar6.c("Object", 8, false);
        hashtable.put(dVar6.getName().toLowerCase(locale), dVar6);
        Wa.d dVar7 = new Wa.d("HideSnackbar", O0.a);
        hashtable.put(dVar7.getName().toLowerCase(locale), dVar7);
        Wa.d dVar8 = new Wa.d("SetNotificationLed", O0.a);
        dVar8.c("LedColor", 1, false);
        dVar8.c("OnDuration", 1, false);
        dVar8.c("OffDuration", 1, true);
        hashtable.put(dVar8.getName().toLowerCase(locale), dVar8);
        Wa.d dVar9 = new Wa.d("ShowNotification", O0.a);
        dVar9.c(DatabaseFilesHelper.ID_COLUMN, 1, false);
        dVar9.c("Title", 1, false);
        dVar9.c("Text", 1, false);
        dVar9.c("XoneDataObject", 1, true);
        dVar9.c("sNodeToExecute", 1, true);
        hashtable.put(dVar9.getName().toLowerCase(locale), dVar9);
        Wa.d dVar10 = new Wa.d("AreNotificationsBlocked", O0.a);
        dVar10.c("channel", 1, true);
        hashtable.put(dVar10.getName().toLowerCase(locale), dVar10);
        Wa.d dVar11 = new Wa.d("ShowNotificationChannelSettings", O0.a);
        dVar11.c("channel", 1, true);
        hashtable.put(dVar11.getName().toLowerCase(locale), dVar11);
        Wa.d dVar12 = new Wa.d("ShowNotificationSettings", O0.a);
        hashtable.put(dVar12.getName().toLowerCase(locale), dVar12);
        Wa.d dVar13 = new Wa.d("DismissNotification", O0.a);
        dVar13.c(DatabaseFilesHelper.ID_COLUMN, 1, false);
        hashtable.put(dVar13.getName().toLowerCase(locale), dVar13);
        Wa.d dVar14 = new Wa.d("RecognizeSpeech", O0.a);
        dVar14.c("dataobject", 8, false);
        dVar14.c("targetproperty", 8, false);
        hashtable.put(dVar14.getName().toLowerCase(locale), dVar14);
        Wa.d dVar15 = new Wa.d("Speak", O0.a);
        dVar15.c("language", 1, false);
        dVar15.c("text", 1, false);
        hashtable.put(dVar15.getName().toLowerCase(locale), dVar15);
        Wa.d dVar16 = new Wa.d("IsSpeaking", O0.a);
        dVar16.c("language", 1, false);
        hashtable.put(dVar16.getName().toLowerCase(locale), dVar16);
        Wa.d dVar17 = new Wa.d("StopSpeaking", O0.a);
        dVar17.c("language", 1, false);
        hashtable.put(dVar17.getName().toLowerCase(locale), dVar17);
        Wa.d dVar18 = new Wa.d("IsNetworkAvailable", O0.a);
        dVar18.c("bCheckInternet", 6, true);
        hashtable.put(dVar18.getName().toLowerCase(locale), dVar18);
        Wa.d dVar19 = new Wa.d("CreateShortcut", O0.a);
        hashtable.put(dVar19.getName().toLowerCase(locale), dVar19);
        Wa.d dVar20 = new Wa.d("DeleteShortcut", O0.a);
        dVar20.c("AppName", 1, false);
        dVar20.c("Caption", 1, false);
        hashtable.put(dVar20.getName().toLowerCase(locale), dVar20);
        Wa.d dVar21 = new Wa.d("CheckGpsStatus", O0.a);
        hashtable.put(dVar21.getName().toLowerCase(locale), dVar21);
        Wa.d dVar22 = new Wa.d("AskUserForGpsPermission", O0.a);
        hashtable.put(dVar22.getName().toLowerCase(locale), dVar22);
        Wa.d dVar23 = new Wa.d("ShowCollection", O0.a);
        dVar23.c("CollName", 1, false);
        dVar23.c("Options", 3, false);
        hashtable.put(dVar23.getName().toLowerCase(locale), dVar23);
        Wa.d dVar24 = new Wa.d("GetInputString", O0.a);
        dVar24.c("MessageText", 1, false);
        dVar24.c("Caption", 1, false);
        dVar24.c("Options", 3, false);
        hashtable.put(dVar24.getName().toLowerCase(locale), dVar24);
        Wa.d dVar25 = new Wa.d("MsgBoxWithSound", O0.a);
        dVar25.c("MessageText", 1, false);
        dVar25.c("Caption", 1, false);
        dVar25.c("Options", 3, false);
        dVar25.c("Sound", 1, false);
        dVar25.c("Vibrate", 1, false);
        dVar25.c("Repeat", 3, false);
        hashtable.put(dVar25.getName().toLowerCase(locale), dVar25);
        Wa.d dVar26 = new Wa.d("PlaySound", O0.a);
        dVar26.c("Sound", 1, false);
        dVar26.c("Repeat", 3, true);
        dVar26.c("ContinuePlaying", 6, true);
        hashtable.put(dVar26.getName().toLowerCase(locale), dVar26);
        Wa.d dVar27 = new Wa.d("playSoundAndVibrate", O0.a);
        dVar27.c("Sound", 1, false);
        dVar27.c("Vibrate", 1, false);
        dVar27.c("Repeat", 3, false);
        dVar27.c("ContinuePlaying", 6, true);
        hashtable.put(dVar27.getName().toLowerCase(locale), dVar27);
        Wa.d dVar28 = new Wa.d("StopPlaySoundAndVibrate", O0.a);
        hashtable.put(dVar28.getName().toLowerCase(locale), dVar28);
        Wa.d dVar29 = new Wa.d("StopPlaySound", O0.a);
        hashtable.put(dVar29.getName().toLowerCase(locale), dVar29);
        Wa.d dVar30 = new Wa.d("PlaySoundVolumen", O0.a);
        dVar30.c("Value", 2, false);
        hashtable.put(dVar30.getName().toLowerCase(locale), dVar30);
        Wa.d dVar31 = new Wa.d("SetPlaySoundVolume", O0.a);
        dVar31.c("Value", 2, false);
        hashtable.put(dVar31.getName().toLowerCase(locale), dVar31);
        Wa.d dVar32 = new Wa.d("GetSoundVolumen", O0.a);
        hashtable.put(dVar32.getName().toLowerCase(locale), dVar32);
        Wa.d dVar33 = new Wa.d("GetSoundVolume", O0.a);
        hashtable.put(dVar33.getName().toLowerCase(locale), dVar33);
        Wa.d dVar34 = new Wa.d("GetMaxSoundVolumen", O0.a);
        hashtable.put(dVar34.getName().toLowerCase(locale), dVar34);
        Wa.d dVar35 = new Wa.d("GetMaxSoundVolume", O0.a);
        hashtable.put(dVar35.getName().toLowerCase(locale), dVar35);
        Wa.d dVar36 = new Wa.d("StartGPS", O0.a);
        hashtable.put(dVar36.getName().toLowerCase(locale), dVar36);
        Wa.d dVar37 = new Wa.d("StopGPS", O0.a);
        hashtable.put(dVar37.getName().toLowerCase(locale), dVar37);
        Wa.d dVar38 = new Wa.d("StartGPSV1", O0.a);
        hashtable.put(dVar38.getName().toLowerCase(locale), dVar38);
        Wa.d dVar39 = new Wa.d("StopGPSV1", O0.a);
        hashtable.put(dVar39.getName().toLowerCase(locale), dVar39);
        Wa.d dVar40 = new Wa.d("StartGPSV2", O0.a);
        hashtable.put(dVar40.getName().toLowerCase(locale), dVar40);
        Wa.d dVar41 = new Wa.d("StopGPSV2", O0.a);
        hashtable.put(dVar41.getName().toLowerCase(locale), dVar41);
        Wa.d dVar42 = new Wa.d("StartAudioRecord", O0.a);
        dVar42.c("callbacknode", 1, false);
        dVar42.c("destinationproperty", 1, false);
        dVar42.c("timeout", 1, false);
        hashtable.put(dVar42.getName().toLowerCase(locale), dVar42);
        Wa.d dVar43 = new Wa.d("StopAudioRecord", O0.a);
        hashtable.put(dVar43.getName().toLowerCase(locale), dVar43);
        Wa.d dVar44 = new Wa.d("ShowSoftwareKeyboard", O0.a);
        dVar44.c("PropertyName", 1, false);
        hashtable.put(dVar44.getName().toLowerCase(locale), dVar44);
        Wa.d dVar45 = new Wa.d("HideSoftwareKeyboard", O0.a);
        hashtable.put(dVar45.getName().toLowerCase(locale), dVar45);
        Wa.d dVar46 = new Wa.d("ShowKeyboardOptions", O0.a);
        hashtable.put(dVar46.getName().toLowerCase(locale), dVar46);
        Wa.d dVar47 = new Wa.d("SetLanguage", O0.a);
        dVar47.c("language", 1, false);
        hashtable.put(dVar47.getName().toLowerCase(locale), dVar47);
        Wa.d dVar48 = new Wa.d("GetLanguage", O0.a);
        hashtable.put(dVar48.getName().toLowerCase(locale), dVar48);
        Wa.d dVar49 = new Wa.d("GetCountryCode", O0.a);
        hashtable.put(dVar49.getName().toLowerCase(locale), dVar49);
        Wa.d dVar50 = new Wa.d("Sleep", O0.a);
        dVar50.c("seconds", 3, false);
        hashtable.put(dVar50.getName().toLowerCase(locale), dVar50);
        Wa.d dVar51 = new Wa.d("StartReplica", O0.a);
        hashtable.put(dVar51.getName().toLowerCase(locale), dVar51);
        Wa.d dVar52 = new Wa.d("StopReplica", O0.a);
        hashtable.put(dVar52.getName().toLowerCase(locale), dVar52);
        Wa.d dVar53 = new Wa.d("StartLive", O0.a);
        dVar53.c("PackageName", 1, true);
        hashtable.put(dVar53.getName().toLowerCase(locale), dVar53);
        Wa.d dVar54 = new Wa.d("StartWIFI", O0.a);
        hashtable.put(dVar54.getName().toLowerCase(locale), dVar54);
        Wa.d dVar55 = new Wa.d("StopWIFI", O0.a);
        hashtable.put(dVar55.getName().toLowerCase(locale), dVar55);
        Wa.d dVar56 = new Wa.d("IsWifiEnabled", O0.a);
        hashtable.put(dVar56.getName().toLowerCase(locale), dVar56);
        Wa.d dVar57 = new Wa.d("IsWifiConnected", O0.a);
        hashtable.put(dVar57.getName().toLowerCase(locale), dVar57);
        Wa.d dVar58 = new Wa.d("StartScanner", O0.a);
        hashtable.put(dVar58.getName().toLowerCase(locale), dVar58);
        dVar58.c("Tipo", 1, false);
        dVar58.c("Codigos", 1, true);
        dVar58.c("PropObjetivo", 1, true);
        Wa.d dVar59 = new Wa.d("GetLastKnownLocation", O0.a);
        hashtable.put(dVar59.getName().toLowerCase(locale), dVar59);
        Wa.d dVar60 = new Wa.d("GetLastKnownLocationLatitude", O0.a);
        hashtable.put(dVar60.getName().toLowerCase(locale), dVar60);
        Wa.d dVar61 = new Wa.d("GetLastKnownLocationLongitude", O0.a);
        hashtable.put(dVar61.getName().toLowerCase(locale), dVar61);
        Wa.d dVar62 = new Wa.d("GetLastKnownLocationAltitude", O0.a);
        hashtable.put(dVar62.getName().toLowerCase(locale), dVar62);
        Wa.d dVar63 = new Wa.d("GetLastKnownLocationAccuracy", O0.a);
        hashtable.put(dVar63.getName().toLowerCase(locale), dVar63);
        Wa.d dVar64 = new Wa.d("GetLastKnownLocationBearing", O0.a);
        hashtable.put(dVar64.getName().toLowerCase(locale), dVar64);
        Wa.d dVar65 = new Wa.d("GetLastKnownLocationSpeed", O0.a);
        hashtable.put(dVar65.getName().toLowerCase(locale), dVar65);
        Wa.d dVar66 = new Wa.d("GetLastKnownLocationProvider", O0.a);
        hashtable.put(dVar66.getName().toLowerCase(locale), dVar66);
        Wa.d dVar67 = new Wa.d("GetLastKnownLocationDateTime", O0.a);
        hashtable.put(dVar67.getName().toLowerCase(locale), dVar67);
        Wa.d dVar68 = new Wa.d("QuitApp", O0.a);
        hashtable.put(dVar68.getName().toLowerCase(locale), dVar68);
        Wa.d dVar69 = new Wa.d("SignDataObject", O0.a);
        dVar69.c("Data", 1, false);
        dVar69.c("Mask", 3, false);
        hashtable.put(dVar69.getName().toLowerCase(locale), dVar69);
        Wa.d dVar70 = new Wa.d("StartPrint", O0.a);
        hashtable.put(dVar70.getName().toLowerCase(locale), dVar70);
        dVar70.c("printer", 255, true);
        Wa.d dVar71 = new Wa.d("EndPrint", O0.a);
        hashtable.put(dVar71.getName().toLowerCase(locale), dVar71);
        dVar71.c("Timeout", 2, false);
        Wa.d dVar72 = new Wa.d("PrintLine", O0.a);
        dVar72.c("Data", 1, false);
        hashtable.put(dVar72.getName().toLowerCase(locale), dVar72);
        Wa.d dVar73 = new Wa.d("PrintCommand", O0.a);
        dVar73.c("Data", 1, false);
        hashtable.put(dVar73.getName().toLowerCase(locale), dVar73);
        Wa.d dVar74 = new Wa.d("LineFeed", O0.a);
        dVar74.c("Lines", 2, false);
        hashtable.put(dVar74.getName().toLowerCase(locale), dVar74);
        Wa.d dVar75 = new Wa.d("PrintBarcode", O0.a);
        dVar75.c("Type", 1, false);
        dVar75.c("Data", 1, false);
        hashtable.put(dVar75.getName().toLowerCase(locale), dVar75);
        Wa.d dVar76 = new Wa.d("PrintImage", O0.a);
        dVar76.c("fileUrl", 1, false);
        dVar76.c("width", 2, false);
        dVar76.c("height", 2, false);
        dVar76.c("align", 1, false);
        dVar76.c("dither", 2, false);
        hashtable.put(dVar76.getName().toLowerCase(locale), dVar76);
        Wa.d dVar77 = new Wa.d("PrintBIDI", O0.a);
        dVar77.c("Size", 2, false);
        dVar77.c("LV", 1, false);
        dVar77.c("Data", 1, false);
        hashtable.put(dVar77.getName().toLowerCase(locale), dVar77);
        Wa.d dVar78 = new Wa.d("PrintPDF", O0.a);
        dVar78.c("Path", 1, false);
        hashtable.put(dVar78.getName().toLowerCase(locale), dVar78);
        Wa.d dVar79 = new Wa.d("SetFeedMode", O0.a);
        dVar79.c("feedmode", 1, false);
        hashtable.put(dVar79.getName().toLowerCase(locale), dVar79);
        Wa.d dVar80 = new Wa.d("UseLastPrinter", O0.a);
        dVar80.c("sw", 1, true);
        hashtable.put(dVar80.getName().toLowerCase(locale), dVar80);
        Wa.d dVar81 = new Wa.d("ShowGroup", O0.a);
        dVar81.c("GroupId", 1, false);
        dVar81.c("InAnimation", 1, false);
        dVar81.c("InAnimationDuration", 2, false);
        dVar81.c("OutAnimation", 1, false);
        dVar81.c("OutAnimationDuration", 2, false);
        hashtable.put(dVar81.getName().toLowerCase(locale), dVar81);
        Wa.d dVar82 = new Wa.d("HideGroup", O0.a);
        dVar82.c("GroupId", 1, false);
        hashtable.put(dVar82.getName().toLowerCase(locale), dVar82);
        Wa.d dVar83 = new Wa.d("ToggleGroup", O0.a);
        dVar83.c("GroupId", 1, false);
        hashtable.put(dVar83.getName().toLowerCase(locale), dVar83);
        Wa.d dVar84 = new Wa.d("LockGroup", O0.a);
        dVar84.c("GroupId", 1, false);
        hashtable.put(dVar84.getName().toLowerCase(locale), dVar84);
        Wa.d dVar85 = new Wa.d("UnlockGroup", O0.a);
        dVar85.c("GroupId", 1, false);
        hashtable.put(dVar85.getName().toLowerCase(locale), dVar85);
        Wa.d dVar86 = new Wa.d("EnsureVisible", O0.a);
        dVar86.c("Name", 1, false);
        dVar86.c("Type", 1, false);
        hashtable.put(dVar86.getName().toLowerCase(locale), dVar86);
        Wa.d dVar87 = new Wa.d("OpenFile", O0.a);
        dVar87.c("file", 1, false);
        hashtable.put(dVar87.getName().toLowerCase(locale), dVar87);
        Wa.d dVar88 = new Wa.d("OpenUrl", O0.a);
        dVar88.c("file", 1, false);
        hashtable.put(dVar88.getName().toLowerCase(locale), dVar88);
        Wa.d dVar89 = new Wa.d("CanOpen", O0.a);
        dVar89.c("url", 1, false);
        hashtable.put(dVar89.getName().toLowerCase(locale), dVar89);
        Wa.d dVar90 = new Wa.d("SendMail", O0.a);
        dVar90.c("to", 1, false);
        dVar90.c("cc", 1, false);
        dVar90.c("subject", 1, false);
        dVar90.c("text", 1, false);
        dVar90.c("attachment", 1, false);
        hashtable.put(dVar90.getName().toLowerCase(locale), dVar90);
        Wa.d dVar91 = new Wa.d("SendSms", O0.a);
        dVar91.c("phone", 1, false);
        dVar91.c("text", 1, false);
        dVar91.c("showSelector", 6, true);
        hashtable.put(dVar91.getName().toLowerCase(locale), dVar91);
        Wa.d dVar92 = new Wa.d("SendSmsRetryIfNetworkIsDown", O0.a);
        dVar92.c("phone", 1, false);
        dVar92.c("text", 1, false);
        hashtable.put(dVar92.getName().toLowerCase(locale), dVar92);
        Wa.d dVar93 = new Wa.d("MakePhoneCall", O0.a);
        dVar93.c("phone", 1, false);
        hashtable.put(dVar93.getName().toLowerCase(locale), dVar93);
        Wa.d dVar94 = new Wa.d("CanMakePhoneCall", O0.a);
        hashtable.put(dVar94.getName().toLowerCase(locale), dVar94);
        Wa.d dVar95 = new Wa.d("ExecuteActionAfterDelay", O0.a);
        dVar95.c("NodeName", 1, false);
        dVar95.c("Delay", 5, false);
        hashtable.put(dVar95.getName().toLowerCase(locale), dVar95);
        Wa.d dVar96 = new Wa.d("MoveToBackground", O0.a);
        hashtable.put(dVar96.getName().toLowerCase(locale), dVar96);
        Wa.d dVar97 = new Wa.d("ReturnToForeground", O0.a);
        hashtable.put(dVar97.getName().toLowerCase(locale), dVar97);
        Wa.d dVar98 = new Wa.d("SetMaxWaitDialog", O0.a);
        dVar98.c("max", 2, false);
        hashtable.put(dVar98.getName().toLowerCase(locale), dVar98);
        Wa.d dVar99 = new Wa.d("UpdateWaitDialog", O0.a);
        dVar99.c("message", 1, false);
        dVar99.c("value", 2, false);
        hashtable.put(dVar99.getName().toLowerCase(locale), dVar99);
        Wa.d dVar100 = new Wa.d("AddCalendarItem", O0.a);
        dVar100.c("Title", 1, false);
        dVar100.c("Description", 1, false);
        dVar100.c("Location", 1, false);
        dVar100.c("DateStart", 4, false);
        dVar100.c("DateEnd", 4, false);
        hashtable.put(dVar100.getName().toLowerCase(locale), dVar100);
        Wa.d dVar101 = new Wa.d("IsSuperuserAvailable", O0.a);
        hashtable.put(dVar101.getName().toLowerCase(locale), dVar101);
        Wa.d dVar102 = new Wa.d("LaunchApp", O0.a);
        dVar102.c("appname", 1, false);
        dVar102.c("extras", 1, true);
        hashtable.put(dVar102.getName().toLowerCase(locale), dVar102);
        Wa.d dVar103 = new Wa.d("LaunchApplication", O0.a);
        dVar103.c("appname", 1, false);
        dVar103.c("extras", 1, true);
        hashtable.put(dVar103.getName().toLowerCase(locale), dVar103);
        Wa.d dVar104 = new Wa.d("SaveDrawing", O0.a);
        dVar104.c("propname", 1, false);
        dVar104.c("filename", 1, true);
        hashtable.put(dVar104.getName().toLowerCase(locale), dVar104);
        Wa.d dVar105 = new Wa.d("ClearDrawing", O0.a);
        dVar105.c("propname", 1, false);
        hashtable.put(dVar105.getName().toLowerCase(locale), dVar105);
        Wa.d dVar106 = new Wa.d("ScanDocument", O0.a);
        dVar106.c("params", 8, false);
        hashtable.put(dVar106.getName().toLowerCase(locale), dVar106);
        Wa.d dVar107 = new Wa.d("StartCamera", O0.a);
        dVar107.c("PropName", 1, false);
        dVar107.c("Type", 1, false);
        hashtable.put(dVar107.getName().toLowerCase(locale), dVar107);
        Wa.d dVar108 = new Wa.d("StartSignature", O0.a);
        dVar108.c("destinationproperty", 1, false);
        dVar108.c("maxwidth", 2, false);
        dVar108.c("maxheight", 2, false);
        dVar108.c("backgroundimage", 2, true);
        hashtable.put(dVar108.getName().toLowerCase(locale), dVar108);
        Wa.d dVar109 = new Wa.d("CaptureImage", O0.a);
        dVar109.c("TargetPropertyName", 1, false);
        dVar109.c("CapturePropertyName", 1, true);
        hashtable.put(dVar109.getName().toLowerCase(locale), dVar109);
        Wa.d dVar110 = new Wa.d("ShareData", O0.a);
        dVar110.c("subject", 1, false);
        dVar110.c("body", 1, false);
        dVar110.c("image", 1, false);
        hashtable.put(dVar110.getName().toLowerCase(locale), dVar110);
        Wa.d dVar111 = new Wa.d("SetInactivityTimer", O0.a);
        dVar111.c("params", 8, false);
        hashtable.put(dVar111.getName().toLowerCase(locale), dVar111);
        Wa.d dVar112 = new Wa.d("RemoveInactivityTimer", O0.a);
        hashtable.put(dVar112.getName().toLowerCase(locale), dVar112);
        Wa.d dVar113 = new Wa.d("GetInactivityTime", O0.a);
        hashtable.put(dVar113.getName().toLowerCase(locale), dVar113);
        Wa.d dVar114 = new Wa.d("Refresh", O0.a);
        dVar114.c("propertiesandframes", 1, false);
        hashtable.put(dVar114.getName().toLowerCase(locale), dVar114);
        Wa.d dVar115 = new Wa.d("RefreshAll", O0.a);
        dVar115.c("PropName", 1, false);
        hashtable.put(dVar115.getName().toLowerCase(locale), dVar115);
        Wa.d dVar116 = new Wa.d("RefreshContentSelectedRow", O0.a);
        dVar116.c("ContentName", 1, false);
        hashtable.put(dVar116.getName().toLowerCase(locale), dVar116);
        Wa.d dVar117 = new Wa.d("RefreshContentRow", O0.a);
        dVar117.c("ContentName", 1, false);
        dVar117.c("Row", 2, false);
        hashtable.put(dVar117.getName().toLowerCase(locale), dVar117);
        Wa.d dVar118 = new Wa.d("InjectJavascript", O0.a);
        dVar118.c("WebViewPropName", 1, false);
        dVar118.c("ScriptText", 1, false);
        hashtable.put(dVar118.getName().toLowerCase(locale), dVar118);
        Wa.d dVar119 = new Wa.d("DrawMapRoute", O0.a);
        dVar119.c("MapPropName", 1, false);
        dVar119.c("Latitude", 5, false);
        dVar119.c("Longitude", 5, false);
        hashtable.put(dVar119.getName().toLowerCase(locale), dVar119);
        Wa.d dVar120 = new Wa.d("IsApplicationInstalled", O0.a);
        dVar120.c("appname", 1, false);
        hashtable.put(dVar120.getName().toLowerCase(locale), dVar120);
        Wa.d dVar121 = new Wa.d("IsAppInstalled", O0.a);
        dVar121.c("appname", 1, false);
        hashtable.put(dVar121.getName().toLowerCase(locale), dVar121);
        Wa.d dVar122 = new Wa.d("UninstallApplication", O0.a);
        dVar122.c("appname", 1, false);
        hashtable.put(dVar122.getName().toLowerCase(locale), dVar122);
        Wa.d dVar123 = new Wa.d("UninstallApp", O0.a);
        dVar123.c("appname", 1, false);
        hashtable.put(dVar123.getName().toLowerCase(locale), dVar123);
        Wa.d dVar124 = new Wa.d("ReturnToMainMenu", O0.a);
        hashtable.put(dVar124.getName().toLowerCase(locale), dVar124);
        Wa.d dVar125 = new Wa.d("GetView", O0.a);
        dVar125.c("EditObject", 8, false);
        hashtable.put(dVar125.getName().toLowerCase(locale), dVar125);
        Wa.d dVar126 = new Wa.d("GetWindow", O0.a);
        dVar126.c("EditObject", 8, false);
        hashtable.put(dVar126.getName().toLowerCase(locale), dVar126);
        Wa.d dVar127 = new Wa.d("pickFile", O0.a);
        dVar127.c("PropName", 1, false);
        dVar127.c("Extension", 1, false);
        dVar127.c("PictureOnly", 1, false);
        hashtable.put(dVar127.getName().toLowerCase(locale), dVar127);
        Wa.d dVar128 = new Wa.d("RefreshValue", O0.a);
        dVar128.c("propertiesandframes", 1, false);
        hashtable.put(dVar128.getName().toLowerCase(locale), dVar128);
        Wa.d dVar129 = new Wa.d("SetSelection", O0.a);
        dVar129.c("position", 2, false);
        hashtable.put(dVar129.getName().toLowerCase(locale), dVar129);
        Wa.d dVar130 = new Wa.d("OpenEditView", O0.a);
        dVar130.c("EditObject", 8, false);
        hashtable.put(dVar130.getName().toLowerCase(locale), dVar130);
        Wa.d dVar131 = new Wa.d("ShowWaitDialog", O0.a);
        dVar131.c("Text", 1, true);
        dVar131.c("AnimationStyle", 1, true);
        dVar131.c("Color", 1, true);
        hashtable.put(dVar131.getName().toLowerCase(locale), dVar131);
        Wa.d dVar132 = new Wa.d("SetWaitDialogText", O0.a);
        dVar132.c("Text", 1, true);
        hashtable.put(dVar132.getName().toLowerCase(locale), dVar132);
        Wa.d dVar133 = new Wa.d("HideWaitDialog", O0.a);
        hashtable.put(dVar133.getName().toLowerCase(locale), dVar133);
        Wa.d dVar134 = new Wa.d("Relayout", O0.a);
        hashtable.put(dVar134.getName().toLowerCase(locale), dVar134);
        Wa.d dVar135 = new Wa.d("ShowConsoleReplica", O0.a);
        hashtable.put(dVar135.getName().toLowerCase(locale), dVar135);
        Wa.d dVar136 = new Wa.d("StartKioskMode", O0.a);
        hashtable.put(dVar136.getName().toLowerCase(locale), dVar136);
        Wa.d dVar137 = new Wa.d("StopKioskMode", O0.a);
        hashtable.put(dVar137.getName().toLowerCase(locale), dVar137);
        Wa.d dVar138 = new Wa.d("RestartApp", O0.a);
        hashtable.put(dVar138.getName().toLowerCase(locale), dVar138);
        Wa.d dVar139 = new Wa.d("IsOnCall", O0.a);
        hashtable.put(dVar139.getName().toLowerCase(locale), dVar139);
        Wa.d dVar140 = new Wa.d("SetMessageBoxResult", O0.a);
        dVar140.c("Option", 2, false);
        hashtable.put(dVar140.getName().toLowerCase(locale), dVar140);
        Wa.d dVar141 = new Wa.d("GarbageCollect", O0.a);
        hashtable.put(dVar141.getName().toLowerCase(locale), dVar141);
        Wa.d dVar142 = new Wa.d("DumpMemory", O0.a);
        hashtable.put(dVar142.getName().toLowerCase(locale), dVar142);
        Wa.d dVar143 = new Wa.d("IsInBackground", O0.a);
        hashtable.put(dVar143.getName().toLowerCase(locale), dVar143);
        Wa.d dVar144 = new Wa.d("IsInForeground", O0.a);
        hashtable.put(dVar144.getName().toLowerCase(locale), dVar144);
        Wa.d dVar145 = new Wa.d("IsDeviceLocked", O0.a);
        dVar145.c("Secure", 6, true);
        hashtable.put(dVar145.getName().toLowerCase(locale), dVar145);
        Wa.d dVar146 = new Wa.d("StartForegroundService", O0.a);
        dVar146.c("Title", 1, true);
        dVar146.c("Text", 1, true);
        hashtable.put(dVar146.getName().toLowerCase(locale), dVar146);
        Wa.d dVar147 = new Wa.d("StopForegroundService", O0.a);
        hashtable.put(dVar147.getName().toLowerCase(locale), dVar147);
        Wa.d dVar148 = new Wa.d("RequestAppReview", O0.a);
        hashtable.put(dVar148.getName().toLowerCase(locale), dVar148);
        Wa.d dVar149 = new Wa.d("StartDrag", O0.a);
        dVar149.c("Source", 1, false);
        dVar149.c("Data", 8, false);
        hashtable.put(dVar149.getName().toLowerCase(locale), dVar149);
        Wa.d dVar150 = new Wa.d("OpenReplicaConsole", O0.a);
        hashtable.put(dVar150.getName().toLowerCase(locale), dVar150);
        Wa.d dVar151 = new Wa.d("Exit", O0.a);
        hashtable.put(dVar151.getName().toLowerCase(locale), dVar151);
        return hashtable;
    }

    @ScriptAllowed
    public static boolean deleteShortcut(Object... objArr) {
        String Y;
        String str;
        if (objArr == null || objArr.length == 0) {
            Y = xoneApp.Z0().Y();
            str = Y;
        } else {
            Utils.g("DeleteShortcut", objArr, 2);
            Y = fb.t.y(objArr[0]);
            str = fb.t.y(objArr[1]);
        }
        return Utils.j0(xoneApp.Z0(), Y, str);
    }

    private synchronized int doInternalMessageBox(String str, String str2, int i) {
        int i2;
        try {
            try {
                this.bIsExecuting = true;
                this.nResponseButton = -1;
                getApp().a3(i, str2, str, "##DEFAULT##", null, 0);
                int i3 = 0;
                while (true) {
                    i2 = this.nResponseButton;
                    if (i2 >= 0 || !this.bIsExecuting || i3 >= MESSAGEBOX_TIMEOUT) {
                        break;
                    }
                    Thread.sleep(100L);
                    if (getApp().W1()) {
                        i3++;
                    }
                }
            } catch (InterruptedException e) {
                throw AbstractC0751f.e(e);
            }
        } finally {
            this.bIsExecuting = false;
        }
        return i2;
    }

    private boolean doInternalPlaySoundAndVibrate(B8.g gVar) {
        B8.e m = B8.e.m();
        m.B(gVar);
        m.x();
        m.h();
        return true;
    }

    private static void doLaunchLiveInternal(String str) {
        xoneApp app = getApp();
        Intent intent = new Intent();
        intent.setClassName(str, "com.xone.live.services.CheckServiceStatus");
        intent.setFlags(268435456);
        intent.setAction("android.intent.action.VIEW");
        try {
            app.startActivity(intent);
        } catch (Exception unused) {
            Utils.l("XOneAndroidFramework", "Exception when trying to launch XOneLive in package " + str + ". Suppressing exception.");
        }
    }

    private static void doStartCameraPermissionCheck(final XoneBaseActivity xoneBaseActivity, final boolean z, final boolean z2, final boolean z3, final int i, final int i2, final int i3, final int i4, final int i5, final Object obj, final Object obj2, final IXoneObject iXoneObject) {
        if (!C9.e.q(getApp(), "android.permission.CAMERA")) {
            new h.a().d(true).e(8003).f(getApp().getString(ha.v.b)).c(new C9.c() {
                @Override
                public final void a(Set set) {
                    XoneGlobalUI.f(z2, xoneBaseActivity, z, i, i2, i3, i4, obj, obj2, iXoneObject, z3, i5, set);
                }
            }).h("android.permission.CAMERA").a().i(xoneBaseActivity);
        } else if (z2) {
            startPhotoIntent(xoneBaseActivity, z, i, i2, i3, i4, obj, obj2, iXoneObject);
        } else if (z3) {
            startVideoIntent(xoneBaseActivity, z, obj, obj2, iXoneObject, i5, i);
        }
    }

    public static boolean e(View view, int i, KeyEvent keyEvent) {
        return i == 66;
    }

    public static void f(boolean z, XoneBaseActivity xoneBaseActivity, boolean z2, int i, int i2, int i3, int i4, Object obj, Object obj2, IXoneObject iXoneObject, boolean z3, int i5, Set set) {
        if (z) {
            startPhotoIntent(xoneBaseActivity, z2, i, i2, i3, i4, obj, obj2, iXoneObject);
        } else if (z3) {
            startVideoIntent(xoneBaseActivity, z2, obj, obj2, iXoneObject, i5, i);
        }
    }

    public static List<String> findXOneLiveApps(Context context) {
        Bundle bundle;
        List<PackageInfo> installedPackages = context.getApplicationContext().getPackageManager().getInstalledPackages(128);
        ArrayList arrayList = new ArrayList();
        for (PackageInfo packageInfo : installedPackages) {
            ApplicationInfo applicationInfo = packageInfo.applicationInfo;
            if (applicationInfo != null && (bundle = applicationInfo.metaData) != null && bundle.containsKey("isXOneLive") && bundle.getBoolean("isXOneLive")) {
                arrayList.add(packageInfo.packageName);
            }
        }
        return arrayList;
    }

    public static void g(XoneBaseActivity xoneBaseActivity, Object obj, IXoneObject iXoneObject, String str, TimePicker timePicker, int i, int i2) {
        if (xoneBaseActivity.c()) {
            return;
        }
        try {
            if (obj != null) {
                new K9.l((InterfaceC1038m0) xoneBaseActivity.getApplicationContext(), iXoneObject, false, obj, Integer.valueOf(i), Integer.valueOf(i2)).runSeriallyAsyncTask();
                return;
            }
            IXoneObject dataObject = xoneBaseActivity.getDataObject();
            if (dataObject == null) {
                return;
            }
            dataObject.put(str, Utils.F(String.valueOf(i), 2) + ":" + Utils.F(String.valueOf(i2), 2));
            xoneBaseActivity.refresh(str);
        } catch (Exception e) {
            xoneBaseActivity.b(e);
        }
    }

    private static ActivityManager getActivityManager() {
        return (ActivityManager) getService("activity");
    }

    private static AlarmManager getAlarmManager() {
        return (AlarmManager) getService("alarm");
    }

    private static xoneApp getApp() {
        return xoneApp.Z0();
    }

    private static IXoneApp getAppData() {
        return xoneApp.c1();
    }

    private static AudioManager getAudioManager() {
        return (AudioManager) getService("audio");
    }

    private static ConnectivityManager getConnectivityManager() {
        return (ConnectivityManager) getService("connectivity");
    }

    private <T extends View> T getControlInternal(String str) {
        InterfaceC1036l0 g = xoneApp.Z0().g();
        if (g == null) {
            return null;
        }
        return (T) g.j(str);
    }

    private static ua.C getGestureProperty(String str) {
        View findViewById;
        androidx.fragment.app.j jVar = (XoneBaseActivity) xoneApp.Z0().I0();
        if (jVar == null || (findViewById = jVar.findViewById(R.id.content)) == null) {
            return null;
        }
        return (ua.C) findViewById.findViewWithTag(str);
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static String getLastKnownLocation() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationLatitude(): Location permissions are not granted yet. Returning 0");
                return "0,0";
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return "0,0";
            }
            return lastKnownLocation.getLatitude() + "," + lastKnownLocation.getLongitude();
        } catch (Exception e) {
            e.printStackTrace();
            return "0,0";
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static float getLastKnownLocationAccuracy() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationAccuracy(): Location permissions are not granted yet. Returning 0");
                return 0.0f;
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return 0.0f;
            }
            return lastKnownLocation.getAccuracy();
        } catch (Exception e) {
            e.printStackTrace();
            return 0.0f;
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static double getLastKnownLocationAltitude() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationAltitude(): Location permissions are not granted yet. Returning 0");
                return 0.0d;
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return 0.0d;
            }
            return lastKnownLocation.getAltitude();
        } catch (Exception e) {
            e.printStackTrace();
            return 0.0d;
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static float getLastKnownLocationBearing() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationBearing(): Location permissions are not granted yet. Returning 0");
                return 0.0f;
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return 0.0f;
            }
            return lastKnownLocation.getBearing();
        } catch (Exception e) {
            e.printStackTrace();
            return 0.0f;
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static String getLastKnownLocationDateTime() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationDateTime(): Location permissions are not granted yet. Returning 0");
                return "";
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return "";
            }
            GregorianCalendar gregorianCalendar = new GregorianCalendar();
            gregorianCalendar.setTimeInMillis(lastKnownLocation.getTime());
            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(gregorianCalendar.getTime());
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static double getLastKnownLocationLatitude() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationLatitude(): Location permissions are not granted yet. Returning 0");
                return 0.0d;
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return 0.0d;
            }
            return lastKnownLocation.getLatitude();
        } catch (Exception e) {
            e.printStackTrace();
            return 0.0d;
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static double getLastKnownLocationLongitude() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationLongitude(): Location permissions are not granted yet. Returning 0");
                return 0.0d;
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return 0.0d;
            }
            return lastKnownLocation.getLongitude();
        } catch (Exception e) {
            e.printStackTrace();
            return 0.0d;
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static String getLastKnownLocationProvider() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationProvider(): Location permissions are not granted yet. Returning 0");
                return "";
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            return (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) ? "" : lastKnownLocation.getProvider();
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public static float getLastKnownLocationSpeed() {
        Location lastKnownLocation;
        try {
            if (!C9.e.q(xoneApp.Z0(), "android.permission.ACCESS_FINE_LOCATION")) {
                Utils.l("XOneAndroidFramework", "ui.getLastKnownLocationSpeed(): Location permissions are not granted yet. Returning 0");
                return 0.0f;
            }
            LocationManager locationManager = getLocationManager();
            Criteria criteria = new Criteria();
            criteria.setAccuracy(0);
            String bestProvider = locationManager.getBestProvider(criteria, true);
            if (TextUtils.isEmpty(bestProvider) || (lastKnownLocation = locationManager.getLastKnownLocation(bestProvider)) == null) {
                return 0.0f;
            }
            return lastKnownLocation.getSpeed();
        } catch (Exception e) {
            e.printStackTrace();
            return 0.0f;
        }
    }

    private static LocationManager getLocationManager() {
        return (LocationManager) getService("location");
    }

    private static EditFramePage getNewEditFramePage(IXoneObject iXoneObject) {
        int V;
        int l;
        if (iXoneObject == null) {
            throw new IllegalArgumentException("Data object cannot be null");
        }
        androidx.fragment.app.j g = xoneApp.Z0().g();
        if (g == null) {
            throw new IllegalArgumentException("Cannot find last edit view");
        }
        IXoneCollection ownerCollection = iXoneObject.getOwnerCollection();
        EditFramePage editFramePage = new EditFramePage(g);
        va.d viewLayout = ownerCollection.getViewLayout();
        if (viewLayout == null) {
            throw new IllegalStateException("Cannot obtain view layout for content " + ownerCollection.getName());
        }
        va.d d = viewLayout.d(1);
        List o = d.l().o();
        if (o.isEmpty()) {
            throw new IllegalArgumentException("Error, content " + ownerCollection.getName() + " does not have visible properties");
        }
        C1066a f = va.d.f(d.l().j((String) o.get(0)));
        if (g instanceof XoneBaseActivity) {
            XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) g;
            V = xoneBaseActivity.getMaxScreenWidth();
            l = xoneBaseActivity.getMaxScreenHeight();
        } else {
            xoneApp Z0 = xoneApp.Z0();
            V = Z0.V();
            l = Z0.l();
        }
        editFramePage.d0(f, null, iXoneObject, f.v(), -2, -2, V, l, 1, 100, 100);
        editFramePage.M();
        return editFramePage;
    }

    private static PackageManager getPackageManager() {
        return getApp().getPackageManager();
    }

    private static String getPrinterType(Object[] objArr) {
        if (objArr == null || objArr.length == 0) {
            return null;
        }
        String y = fb.t.y(objArr[0]);
        try {
            int parseInt = Integer.parseInt(y);
            String str = getAppData().getAppPath() + "/printer.xml";
            if (!new File(str).exists()) {
                return null;
            }
            C0731a c = C0731a.c();
            FileInputStream fileInputStream = new FileInputStream(str);
            try {
                c.b(xoneApp.Z0(), getAppData().getAppPath(), fileInputStream, false);
                Utils.N(fileInputStream);
                C0732b a2 = c.a();
                if (a2 == null) {
                    return null;
                }
                InterfaceC1034k0 childNodes = a2.getChildNodes();
                if (parseInt >= childNodes.count()) {
                    return null;
                }
                String w0 = childNodes.get(parseInt).w0("type");
                if (TextUtils.isEmpty(w0)) {
                    return null;
                }
                return w0.toLowerCase(Locale.US);
            } catch (Throwable th) {
                Utils.N(fileInputStream);
                throw th;
            }
        } catch (Exception unused) {
            return y;
        }
    }

    private ua.X getScriptRuntime() {
        return (ua.X) getAppData();
    }

    private IXoneObject getSelfObject() {
        Q0 m = XOneJavascript.m();
        if (m == null) {
            return null;
        }
        Object obj = m.get("self");
        if (obj instanceof IXoneObject) {
            return (IXoneObject) obj;
        }
        return null;
    }

    private static <T> T getService(String str) {
        T t = (T) xoneApp.Z0().getSystemService(str);
        if (t != null) {
            return t;
        }
        throw new NullPointerException("Cannot obtain service " + str);
    }

    private static TelephonyManager getTelephonyManager() {
        return (TelephonyManager) getService("phone");
    }

    public static File getTempFolder(Context context) {
        Context applicationContext = context.getApplicationContext();
        if (Utils.H2(applicationContext) >= 29 && Build.VERSION.SDK_INT >= 29) {
            return applicationContext.getCacheDir();
        }
        if (!C9.e.c(applicationContext, "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE")) {
            return applicationContext.getCacheDir();
        }
        File file = new File(Environment.getExternalStorageDirectory(), "xone/tmpfolder");
        if (file.exists() || file.mkdirs()) {
            return file;
        }
        if (file.canWrite()) {
            throw AbstractC0751f.c("Cannot create directory " + file.getAbsolutePath());
        }
        throw AbstractC0751f.c("Cannot create directory " + file.getAbsolutePath() + ", write permission for this folder is not granted");
    }

    private Vibrator getVibrator() {
        return (Vibrator) getService("vibrator");
    }

    private static Long getWhatsAppContactIdUsingNumber(Context context, String str) {
        Cursor query = context.getContentResolver().query(Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(str)), null, null, null, null);
        if (query != null) {
            try {
                if (query.getCount() > 0) {
                    query.moveToFirst();
                    query = context.getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, "contact_id = ? ", new String[]{Long.toString(query.getLong(query.getColumnIndex("contact_id")))}, null);
                    if (query == null) {
                        if (query != null) {
                            query.close();
                        }
                        return null;
                    }
                    while (query.moveToNext()) {
                        if (query.getString(query.getColumnIndex("mimetype")).equals("vnd.android.cursor.item/vnd.com.whatsapp.video.call")) {
                            Long valueOf = Long.valueOf(query.getLong(query.getColumnIndex("_id")));
                            query.close();
                            return valueOf;
                        }
                    }
                    return null;
                }
            } finally {
                query.close();
            }
        }
        if (query != null) {
            query.close();
        }
        return null;
    }

    private static WifiManager getWifiManager() {
        return (WifiManager) getService("wifi");
    }

    public static void h(XoneBaseActivity xoneBaseActivity, Object obj, IXoneObject iXoneObject, String str, DatePicker datePicker, int i, int i2, int i3) {
        if (xoneBaseActivity.c()) {
            return;
        }
        try {
            if (obj != null) {
                new K9.l((InterfaceC1038m0) xoneBaseActivity.getApplicationContext(), iXoneObject, false, obj, Integer.valueOf(i), Integer.valueOf(i2 + 1), Integer.valueOf(i3)).runSeriallyAsyncTask();
                return;
            }
            IXoneObject dataObject = xoneBaseActivity.getDataObject();
            if (dataObject == null) {
                return;
            }
            Calendar calendar = Calendar.getInstance();
            calendar.set(1, i);
            calendar.set(2, i2);
            calendar.set(5, i3);
            dataObject.put(str, calendar.getTime());
            xoneBaseActivity.refresh(str);
        } catch (Exception e) {
            xoneBaseActivity.b(e);
        }
    }

    @ScriptAllowed
    public static boolean hasDrawing(Object... objArr) {
        Utils.j("HasDrawing", objArr);
        Utils.g("HasDrawing", objArr, 1);
        ua.C gestureProperty = getGestureProperty(fb.t.y(objArr[0]));
        if (gestureProperty == null) {
            return false;
        }
        return gestureProperty.hasDrawing();
    }

    private static void invokeCallback(IXoneObject iXoneObject, Object obj, Object... objArr) {
        new K9.l((InterfaceC1038m0) xoneApp.Z0(), iXoneObject, false, obj, objArr).runSeriallyAsyncTask();
    }

    private static boolean isAppInLockTaskMode() {
        int lockTaskModeState;
        ActivityManager activityManager = getActivityManager();
        if (Build.VERSION.SDK_INT < 23) {
            return activityManager.isInLockTaskMode();
        }
        lockTaskModeState = activityManager.getLockTaskModeState();
        return lockTaskModeState != 0;
    }

    @ScriptAllowed
    public static int isAppInstalled(Object... objArr) {
        Utils.j("IsAppInstalled", objArr);
        Utils.g("IsAppInstalled", objArr, 1);
        try {
            getPackageManager().getApplicationInfo(fb.t.y(objArr[0]), 0);
            return 0;
        } catch (PackageManager.NameNotFoundException unused) {
            return -1;
        }
    }

    @ScriptAllowed
    @Deprecated
    public static int isApplicationInstalled(Object... objArr) {
        return isAppInstalled(objArr);
    }

    private static boolean isGooglePlayServicesAvailable() {
        return q3.j.o().g(xoneApp.Z0()) == 0;
    }

    private boolean isPrintServiceDead(La.a aVar) {
        try {
            aVar.A4();
            return false;
        } catch (DeadObjectException e) {
            e.printStackTrace();
            return true;
        }
    }

    private void isPrinterServerBinded() {
        if (!this.bWasStartPrintInvoked) {
            throw new IllegalStateException("StartPrint no ha sido invocado en primer lugar");
        }
        if (this.remotePrintService == null) {
            throw new IllegalStateException("StartPrint falló!");
        }
    }

    private static void isPrinterServerInstalled() {
        try {
            getPackageManager().getPackageInfo("com.xone.print.server", 0);
        } catch (PackageManager.NameNotFoundException unused) {
            throw new IOException(xoneApp.getContext().getString(AbstractC0568j.d0));
        }
    }

    public static void k(IXoneObject iXoneObject, Object obj, Exception exc) {
        exc.printStackTrace();
        invokeCallback(iXoneObject, obj, Utils.M2(exc));
    }

    public void lambda$prompt$1(EditText editText, DialogInterface dialogInterface, int i) {
        String obj = editText.getText().toString();
        this.sResultAux = obj;
        if (TextUtils.isEmpty(obj)) {
            this.sResultAux = "";
        }
        dialogInterface.dismiss();
    }

    public void lambda$prompt$2(DialogInterface dialogInterface, int i) {
        this.sResultAux = "##CANCELLED##";
        dialogInterface.dismiss();
    }

    public void lambda$prompt$3(Activity activity, Object[] objArr) {
        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
        final EditText editText = new EditText(activity);
        builder.setTitle("");
        String y = fb.t.y(objArr[0]);
        if (objArr.length == 2) {
            editText.setText(fb.t.y(objArr[1]));
        }
        builder.setMessage(y);
        editText.setInputType(128);
        editText.setMaxLines(1);
        editText.setOnKeyListener(new View.OnKeyListener() {
            @Override
            public final boolean onKey(View view, int i, KeyEvent keyEvent) {
                return XoneGlobalUI.e(view, i, keyEvent);
            }
        });
        builder.setView(editText);
        builder.setPositiveButton(AbstractC0568j.X, new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                XoneGlobalUI.this.lambda$prompt$1(editText, dialogInterface, i);
            }
        });
        builder.setNegativeButton(AbstractC0568j.f, new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                XoneGlobalUI.this.lambda$prompt$2(dialogInterface, i);
            }
        });
        builder.setCancelable(false);
        builder.create().show();
    }

    public void lambda$startGps$11(Object[] objArr, Set set) {
        doInternalStartGps(objArr);
    }

    @ScriptAllowed
    public static boolean launchApp(Object... objArr) {
        String str;
        Utils.j("LaunchApp", objArr);
        Utils.h("LaunchApp", objArr, 1, 2);
        Utils.l("XOneAndroidFramework", "Invoking XoneGlobalUI.launchApp()");
        final int i = 0;
        Object obj = objArr[0];
        if (obj instanceof C0932x0) {
            C0932x0 c0932x0 = (C0932x0) obj;
            str = Q8.k.E(c0932x0, "packageName", "");
            C0932x0 w = Q8.k.w(c0932x0, "extras", null);
            r8 = w != null ? Q8.k.d0(w) : null;
            i = Q8.k.o(c0932x0, "delay", 0);
        } else {
            String z = fb.t.z(obj, "");
            if (objArr.length >= 2) {
                String y = fb.t.y(objArr[1]);
                String[] split = y.split(";");
                if (!TextUtils.isEmpty(y)) {
                    for (String str2 : split) {
                        String[] split2 = str2.split("=");
                        if (split2.length != 2) {
                            throw new IllegalArgumentException("LaunchApp(): Error parsing extra");
                        }
                        if (r8 == null) {
                            r8 = new Bundle();
                        }
                        r8.putString(split2[0], split2[1]);
                    }
                }
            }
            str = z;
        }
        if (TextUtils.isEmpty(str)) {
            throw new IllegalArgumentException("LaunchApp(): Empty package name argument");
        }
        final Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage(str);
        if (launchIntentForPackage == null) {
            throw new PackageManager.NameNotFoundException("LaunchApp(): Application " + str + " is not installed");
        }
        if (isAppInLockTaskMode()) {
            launchIntentForPackage.setFlags(launchIntentForPackage.getFlags() & (-268435457));
        }
        if (r8 != null) {
            for (String str3 : r8.keySet()) {
                launchIntentForPackage.putExtra(str3, r8.getString(str3));
            }
        }
        if (i > 0) {
            new Thread(new Runnable() {
                @Override
                public final void run() {
                    XoneGlobalUI.launchApp(launchIntentForPackage, i);
                }
            }).start();
            return true;
        }
        xoneApp Z0 = xoneApp.Z0();
        androidx.fragment.app.j g = Z0.g();
        if (g == null) {
            Utils.l("XOneAndroidFramework", "XoneGlobalUI.launchApp(): Launching app from app context");
            Z0.startActivity(launchIntentForPackage);
            return true;
        }
        Utils.l("XOneAndroidFramework", "XoneGlobalUI.launchApp(): Launching app from activity context");
        g.startActivityForResult(launchIntentForPackage, 516);
        return true;
    }

    @ScriptAllowed
    public static boolean launchApplication(Object... objArr) {
        return launchApp(objArr);
    }

    private static void launchSceneViewerIntent(String str) {
        g.c S = getApp().S();
        if (S == null) {
            throw new NullPointerException("Cannot find activity");
        }
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse(str));
        intent.setPackage("com.google.ar.core");
        S.startActivity(intent);
    }

    public static void m(XoneBaseActivity xoneBaseActivity, String str, TimePickerDialog.OnTimeSetListener onTimeSetListener, int i, int i2, boolean z, String str2) {
        ?? r1;
        Exception exc;
        XoneBaseActivity xoneBaseActivity2;
        int q;
        if (xoneBaseActivity.c()) {
            return;
        }
        try {
            if (TextUtils.isEmpty(str)) {
                q = 0;
            } else {
                try {
                    q = AbstractC0665a.q(str);
                } catch (Exception e) {
                    exc = e;
                    xoneBaseActivity2 = xoneBaseActivity;
                    xoneBaseActivity2.b(exc);
                }
            }
            r1 = xoneBaseActivity;
        } catch (Exception e2) {
            e = e2;
            r1 = xoneBaseActivity;
        }
        try {
            TimePickerDialog timePickerDialog = new TimePickerDialog(r1, q, onTimeSetListener, i, i2, z);
            timePickerDialog.setTitle(str2);
            timePickerDialog.show();
        } catch (Exception e3) {
            e = e3;
            exc = e;
            xoneBaseActivity2 = r1;
            xoneBaseActivity2.b(exc);
        }
    }

    public static void n(XoneBaseActivity xoneBaseActivity, String str, DatePickerDialog.OnDateSetListener onDateSetListener, int i, int i2, int i3, String str2) {
        ?? r1;
        Exception exc;
        XoneBaseActivity xoneBaseActivity2;
        int q;
        if (xoneBaseActivity.c()) {
            return;
        }
        try {
            if (TextUtils.isEmpty(str)) {
                q = 0;
            } else {
                try {
                    q = AbstractC0665a.q(str);
                } catch (Exception e) {
                    exc = e;
                    xoneBaseActivity2 = xoneBaseActivity;
                    xoneBaseActivity2.b(exc);
                }
            }
            r1 = xoneBaseActivity;
        } catch (Exception e2) {
            e = e2;
            r1 = xoneBaseActivity;
        }
        try {
            DatePickerDialog datePickerDialog = new DatePickerDialog(r1, q, onDateSetListener, i, i2, i3);
            datePickerDialog.setTitle(str2);
            datePickerDialog.show();
        } catch (Exception e3) {
            e = e3;
            exc = e;
            xoneBaseActivity2 = r1;
            xoneBaseActivity2.b(exc);
        }
    }

    public static void o(IXoneObject iXoneObject, Object obj, File file, String str, Object obj2, Object obj3, androidx.activity.result.a aVar) {
        int b2 = aVar.b();
        if (b2 != -1) {
            if (b2 == 0) {
                invokeCallback(iXoneObject, obj3, new Object[0]);
                return;
            }
            invokeCallback(iXoneObject, obj3, "Unknown result code: " + b2);
            return;
        }
        try {
            B6.d a2 = B6.d.a(aVar.a());
            if (a2 == null) {
                invokeCallback(iXoneObject, obj, "Empty scan result");
                return;
            }
            List b3 = a2.b();
            if (b3 == null) {
                invokeCallback(iXoneObject, obj, "Empty page list result");
                return;
            }
            xoneApp app = getApp();
            ArrayList arrayList = new ArrayList();
            Iterator it = b3.iterator();
            while (it.hasNext()) {
                File c = fb.u.c(app, ((d.a) it.next()).a(), file, false, "scan_");
                File file2 = new File(c.getAbsolutePath() + ".jpg");
                if (!c.renameTo(file2)) {
                    throw new IOException(str + "(): Cannot rename file " + c.getAbsolutePath());
                }
                arrayList.add(file2.getName());
            }
            d.b c2 = a2.c();
            if (c2 != null) {
                File c3 = fb.u.c(app, c2.b(), file, false, "scan_");
                File file3 = new File(c3.getAbsolutePath() + ".pdf");
                if (!c3.renameTo(file3)) {
                    throw new IOException(str + "(): Cannot rename file " + c3.getAbsolutePath());
                }
                arrayList.add(file3.getName());
            }
            invokeCallback(iXoneObject, obj2, Q8.m.u(arrayList));
        } catch (Exception e) {
            e.printStackTrace();
            invokeCallback(iXoneObject, obj, Utils.M2(e));
        }
    }

    private void releaseService() {
        if (this.connPrinter == null) {
            Utils.l("XOneAndroidFramework", "Cannot unbind - service not bound");
        } else {
            xoneApp.getContext().unbindService(this.connPrinter);
            Utils.l("XOneAndroidFramework", "releaseService()");
        }
    }

    @ScriptAllowed
    public static boolean saveDrawing(Object... objArr) {
        String str;
        Utils.j("SaveDrawing", objArr);
        if (objArr.length != 1 && objArr.length != 2) {
            Utils.g("SaveDrawing", objArr, 1);
        }
        String y = fb.t.y(objArr[0]);
        if (objArr.length == 2) {
            str = fb.t.y(objArr[1]);
            if (TextUtils.isEmpty(str)) {
                throw new NullPointerException("SaveDrawing(): sFileName == null");
            }
        } else {
            str = null;
        }
        ua.C gestureProperty = getGestureProperty(y);
        if (gestureProperty == null) {
            return false;
        }
        return gestureProperty.saveDrawing(str);
    }

    @ScriptAllowed
    public static int sendMail(Object... objArr) {
        String y;
        String y2;
        String y3;
        String y4;
        String str;
        Utils.j("SendMail", objArr);
        Utils.h("SendMail", objArr, 1, 5);
        Object obj = objArr[0];
        if (obj instanceof C0932x0) {
            C0932x0 c0932x0 = (C0932x0) obj;
            str = Q8.k.E(c0932x0, "to", "");
            y = Q8.k.E(c0932x0, "cc", "");
            y2 = Q8.k.E(c0932x0, "subject", "");
            y3 = Q8.k.E(c0932x0, "text", "");
            y4 = Q8.k.E(c0932x0, "attachments", "");
        } else {
            String y5 = fb.t.y(obj);
            y = fb.t.y(objArr[1]);
            y2 = fb.t.y(objArr[2]);
            y3 = fb.t.y(objArr[3]);
            y4 = objArr.length == 5 ? fb.t.y(objArr[4]) : null;
            str = y5;
        }
        String[] split = str.split(";");
        String[] split2 = TextUtils.isEmpty(y) ? new String[0] : y.split(";");
        Intent intent = new Intent("android.intent.action.SEND");
        intent.putExtra("android.intent.extra.EMAIL", split);
        if (split2.length > 0) {
            intent.putExtra("android.intent.extra.CC", split2);
        }
        if (!TextUtils.isEmpty(y2)) {
            intent.putExtra("android.intent.extra.SUBJECT", y2);
        }
        intent.putExtra("android.intent.extra.TEXT", y3);
        intent.setType("message/rfc882");
        xoneApp Z0 = xoneApp.Z0();
        String Y = Z0.Y();
        String T = Z0.T();
        if (!TextUtils.isEmpty(y4)) {
            String[] split3 = y4.split(";");
            if (split3.length == 1) {
                File x1 = Utils.x1(Y, T, split3[0], false);
                if (!x1.exists()) {
                    throw new FileNotFoundException("File " + split3[0] + " doesn't exist");
                }
                intent.putExtra("android.intent.extra.STREAM", Utils.B1(Z0, x1));
            } else if (split3.length > 1) {
                intent.setAction("android.intent.action.SEND_MULTIPLE");
                ArrayList<? extends Parcelable> arrayList = new ArrayList<>();
                for (String str2 : split3) {
                    File x12 = Utils.x1(Y, T, str2, false);
                    if (!x12.exists()) {
                        throw new FileNotFoundException("File " + str2 + " doesn't exist");
                    }
                    arrayList.add(Utils.B1(Z0, x12));
                }
                intent.putParcelableArrayListExtra("android.intent.extra.STREAM", arrayList);
            }
        }
        intent.setType("message/rfc882");
        Intent createChooser = Intent.createChooser(intent, Z0.getString(AbstractC0568j.p));
        g.c S = Z0.S();
        if (S != null) {
            S.startActivity(createChooser);
            return 0;
        }
        throw new NullPointerException("SendMail(): Cannot find activity");
    }

    @ScriptAllowed
    @Deprecated
    public static Object sendSMS(Object... objArr) {
        IRuntimeObject a2 = getApp().a("smsservice");
        if (a2 != null) {
            return a2.Invoke("send", EnumC0975b.Method, objArr);
        }
        throw new NullPointerException("smsObject == null");
    }

    @ScriptAllowed
    @Deprecated
    public static Object sendSMSRetryIfNetworkIsDown(Object... objArr) {
        IRuntimeObject a2 = getApp().a("smsservice");
        if (a2 != null) {
            return a2.Invoke("sendRetry", EnumC0975b.Method, objArr);
        }
        throw new NullPointerException("smsObject == null");
    }

    @ScriptAllowed
    public static Object sendSms(Object... objArr) {
        IRuntimeObject a2 = getApp().a("smsservice");
        if (a2 != null) {
            return a2.Invoke("send", EnumC0975b.Method, objArr);
        }
        throw new NullPointerException("smsObject == null");
    }

    @ScriptAllowed
    public static Object sendSmsRetryIfNetworkIsDown(Object... objArr) {
        IRuntimeObject a2 = getApp().a("smsservice");
        if (a2 != null) {
            return a2.Invoke("sendRetry", EnumC0975b.Method, objArr);
        }
        throw new NullPointerException("smsObject == null");
    }

    private static void showConfirmationOverlay(final Activity activity, final CharSequence charSequence, final int i, final String str) {
        if (Utils.s3()) {
            showConfirmationOverlayInternal(activity, charSequence, i, str);
        } else {
            fa.j.m(new Runnable() {
                @Override
                public final void run() {
                    XoneGlobalUI.showConfirmationOverlayInternal(activity, charSequence, i, str);
                }
            });
        }
    }

    public static void showConfirmationOverlayInternal(Activity activity, CharSequence charSequence, int i, String str) {
        C1.d dVar = new C1.d();
        dVar.g(toConfirmationOverlayAnimation(str));
        dVar.e(i);
        dVar.f(charSequence);
        dVar.i(activity);
    }

    @ScriptAllowed
    public static boolean sleep(Object... objArr) {
        Utils.j("Sleep", objArr);
        Utils.g("Sleep", objArr, 1);
        float l = fb.q.l(objArr[0]);
        if (l <= 0.0f) {
            return false;
        }
        TimeUnit.MILLISECONDS.sleep((long) (l * 1000.0f));
        return true;
    }

    @ScriptAllowed
    public static boolean startLive(Object... objArr) {
        Utils.h("StartLive", objArr, 0, 1);
        if (objArr != null && objArr.length >= 1) {
            String z = fb.t.z(objArr[0], null);
            if (!TextUtils.isEmpty(z)) {
                doLaunchLiveInternal(z);
                return true;
            }
            throw new IllegalArgumentException("StartLive(): Empty package name");
        }
        if (xoneApp.Z0().a2()) {
            doLaunchLiveInternal(xoneApp.Z0().getPackageName());
            return true;
        }
        List<String> findXOneLiveApps = findXOneLiveApps(getApp());
        if (findXOneLiveApps.isEmpty()) {
            return false;
        }
        Iterator<String> it = findXOneLiveApps.iterator();
        while (it.hasNext()) {
            doLaunchLiveInternal(it.next());
        }
        return true;
    }

    public static void startPhotoIntent(XoneBaseActivity xoneBaseActivity, boolean z, int i, int i2, int i3, int i4, Object obj, Object obj2, IXoneObject iXoneObject) {
        File file = new File(getTempFolder(xoneBaseActivity), "ph_" + UUID.randomUUID().toString() + ".jpg");
        xoneBaseActivity.t5(file);
        xoneBaseActivity.W4(obj);
        xoneBaseActivity.V4(obj2);
        xoneBaseActivity.X4(iXoneObject);
        xoneBaseActivity.T4(i);
        xoneBaseActivity.U4(i2);
        xoneBaseActivity.S4(i3);
        xoneBaseActivity.R4(i4);
        Uri B1 = Utils.B1(getApp(), file);
        Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
        if (z) {
            intent.setClass(getApp(), CameraActivity.class);
        }
        intent.putExtra("output", B1);
        intent.addFlags(16777216);
        if (Build.VERSION.SDK_INT <= 21) {
            intent.setClipData(ClipData.newRawUri("", B1));
            intent.addFlags(1);
            intent.addFlags(2);
        }
        try {
            xoneBaseActivity.startActivityForResult(intent, 508);
        } catch (ActivityNotFoundException unused) {
            throw new C0736a(AbstractC0568j.e);
        }
    }

    @ScriptAllowed
    public static boolean startReplica() {
        return Utils.k4(getApp(), "FrameworkGlobalUI", null, null);
    }

    @ScriptAllowed
    public static boolean startScanner(Object... objArr) {
        Utils.j("StartScanner", objArr);
        Utils.h("StartScanner", objArr, 1, 3);
        Object obj = objArr[0];
        if (!(obj instanceof C0932x0)) {
            String y = fb.t.y(obj);
            String y2 = objArr.length >= 3 ? fb.t.y(objArr[2]) : null;
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("codeType", "");
            jSONObject.put("scanRectangle", true);
            jSONObject.put("confirmPicture", false);
            return getApp().i3(y, y2, jSONObject);
        }
        C0932x0 c0932x0 = (C0932x0) obj;
        String E = Q8.k.E(c0932x0, "mode", "manual");
        String E2 = Q8.k.E(c0932x0, "type", "");
        Object obj2 = c0932x0.get("onCodeScanned");
        if (Build.MANUFACTURER.equals("SNOPOW") && Build.MODEL.equals("M9_LTE")) {
            C1073c.n(E, obj2);
            return true;
        }
        String E3 = Q8.k.E(c0932x0, "codeType", "");
        boolean a2 = Q8.k.a(c0932x0, "scanRectangle", true);
        boolean a3 = Q8.k.a(c0932x0, "confirmPicture", true);
        JSONObject jSONObject2 = new JSONObject();
        jSONObject2.put("codeType", E3);
        jSONObject2.put("scanRectangle", a2);
        jSONObject2.put("confirmPicture", a3);
        return getApp().h3(E2, obj2, jSONObject2);
    }

    private static void startSignIntent(Activity activity, long j, int i, int i2, File file, String str, String str2) {
        Intent intent = new Intent(activity, (Class<?>) XoneSignActivity.class);
        intent.setAction("android.intent.action.MAIN");
        intent.putExtra("screen-orientation", str);
        intent.putExtra("interval", j);
        intent.putExtra("file-maxwidth", i);
        intent.putExtra("file-maxheight", i2);
        if (file != null) {
            intent.putExtra("imgbk", file.toString());
        }
        intent.putExtra("stroke-color", str2);
        activity.startActivityForResult(intent, 505);
    }

    @com.xone.annotations.ScriptAllowed
    public static int startSignature(java.lang.Object... r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.xone.android.framework.XoneGlobalUI.startSignature(java.lang.Object[]):int");
    }

    public static void startVideoIntent(XoneBaseActivity xoneBaseActivity, boolean z, Object obj, Object obj2, IXoneObject iXoneObject, int i, int i2) {
        File file = new File(getTempFolder(xoneBaseActivity), "vd_" + UUID.randomUUID().toString() + ".3gp");
        xoneBaseActivity.t5(file);
        xoneBaseActivity.W4(obj);
        xoneBaseActivity.V4(obj2);
        xoneBaseActivity.X4(iXoneObject);
        Uri B1 = Utils.B1(getApp(), file);
        Intent intent = new Intent("android.media.action.VIDEO_CAPTURE");
        if (z) {
            intent.setClass(getApp(), CameraActivity.class);
        }
        intent.putExtra("output", B1);
        intent.addFlags(16777216);
        if (Build.VERSION.SDK_INT <= 21) {
            intent.setClipData(ClipData.newRawUri("", B1));
            intent.addFlags(1);
            intent.addFlags(2);
        }
        if (i > 0) {
            intent.putExtra("android.intent.extra.durationLimit", i);
        }
        if (i2 > 0) {
            intent.putExtra("android.intent.extra.sizeLimit", i2);
        }
        try {
            xoneBaseActivity.startActivityForResult(intent, 504);
        } catch (ActivityNotFoundException unused) {
            throw new C0736a(AbstractC0568j.e);
        }
    }

    @ScriptAllowed
    public static boolean startWhatsAppVideoCall(Object... objArr) {
        Long whatsAppContactIdUsingNumber;
        Utils.g("StartWhatsAppVideoCall", objArr, 1);
        String y = fb.t.y(objArr[0]);
        if (TextUtils.isEmpty(y)) {
            throw new IllegalArgumentException("StartWhatsAppVideoCall(): Empty phone number");
        }
        xoneApp Z0 = xoneApp.Z0();
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) Z0.g();
        if (xoneBaseActivity == null || (whatsAppContactIdUsingNumber = getWhatsAppContactIdUsingNumber(Z0, y)) == null) {
            return false;
        }
        Intent intent = new Intent();
        intent.setAction("android.intent.action.VIEW");
        intent.setDataAndType(Uri.parse("content://com.android.contacts/data/" + whatsAppContactIdUsingNumber), "vnd.android.cursor.item/vnd.com.whatsapp.video.call");
        intent.setPackage("com.whatsapp");
        xoneBaseActivity.startActivity(intent);
        return true;
    }

    @ScriptAllowed
    public static boolean stopReplica() {
        return Utils.k4(getApp(), "FrameworkGlobalUI", "com.xone.android.framework.replica.stop", null);
    }

    private static int toConfirmationOverlayAnimation(String str) {
        if (TextUtils.isEmpty(str)) {
            return 0;
        }
        str.getClass();
        switch (str) {
        }
        return 0;
    }

    private static Calendar toDate(Object obj) {
        return obj instanceof C0907k0 ? Q8.m.n((C0907k0) obj) : fb.r.m(obj);
    }

    @ScriptAllowed
    public static int uninstallApp(Object... objArr) {
        Utils.j("UninstallApp", objArr);
        Utils.g("UninstallApp", objArr, 1);
        Intent intent = new Intent("android.intent.action.UNINSTALL_PACKAGE", Uri.parse("package:" + fb.t.y(objArr[0])));
        intent.addFlags(268435456);
        xoneApp.getContext().startActivity(intent);
        return 0;
    }

    @ScriptAllowed
    @Deprecated
    public static int uninstallApplication(Object... objArr) {
        return uninstallApp(objArr);
    }

    @Override
    public ua.W GetTypeInfo(String str) {
        String lowerCase = str.toLowerCase(Locale.US);
        Map<String, ua.W> map = mapTypeInfo;
        if (map.containsKey(lowerCase)) {
            return map.get(lowerCase);
        }
        return null;
    }

    @Override
    public Object Invoke(String str, EnumC0975b enumC0975b, Object[] objArr) {
        char c;
        String lowerCase = str.toLowerCase(Locale.US);
        lowerCase.getClass();
        switch (lowerCase.hashCode()) {
            case -2128809834:
                if (lowerCase.equals("startdrag")) {
                    c = 0;
                    break;
                }
                c = 65535;
                break;
            case -2128579506:
                if (lowerCase.equals("startlive")) {
                    c = 1;
                    break;
                }
                c = 65535;
                break;
            case -2128252297:
                if (lowerCase.equals("startwifi")) {
                    c = 2;
                    break;
                }
                c = 65535;
                break;
            case -2116629864:
                if (lowerCase.equals("scandocument")) {
                    c = 3;
                    break;
                }
                c = 65535;
                break;
            case -1924665616:
                if (lowerCase.equals("recognizespeech")) {
                    c = 4;
                    break;
                }
                c = 65535;
                break;
            case -1895992926:
                if (lowerCase.equals("showgroup")) {
                    c = 5;
                    break;
                }
                c = 65535;
                break;
            case -1884327576:
                if (lowerCase.equals("stopgps")) {
                    c = 6;
                    break;
                }
                c = 65535;
                break;
            case -1884090038:
                if (lowerCase.equals("showtoast")) {
                    c = 7;
                    break;
                }
                c = 65535;
                break;
            case -1859183013:
                if (lowerCase.equals("playsound")) {
                    c = '\b';
                    break;
                }
                c = 65535;
                break;
            case -1858254541:
                if (lowerCase.equals("printbarcode")) {
                    c = '\t';
                    break;
                }
                c = 65535;
                break;
            case -1854922122:
                if (lowerCase.equals("stopreplica")) {
                    c = '\n';
                    break;
                }
                c = 65535;
                break;
            case -1805866760:
                if (lowerCase.equals("getlastknownlocationlatitude")) {
                    c = 11;
                    break;
                }
                c = 65535;
                break;
            case -1796556999:
                if (lowerCase.equals("printbidi")) {
                    c = '\f';
                    break;
                }
                c = 65535;
                break;
            case -1796258783:
                if (lowerCase.equals("printline")) {
                    c = '\r';
                    break;
                }
                c = 65535;
                break;
            case -1783832177:
                if (lowerCase.equals("shareddata")) {
                    c = 14;
                    break;
                }
                c = 65535;
                break;
            case -1775178318:
                if (lowerCase.equals("restartapp")) {
                    c = 15;
                    break;
                }
                c = 65535;
                break;
            case -1685219779:
                if (lowerCase.equals("isinbackground")) {
                    c = 16;
                    break;
                }
                c = 65535;
                break;
            case -1660695924:
                if (lowerCase.equals("setwaitdialogtext")) {
                    c = 17;
                    break;
                }
                c = 65535;
                break;
            case -1635779308:
                if (lowerCase.equals("checkgpsstatus")) {
                    c = 18;
                    break;
                }
                c = 65535;
                break;
            case -1631602270:
                if (lowerCase.equals("getlastknownlocationbearing")) {
                    c = 19;
                    break;
                }
                c = 65535;
                break;
            case -1593292653:
                if (lowerCase.equals("setplaysoundvolume")) {
                    c = 20;
                    break;
                }
                c = 65535;
                break;
            case -1581565943:
                if (lowerCase.equals("sharedata")) {
                    c = 21;
                    break;
                }
                c = 65535;
                break;
            case -1579878247:
                if (lowerCase.equals("stopplaysound")) {
                    c = 22;
                    break;
                }
                c = 65535;
                break;
            case -1573037563:
                if (lowerCase.equals("startaudiorecord")) {
                    c = 23;
                    break;
                }
                c = 65535;
                break;
            case -1565866621:
                if (lowerCase.equals("startgpsv1")) {
                    c = 24;
                    break;
                }
                c = 65535;
                break;
            case -1565866620:
                if (lowerCase.equals("startgpsv2")) {
                    c = 25;
                    break;
                }
                c = 65535;
                break;
            case -1564116157:
                if (lowerCase.equals("returntomainmenu")) {
                    c = 26;
                    break;
                }
                c = 65535;
                break;
            case -1557505141:
                if (lowerCase.equals("startprint")) {
                    c = 27;
                    break;
                }
                c = 65535;
                break;
            case -1538765939:
                if (lowerCase.equals("removeinactivitytimer")) {
                    c = 28;
                    break;
                }
                c = 65535;
                break;
            case -1479475930:
                if (lowerCase.equals("sendsmsretryifnetworkisdown")) {
                    c = 29;
                    break;
                }
                c = 65535;
                break;
            case -1425787385:
                if (lowerCase.equals("startcamera")) {
                    c = 30;
                    break;
                }
                c = 65535;
                break;
            case -1413897001:
                if (lowerCase.equals("getinactivitytime")) {
                    c = 31;
                    break;
                }
                c = 65535;
                break;
            case -1353383299:
                if (lowerCase.equals("getlastknownlocationprovider")) {
                    c = ' ';
                    break;
                }
                c = 65535;
                break;
            case -1284726122:
                if (lowerCase.equals("startsignature")) {
                    c = '!';
                    break;
                }
                c = 65535;
                break;
            case -1280760611:
                if (lowerCase.equals("msgboxex")) {
                    c = '\"';
                    break;
                }
                c = 65535;
                break;
            case -1272902145:
                if (lowerCase.equals("uninstallapp")) {
                    c = '#';
                    break;
                }
                c = 65535;
                break;
            case -1263172891:
                if (lowerCase.equals("openurl")) {
                    c = '$';
                    break;
                }
                c = 65535;
                break;
            case -1190252381:
                if (lowerCase.equals("isappinstalled")) {
                    c = '%';
                    break;
                }
                c = 65535;
                break;
            case -1166318811:
                if (lowerCase.equals("printpdf")) {
                    c = '&';
                    break;
                }
                c = 65535;
                break;
            case -1155689814:
                if (lowerCase.equals("iswificonnected")) {
                    c = '\'';
                    break;
                }
                c = 65535;
                break;
            case -1155540802:
                if (lowerCase.equals("shownotificationchannelsettings")) {
                    c = '(';
                    break;
                }
                c = 65535;
                break;
            case -1143056630:
                if (lowerCase.equals("isdevicelocked")) {
                    c = ')';
                    break;
                }
                c = 65535;
                break;
            case -1065018710:
                if (lowerCase.equals("msgbox")) {
                    c = '*';
                    break;
                }
                c = 65535;
                break;
            case -1047731222:
                if (lowerCase.equals("startkioskmode")) {
                    c = '+';
                    break;
                }
                c = 65535;
                break;
            case -979805852:
                if (lowerCase.equals("prompt")) {
                    c = ',';
                    break;
                }
                c = 65535;
                break;
            case -975039734:
                if (lowerCase.equals("requestappreview")) {
                    c = '-';
                    break;
                }
                c = 65535;
                break;
            case -952709016:
                if (lowerCase.equals("shownotification")) {
                    c = '.';
                    break;
                }
                c = 65535;
                break;
            case -922635212:
                if (lowerCase.equals("lockgroup")) {
                    c = '/';
                    break;
                }
                c = 65535;
                break;
            case -855535003:
                if (lowerCase.equals("stopaudiorecord")) {
                    c = '0';
                    break;
                }
                c = 65535;
                break;
            case -854195781:
                if (lowerCase.equals("unlockgroup")) {
                    c = '1';
                    break;
                }
                c = 65535;
                break;
            case -792415149:
                if (lowerCase.equals("playsoundandvibrate")) {
                    c = '2';
                    break;
                }
                c = 65535;
                break;
            case -788572208:
                if (lowerCase.equals("hidesoftwarekeyboard")) {
                    c = '3';
                    break;
                }
                c = 65535;
                break;
            case -738886371:
                if (lowerCase.equals("pickfile")) {
                    c = '4';
                    break;
                }
                c = 65535;
                break;
            case -721150638:
                if (lowerCase.equals("executeactionafterdelay")) {
                    c = '5';
                    break;
                }
                c = 65535;
                break;
            case -704595434:
                if (lowerCase.equals("startreplica")) {
                    c = '6';
                    break;
                }
                c = 65535;
                break;
            case -694833231:
                if (lowerCase.equals("drawmaproute")) {
                    c = '7';
                    break;
                }
                c = 65535;
                break;
            case -681896290:
                if (lowerCase.equals("makephonecall")) {
                    c = '8';
                    break;
                }
                c = 65535;
                break;
            case -675097202:
                if (lowerCase.equals("launchapp")) {
                    c = '9';
                    break;
                }
                c = 65535;
                break;
            case -674972555:
                if (lowerCase.equals("dismissnotification")) {
                    c = ':';
                    break;
                }
                c = 65535;
                break;
            case -671006490:
                if (lowerCase.equals("signdataobject")) {
                    c = ';';
                    break;
                }
                c = 65535;
                break;
            case -643991806:
                if (lowerCase.equals("showsnackbar")) {
                    c = '<';
                    break;
                }
                c = 65535;
                break;
            case -638177365:
                if (lowerCase.equals("togglegroup")) {
                    c = '=';
                    break;
                }
                c = 65535;
                break;
            case -614769606:
                if (lowerCase.equals("showkeyboardoptions")) {
                    c = '>';
                    break;
                }
                c = 65535;
                break;
            case -582582797:
                if (lowerCase.equals("getmaxsoundvolumen")) {
                    c = '?';
                    break;
                }
                c = 65535;
                break;
            case -574275586:
                if (lowerCase.equals("printcommand")) {
                    c = '@';
                    break;
                }
                c = 65535;
                break;
            case -554281187:
                if (lowerCase.equals("relayout")) {
                    c = 'A';
                    break;
                }
                c = 65535;
                break;
            case -510900084:
                if (lowerCase.equals("getlastknownlocation")) {
                    c = 'B';
                    break;
                }
                c = 65535;
                break;
            case -504109370:
                if (lowerCase.equals("openfile")) {
                    c = 'C';
                    break;
                }
                c = 65535;
                break;
            case -503904599:
                if (lowerCase.equals("openmenu")) {
                    c = 'D';
                    break;
                }
                c = 65535;
                break;
            case -423274223:
                if (lowerCase.equals("stopplaysoundandvibrate")) {
                    c = 'E';
                    break;
                }
                c = 65535;
                break;
            case -393484870:
                if (lowerCase.equals("showwaitdialog")) {
                    c = 'F';
                    break;
                }
                c = 65535;
                break;
            case -354686817:
                if (lowerCase.equals("msgboxwithsound")) {
                    c = 'G';
                    break;
                }
                c = 65535;
                break;
            case -321833754:
                if (lowerCase.equals("refreshall")) {
                    c = 'H';
                    break;
                }
                c = 65535;
                break;
            case -268251143:
                if (lowerCase.equals("openeditview")) {
                    c = 'I';
                    break;
                }
                c = 65535;
                break;
            case -211038150:
                if (lowerCase.equals("movetobackground")) {
                    c = 'J';
                    break;
                }
                c = 65535;
                break;
            case -100644880:
                if (lowerCase.equals("startforegroundservice")) {
                    c = 'K';
                    break;
                }
                c = 65535;
                break;
            case -74109189:
                if (lowerCase.equals("getview")) {
                    c = 'L';
                    break;
                }
                c = 65535;
                break;
            case -25522314:
                if (lowerCase.equals("refreshvalue")) {
                    c = 'M';
                    break;
                }
                c = 65535;
                break;
            case -18792997:
                if (lowerCase.equals("getmaxsoundvolume")) {
                    c = 'N';
                    break;
                }
                c = 65535;
                break;
            case -5726430:
                if (lowerCase.equals("iswifienabled")) {
                    c = 'O';
                    break;
                }
                c = 65535;
                break;
            case 3127582:
                if (lowerCase.equals("exit")) {
                    c = 'P';
                    break;
                }
                c = 65535;
                break;
            case 32510425:
                if (lowerCase.equals("playsoundvolumen")) {
                    c = 'Q';
                    break;
                }
                c = 65535;
                break;
            case 38899695:
                if (lowerCase.equals("setinactivitytimer")) {
                    c = 'R';
                    break;
                }
                c = 65535;
                break;
            case 106934957:
                if (lowerCase.equals("print")) {
                    c = 'S';
                    break;
                }
                c = 65535;
                break;
            case 109522647:
                if (lowerCase.equals("sleep")) {
                    c = 'T';
                    break;
                }
                c = 65535;
                break;
            case 109641682:
                if (lowerCase.equals("speak")) {
                    c = 'U';
                    break;
                }
                c = 65535;
                break;
            case 111861596:
                if (lowerCase.equals("startscanner")) {
                    c = 'V';
                    break;
                }
                c = 65535;
                break;
            case 120234142:
                if (lowerCase.equals("setnotificationled")) {
                    c = 'W';
                    break;
                }
                c = 65535;
                break;
            case 139472699:
                if (lowerCase.equals("getlastknownlocationspeed")) {
                    c = 'X';
                    break;
                }
                c = 65535;
                break;
            case 147888846:
                if (lowerCase.equals("printimage")) {
                    c = 'Y';
                    break;
                }
                c = 65535;
                break;
            case 198690196:
                if (lowerCase.equals("askuserforgpspermission")) {
                    c = 'Z';
                    break;
                }
                c = 65535;
                break;
            case 224542001:
                if (lowerCase.equals("cleardrawing")) {
                    c = '[';
                    break;
                }
                c = 65535;
                break;
            case 242594420:
                if (lowerCase.equals("ensurevisible")) {
                    c = '\\';
                    break;
                }
                c = 65535;
                break;
            case 311086522:
                if (lowerCase.equals("setlanguage")) {
                    c = ']';
                    break;
                }
                c = 65535;
                break;
            case 323750215:
                if (lowerCase.equals("getcontrol")) {
                    c = '^';
                    break;
                }
                c = 65535;
                break;
            case 360677259:
                if (lowerCase.equals("showsoftwarekeyboard")) {
                    c = '_';
                    break;
                }
                c = 65535;
                break;
            case 399666350:
                if (lowerCase.equals("getlanguage")) {
                    c = '`';
                    break;
                }
                c = 65535;
                break;
            case 408175445:
                if (lowerCase.equals("garbagecollect")) {
                    c = 'a';
                    break;
                }
                c = 65535;
                break;
            case 424682849:
                if (lowerCase.equals("refreshcontentselectedrow")) {
                    c = 'b';
                    break;
                }
                c = 65535;
                break;
            case 438000237:
                if (lowerCase.equals("issuperuseravailable")) {
                    c = 'c';
                    break;
                }
                c = 65535;
                break;
            case 447656553:
                if (lowerCase.equals("openreplicaconsole")) {
                    c = 'd';
                    break;
                }
                c = 65535;
                break;
            case 451310959:
                if (lowerCase.equals("vibrate")) {
                    c = 'e';
                    break;
                }
                c = 65535;
                break;
            case 510716269:
                if (lowerCase.equals("getcountrycode")) {
                    c = 'f';
                    break;
                }
                c = 65535;
                break;
            case 515424578:
                if (lowerCase.equals("createshortcut")) {
                    c = 'g';
                    break;
                }
                c = 65535;
                break;
            case 550583834:
                if (lowerCase.equals("canopen")) {
                    c = 'h';
                    break;
                }
                c = 65535;
                break;
            case 577668711:
                if (lowerCase.equals("isoncall")) {
                    c = 'i';
                    break;
                }
                c = 65535;
                break;
            case 614664147:
                if (lowerCase.equals("getsoundvolume")) {
                    c = 'j';
                    break;
                }
                c = 65535;
                break;
            case 617971800:
                if (lowerCase.equals("arenotificationsblocked")) {
                    c = 'k';
                    break;
                }
                c = 65535;
                break;
            case 658833778:
                if (lowerCase.equals("quitapp")) {
                    c = 'l';
                    break;
                }
                c = 65535;
                break;
            case 741591246:
                if (lowerCase.equals("canmakephonecall")) {
                    c = 'm';
                    break;
                }
                c = 65535;
                break;
            case 748048867:
                if (lowerCase.equals("setmessageboxresult")) {
                    c = 'n';
                    break;
                }
                c = 65535;
                break;
            case 770204743:
                if (lowerCase.equals("hidesnackbar")) {
                    c = 'o';
                    break;
                }
                c = 65535;
                break;
            case 776109525:
                if (lowerCase.equals("captureimage")) {
                    c = 'p';
                    break;
                }
                c = 65535;
                break;
            case 861016701:
                if (lowerCase.equals("hidegroup")) {
                    c = 'q';
                    break;
                }
                c = 65535;
                break;
            case 890288208:
                if (lowerCase.equals("stopforegroundservice")) {
                    c = 'r';
                    break;
                }
                c = 65535;
                break;
            case 912052014:
                if (lowerCase.equals("returntoforeground")) {
                    c = 's';
                    break;
                }
                c = 65535;
                break;
            case 922391762:
                if (lowerCase.equals("stopspeaking")) {
                    c = 't';
                    break;
                }
                c = 65535;
                break;
            case 939015169:
                if (lowerCase.equals("savedrawing")) {
                    c = 'u';
                    break;
                }
                c = 65535;
                break;
            case 951117504:
                if (lowerCase.equals("confirm")) {
                    c = 'v';
                    break;
                }
                c = 65535;
                break;
            case 961544276:
                if (lowerCase.equals("isapplicationinstalled")) {
                    c = 'w';
                    break;
                }
                c = 65535;
                break;
            case 1023702150:
                if (lowerCase.equals("updatewaitdialog")) {
                    c = 'x';
                    break;
                }
                c = 65535;
                break;
            case 1027244478:
                if (lowerCase.equals("injectjavascript")) {
                    c = 'y';
                    break;
                }
                c = 65535;
                break;
            case 1085444827:
                if (lowerCase.equals("refresh")) {
                    c = 'z';
                    break;
                }
                c = 65535;
                break;
            case 1189182354:
                if (lowerCase.equals("linefeed")) {
                    c = '{';
                    break;
                }
                c = 65535;
                break;
            case 1248186687:
                if (lowerCase.equals("sendmail")) {
                    c = '|';
                    break;
                }
                c = 65535;
                break;
            case 1302393338:
                if (lowerCase.equals("isspeaking")) {
                    c = '}';
                    break;
                }
                c = 65535;
                break;
            case 1316804872:
                if (lowerCase.equals("startgps")) {
                    c = '~';
                    break;
                }
                c = 65535;
                break;
            case 1330884597:
                if (lowerCase.equals("dumpmemory")) {
                    c = 127;
                    break;
                }
                c = 65535;
                break;
            case 1345906622:
                if (lowerCase.equals("showconsolereplica")) {
                    c = 128;
                    break;
                }
                c = 65535;
                break;
            case 1427814407:
                if (lowerCase.equals("getlastknownlocationdatetime")) {
                    c = 129;
                    break;
                }
                c = 65535;
                break;
            case 1439733183:
                if (lowerCase.equals("hidewaitdialog")) {
                    c = 130;
                    break;
                }
                c = 65535;
                break;
            case 1476240317:
                if (lowerCase.equals("launchapplication")) {
                    c = 131;
                    break;
                }
                c = 65535;
                break;
            case 1555473547:
                if (lowerCase.equals("shownotificationsettings")) {
                    c = 132;
                    break;
                }
                c = 65535;
                break;
            case 1559836274:
                if (lowerCase.equals("addcalendaritem")) {
                    c = 133;
                    break;
                }
                c = 65535;
                break;
            case 1589883978:
                if (lowerCase.equals("stopkioskmode")) {
                    c = 134;
                    break;
                }
                c = 65535;
                break;
            case 1624824622:
                if (lowerCase.equals("uninstallapplication")) {
                    c = 135;
                    break;
                }
                c = 65535;
                break;
            case 1628583914:
                if (lowerCase.equals("mergeimageslefttoright")) {
                    c = 136;
                    break;
                }
                c = 65535;
                break;
            case 1631431250:
                if (lowerCase.equals("isinforeground")) {
                    c = 137;
                    break;
                }
                c = 65535;
                break;
            case 1637402083:
                if (lowerCase.equals("stopgpsv1")) {
                    c = 138;
                    break;
                }
                c = 65535;
                break;
            case 1637402084:
                if (lowerCase.equals("stopgpsv2")) {
                    c = 139;
                    break;
                }
                c = 65535;
                break;
            case 1654821085:
                if (lowerCase.equals("uselastprinter")) {
                    c = 140;
                    break;
                }
                c = 65535;
                break;
            case 1670661934:
                if (lowerCase.equals("getlastknownlocationaltitude")) {
                    c = 141;
                    break;
                }
                c = 65535;
                break;
            case 1679728291:
                if (lowerCase.equals("getlastknownlocationlongitude")) {
                    c = 142;
                    break;
                }
                c = 65535;
                break;
            case 1681788479:
                if (lowerCase.equals("setmaxwaitdialog")) {
                    c = 143;
                    break;
                }
                c = 65535;
                break;
            case 1715856919:
                if (lowerCase.equals("stopwifi")) {
                    c = 144;
                    break;
                }
                c = 65535;
                break;
            case 1733515939:
                if (lowerCase.equals("setfeedmode")) {
                    c = 145;
                    break;
                }
                c = 65535;
                break;
            case 1737360348:
                if (lowerCase.equals("refreshcontentrow")) {
                    c = 146;
                    break;
                }
                c = 65535;
                break;
            case 1741191858:
                if (lowerCase.equals("endprint")) {
                    c = 147;
                    break;
                }
                c = 65535;
                break;
            case 1797371269:
                if (lowerCase.equals("getlastknownlocationaccuracy")) {
                    c = 148;
                    break;
                }
                c = 65535;
                break;
            case 1824395974:
                if (lowerCase.equals("getwindow")) {
                    c = 149;
                    break;
                }
                c = 65535;
                break;
            case 1834845937:
                if (lowerCase.equals("deleteshortcut")) {
                    c = 150;
                    break;
                }
                c = 65535;
                break;
            case 1874719483:
                if (lowerCase.equals("getsoundvolumen")) {
                    c = 151;
                    break;
                }
                c = 65535;
                break;
            case 1979932881:
                if (lowerCase.equals("sendsms")) {
                    c = 152;
                    break;
                }
                c = 65535;
                break;
            case 2114421610:
                if (lowerCase.equals("setselection")) {
                    c = 153;
                    break;
                }
                c = 65535;
                break;
            default:
                c = 65535;
                break;
        }
        switch (c) {
            case 0:
                return startDrag(objArr);
            case 1:
                return Boolean.valueOf(startLive(objArr));
            case 2:
                return Integer.valueOf(startWifi());
            case 3:
                return scanDocument(objArr);
            case 4:
                return Integer.valueOf(recognizeSpeech(objArr));
            case 5:
                return Integer.valueOf(showGroup(objArr));
            case 6:
                return Boolean.valueOf(stopGps());
            case org.mozilla.javascript.Context.FEATURE_DYNAMIC_SCOPE:
                return showToast(objArr);
            case '\b':
                return Boolean.valueOf(playSound(objArr));
            case org.mozilla.javascript.Context.FEATURE_STRICT_EVAL:
                return Integer.valueOf(printBarcode(objArr));
            case org.mozilla.javascript.Context.FEATURE_LOCATION_INFORMATION_IN_ERROR:
                return Boolean.valueOf(stopReplica());
            case org.mozilla.javascript.Context.FEATURE_STRICT_MODE:
                return Double.valueOf(getLastKnownLocationLatitude());
            case org.mozilla.javascript.Context.FEATURE_WARNING_AS_ERROR:
                return Integer.valueOf(printBIDI(objArr));
            case '\r':
                return Integer.valueOf(printLine(objArr));
            case org.mozilla.javascript.Context.FEATURE_V8_EXTENSIONS:
            case 21:
                return Integer.valueOf(shareData(objArr));
            case org.mozilla.javascript.Context.FEATURE_OLD_UNDEF_NULL_THIS:
                return Boolean.valueOf(restartApp());
            case org.mozilla.javascript.Context.FEATURE_ENUMERATE_IDS_FIRST:
                return Boolean.valueOf(isInBackground());
            case org.mozilla.javascript.Context.FEATURE_THREAD_SAFE_OBJECTS:
                return Integer.valueOf(setWaitDialogText(objArr));
            case org.mozilla.javascript.Context.FEATURE_INTEGER_WITHOUT_DECIMAL_PLACE:
                return Integer.valueOf(checkGpsStatus());
            case 19:
                return Float.valueOf(getLastKnownLocationBearing());
            case 20:
            case 'Q':
                return Boolean.valueOf(setPlaySoundVolume(objArr));
            case 22:
                return Boolean.valueOf(stopPlaySound());
            case 23:
                return Integer.valueOf(startAudioRecord(objArr));
            case 24:
                return Boolean.valueOf(startGpsV1(objArr));
            case 25:
                return Boolean.valueOf(startGpsV2(objArr));
            case 26:
                return Integer.valueOf(returnToMainMenu());
            case 27:
                return Integer.valueOf(startPrint(objArr));
            case 28:
                return removeInactivityTimer();
            case 29:
                return sendSmsRetryIfNetworkIsDown(objArr);
            case 30:
                return Integer.valueOf(startCamera(objArr));
            case 31:
                return Long.valueOf(getInactivityTime());
            case ' ':
                return getLastKnownLocationProvider();
            case '!':
                return Integer.valueOf(startSignature(objArr));
            case '\"':
            case '*':
                return Integer.valueOf(msgBox(objArr));
            case '#':
            case 135:
                return Integer.valueOf(uninstallApp(objArr));
            case '$':
                return Integer.valueOf(openUrl(objArr));
            case '%':
            case 'w':
                return Integer.valueOf(isAppInstalled(objArr));
            case '&':
                return Integer.valueOf(printPDF(objArr));
            case '\'':
                return Boolean.valueOf(isWifiConnected());
            case '(':
                return Boolean.valueOf(showNotificationChannelSettings(objArr));
            case ')':
                return Boolean.valueOf(isDeviceLocked(objArr));
            case '+':
                return Boolean.valueOf(startKioskMode());
            case ',':
                return prompt(objArr);
            case '-':
                return Boolean.valueOf(requestAppReview(objArr));
            case '.':
                return Integer.valueOf(showNotification(objArr));
            case '/':
                return Integer.valueOf(lockGroup(objArr));
            case '0':
                return Integer.valueOf(stopAudioRecord());
            case '1':
                return Integer.valueOf(unlockGroup(objArr));
            case '2':
                return Boolean.valueOf(playSoundAndVibrate(objArr));
            case '3':
                return Integer.valueOf(hideSoftwareKeyboard(new Object[0]));
            case '4':
                return Integer.valueOf(pickFile(objArr));
            case '5':
                return Integer.valueOf(executeActionAfterDelay(objArr));
            case '6':
                return Boolean.valueOf(startReplica());
            case '7':
                return Integer.valueOf(drawMapRoute(objArr));
            case '8':
                return Boolean.valueOf(makePhoneCall(objArr));
            case '9':
            case 131:
                return Boolean.valueOf(launchApp(objArr));
            case ':':
                return Integer.valueOf(dismissNotification(objArr));
            case ';':
                return signDataObject(objArr);
            case AmazonAppStore.RESPONSE_TIMEOUT:
                return Boolean.valueOf(showSnackbar(objArr));
            case '=':
                return Integer.valueOf(toggleGroup(objArr));
            case '>':
                return Boolean.valueOf(showKeyboardOptions(objArr));
            case '?':
            case 'N':
                return Integer.valueOf(getMaxSoundVolume());
            case '@':
                return Integer.valueOf(printCommand(objArr));
            case 'A':
                return Integer.valueOf(relayout());
            case 'B':
                return getLastKnownLocation();
            case 'C':
                return Integer.valueOf(openFile(objArr));
            case 'D':
                return Integer.valueOf(openMenu(objArr));
            case 'E':
                return Boolean.valueOf(stopPlaySoundAndVibrate());
            case 'F':
                return Integer.valueOf(showWaitDialog(objArr));
            case 'G':
                return Integer.valueOf(msgBoxWithSound(objArr));
            case 'H':
                return Boolean.valueOf(refreshAll(objArr));
            case 'I':
                return Integer.valueOf(openEditView(objArr));
            case 'J':
                return Boolean.valueOf(moveToBackground());
            case 'K':
                return startForegroundService(objArr);
            case 'L':
            case 149:
                return getView(objArr);
            case 'M':
                return Integer.valueOf(refreshValue(objArr));
            case 'O':
                return Integer.valueOf(isWifiEnabled());
            case 'P':
                return Boolean.valueOf(exit());
            case 'R':
                return setInactivityTimer(objArr);
            case 'S':
                return Integer.valueOf(print(objArr));
            case 'T':
                return Boolean.valueOf(sleep(objArr));
            case 'U':
                return Integer.valueOf(speak(objArr));
            case 'V':
                return Boolean.valueOf(startScanner(objArr));
            case 'W':
                return Integer.valueOf(setNotificationLed(objArr));
            case 'X':
                return Float.valueOf(getLastKnownLocationSpeed());
            case 'Y':
                return Integer.valueOf(printImage(objArr));
            case 'Z':
                return Integer.valueOf(askUserForGpsPermission(objArr));
            case '[':
                return Boolean.valueOf(clearDrawing(objArr));
            case '\\':
                return Integer.valueOf(ensureVisible(objArr));
            case ']':
                return Integer.valueOf(setLanguage(objArr));
            case '^':
                return getControl(objArr);
            case '_':
                return Integer.valueOf(showSoftwareKeyboard(objArr));
            case '`':
                return getLanguage();
            case 'a':
                return Boolean.valueOf(garbageCollect());
            case 'b':
                return Integer.valueOf(refreshContentSelectedRow(objArr));
            case 'c':
                return Integer.valueOf(isSuperuserAvailable());
            case org.mozilla.javascript.Context.VERSION_1_0:
                return Boolean.valueOf(openReplicaConsole());
            case 'e':
                return Boolean.valueOf(vibrate(objArr));
            case 'f':
                return getCountryCode();
            case 'g':
                return Boolean.valueOf(createShortcut(objArr));
            case 'h':
                return Boolean.valueOf(canOpen(objArr));
            case 'i':
                return Boolean.valueOf(isOnCall());
            case 'j':
            case 151:
                return Integer.valueOf(getSoundVolume());
            case 'k':
                return Boolean.valueOf(areNotificationsBlocked(objArr));
            case 'l':
                return Integer.valueOf(quitApp());
            case 'm':
                return Boolean.valueOf(canMakePhoneCall());
            case org.mozilla.javascript.Context.VERSION_1_1:
                return Integer.valueOf(setMessageBoxResult(new Object[0]));
            case 'o':
                return Boolean.valueOf(hideSnackbar());
            case 'p':
                return captureImage(objArr);
            case 'q':
                return Integer.valueOf(hideGroup(objArr));
            case 'r':
                return stopForegroundService(objArr);
            case 's':
                return Boolean.valueOf(returnToForeground());
            case 't':
                return Boolean.valueOf(stopSpeaking(objArr));
            case 'u':
                return Boolean.valueOf(saveDrawing(objArr));
            case 'v':
                return Boolean.valueOf(confirm(objArr));
            case org.mozilla.javascript.Context.VERSION_1_2:
                return Integer.valueOf(updateWaitDialog(objArr));
            case 'y':
                return Integer.valueOf(injectJavascript(objArr));
            case 'z':
                return Boolean.valueOf(refresh(objArr));
            case '{':
                return Integer.valueOf(lineFeed(objArr));
            case '|':
                return Integer.valueOf(sendMail(objArr));
            case '}':
                return Boolean.valueOf(isSpeaking(objArr));
            case '~':
                return Boolean.valueOf(startGps(objArr));
            case 127:
                return Boolean.valueOf(dumpMemory(objArr));
            case 128:
                return Integer.valueOf(showConsoleReplica());
            case 129:
                return getLastKnownLocationDateTime();
            case org.mozilla.javascript.Context.VERSION_1_3:
                return Integer.valueOf(hideWaitDialog());
            case 132:
                return Boolean.valueOf(showNotificationSettings());
            case 133:
                return Long.valueOf(addCalendarItem(objArr));
            case 134:
                return Boolean.valueOf(stopKioskMode());
            case 136:
                return Boolean.valueOf(mergeImagesLeftToRight(objArr));
            case 137:
                return Boolean.valueOf(isInForeground());
            case 138:
                return Boolean.valueOf(stopGpsV1());
            case 139:
                return Boolean.valueOf(stopGpsV2());
            case org.mozilla.javascript.Context.VERSION_1_4:
                return Boolean.valueOf(useLastPrinter(objArr));
            case 141:
                return Double.valueOf(getLastKnownLocationAltitude());
            case 142:
                return Double.valueOf(getLastKnownLocationLongitude());
            case 143:
                return Integer.valueOf(setMaxWaitDialog(objArr));
            case 144:
                return Integer.valueOf(stopWifi());
            case 145:
                return Integer.valueOf(setFeedMode(objArr));
            case 146:
                return Integer.valueOf(refreshContentRow(objArr));
            case 147:
                return Integer.valueOf(endPrint(objArr));
            case 148:
                return Float.valueOf(getLastKnownLocationAccuracy());
            case org.mozilla.javascript.Context.VERSION_1_5:
                return Boolean.valueOf(deleteShortcut(objArr));
            case 152:
                return sendSms(objArr);
            case 153:
                return Integer.valueOf(setSelection(objArr));
            default:
                throw new U0("Function/Method/Property '" + str + "' not implemented.", -1, getScriptRuntime().i());
        }
    }

    @ScriptAllowed
    public long addCalendarItem(Object... objArr) {
        String y;
        String y2;
        Calendar date;
        Calendar date2;
        String str;
        Utils.j("AddCalendarItem", objArr);
        Utils.h("AddCalendarItem", objArr, 1, 5);
        Object obj = objArr[0];
        if (obj instanceof C0932x0) {
            C0932x0 c0932x0 = (C0932x0) obj;
            y = Q8.k.E(c0932x0, "title", "");
            y2 = Q8.k.E(c0932x0, "description", "");
            str = Q8.k.E(c0932x0, "location", "");
            date = Q8.k.d(c0932x0, "startDate", null);
            date2 = Q8.k.d(c0932x0, "startDate", null);
        } else {
            y = fb.t.y(obj);
            y2 = fb.t.y(objArr[1]);
            String y3 = fb.t.y(objArr[2]);
            date = toDate(objArr[3]);
            date2 = toDate(objArr[4]);
            str = y3;
        }
        if (date == null) {
            throw new IllegalArgumentException("AddCalendarItem(): Empty start date");
        }
        if (date2 == null) {
            throw new IllegalArgumentException("AddCalendarItem(): Empty end date");
        }
        Bundle bundle = new Bundle();
        bundle.putString("title", y);
        bundle.putString("description", y2);
        bundle.putString("eventLocation", str);
        bundle.putLong("dtstart", date.getTimeInMillis());
        bundle.putLong("dtend", date2.getTimeInMillis());
        bundle.putInt("allDay", 0);
        bundle.putInt("hasAlarm", 1);
        return F7.c.a(getApp(), bundle);
    }

    @ScriptAllowed
    public boolean areNotificationsBlocked(Object... objArr) {
        boolean areNotificationsEnabled;
        List notificationChannels;
        String group;
        NotificationChannelGroup notificationChannelGroup;
        boolean isBlocked;
        boolean isBlocked2;
        Utils.h("AreNotificationsBlocked", objArr, 0, 1);
        String x = Utils.x(objArr, 0, "");
        int i = Build.VERSION.SDK_INT;
        if (i < 24) {
            return false;
        }
        NotificationManager A1 = xoneApp.A1();
        areNotificationsEnabled = A1.areNotificationsEnabled();
        if (!areNotificationsEnabled) {
            return true;
        }
        if (i < 28) {
            return false;
        }
        NotificationChannelGroup e = s8.h.e(A1, x);
        if (e != null) {
            isBlocked2 = e.isBlocked();
            return isBlocked2;
        }
        notificationChannels = A1.getNotificationChannels();
        Iterator it = notificationChannels.iterator();
        while (it.hasNext()) {
            NotificationChannel a2 = AbstractC0574p.a(it.next());
            if (a2 != null) {
                group = a2.getGroup();
                notificationChannelGroup = A1.getNotificationChannelGroup(group);
                if (notificationChannelGroup != null) {
                    isBlocked = notificationChannelGroup.isBlocked();
                    return isBlocked;
                }
            }
        }
        return false;
    }

    @ScriptAllowed
    @Deprecated
    public int askUserForGPSPermission(Object... objArr) {
        return askUserForGpsPermission(objArr);
    }

    @ScriptAllowed
    public int askUserForGpsPermission(Object... objArr) {
        Object obj;
        Object obj2 = null;
        Object v = Utils.v(objArr, 0, null);
        if (v instanceof C0932x0) {
            C0932x0 c0932x0 = (C0932x0) v;
            obj2 = Q8.k.y(c0932x0, "onEnabled");
            obj = Q8.k.y(c0932x0, "onDenied");
        } else {
            obj = null;
        }
        if (askUserForGpsPermissionGoogle(obj2, obj)) {
            return 0;
        }
        xoneApp Z0 = xoneApp.Z0();
        Intent j = AbstractC0698k.j(Z0, "android.settings.LOCATION_SOURCE_SETTINGS");
        if (j == null) {
            j = AbstractC0698k.j(Z0, "android.settings.SECURITY_SETTINGS_SETUPWIZARD");
        }
        if (j == null) {
            j = new Intent("android.settings.SECURITY_SETTINGS");
        }
        j.setFlags(268435456);
        Z0.startActivity(j);
        return 0;
    }

    @ScriptAllowed
    public boolean canMakePhoneCall() {
        try {
            if (!getPackageManager().hasSystemFeature("android.hardware.telephony")) {
                Utils.l("XOneAndroidFramework", "canMakePhoneCall(): Device does not have phone capabilities");
                return false;
            }
            int simState = getTelephonyManager().getSimState();
            if (simState != 5) {
                Utils.l("XOneAndroidFramework", "canMakePhoneCall(): Sim is not ready for calls. Status code: " + simState);
                return false;
            }
            int state = p8.q.a().b().getState();
            if (state == 0) {
                return true;
            }
            Utils.l("XOneAndroidFramework", "canMakePhoneCall(): Phone network is not ready for calls. Status code: " + state);
            return false;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    @ScriptAllowed
    public boolean canOpen(Object... objArr) {
        Utils.j("CanOpen", objArr);
        Utils.g("CanOpen", objArr, 1);
        String y = fb.t.y(objArr[0]);
        if (TextUtils.isEmpty(y)) {
            return false;
        }
        String trim = y.trim();
        if (fb.t.D(trim, "https")) {
            trim = fb.t.s(trim, "https", "https");
        } else if (fb.t.D(trim, "http")) {
            trim = fb.t.s(trim, "http", "http");
        }
        Intent intent = new Intent();
        intent.setAction("android.intent.action.VIEW");
        File file = new File(trim);
        if (file.exists()) {
            intent.setData(Utils.B1(getApp(), file));
        } else {
            Uri parse = Uri.parse(trim);
            if (TextUtils.isEmpty(parse.getScheme())) {
                intent.setType(trim);
            } else {
                intent.setData(parse);
            }
        }
        return intent.resolveActivity(getPackageManager()) != null;
    }

    @ScriptAllowed
    public String captureImage(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) getApp().g();
        if (xoneBaseActivity != null) {
            return xoneBaseActivity.captureImage(objArr);
        }
        throw new NullPointerException("No active window found");
    }

    @ScriptAllowed
    public boolean confirm(Object... objArr) {
        Utils.j("confirm", objArr);
        Utils.g("confirm", objArr, 1);
        int msgBox = msgBox(fb.t.y(objArr[0]), "", 1);
        if (msgBox == 1) {
            return true;
        }
        if (msgBox == 2) {
            return false;
        }
        throw new IllegalArgumentException("confirm(): Unknown value");
    }

    @ScriptAllowed
    public void destroyRecognizeSpeech(Object... objArr) {
        i8.i.f().e();
    }

    @ScriptAllowed
    public int dismissNotification(Object... objArr) {
        Utils.j("DismissNotification", objArr);
        Utils.g("DismissNotification", objArr, 1);
        s8.h.f().c(Integer.valueOf(fb.q.o(objArr[0])));
        return 0;
    }

    public boolean doInternalStartGps(Object[] objArr) {
        if (objArr == null || objArr.length == 0) {
            xoneApp.Z0().y("", 30000L, 0);
            return true;
        }
        Utils.j("StartGPS", objArr);
        if (objArr.length == 1 && (objArr[0] instanceof C0932x0)) {
            xoneApp.Z0().c3((C0932x0) objArr[0]);
            return true;
        }
        Utils.g("StartGPS", objArr, 3);
        xoneApp.Z0().y(fb.t.y(objArr[0]), objArr.length > 1 ? fb.q.s(objArr[1]) : 30000L, objArr.length > 2 ? fb.q.o(objArr[2]) : 0);
        return true;
    }

    @ScriptAllowed
    public int drawMapRoute(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity != null) {
            return xoneBaseActivity.drawMapRoute(objArr);
        }
        throw new IllegalStateException("DrawMapRoute(): Error, lastEditView == null");
    }

    @ScriptAllowed
    public boolean dumpMemory(Object... objArr) {
        Utils.j("DumpMemory", objArr);
        Utils.g("DumpMemory", objArr, 1);
        String y = fb.t.y(objArr[0]);
        if (!TextUtils.isEmpty(y)) {
            xoneApp app = getApp();
            Debug.dumpHprofData(Utils.h2(app.Y(), app.T(), y));
            return true;
        }
        throw new IllegalArgumentException("DumpMemory(): Empty file path argument");
    }

    @com.xone.annotations.ScriptAllowed
    public int endPrint(java.lang.Object... r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.xone.android.framework.XoneGlobalUI.endPrint(java.lang.Object[]):int");
    }

    @ScriptAllowed
    public int ensureVisible(Object... objArr) {
        Utils.j("EnsureVisible", objArr);
        Utils.g("EnsureVisible", objArr, 2);
        String y = fb.t.y(objArr[0]);
        String y2 = fb.t.y(objArr[1]);
        InterfaceC1036l0 g = getApp().g();
        if (g == null) {
            return -1;
        }
        Message obtainMessage = g.getHandler().obtainMessage();
        Bundle bundle = new Bundle();
        bundle.putString("name", y);
        bundle.putString("type", y2);
        obtainMessage.setData(bundle);
        obtainMessage.what = 1009;
        g.getHandler().sendMessage(obtainMessage);
        return 0;
    }

    @ScriptAllowed
    public int executeActionAfterDelay(Object... objArr) {
        InterfaceC1036l0 g = getApp().g();
        if (g == null) {
            return -1;
        }
        return g.executeActionAfterDelay(objArr);
    }

    @ScriptAllowed
    public boolean exit() {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return false;
        }
        return xoneBaseActivity.exit();
    }

    @ScriptAllowed
    public boolean garbageCollect() {
        System.gc();
        return true;
    }

    @ScriptAllowed
    public C0893d0 getAvailableSpeakLanguages() {
        Locale[] availableLocales = Locale.getAvailableLocales();
        HashSet hashSet = new HashSet();
        for (Locale locale : availableLocales) {
            if (locale != null && i8.m.c(locale)) {
                String iSO3Language = locale.getISO3Language();
                if (!TextUtils.isEmpty(iSO3Language)) {
                    hashSet.add(iSO3Language);
                }
            }
        }
        return new C0893d0(hashSet.toArray(new String[0]));
    }

    @ScriptAllowed
    public <T extends View> T getControl(Object... objArr) {
        Utils.j("GetControl", objArr);
        Utils.g("GetControl", objArr, 1);
        String y = fb.t.y(objArr[0]);
        if (!TextUtils.isEmpty(y)) {
            return (T) getControlInternal(y);
        }
        throw new IllegalArgumentException("GetControl(): Empty control name");
    }

    @ScriptAllowed
    public String getCountryCode() {
        String country = Locale.getDefault().getCountry();
        return country == null ? "" : country;
    }

    @Override
    public String getDefaultMethod() {
        return "";
    }

    @ScriptAllowed
    public long getInactivityTime() {
        Calendar h1 = xoneApp.Z0().h1();
        if (h1 == null) {
            return -1L;
        }
        return Calendar.getInstance().getTimeInMillis() - h1.getTimeInMillis();
    }

    @ScriptAllowed
    public String getLanguage() {
        xoneApp Z0 = xoneApp.Z0();
        mainEntry S = Z0.S();
        if (S != null) {
            Z0 = S;
        }
        String b2 = fb.n.b(Z0);
        return b2 == null ? "" : b2;
    }

    @ScriptAllowed
    public int getMaxSoundVolume() {
        return getAudioManager().getStreamMaxVolume(3);
    }

    @ScriptAllowed
    @Deprecated
    public int getMaxSoundVolumen() {
        return getMaxSoundVolume();
    }

    public int getMessageBoxResponseButton() {
        return this.nResponseButton;
    }

    @Override
    public String getName() {
        return "UserInterface";
    }

    @Override
    public ua.V getScope() {
        return getScriptRuntime().c();
    }

    @ScriptAllowed
    public int getSoundVolume() {
        return getAudioManager().getStreamVolume(3);
    }

    @ScriptAllowed
    @Deprecated
    public int getSoundVolumen() {
        return getSoundVolume();
    }

    @ScriptAllowed
    public Object getView(Object... objArr) {
        Object obj;
        xoneApp Z0 = xoneApp.Z0();
        if (objArr == null || objArr.length == 0 || (obj = objArr[0]) == null) {
            return Z0.g();
        }
        if (!(obj instanceof IXoneObject)) {
            return null;
        }
        IXoneObject iXoneObject = (IXoneObject) obj;
        InterfaceC1036l0 m0 = Z0.m0(iXoneObject);
        return m0 != null ? m0 : Z0.g1(iXoneObject);
    }

    @ScriptAllowed
    public C0893d0 getViewStack(Object... objArr) {
        return getWindowStack(objArr);
    }

    @ScriptAllowed
    public Object getWindow(Object... objArr) {
        return getView(objArr);
    }

    @ScriptAllowed
    public C0893d0 getWindowStack(Object... objArr) {
        IXoneCollection ownerCollection;
        ArrayList arrayList = new ArrayList();
        if (objArr != null) {
            for (Object obj : objArr) {
                arrayList.add(fb.t.y(obj));
            }
        }
        List<InterfaceC1036l0> b1 = xoneApp.Z0().b1();
        ArrayList arrayList2 = new ArrayList();
        for (InterfaceC1036l0 interfaceC1036l0 : b1) {
            if (arrayList.isEmpty()) {
                arrayList2.add(interfaceC1036l0);
            }
            IXoneObject dataObject = interfaceC1036l0.getDataObject();
            if (dataObject != null && (ownerCollection = dataObject.getOwnerCollection()) != null) {
                String name = ownerCollection.getName();
                if (!TextUtils.isEmpty(name) && arrayList.contains(name)) {
                    arrayList2.add(interfaceC1036l0);
                }
            }
        }
        return Q8.m.u(arrayList2);
    }

    @ScriptAllowed
    public int hideGroup(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) getApp().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        return xoneBaseActivity.hideGroup(objArr);
    }

    @ScriptAllowed
    public boolean hideSnackbar() {
        EditViewHyper editViewHyper = (EditViewHyper) getApp().g();
        if (editViewHyper == null) {
            return false;
        }
        return editViewHyper.hideSnackbar();
    }

    @ScriptAllowed
    public int hideSoftwareKeyboard(Object... objArr) {
        InterfaceC1036l0 g = xoneApp.Z0().g();
        if (g == null) {
            return 0;
        }
        return g.hideSoftwareKeyboard(objArr);
    }

    @ScriptAllowed
    public int hideWaitDialog() {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        xoneBaseActivity.hideWaitDialog();
        return 0;
    }

    @ScriptAllowed
    public int injectJavascript(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity != null) {
            return xoneBaseActivity.injectJavascript(objArr);
        }
        throw new NullPointerException("InjectJavascript(): Cannot find activity");
    }

    @ScriptAllowed
    public boolean isDeviceLocked(Object... objArr) {
        return Utils.e3(getApp());
    }

    @ScriptAllowed
    public boolean isInBackground() {
        return xoneApp.Z0().U1();
    }

    @ScriptAllowed
    public boolean isInForeground() {
        return xoneApp.Z0().V1();
    }

    @ScriptAllowed
    public boolean isOnCall() {
        return getAudioManager().getMode() == 2;
    }

    @ScriptAllowed
    public boolean isSpeaking(Object... objArr) {
        Utils.j("IsSpeaking", objArr);
        Utils.g("IsSpeaking", objArr, 1);
        return i8.m.d(fb.t.y(objArr[0]));
    }

    @ScriptAllowed
    public int isSuperuserAvailable() {
        return Utils.f3(getApp()) ? 0 : 1;
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public boolean isWifiConnected() {
        NetworkInfo activeNetworkInfo = getConnectivityManager().getActiveNetworkInfo();
        return activeNetworkInfo != null && activeNetworkInfo.getType() == 1;
    }

    @ScriptAllowed
    @SuppressLint({"WifiManagerLeak"})
    public int isWifiEnabled() {
        return getWifiManager().isWifiEnabled() ? 1 : 0;
    }

    @ScriptAllowed
    public int lineFeed(Object... objArr) {
        Utils.j("LineFeed", objArr);
        Utils.g("LineFeed", objArr, 1);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        try {
            this.remotePrintService.r0(fb.q.o(objArr[0]));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public int lockGroup(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) getApp().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        return xoneBaseActivity.lockGroup(objArr);
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public boolean makePhoneCall(Object... objArr) {
        String y;
        Utils.j("MakePhoneCall", objArr);
        Utils.g("MakePhoneCall", objArr, 1);
        boolean z = false;
        Object obj = objArr[0];
        if (obj instanceof C0932x0) {
            C0932x0 c0932x0 = (C0932x0) obj;
            y = Q8.k.E(c0932x0, "number", "");
            z = Q8.k.a(c0932x0, "withPermission", false);
        } else {
            y = fb.t.y(obj);
        }
        if (TextUtils.isEmpty(y)) {
            throw new IllegalArgumentException("MakePhoneCall(): Empty phone number");
        }
        String replace = y.replace("#", "%23");
        Uri parse = Uri.parse("tel:" + replace);
        xoneApp Z0 = xoneApp.Z0();
        Intent intent = new Intent((C9.e.q(Z0, "android.permission.CALL_PHONE") || z) ? "android.intent.action.CALL" : "android.intent.action.DIAL", parse);
        intent.addFlags(268435456);
        g.c S = Z0.S();
        if (S != null) {
            S.startActivity(intent);
            xoneApp.Y2(replace);
            return true;
        }
        throw new NullPointerException("MakePhoneCallCannot find activity");
    }

    @ScriptAllowed
    public boolean mergeImagesLeftToRight(Object... objArr) {
        xoneApp Z0 = xoneApp.Z0();
        String A0 = Utils.A0(Z0, Z0.Y(), Z0.T(), fb.t.y(objArr[0]), false, 1);
        if (TextUtils.isEmpty(A0)) {
            throw new IllegalArgumentException("Cannot obtain target file path");
        }
        ArrayList arrayList = new ArrayList();
        for (int i = 1; i < objArr.length; i++) {
            File q1 = Utils.q1(Z0.Y(), Z0.T(), fb.t.y(objArr[i]), false, 1);
            if (!q1.exists()) {
                throw new FileNotFoundException("Image " + q1.getAbsolutePath() + " does not exist");
            }
            arrayList.add(q1);
        }
        AbstractC0752g.j(new File(A0), arrayList);
        return true;
    }

    @ScriptAllowed
    public boolean moveToBackground() {
        Intent intent = new Intent("android.intent.action.MAIN");
        intent.addCategory("android.intent.category.HOME");
        intent.addFlags(268435456);
        getApp().startActivity(intent);
        return true;
    }

    @ScriptAllowed
    public int msgBox(Object... objArr) {
        Utils.j("MessageBox", objArr);
        Utils.f("MessageBox");
        if (objArr.length == 1) {
            Object obj = objArr[0];
            if (obj == null) {
                throw new IllegalArgumentException("MessageBox(): Empty parameter");
            }
            if (obj instanceof IXoneObject) {
                return doInternalMessageBox((IXoneObject) obj, "", "", "");
            }
            if (obj instanceof String) {
                return doInternalMessageBox(null, (String) obj, "", "");
            }
            throw new IllegalArgumentException("MessageBox(): Unknown parameter of type " + objArr[0].getClass().getName());
        }
        Utils.h("MessageBox", objArr, 3, 4);
        String y = fb.t.y(objArr[0]);
        String y2 = fb.t.y(objArr[1]);
        int o = fb.q.o(objArr[2]);
        if (objArr.length == 3) {
            return doInternalMessageBox(y, y2, o);
        }
        Object obj2 = objArr[3];
        if (obj2 == null) {
            throw new IllegalArgumentException("MessageBox(): Empty parameter");
        }
        if (obj2 instanceof IXoneObject) {
            return doInternalMessageBox((IXoneObject) obj2, "", y, y2);
        }
        if (obj2 instanceof String) {
            return doInternalMessageBox(null, (String) obj2, y, y2);
        }
        throw new IllegalArgumentException("MessageBox(): Unknown parameter of type " + objArr[3].getClass().getName());
    }

    @ScriptAllowed
    public int msgBoxWithSound(Object... objArr) {
        Utils.j("MessageBoxWithSound", objArr);
        Utils.g("MessageBoxWithSound", objArr, 6);
        return doInternalMessageBox(fb.t.y(objArr[0]), fb.t.y(objArr[1]), fb.q.o(objArr[2]), fb.t.y(objArr[3]), fb.t.y(objArr[4]), fb.q.o(objArr[5]));
    }

    @ScriptAllowed
    public int openEditView(Object... objArr) {
        IXoneObject iXoneObject;
        Utils.j("OpenEditView", objArr);
        Utils.h("OpenEditView", objArr, 1, 2);
        Object obj = objArr[0];
        if (obj instanceof CharSequence) {
            IXoneCollection GetCollection = getAppData().GetCollection(obj.toString());
            iXoneObject = GetCollection.CreateObject();
            GetCollection.AddItem(iXoneObject);
        } else {
            if (!(obj instanceof IXoneObject)) {
                throw new IllegalArgumentException("OpenEditView(): Unknown parameter type");
            }
            iXoneObject = (IXoneObject) obj;
        }
        boolean q = Utils.q(objArr, 1, false);
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity != null) {
            FutureC0996a e = xoneBaseActivity.e(iXoneObject);
            if (q) {
                xoneBaseActivity.k(xoneBaseActivity.F0());
            }
            try {
                e.get(2L, TimeUnit.SECONDS);
            } catch (Exception unused) {
            }
            return 0;
        }
        mainEntry S = xoneApp.Z0().S();
        if (S != null) {
            try {
                S.p1(iXoneObject).get(2L, TimeUnit.SECONDS);
            } catch (Exception unused2) {
            }
            return 0;
        }
        throw new NullPointerException("OpenEditView(): Cannot find activity");
    }

    @ScriptAllowed
    public int openFile(Object... objArr) {
        URL url;
        Utils.j("OpenFile", objArr);
        Utils.g("OpenFile", objArr, 1);
        String y = fb.t.y(objArr[0]);
        if (TextUtils.isEmpty(y)) {
            throw new IllegalArgumentException("OpenFile(): Empty path argument");
        }
        try {
            url = new URL(y);
        } catch (Exception unused) {
            url = null;
        }
        xoneApp app = getApp();
        if (url != null && url.getProtocol().startsWith("http")) {
            if (y.toLowerCase(Locale.US).endsWith(".gltf")) {
                launchSceneViewerIntent(y);
                return 0;
            }
            File l0 = app.l0(Utils.U2("cache/" + url.getFile()));
            if (!l0.exists()) {
                Utils.u0(url, l0.getAbsolutePath());
            }
            y = l0.getAbsolutePath();
        }
        File w1 = Utils.w1(app.Y(), app.T(), y);
        if (!w1.exists()) {
            throw new FileNotFoundException("OpenFile(): File " + w1.getAbsolutePath() + " not found");
        }
        g.c S = getApp().S();
        if (S == null) {
            throw new NullPointerException("OpenFile(): Cannot find activity");
        }
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addFlags(1);
        String mimeTypeFromExtension = MimeTypeMap.getSingleton().getMimeTypeFromExtension(Utils.u1(w1.getAbsolutePath()));
        TextUtils.equals(mimeTypeFromExtension, "application/vnd.android.package-archive");
        Uri B1 = Utils.B1(app, w1);
        if (TextUtils.isEmpty(mimeTypeFromExtension)) {
            intent.setData(B1);
        } else {
            intent.setDataAndType(B1, mimeTypeFromExtension);
        }
        try {
            S.startActivity(intent);
            return 0;
        } catch (ActivityNotFoundException e) {
            if (!TextUtils.equals(mimeTypeFromExtension, "application/vnd.android.package-archive") || Build.VERSION.SDK_INT >= 24) {
                throw e;
            }
            if (!C9.e.q(getApp(), "android.permission.WRITE_EXTERNAL_STORAGE")) {
                throw new SecurityException("OpenFile(): External storage permission is needed to install APKs on API levels < 24");
            }
            File file = new File(Environment.getExternalStorageDirectory(), "temp.apk");
            Utils.Z(w1, file);
            intent.setDataAndType(Uri.fromFile(file), mimeTypeFromExtension);
            S.startActivity(intent);
            return 0;
        }
    }

    @ScriptAllowed
    public int openMenu(Object... objArr) {
        Utils.j("OpenMenu", objArr);
        Utils.g("OpenMenu", objArr, 3);
        String y = fb.t.y(objArr[0]);
        int o = fb.q.o(objArr[1]);
        int o2 = fb.q.o(objArr[2]);
        Message obtainMessage = getApp().w1().obtainMessage();
        obtainMessage.what = 300;
        Bundle bundle = new Bundle();
        bundle.putString("collname", y);
        bundle.putInt("mask", o);
        bundle.putInt("mode", o2);
        obtainMessage.setData(bundle);
        if (getAppData().GetCollection(y) != null) {
            xoneApp.Z0().w1().sendMessage(obtainMessage);
            return 0;
        }
        throw new IllegalArgumentException("OpenMenu(): Cannot find collection " + y);
    }

    @ScriptAllowed
    public boolean openReplicaConsole() {
        xoneApp Z0 = xoneApp.Z0();
        ua.O S = Z0.S();
        if (S == 0) {
            return false;
        }
        String Y = Z0.Y();
        Intent intent = new Intent((Context) S, (Class<?>) ReplicaConsoleActivity.class);
        intent.setAction("android.intent.action.MAIN");
        intent.setFlags(268435456);
        intent.putExtra("appname", Y);
        S.startActivity(intent);
        return true;
    }

    @ScriptAllowed
    public int openUrl(Object... objArr) {
        Utils.j("OpenUrl", objArr);
        Utils.h("OpenUrl", objArr, 1, 2);
        String x = Utils.x(objArr, 0, "");
        boolean q = Utils.q(objArr, 1, false);
        if (TextUtils.isEmpty(x)) {
            return -1;
        }
        String trim = x.trim();
        if (fb.t.D(trim, "https")) {
            trim = fb.t.s(trim, "https", "https");
        } else if (fb.t.D(trim, "http")) {
            trim = fb.t.s(trim, "http", "http");
        }
        if (trim.toLowerCase(Locale.US).endsWith(".gltf")) {
            launchSceneViewerIntent(trim);
            return 0;
        }
        g.c S = getApp().S();
        if (S == null) {
            throw new NullPointerException("OpenUrl(): Cannot find activity");
        }
        Uri parse = Uri.parse(trim);
        if (q) {
            new d.d().a().a(S, parse);
            return 0;
        }
        Intent intent = new Intent();
        intent.setAction("android.intent.action.VIEW");
        intent.setData(parse);
        if (intent.resolveActivity(getPackageManager()) != null) {
            S.startActivity(intent);
            return 0;
        }
        throw new IllegalArgumentException("OpenUrl(): No application or component found to handle url " + trim + "\nVerify that a compatible app is installed on this device.");
    }

    @ScriptAllowed
    public int pickFile(Object... objArr) {
        InterfaceC1036l0 g = xoneApp.Z0().g();
        if (g != null) {
            return g.pickFile(objArr);
        }
        throw new ra.f(-92119, "Activity not found.");
    }

    @ScriptAllowed
    public boolean playSound(Object... objArr) {
        Utils.j("PlaySound", objArr);
        Utils.h("PlaySound", objArr, 1, 3);
        B8.g gVar = new B8.g();
        Object obj = objArr[0];
        if (obj instanceof C0932x0) {
            C0932x0 c0932x0 = (C0932x0) obj;
            gVar.b(Q8.k.E(c0932x0, "sound", ""));
            gVar.m(Q8.k.E(c0932x0, "vibrate", ""));
            gVar.k(Q8.k.o(c0932x0, "repeatCount", 0));
            gVar.i(Q8.k.a(c0932x0, "continuePlaying", false));
            gVar.l(Q8.k.E(c0932x0, "soundType", "undefined"));
            gVar.j(Q8.k.E(c0932x0, "output", "undefined"));
        } else {
            String y = fb.t.y(obj);
            if (TextUtils.isEmpty(y)) {
                throw new IllegalArgumentException("PlaySound(): Empty file parameter");
            }
            File w1 = Utils.w1(getApp().Y(), getApp().T(), y);
            if (!w1.exists()) {
                throw new IllegalArgumentException("PlaySound(): File " + w1.getAbsolutePath() + " does not exist");
            }
            if (!w1.isFile()) {
                throw new IllegalArgumentException("PlaySound(): Path " + w1.getAbsolutePath() + " is not a file");
            }
            gVar.a(w1);
            if (objArr.length > 1) {
                gVar.k(fb.q.o(objArr[1]));
            }
            if (objArr.length > 2) {
                gVar.i(fb.t.l(fb.t.y(objArr[2]), false));
            }
        }
        return doInternalPlaySoundAndVibrate(gVar);
    }

    @ScriptAllowed
    public boolean playSoundAndVibrate(Object... objArr) {
        Utils.l("XOneAndroidFramework", "Invoking XoneGlobalUI.playSoundAndVibrate()");
        Utils.j("PlaySoundAndVibrate", objArr);
        Utils.h("PlaySoundAndVibrate", objArr, 1, 4);
        B8.g gVar = new B8.g();
        if (objArr.length == 1) {
            C0932x0 c0932x0 = (C0932x0) objArr[0];
            gVar.b(Q8.k.E(c0932x0, "sound", ""));
            gVar.m(Q8.k.E(c0932x0, "vibrate", ""));
            gVar.k(Q8.k.o(c0932x0, "repeatCount", 0));
            gVar.i(Q8.k.a(c0932x0, "continuePlaying", false));
            gVar.l(Q8.k.E(c0932x0, "soundType", "undefined"));
            gVar.j(Q8.k.E(c0932x0, "output", "undefined"));
        } else {
            gVar.b(fb.t.z(objArr[0], ""));
            gVar.m(fb.t.z(objArr[1], ""));
            gVar.k(fb.q.p(objArr[2], 0));
            if (objArr.length > 3) {
                gVar.i(fb.t.l(fb.t.y(objArr[3]), false));
            }
        }
        boolean doInternalPlaySoundAndVibrate = doInternalPlaySoundAndVibrate(gVar);
        Utils.l("XOneAndroidFramework", "Finished invoking XoneGlobalUI.playSoundAndVibrate()");
        return doInternalPlaySoundAndVibrate;
    }

    @ScriptAllowed
    @Deprecated
    public boolean playSoundVolumen(Object... objArr) {
        return setPlaySoundVolume(objArr);
    }

    @ScriptAllowed
    public int print(Object... objArr) {
        Utils.j("Print", objArr);
        Utils.g("Print", objArr, 1);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        try {
            this.remotePrintService.u0(fb.t.y(objArr[0]));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public int printBIDI(Object... objArr) {
        Utils.j("PrintBIDI", objArr);
        Utils.g("PrintBIDI", objArr, 3);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        try {
            this.remotePrintService.z0(fb.q.o(objArr[0]), fb.t.y(objArr[1]), fb.t.y(objArr[2]));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public int printBarcode(Object... objArr) {
        Utils.j("PrintBarcode", objArr);
        Utils.g("PrintBarcode", objArr, 4);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        try {
            this.remotePrintService.B1(fb.t.y(objArr[0]), fb.t.y(objArr[1]), fb.q.p(objArr[2], -1), fb.q.p(objArr[3], -1));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public int printCommand(Object... objArr) {
        Utils.j("PrintCommand", objArr);
        Utils.g("PrintCommand", objArr, 1);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        try {
            this.remotePrintService.h3(fb.t.y(objArr[0]));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public int printImage(Object... objArr) {
        String str;
        int i;
        int i2;
        int i3;
        Utils.j("PrintImage", objArr);
        Utils.g("PrintImage", objArr, 5);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        xoneApp Z0 = xoneApp.Z0();
        String A0 = Utils.A0(Z0, Z0.Y(), Z0.T(), fb.t.y(objArr[0]), false, 1);
        if (TextUtils.isEmpty(A0)) {
            throw new FileNotFoundException("PrintImage(): File not found.");
        }
        if (A0.startsWith("http://")) {
            File x1 = Utils.x1(Z0.Y(), Z0.T(), new Random().nextInt() + "_TEMP", false);
            Utils.t0(A0, x1.getAbsolutePath());
            if (x1.exists()) {
                A0 = x1.getAbsolutePath();
            }
        }
        String str2 = A0;
        try {
            int o = fb.q.o(objArr[1]);
            int o2 = fb.q.o(objArr[2]);
            str = fb.t.y(objArr[3]);
            i3 = fb.q.o(objArr[4]);
            i = o;
            i2 = o2;
        } catch (Exception unused) {
            str = "center";
            i = 300;
            i2 = 300;
            i3 = 0;
        }
        try {
            this.remotePrintService.q3(str2, i, i2, str, i3);
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public int printLine(Object... objArr) {
        Utils.j("PrintLine", objArr);
        Utils.g("PrintLine", objArr, 1);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        try {
            this.remotePrintService.j1(fb.t.y(objArr[0]));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public int printPDF(Object... objArr) {
        Utils.j("PrintPDF", objArr);
        Utils.g("PrintPDF", objArr, 1);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        xoneApp Z0 = xoneApp.Z0();
        try {
            this.remotePrintService.O2(Utils.A0(Z0, Z0.Y(), Z0.T(), fb.t.y(objArr[0]), false, 1));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public String prompt(final Object... objArr) {
        String str;
        Utils.j("prompt", objArr);
        Utils.h("prompt", objArr, 1, 2);
        final androidx.fragment.app.j g = getApp().g();
        if (g == null) {
            return null;
        }
        this.sResultAux = null;
        g.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                XoneGlobalUI.this.lambda$prompt$3(g, objArr);
            }
        });
        while (true) {
            str = this.sResultAux;
            if (str != null) {
                break;
            }
            Thread.sleep(100L);
        }
        if (!TextUtils.isEmpty(str) && this.sResultAux.compareTo("##CANCELLED##") == 0) {
            this.sResultAux = null;
            return null;
        }
        String str2 = this.sResultAux;
        this.sResultAux = null;
        return str2;
    }

    @ScriptAllowed
    public int quitApp() {
        Activity I0 = getApp().I0();
        if (I0 == null) {
            return -1;
        }
        I0.moveTaskToBack(true);
        return 0;
    }

    @ScriptAllowed
    public int recognizeSpeech(Object... objArr) {
        Utils.j("RecognizeSpeech", objArr);
        Utils.h("RecognizeSpeech", objArr, 1, 2);
        Object obj = objArr[0];
        if (obj == null) {
            throw new IllegalArgumentException("RecognizeSpeech(): Empty first parameter");
        }
        if (obj instanceof IXoneObject) {
            XoneDataObject xoneDataObject = (XoneDataObject) obj;
            String z = fb.t.z(objArr[1], null);
            if (TextUtils.isEmpty(z)) {
                throw new IllegalArgumentException("RecognizeSpeech(): Empty target property parameter");
            }
            InterfaceC1036l0 g = getApp().g();
            if (g != null) {
                i8.i.f().j(new p8.r(g, xoneDataObject, z, 0L, 0));
                return 0;
            }
            throw new NullPointerException("RecognizeSpeech(): No edit view is visible");
        }
        if (!(obj instanceof C0932x0)) {
            throw new IllegalArgumentException("RecognizeSpeech(): Unknown parameter of type " + objArr[0].getClass().getSimpleName());
        }
        C0932x0 c0932x0 = (C0932x0) obj;
        String E = Q8.k.E(c0932x0, "language", "");
        long t = Q8.k.t(c0932x0, "timeoutAfterSilence", 0L);
        int o = Q8.k.o(c0932x0, "characterLimit", 0);
        Object z2 = Q8.k.z(c0932x0, "onRecognize", null);
        Object z3 = Q8.k.z(c0932x0, "onError", null);
        Object z4 = Q8.k.z(c0932x0, "onReadyForSpeech", null);
        Object z5 = Q8.k.z(c0932x0, "onBeginningOfSpeech", null);
        Object z6 = Q8.k.z(c0932x0, "onRmsChanged", null);
        Object z7 = Q8.k.z(c0932x0, "onBufferReceived", null);
        Object z10 = Q8.k.z(c0932x0, "onEndOfSpeech", null);
        Object z11 = Q8.k.z(c0932x0, "onPartialResults", null);
        Object z12 = Q8.k.z(c0932x0, "onEvent", null);
        if (z2 == null) {
            throw new NullPointerException("RecognizeSpeech(): Empty onRecognize callback");
        }
        if (z3 == null) {
            throw new NullPointerException("RecognizeSpeech(): Empty onError callback");
        }
        InterfaceC1036l0 g2 = getApp().g();
        if (g2 != null) {
            i8.i.f().j(new p8.r(g2, getSelfObject(), E, t, o, z2, z3, z4, z5, z6, z7, z10, z11, z12));
            return 0;
        }
        throw new NullPointerException("RecognizeSpeech(): No edit view is visible");
    }

    @ScriptAllowed
    public boolean refresh(Object... objArr) {
        xoneApp Z0 = xoneApp.Z0();
        if (Z0.D() == EnumC0821f.FullAuto) {
            return true;
        }
        InterfaceC1036l0 g = Z0.g();
        int i = 0;
        if (g == null) {
            Utils.l("XOneAndroidFramework", "XoneGlobalUI refresh(): Cannot refresh properties, no activity was found");
            return false;
        }
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        if (objArr != null && objArr.length > 0) {
            if (objArr.length == 1) {
                String[] split = fb.t.y(objArr[0]).split(",");
                int length = split.length;
                while (i < length) {
                    linkedHashSet.add(cleanScriptStringValue(split[i]));
                    i++;
                }
            } else {
                int length2 = objArr.length;
                while (i < length2) {
                    linkedHashSet.add(cleanScriptStringValue(fb.t.y(objArr[i])));
                    i++;
                }
            }
        }
        g.h(true);
        g.I(linkedHashSet);
        return true;
    }

    @ScriptAllowed
    public boolean refreshAll(Object... objArr) {
        InterfaceC1036l0 g = xoneApp.Z0().g();
        int i = 0;
        if (g == null) {
            Utils.l("XOneAndroidFramework", "XoneGlobalUI refreshAll(): Cannot refresh properties, no activity was found");
            return false;
        }
        if (objArr == null || objArr.length == 0) {
            g.I(null);
            return false;
        }
        LinkedHashSet linkedHashSet = new LinkedHashSet();
        if (objArr.length == 1) {
            String[] split = fb.t.y(objArr[0]).split(",");
            int length = split.length;
            while (i < length) {
                linkedHashSet.add(cleanScriptStringValue(split[i]));
                i++;
            }
        } else {
            int length2 = objArr.length;
            while (i < length2) {
                linkedHashSet.add(cleanScriptStringValue(fb.t.y(objArr[i])));
                i++;
            }
        }
        g.h(true);
        g.I(linkedHashSet);
        return true;
    }

    @ScriptAllowed
    public int refreshContentRow(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity != null) {
            return xoneBaseActivity.refreshContentRow(objArr);
        }
        throw new NullPointerException("RefreshContentRow(): Cannot find activity");
    }

    @ScriptAllowed
    public int refreshContentSelectedRow(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity != null) {
            return xoneBaseActivity.refreshContentSelectedRow(objArr);
        }
        throw new NullPointerException("RefreshContentSelectedRow(): Cannot find activity");
    }

    @ScriptAllowed
    public int refreshValue(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        return xoneBaseActivity.refreshValue(objArr);
    }

    @ScriptAllowed
    public int relayout() {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        xoneBaseActivity.relayout();
        return 0;
    }

    @ScriptAllowed
    public Object removeInactivityTimer() {
        fa.j.t();
        return null;
    }

    @ScriptAllowed
    public boolean requestAppReview(Object... objArr) {
        androidx.fragment.app.j g = getApp().g();
        if (!(g instanceof XoneBaseActivity)) {
            return true;
        }
        ((XoneBaseActivity) g).requestAppReview(objArr);
        return true;
    }

    @ScriptAllowed
    public boolean restartApp() {
        xoneApp app = getApp();
        mainEntry S = app.S();
        if (S == null) {
            return false;
        }
        S.E0(true);
        Intent intent = new Intent(app, (Class<?>) mainEntry.class);
        intent.setAction("android.intent.action.MAIN");
        intent.addCategory("android.intent.category.LAUNCHER");
        intent.addFlags(536870912);
        getAlarmManager().set(1, System.currentTimeMillis() + 3000, PendingIntent.getActivity(app, 450224, intent, Utils.l2(true, 268435456)));
        return true;
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public boolean returnToForeground() {
        ActivityManager activityManager = getActivityManager();
        g.c S = getApp().S();
        if (S == null) {
            return false;
        }
        activityManager.moveTaskToFront(S.getTaskId(), 0);
        return true;
    }

    @ScriptAllowed
    public int returnToMainMenu() {
        xoneApp.Q0(true, true);
        return 0;
    }

    @ScriptAllowed
    public Object scanDocument(Object... objArr) {
        String E;
        int i;
        final String str = "ScanDocument";
        Utils.j("ScanDocument", objArr);
        Utils.g("ScanDocument", objArr, 1);
        C0932x0 c0932x0 = (C0932x0) objArr[0];
        boolean a2 = Q8.k.a(c0932x0, "allowGallery", false);
        int o = Q8.k.o(c0932x0, "pageLimit", 1);
        boolean a3 = Q8.k.a(c0932x0, "outputJpg", true);
        boolean a4 = Q8.k.a(c0932x0, "outputPdf", false);
        E = Q8.k.E(c0932x0, "mode", "base");
        final Object z = Q8.k.z(c0932x0, "onSuccess", null);
        final Object z2 = Q8.k.z(c0932x0, "onError", null);
        final Object z3 = Q8.k.z(c0932x0, "onCancelled", null);
        E.getClass();
        switch (E) {
            case "baseWithFilters":
                i = 2;
                break;
            case "base":
                i = 3;
                break;
            case "full":
                i = 1;
                break;
            default:
                throw new IllegalArgumentException("ScanDocument(): Unknown mode argument " + E);
        }
        ArrayList arrayList = new ArrayList();
        if (a3) {
            arrayList.add(101);
        }
        if (a4) {
            arrayList.add(102);
        }
        if (arrayList.isEmpty()) {
            throw new IllegalArgumentException("ScanDocument(): Must specify at least one output format");
        }
        if (z2 == null) {
            throw new IllegalArgumentException("ScanDocument(): Empty onError callback argument");
        }
        if (z3 == null) {
            throw new IllegalArgumentException("ScanDocument(): Empty onCancelled callback argument");
        }
        TabLayout.d dVar = (EditViewHyper) xoneApp.Z0().g();
        if (dVar == null) {
            throw new IllegalStateException("ScanDocument(): No edit view present");
        }
        IXoneApp appData = getAppData();
        if (appData == null) {
            throw new IllegalStateException("ScanDocument(): No app data present");
        }
        final File file = new File(appData.getFilesPath());
        final IXoneObject selfObject = getSelfObject();
        b.a aVar = new b.a();
        aVar.b(a2);
        aVar.c(o);
        if (arrayList.size() == 1) {
            aVar.d(((Integer) arrayList.get(0)).intValue(), new int[0]);
        } else if (arrayList.size() == 2) {
            aVar.d(((Integer) arrayList.get(0)).intValue(), new int[]{((Integer) arrayList.get(1)).intValue()});
        }
        aVar.e(i);
        B6.b a5 = aVar.a();
        androidx.activity.result.b bVar = new androidx.activity.result.b() {
            public final void a(Object obj) {
                XoneGlobalUI.o(IXoneObject.this, z2, file, str, z, z3, (androidx.activity.result.a) obj);
            }
        };
        m4.l b2 = B6.c.a(a5).b(dVar);
        final androidx.activity.result.c d3 = dVar.d3(bVar);
        b2.g(new m4.h() {
            public final void a(Object obj) {
                d3.a(new e.a((IntentSender) obj).a());
            }
        });
        b2.e(new m4.g() {
            public final void d(Exception exc) {
                XoneGlobalUI.k(IXoneObject.this, z2, exc);
            }
        });
        return null;
    }

    @ScriptAllowed
    public int setFeedMode(Object... objArr) {
        Utils.j("SetFeedMode", objArr);
        Utils.g("SetFeedMode", objArr, 1);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        try {
            this.remotePrintService.D3(fb.t.y(objArr[0]));
            return 0;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
        }
    }

    @ScriptAllowed
    public void setFontFactor(Object... objArr) {
        Utils.g("SetFontFactor", objArr, 1);
        Float n = fb.q.n(objArr[0], null);
        if (n != null) {
            xoneApp.Z0().E2(n.floatValue());
            return;
        }
        throw new IllegalArgumentException("SetFontFactor(): Empty font factor argument");
    }

    @ScriptAllowed
    public Object setInactivityTimer(Object... objArr) {
        Utils.j("SetInactivityTimer", objArr);
        Utils.g("SetInactivityTimer", objArr, 1);
        C0932x0 c0932x0 = (C0932x0) objArr[0];
        long t = Q8.k.t(c0932x0, "timeout", 0L);
        Object z = Q8.k.z(c0932x0, "callback", null);
        if (t <= 0) {
            throw new IllegalArgumentException("SetInactivityTimer(): Timeout argument cannot be lower than zero");
        }
        if (z == null) {
            throw new IllegalArgumentException("SetInactivityTimer(): Callback argument cannot be empty");
        }
        fa.j.t();
        ScheduledExecutorService g = fa.j.g();
        xoneApp Z0 = xoneApp.Z0();
        Z0.G2(true);
        Z0.L2(Calendar.getInstance());
        g.schedule(new CallableC0846a(g, z, t), t, TimeUnit.MILLISECONDS);
        return null;
    }

    @ScriptAllowed
    @SuppressLint({"ApplySharedPref"})
    public int setLanguage(Object... objArr) {
        Utils.j("SetLanguage", objArr);
        Utils.g("SetLanguage", objArr, 1);
        String lowerCase = fb.t.y(objArr[0]).toLowerCase(Locale.US);
        if (lowerCase.compareTo("") != 0) {
            Locale locale = new Locale(lowerCase);
            Locale.setDefault(locale);
            Configuration configuration = xoneApp.Z0().getResources().getConfiguration();
            configuration.locale = locale;
            xoneApp.Z0().getResources().updateConfiguration(configuration, null);
        }
        SharedPreferences.Editor edit = xoneApp.Z0().getSharedPreferences(xoneApp.Z0().Y(), 0).edit();
        edit.putString("XOneAppLanguage", lowerCase);
        edit.commit();
        Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage(xoneApp.Z0().getPackageName());
        if (launchIntentForPackage != null) {
            launchIntentForPackage.setClass(xoneApp.Z0(), mainEntry.class);
            launchIntentForPackage.addFlags(67108864);
            xoneApp.Z0().startActivity(launchIntentForPackage);
            return 0;
        }
        throw new NullPointerException("SetLanguage(): Cannot find launch intent");
    }

    @ScriptAllowed
    public int setMaxWaitDialog(Object... objArr) {
        Utils.j("SetMaxWaitDialog", objArr);
        Utils.g("SetMaxWaitDialog", objArr, 1);
        int o = fb.q.o(objArr[0]);
        InterfaceC1036l0 g = xoneApp.Z0().g();
        if (g == null) {
            return -1;
        }
        Message obtainMessage = g.getHandler().obtainMessage();
        obtainMessage.what = 1015;
        Bundle bundle = new Bundle();
        bundle.putInt("max", o);
        obtainMessage.setData(bundle);
        g.getHandler().sendMessage(obtainMessage);
        return 0;
    }

    public void setMessageBoxButtonClick(int i) {
        this.nResponseButton = i;
    }

    public void setMessageBoxResponseButton(int i) {
        this.nResponseButton = i;
    }

    @ScriptAllowed
    public int setMessageBoxResult(Object... objArr) {
        C0786e j0;
        Utils.j("SetMessageBoxResult", objArr);
        Utils.g("SetMessageBoxResult", objArr, 1);
        int p = fb.q.p(objArr[0], 0);
        androidx.fragment.app.j g = xoneApp.Z0().g();
        if (g == null || (j0 = g.getSupportFragmentManager().j0("fragment_custom_dialog")) == null) {
            return -1;
        }
        j0.t0();
        setMessageBoxButtonClick(p);
        return 0;
    }

    public void setMessageBoxText(CharSequence charSequence) {
        this.sResponseText = charSequence;
    }

    @ScriptAllowed
    public int setNotificationLed(Object... objArr) {
        Utils.j("SetNotificationLed", objArr);
        Utils.g("SetNotificationLed", objArr, 3);
        int parseColor = Color.parseColor(fb.t.y(objArr[0]));
        int o = fb.q.o(objArr[1]);
        int o2 = fb.q.o(objArr[2]);
        if (o <= 0) {
            throw new IllegalArgumentException("SetNotificationLed(): nLedOnMilliseconds <= 0");
        }
        if (o2 <= 0) {
            throw new IllegalArgumentException("SetNotificationLed(): nLedOffMilliseconds <= 0");
        }
        s8.h f = s8.h.f();
        f.n(parseColor);
        f.p(o);
        f.o(o2);
        return 0;
    }

    @ScriptAllowed
    public boolean setPlaySoundVolume(Object... objArr) {
        Utils.j("SetPlaySoundVolume", objArr);
        Utils.g("SetPlaySoundVolume", objArr, 1);
        int o = fb.q.o(objArr[0]);
        AudioManager audioManager = getAudioManager();
        audioManager.setStreamVolume(3, Math.min(o, audioManager.getStreamMaxVolume(3)), 1);
        return true;
    }

    @ScriptAllowed
    public void setScaleFontSize(Object... objArr) {
        Utils.g("SetScaleFontSize", objArr, 1);
        Boolean m = fb.t.m(fb.t.z(objArr[0], null), null);
        if (m != null) {
            xoneApp.Z0().U2(m.booleanValue());
            return;
        }
        throw new IllegalArgumentException("SetScaleFontSize(): Empty scale fontsize argument");
    }

    @ScriptAllowed
    public int setSelection(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        return xoneBaseActivity.setSelection(objArr);
    }

    @ScriptAllowed
    public int setWaitDialogText(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        xoneBaseActivity.setWaitDialogText(objArr);
        return 0;
    }

    @ScriptAllowed
    public int shareData(Object... objArr) {
        Utils.j("ShareData", objArr);
        Utils.g("ShareData", objArr, 3);
        String y = fb.t.y(objArr[0]);
        String y2 = fb.t.y(objArr[1]);
        String y3 = fb.t.y(objArr[2]);
        Intent intent = new Intent("android.intent.action.SEND");
        intent.putExtra("android.intent.extra.SUBJECT", y);
        intent.putExtra("android.intent.extra.TEXT", y2);
        xoneApp app = getApp();
        if (TextUtils.isEmpty(y3) || y3.trim().isEmpty()) {
            intent.setType("text/plain");
        } else {
            intent.setType("image/*");
            File x1 = Utils.x1(app.Y(), app.T(), y3, false);
            if (x1.exists()) {
                intent.putExtra("android.intent.extra.STREAM", Utils.B1(app, x1));
            }
        }
        String string = getApp().getString(AbstractC0568j.o0);
        androidx.fragment.app.j I0 = app.I0();
        if (I0 == null) {
            I0 = app.g();
        }
        if (I0 == null) {
            I0 = app.S();
        }
        if (I0 != null) {
            I0.startActivity(Intent.createChooser(intent, string));
            return 0;
        }
        throw new NullPointerException("ShareData(): Cannot find activity");
    }

    @ScriptAllowed
    @Deprecated
    public int sharedData(Object... objArr) {
        return shareData(objArr);
    }

    @ScriptAllowed
    public int showConsoleReplica() {
        mainEntry S = xoneApp.Z0().S();
        if (S == null) {
            return -1;
        }
        S.J2();
        return 0;
    }

    @ScriptAllowed
    public void showDatePicker(Object... objArr) {
        Utils.j("ShowDatePicker", objArr);
        Utils.g("ShowDatePicker", objArr, 1);
        C0932x0 c0932x0 = (C0932x0) objArr[0];
        final String D = Q8.k.D(c0932x0, "targetProperty");
        final Object y = Q8.k.y(c0932x0, "onDateSet");
        if (TextUtils.isEmpty(D) && y == null) {
            throw new IllegalArgumentException("ShowDatePicker(): A target property or a callback function must be set");
        }
        final String E = Q8.k.E(c0932x0, "title", "");
        final ?? r7 = (XoneBaseActivity) xoneApp.Z0().g();
        if (r7 == 0) {
            throw new NullPointerException("ShowDatePicker(): Cannot find activity");
        }
        final IXoneObject selfObject = getSelfObject();
        final DatePickerDialog.OnDateSetListener onDateSetListener = new DatePickerDialog.OnDateSetListener() {
            @Override
            public final void onDateSet(DatePicker datePicker, int i, int i2, int i3) {
                XoneGlobalUI.h(XoneBaseActivity.this, y, selfObject, D, datePicker, i, i2, i3);
            }
        };
        Calendar calendar = Calendar.getInstance();
        final int o = Q8.k.o(c0932x0, "initialYear", calendar.get(1));
        final int o2 = Q8.k.o(c0932x0, "initialMonth", calendar.get(2) + 1) - 1;
        final int o3 = Q8.k.o(c0932x0, "initialDay", calendar.get(5));
        final String E2 = Q8.k.E(c0932x0, "theme", "");
        r7.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                XoneGlobalUI.n(XoneBaseActivity.this, E2, onDateSetListener, o, o2, o3, E);
            }
        });
    }

    @ScriptAllowed
    public int showGroup(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) getApp().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        return xoneBaseActivity.showGroup(objArr);
    }

    @ScriptAllowed
    public boolean showKeyboardOptions(Object... objArr) {
        xoneApp.r1().showInputMethodPicker();
        return true;
    }

    @ScriptAllowed
    public int showNotification(Object... objArr) {
        int i;
        XoneDataObject xoneDataObject;
        String y;
        String str;
        String str2;
        File file;
        Utils.j("ShowNotification", objArr);
        Utils.h("ShowNotification", objArr, 1, 6);
        s8.h f = s8.h.f();
        if (objArr.length == 1) {
            C0932x0 c0932x0 = (C0932x0) objArr[0];
            String str3 = "";
            String E = Q8.k.E(c0932x0, "icon", "");
            String E2 = Q8.k.E(c0932x0, "largeIcon", "");
            String str4 = XoneNFCRuntime.TAG_ID_FIELD;
            int o = Q8.k.o(c0932x0, XoneNFCRuntime.TAG_ID_FIELD, 0);
            String str5 = "title";
            String E3 = Q8.k.E(c0932x0, "title", "");
            String E4 = Q8.k.E(c0932x0, "textHtml", "");
            CharSequence fromHtml = !TextUtils.isEmpty(E4) ? Html.fromHtml(E4.toString()) : Q8.k.E(c0932x0, "text", "");
            String E5 = Q8.k.E(c0932x0, "tickerTextHtml", "");
            CharSequence fromHtml2 = !TextUtils.isEmpty(E5) ? Html.fromHtml(E5.toString()) : Q8.k.E(c0932x0, "tickerText", "");
            String E6 = Q8.k.E(c0932x0, "backgroundColor", null);
            boolean a2 = Q8.k.a(c0932x0, "cancelable", true);
            CharSequence charSequence = fromHtml;
            IXoneObject i2 = Q8.k.i(c0932x0, "dataObject");
            CharSequence charSequence2 = fromHtml2;
            String E7 = Q8.k.E(c0932x0, "nodeName", "");
            String E10 = Q8.k.E(c0932x0, "sound", "");
            String E11 = Q8.k.E(c0932x0, "vibratePattern", "");
            String str6 = "parameters";
            String D = Q8.k.D(c0932x0, "parameters");
            C0893d0 u = Q8.k.u(c0932x0, "buttons", null);
            ArrayList arrayList = new ArrayList();
            if (u != null) {
                int size = u.size();
                str2 = E2;
                int i3 = 0;
                while (i3 < size) {
                    C0893d0 c0893d0 = u;
                    C0932x0 c0932x02 = (C0932x0) u.get(i3);
                    int i4 = size;
                    int i5 = i3;
                    int o2 = Q8.k.o(c0932x02, str4, -1);
                    if (o2 == -1) {
                        throw new IllegalArgumentException("ShowNotification(): Empty button id");
                    }
                    String D2 = Q8.k.D(c0932x02, str5);
                    String str7 = str4;
                    String str8 = str5;
                    boolean a3 = Q8.k.a(c0932x02, "directReply", false);
                    arrayList.add(new d.a().e(Integer.valueOf(o2)).h(D2).b(Q8.k.i(c0932x02, "dataObject")).f(Q8.k.E(c0932x02, "nodeName", str3)).c(a3).d(Q8.k.E(c0932x02, "directReplyLabel", null)).g(Q8.k.D(c0932x0, str6)).a());
                    i3 = i5 + 1;
                    size = i4;
                    u = c0893d0;
                    str4 = str7;
                    str5 = str8;
                    str3 = str3;
                    c0932x0 = c0932x0;
                    str6 = str6;
                }
            } else {
                str2 = E2;
            }
            xoneApp app = getApp();
            if (TextUtils.isEmpty(E10)) {
                file = null;
            } else {
                File x1 = Utils.x1(app.Y(), app.T(), E10, false);
                if (!x1.exists() || !x1.isFile()) {
                    throw AbstractC0751f.b("ShowNotification(): File " + x1.getAbsolutePath() + " does not exist");
                }
                file = x1;
            }
            i = 0;
            f.d(app, E, str2, E3, charSequence, charSequence2, a2, i2, E7, o, file, E11, E6, D, arrayList);
        } else {
            i = 0;
            int o3 = fb.q.o(objArr[0]);
            String y2 = fb.t.y(objArr[1]);
            String y3 = fb.t.y(objArr[2]);
            if (objArr.length == 3 || objArr.length == 4) {
                f.d(xoneApp.getContext(), "", "", y2, y3, objArr.length == 4 ? fb.t.y(objArr[3]) : null, true, null, null, o3, null, null, null, null, null);
                return 0;
            }
            if (objArr.length == 5 || objArr.length == 6) {
                if (objArr.length == 5) {
                    xoneDataObject = (XoneDataObject) objArr[3];
                    y = fb.t.y(objArr[4]);
                    str = null;
                } else {
                    String y4 = fb.t.y(objArr[3]);
                    xoneDataObject = (XoneDataObject) objArr[4];
                    y = fb.t.y(objArr[5]);
                    str = y4;
                }
                f.d(xoneApp.getContext(), "", "", y2, y3, str, true, xoneDataObject, y, o3, null, null, null, null, null);
            }
        }
        return i;
    }

    @ScriptAllowed
    public boolean showNotificationChannelSettings(Object... objArr) {
        String id;
        Utils.j("ShowNotificationChannelSettings", objArr);
        Utils.g("ShowNotificationChannelSettings", objArr, 1);
        String z = fb.t.z(objArr[0], "");
        if (Build.VERSION.SDK_INT < 26) {
            return false;
        }
        NotificationChannel a2 = q3.e.a(xoneApp.A1(), z);
        Intent intent = new Intent("android.settings.CHANNEL_NOTIFICATION_SETTINGS");
        intent.addFlags(268435456);
        id = a2.getId();
        intent.putExtra("android.provider.extra.CHANNEL_ID", id);
        intent.putExtra("android.provider.extra.APP_PACKAGE", getApp().getPackageName());
        getApp().startActivity(intent);
        return true;
    }

    @ScriptAllowed
    @SuppressLint({"InlinedApi"})
    public boolean showNotificationSettings() {
        xoneApp app = getApp();
        String packageName = app.getPackageName();
        ApplicationInfo applicationInfo = app.getApplicationInfo();
        Intent intent = new Intent("android.settings.APP_NOTIFICATION_SETTINGS");
        intent.addFlags(268435456);
        if (Build.VERSION.SDK_INT >= 26) {
            intent.putExtra("android.provider.extra.APP_PACKAGE", packageName);
        } else {
            intent.putExtra("app_package", packageName);
            intent.putExtra("app_uid", applicationInfo.uid);
        }
        app.startActivity(intent);
        return true;
    }

    @ScriptAllowed
    public boolean showSnackbar(Object... objArr) {
        EditViewHyper editViewHyper = (EditViewHyper) getApp().g();
        if (editViewHyper != null) {
            return editViewHyper.showSnackbar(objArr);
        }
        Utils.l("XOneAndroidFramework", "ShowSnackbar(): No valid activity instance found, cancelling snackbar");
        return false;
    }

    @ScriptAllowed
    public int showSoftwareKeyboard(Object... objArr) {
        InterfaceC1036l0 g = xoneApp.Z0().g();
        if (g == null) {
            return -1;
        }
        return g.showSoftwareKeyboard(objArr);
    }

    @ScriptAllowed
    public void showTimePicker(Object... objArr) {
        Utils.j("ShowTimePicker", objArr);
        Utils.g("ShowTimePicker", objArr, 1);
        C0932x0 c0932x0 = (C0932x0) objArr[0];
        final String D = Q8.k.D(c0932x0, "targetProperty");
        final Object y = Q8.k.y(c0932x0, "onTimeSet");
        if (TextUtils.isEmpty(D) && y == null) {
            throw new IllegalArgumentException("ShowTimePicker(): A target property or a callback function must be set");
        }
        final String E = Q8.k.E(c0932x0, "title", "");
        final ?? r7 = (XoneBaseActivity) xoneApp.Z0().g();
        if (r7 == 0) {
            throw new NullPointerException("ShowTimePicker(): Cannot find activity");
        }
        final IXoneObject selfObject = getSelfObject();
        final TimePickerDialog.OnTimeSetListener onTimeSetListener = new TimePickerDialog.OnTimeSetListener() {
            @Override
            public final void onTimeSet(TimePicker timePicker, int i, int i2) {
                XoneGlobalUI.g(XoneBaseActivity.this, y, selfObject, D, timePicker, i, i2);
            }
        };
        Calendar calendar = Calendar.getInstance();
        final int o = Q8.k.o(c0932x0, "initialHour", calendar.get(11));
        final int o2 = Q8.k.o(c0932x0, "initialMinute", calendar.get(12));
        final boolean a2 = Q8.k.a(c0932x0, "is24HoursMode", true);
        final String E2 = Q8.k.E(c0932x0, "theme", "");
        r7.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                XoneGlobalUI.m(XoneBaseActivity.this, E2, onTimeSetListener, o, o2, a2, E);
            }
        });
    }

    @ScriptAllowed
    public Object showToast(Object... objArr) {
        File file;
        Utils.j("ShowToast", objArr);
        int i = 1;
        Utils.g("ShowToast", objArr, 1);
        xoneApp g = getApp().g();
        if (g == null) {
            g = getApp();
        }
        Context context = g;
        Object obj = objArr[0];
        if (obj instanceof IXoneObject) {
            Utils.f4(context, getNewEditFramePage((IXoneObject) obj));
            return null;
        }
        if (obj instanceof IXoneCollection) {
            Utils.f4(context, getNewEditFramePage(((IXoneCollection) obj).CreateObject()));
            return null;
        }
        if (!(obj instanceof C0932x0)) {
            Utils.h4(context, fb.t.y(obj), 1);
            return null;
        }
        C0932x0 c0932x0 = (C0932x0) obj;
        String E = Q8.k.E(c0932x0, "color", "");
        String E2 = Q8.k.E(c0932x0, "duration", "long");
        String E3 = Q8.k.E(c0932x0, "text", "");
        String E4 = Q8.k.E(c0932x0, "textColor", "");
        String E5 = Q8.k.E(c0932x0, "textFont", "");
        int o = Q8.k.o(c0932x0, "textSize", 0);
        boolean a2 = Q8.k.a(c0932x0, "rounded", false);
        String E6 = Q8.k.E(c0932x0, "wearAnimation", null);
        int w = fb.t.w(E, 0);
        int w2 = fb.t.w(E4, 0);
        E2.getClass();
        if (E2.equals("long")) {
            if (!TextUtils.isEmpty(E6)) {
                i = 2000;
            }
        } else {
            if (!E2.equals("short")) {
                throw new IllegalArgumentException("ShowToast(): Unknown duration argument: " + E2);
            }
            i = TextUtils.isEmpty(E6) ? 0 : MESSAGEBOX_TIMEOUT;
        }
        if (!TextUtils.isEmpty(E5)) {
            File file2 = new File(getApp().T(), "fonts/" + E5);
            if (file2.exists() && file2.isFile()) {
                file = file2;
                if (TextUtils.isEmpty(E6) && (context instanceof Activity)) {
                    showConfirmationOverlay((Activity) context, E3, i, E6);
                } else {
                    Utils.e4(context, w, E3, w2, file, o, i, a2);
                }
                return null;
            }
        }
        file = null;
        if (TextUtils.isEmpty(E6)) {
        }
        Utils.e4(context, w, E3, w2, file, o, i, a2);
        return null;
    }

    @ScriptAllowed
    public int showWaitDialog(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        xoneBaseActivity.showWaitDialog(objArr);
        return 0;
    }

    @ScriptAllowed
    public Object signDataObject(Object... objArr) {
        int i;
        Utils.j("SignDataObject", objArr);
        Utils.g("SignDataObject", objArr, 2);
        String y = fb.t.y(objArr[0]);
        int o = fb.q.o(objArr[1]);
        Object s = ha.M.s("com.xone.sign.signer");
        if (s == null) {
            return -1;
        }
        try {
            this.bIsExecuting = true;
            this.nResponseButton = -1;
            getApp().a3(10, "PIN", "Escriba el PIN", "##DEFAULT##", null, 1);
            while (true) {
                i = this.nResponseButton;
                if (i >= 0 || !this.bIsExecuting) {
                    break;
                }
                Thread.sleep(100L);
            }
            this.bIsExecuting = false;
            if (i != 1) {
                return -1;
            }
            return ha.M.B(s, "SignDataObject", new Object[]{getApp().S(), null, this.sResponseText.toString(), AbstractC0752g.g(getAppData().getAppPath(), "template.xml"), y, Integer.valueOf(o)});
        } catch (Exception unused) {
            this.bIsExecuting = false;
            return -1;
        }
    }

    @ScriptAllowed
    public int speak(Object... objArr) {
        String z;
        String str;
        Object obj;
        Float f;
        boolean z2;
        Utils.j("Speak", objArr);
        Utils.h("Speak", objArr, 1, 2);
        Object obj2 = objArr[0];
        Float f2 = null;
        if (obj2 instanceof C0932x0) {
            C0932x0 c0932x0 = (C0932x0) obj2;
            str = Q8.k.E(c0932x0, "language", null);
            z = Q8.k.E(c0932x0, "text", null);
            Float m = Q8.k.m(c0932x0, "pitch", null);
            f = Q8.k.m(c0932x0, "speechRate", null);
            z2 = Q8.k.a(c0932x0, "networkSynthesis", true);
            obj = Q8.k.z(c0932x0, "onCompleted", null);
            f2 = m;
        } else {
            String z3 = fb.t.z(obj2, null);
            z = fb.t.z(objArr[1], null);
            str = z3;
            obj = null;
            f = null;
            z2 = true;
        }
        String str2 = z;
        if (TextUtils.isEmpty(str2)) {
            return 0;
        }
        if (TextUtils.isEmpty(str)) {
            str = Locale.getDefault().getISO3Language();
        }
        if (TextUtils.isEmpty(str)) {
            throw new IllegalArgumentException("Speak(): Cannot obtain default language from locale. Please specify one");
        }
        if (f2 != null) {
            f2 = Float.valueOf(f2.floatValue() / 100.0f);
        }
        Float f3 = f2;
        if (f != null) {
            f = Float.valueOf(f.floatValue() / 100.0f);
        }
        i8.m.f(str, str2, f3, f, z2, obj != null ? new C0945i(obj, getSelfObject()) : new C0944h());
        return 0;
    }

    @ScriptAllowed
    public int startAudioRecord(Object... objArr) {
        Utils.j("StartAudioRecord", objArr);
        Utils.g("StartAudioRecord", objArr, 3);
        if (!getPackageManager().hasSystemFeature("android.hardware.microphone")) {
            throw new UnsupportedOperationException("StartAudioRecord(): Device does not have a microphone");
        }
        String y = fb.t.y(objArr[0]);
        String y2 = fb.t.y(objArr[1]);
        int o = fb.q.o(objArr[2]);
        if (o < 0) {
            throw new IllegalArgumentException("StartAudioRecord(): Error, nTimeout < 0");
        }
        xoneApp Z0 = xoneApp.Z0();
        if (((XoneBaseActivity) Z0.g()) == null) {
            throw new IllegalArgumentException("StartAudioRecord(): Error, lastEditView == null");
        }
        String A0 = Utils.A0(Z0, Z0.Y(), Z0.T(), "sound_" + UUID.randomUUID().toString(), false, 1);
        C0767c d = C0767c.d();
        if (d.f()) {
            throw new IllegalStateException("StartAudioRecord(): A recording session is already in place");
        }
        d.i();
        d.p(2);
        d.j(4);
        d.o(A0 + ".mp4");
        if (o > 0) {
            o *= MESSAGEBOX_TIMEOUT;
        }
        d.m(o);
        d.k(y);
        d.l(y2);
        d.q();
        return 0;
    }

    @ScriptAllowed
    public int startCamera(Object... objArr) {
        char c;
        char c2;
        int i;
        String str;
        int i2;
        Object obj;
        String str2;
        int i3;
        Object obj2;
        boolean z;
        int i4;
        int i5;
        int i6;
        Utils.j("StartCamera", objArr);
        Utils.h("StartCamera", objArr, 1, 2);
        Object obj3 = objArr[0];
        if (obj3 instanceof CharSequence) {
            str = (String) Utils.w(objArr, 0, null);
            str2 = (String) Utils.w(objArr, 1, "photo");
            if (TextUtils.isEmpty(str2)) {
                str2 = "photo";
            }
            obj = null;
            obj2 = null;
            c = 1;
            c2 = 2;
            i = 0;
            z = false;
            i4 = 0;
            i5 = -1;
            i6 = -1;
            i3 = 90;
            i2 = -1;
        } else {
            if (!(obj3 instanceof C0932x0)) {
                if (obj3 == null) {
                    throw new IllegalArgumentException("StartCamera(): Empty parameter");
                }
                throw new IllegalArgumentException("StartCamera(): Unknown parameter type " + objArr[0].getClass().getSimpleName());
            }
            C0932x0 c0932x0 = (C0932x0) obj3;
            String E = Q8.k.E(c0932x0, "propName", "");
            String E2 = Q8.k.E(c0932x0, "type", "photo");
            if (TextUtils.isEmpty(E2)) {
                E2 = "photo";
            }
            boolean a2 = Q8.k.a(c0932x0, "useInternalCamera", false);
            int o = Q8.k.o(c0932x0, "size", 0);
            int o2 = Q8.k.o(c0932x0, "width", -1);
            int o3 = Q8.k.o(c0932x0, "height", -1);
            c = 1;
            int o4 = Q8.k.o(c0932x0, "quality", 90);
            int o5 = Q8.k.o(c0932x0, "maxDuration", -1);
            c2 = 2;
            Object z2 = Q8.k.z(c0932x0, "onSuccess", null);
            i = 0;
            Object z3 = Q8.k.z(c0932x0, "onCancelled", null);
            str = E;
            i2 = o5;
            obj = z2;
            str2 = E2;
            i3 = o4;
            obj2 = z3;
            z = a2;
            i4 = o;
            i5 = o2;
            i6 = o3;
        }
        if (TextUtils.isEmpty(str2)) {
            throw new IllegalArgumentException("StartCamera(): Empty type argument");
        }
        IXoneObject selfObject = getSelfObject();
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) xoneApp.Z0().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        xoneBaseActivity.r(str);
        str2.getClass();
        switch (str2) {
            case "attach":
                if (TextUtils.isEmpty(str)) {
                    throw new IllegalArgumentException("StartCamera(): Empty prop name argument");
                }
                Object[] objArr2 = new Object[4];
                objArr2[i] = xoneBaseActivity.getDataObject();
                objArr2[c] = str;
                objArr2[c2] = "";
                objArr2[3] = "false";
                xoneBaseActivity.pickFile(objArr2);
                return i;
            case "photo":
                doStartCameraPermissionCheck(xoneBaseActivity, z, true, false, i4, i5, i6, i3, i2, obj, obj2, selfObject);
                return i;
            case "video":
                doStartCameraPermissionCheck(xoneBaseActivity, z, false, true, i4, i5, i6, i3, i2, obj, obj2, selfObject);
                return i;
            default:
                throw new IllegalArgumentException("StartCamera(): Unknown type " + str2);
        }
    }

    @ScriptAllowed
    public XoneGlobalUI startDrag(Object... objArr) {
        Object obj;
        Object obj2;
        View controlInternal;
        Utils.j("StartDrag", objArr);
        Utils.h("StartDrag", objArr, 1, 2);
        int i = 0;
        if (objArr.length == 1) {
            C0932x0 c0932x0 = (C0932x0) objArr[0];
            obj = Q8.k.z(c0932x0, "source", null);
            obj2 = Q8.k.z(c0932x0, "data", null);
            boolean a2 = Q8.k.a(c0932x0, "enableGlobalDrag", false);
            if (Build.VERSION.SDK_INT >= 24 && a2) {
                i = 257;
            }
        } else {
            obj = objArr[0];
            obj2 = objArr[1];
            if (obj == null) {
                throw new IllegalArgumentException("StartDrag(): Empty source argument");
            }
            if (obj2 == null) {
                throw new IllegalArgumentException("StartDrag(): Empty data argument");
            }
        }
        if (obj instanceof View) {
            controlInternal = (View) obj;
        } else {
            if (!(obj instanceof CharSequence)) {
                throw new IllegalArgumentException("StartDrag(): Unknown source argument of type " + obj.getClass().getSimpleName());
            }
            String obj3 = obj.toString();
            controlInternal = getControlInternal(obj3);
            if (controlInternal == null) {
                throw new IllegalArgumentException("StartDrag(): Cannot find control " + obj3);
            }
        }
        ClipData newPlainText = ClipData.newPlainText("", "");
        View.DragShadowBuilder dragShadowBuilder = new View.DragShadowBuilder(controlInternal);
        if (Build.VERSION.SDK_INT >= 24) {
            controlInternal.startDragAndDrop(newPlainText, dragShadowBuilder, obj2, i);
            return this;
        }
        controlInternal.startDrag(newPlainText, dragShadowBuilder, obj2, i);
        return this;
    }

    @ScriptAllowed
    public Object startForegroundService(Object... objArr) {
        Utils.h("StartForegroundService", objArr, 0, 2);
        xoneApp Z0 = xoneApp.Z0();
        AppForegroundService.a(Z0, (String) Utils.w(objArr, 0, Z0.getString(AbstractC0568j.c)), (String) Utils.w(objArr, 1, Z0.getString(AbstractC0568j.b)));
        return null;
    }

    @ScriptAllowed
    public boolean startGps(final Object... objArr) {
        xoneApp Z0 = xoneApp.Z0();
        if (C9.e.q(Z0, "android.permission.ACCESS_FINE_LOCATION")) {
            return doInternalStartGps(objArr);
        }
        Utils.l("XOneAndroidFramework", "ui.startGps() has been invoked but permission is not granted yet. Requesting it if possible");
        C9.a g = Z0.g();
        if (g instanceof XoneBaseActivity) {
            new h.a().d(true).e(8001).f(Z0.getString(ha.v.b)).c(new C9.c() {
                @Override
                public final void a(Set set) {
                    XoneGlobalUI.this.lambda$startGps$11(objArr, set);
                }
            }).h("android.permission.ACCESS_FINE_LOCATION").a().i(g);
            return false;
        }
        Utils.l("XOneAndroidFramework", "ui.startGps(): No edit view is visible, cannot request location permissions. Ignoring request");
        return false;
    }

    @ScriptAllowed
    public boolean startGpsV1(Object... objArr) {
        xoneApp.Z0().d3();
        return true;
    }

    @ScriptAllowed
    public boolean startGpsV2(Object... objArr) {
        if (objArr == null || objArr.length == 0) {
            xoneApp.Z0().f3("", 30000L, 0);
            return true;
        }
        Utils.j("StartGPS", objArr);
        if (objArr.length == 1 && (objArr[0] instanceof C0932x0)) {
            xoneApp.Z0().g3((C0932x0) objArr[0]);
            return true;
        }
        Utils.g("StartGPS", objArr, 3);
        xoneApp.Z0().f3(fb.t.y(objArr[0]), objArr.length > 1 ? fb.q.s(objArr[1]) : 30000L, objArr.length > 2 ? fb.q.o(objArr[2]) : 0);
        return true;
    }

    @ScriptAllowed
    public boolean startKioskMode() {
        g.c S = xoneApp.Z0().S();
        if (S == null) {
            return false;
        }
        S.startLockTask();
        return true;
    }

    @com.xone.annotations.ScriptAllowed
    public int startPrint(java.lang.Object... r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.xone.android.framework.XoneGlobalUI.startPrint(java.lang.Object[]):int");
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public int startWifi() {
        WifiManager wifiManager = getWifiManager();
        if (wifiManager.isWifiEnabled()) {
            return 0;
        }
        wifiManager.setWifiEnabled(true);
        return 0;
    }

    @ScriptAllowed
    public int stopAudioRecord() {
        C0767c d = C0767c.d();
        if (d.f()) {
            d.r();
            return 0;
        }
        throw new IllegalStateException("StopAudioRecord(): No active recording sessions");
    }

    @ScriptAllowed
    public Object stopForegroundService(Object... objArr) {
        AppForegroundService.b(xoneApp.Z0());
        return null;
    }

    @ScriptAllowed
    public boolean stopGps() {
        return xoneApp.Z0().G();
    }

    @ScriptAllowed
    public boolean stopGpsV1() {
        return xoneApp.Z0().m3();
    }

    @ScriptAllowed
    public boolean stopGpsV2() {
        return xoneApp.Z0().n3();
    }

    @ScriptAllowed
    public boolean stopKioskMode() {
        g.c S = xoneApp.Z0().S();
        if (S == null) {
            return false;
        }
        S.stopLockTask();
        return true;
    }

    @ScriptAllowed
    public boolean stopPlaySound() {
        B8.e.g();
        return true;
    }

    @ScriptAllowed
    public boolean stopPlaySoundAndVibrate() {
        B8.e.g();
        return true;
    }

    @ScriptAllowed
    public void stopRecognizeSpeech(Object... objArr) {
        i8.i.f().l(Utils.q(objArr, 0, true));
    }

    @ScriptAllowed
    public boolean stopSpeaking(Object... objArr) {
        Utils.j("StopSpeaking", objArr);
        Utils.g("StopSpeaking", objArr, 1);
        return i8.m.g(fb.t.y(objArr[0]));
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public int stopWifi() {
        WifiManager wifiManager = getWifiManager();
        if (wifiManager.isWifiEnabled()) {
            wifiManager.setWifiEnabled(false);
        }
        return 0;
    }

    @ScriptAllowed
    public String toString() {
        return "XOne global ui object";
    }

    @ScriptAllowed
    public int toggleGroup(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) getApp().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        return xoneBaseActivity.toggleGroup(objArr);
    }

    @ScriptAllowed
    public int unlockGroup(Object... objArr) {
        XoneBaseActivity xoneBaseActivity = (XoneBaseActivity) getApp().g();
        if (xoneBaseActivity == null) {
            return -1;
        }
        return xoneBaseActivity.unlockGroup(objArr);
    }

    @ScriptAllowed
    public int updateWaitDialog(Object... objArr) {
        Utils.j("UpdateWaitDialog", objArr);
        Utils.g("UpdateWaitDialog", objArr, 2);
        String y = fb.t.y(objArr[0]);
        int o = fb.q.o(objArr[1]);
        InterfaceC1036l0 g = xoneApp.Z0().g();
        if (g == null) {
            return -1;
        }
        Message obtainMessage = g.getHandler().obtainMessage();
        obtainMessage.what = 1014;
        Bundle bundle = new Bundle();
        bundle.putString("title", "");
        bundle.putString("message", y);
        bundle.putInt("value", o);
        obtainMessage.setData(bundle);
        g.getHandler().sendMessage(obtainMessage);
        return 0;
    }

    @ScriptAllowed
    public boolean useLastPrinter(Object... objArr) {
        Utils.j("UseLastPrinter", objArr);
        Utils.g("UseLastPrinter", objArr, 1);
        isPrinterServerInstalled();
        isPrinterServerBinded();
        boolean parseBoolean = Boolean.parseBoolean(fb.t.y(objArr[0]));
        La.a aVar = this.remotePrintService;
        if (aVar == null) {
            return false;
        }
        aVar.W2(parseBoolean);
        return true;
    }

    @ScriptAllowed
    @SuppressLint({"MissingPermission"})
    public boolean vibrate(Object... objArr) {
        Utils.h("Vibrate", objArr, 0, 1);
        String y = objArr != null ? fb.t.y(objArr[0]) : null;
        Vibrator vibrator = getVibrator();
        if (TextUtils.isEmpty(y)) {
            vibrator.vibrate(1000L);
        } else {
            String[] split = y.split(",");
            long[] jArr = new long[split.length];
            for (int i = 0; i < split.length; i++) {
                long t = fb.q.t(split[i], -1L);
                if (t == -1) {
                    throw new IllegalArgumentException("Vibrate(): Invalid vibration pattern");
                }
                jArr[i] = t;
            }
            vibrator.vibrate(jArr, -1);
        }
        return true;
    }

    @Override
    public ua.U GetPropertyManager(String str, Object[] objArr) {
        Map<String, ua.U> map = mapPropManagers;
        Locale locale = Locale.US;
        if (map.containsKey(str.toLowerCase(locale))) {
            return map.get(str.toLowerCase(locale));
        }
        Xa.U u = new Xa.U(str, this, getScriptRuntime());
        u.e(objArr);
        map.put(str.toLowerCase(locale), u);
        return u;
    }

    @ScriptAllowed
    public boolean stopPlaySoundAndVibrate(boolean z) {
        B8.e m;
        if (B8.e.q() && (m = B8.e.m()) != null && (!z || !m.s())) {
            B8.e.g();
        }
        return true;
    }

    private synchronized int doInternalMessageBox(String str, String str2, int i, String str3, String str4, int i2) {
        int i3;
        try {
            try {
                try {
                    this.bIsExecuting = true;
                    this.nResponseButton = -1;
                    getApp().a3(i, str2, str, str3, str4, i2);
                    while (true) {
                        i3 = this.nResponseButton;
                        if (i3 >= 0 || !this.bIsExecuting) {
                            break;
                        }
                        Thread.sleep(100L);
                    }
                    this.bIsExecuting = false;
                } catch (Exception e) {
                    e.printStackTrace();
                    this.bIsExecuting = false;
                    return -1;
                }
            } catch (InterruptedException e2) {
                Thread.currentThread().interrupt();
                throw AbstractC0751f.e(e2);
            }
        } catch (Throwable th) {
            throw th;
        }
        return i3;
    }

    private synchronized int doInternalMessageBox(IXoneObject iXoneObject, String str, String str2, String str3) {
        int i;
        try {
            try {
                this.bIsExecuting = true;
                this.nResponseButton = -1;
                xoneApp app = getApp();
                app.b3(iXoneObject, str, str3, str2);
                int i2 = 0;
                while (true) {
                    i = this.nResponseButton;
                    if (i >= 0 || !this.bIsExecuting || i2 >= MESSAGEBOX_TIMEOUT) {
                        break;
                    }
                    Thread.sleep(100L);
                    if (app.W1()) {
                        i2++;
                    }
                }
                this.bIsExecuting = false;
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw AbstractC0751f.e(e);
            } catch (Exception e2) {
                e2.printStackTrace();
                this.bIsExecuting = false;
                return -1;
            }
        } catch (Throwable th) {
            throw th;
        }
        return i;
    }

    public static void launchApp(Intent intent, int i) {
        try {
            TimeUnit.MILLISECONDS.sleep(i);
            xoneApp Z0 = xoneApp.Z0();
            androidx.fragment.app.j g = Z0.g();
            if (g == null) {
                Utils.l("XOneAndroidFramework", "LaunchAppThread.run(): Launching app with " + i + " ms of delay from app context");
                Z0.startActivity(intent);
                return;
            }
            Utils.l("XOneAndroidFramework", "LaunchAppThread.run(): Launching app with " + i + " ms of delay from activity context");
            g.startActivityForResult(intent, 516);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}