Ejemplo n.º 1
0
        private void CallToInitApp(
            IBluetoothLowEnergyAdapter adapter,
            IUserDialogs dialogs,
            string appVersion)
        {
            // Catch unhandled exceptions
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskSchedulerOnUnobservedTaskException;

            Utils.Print("FormsApp: Interactive [ " + Data.Get.IsFromScripting + " ]");

            appVersion_str = appVersion;

            deviceId = CrossDeviceInfo.Current.Id;

            // Profiles manager
            credentialsService = new CredentialsService();

            // Initializes Bluetooth
            ble_interface = new BleSerial(adapter);

            AppResources.Culture = CrossMultilingual.Current.DeviceCultureInfo;

            // Config path
            ConfigPaths();

            if (Device.RuntimePlatform == Device.iOS)
            {
                var MamServ = DependencyService.Get <IMAMService>();
                MamServ.UtilMAMService();
            }

            this.LoadConfigurationAndOpenScene(dialogs);
        }
Ejemplo n.º 2
0
        private void CallToInitApp(IBluetoothLowEnergyAdapter adapter, List <string> listaDatos, IUserDialogs dialogs, string appVersion)
        {
            appVersion_str = appVersion;

            deviceId = CrossDeviceInfo.Current.Id;

            // Profiles manager
            credentialsService = new CredentialsService();

            // Initializes Bluetooth
            ble_interface = new BleSerial(adapter);

            string data = string.Empty;

            if (listaDatos.Count != 0 ||
                listaDatos != null)
            {
                for (int i = 0; i < listaDatos.Count; i++)
                {
                    data = data + listaDatos[i] + "\r\n";
                }
            }

            string base64CertificateString = "";

            try
            {
                base64CertificateString = listaDatos[2].Replace("cert_file: ", "");
                byte[]           bytes           = Convert.FromBase64String(base64CertificateString);
                X509Certificate2 x509certificate = new X509Certificate2(bytes);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }

            AppResources.Culture = CrossMultilingual.Current.DeviceCultureInfo;

            // Force to not download server XML files
            if (DEBUG_MODE_ON)
            {
                this.LoadXmlsAndCreateContainer(dialogs, data);
            }
            else
            {
                // Downloads, if necesary, and loads configuration from XML files
                if (this.HasDeviceAllXmls())
                {
                    this.LoadXmlsAndCreateContainer(dialogs, data);
                }
                else
                {
                    this.DownloadXmlsIfNecessary(dialogs, data);
                }
            }
        }
Ejemplo n.º 3
0
        private void CallToInitApp(
            IBluetoothLowEnergyAdapter adapter,
            IUserDialogs dialogs,
            string appVersion)
        {
            // Catch unhandled exceptions
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskSchedulerOnUnobservedTaskException;

            Utils.Print("FormsApp: Interactive [ " + Data.Get.IsFromScripting + " ]");

            appVersion_str = appVersion;

            deviceId = CrossDeviceInfo.Current.Id;

            // Profiles manager
            credentialsService = new CredentialsService();

            // Initializes Bluetooth
            ble_interface = new BleSerial(adapter);

            AppResources.Culture = CrossMultilingual.Current.DeviceCultureInfo;

            // Config path
            ConfigPaths();

            string Mode = GenericUtilsClass.ChekInstallMode();

            if (Data.Get.IsAndroid && Mode.Equals("None"))
            {
                var MamServ = DependencyService.Get <IMAMService>();
                MamServ.UtilMAMService();
                if (Mobile.configData.HasIntune)
                {
                    GenericUtilsClass.SetInstallMode("Intune");
                    this.LoadConfigurationAndOpenScene(dialogs);
                    return;
                }
            }

            // var MamServ = DependencyService.Get<IMAMService>();
            // MamServ.UtilMAMService();

            if (VersionTracking.IsFirstLaunchEver || Mode.Equals("None"))
            {
                SecureStorage.RemoveAll();
                Device.BeginInvokeOnMainThread(() =>
                {
                    MainPage = new NavigationPage(new AclaraInstallPage());
                });
            }
            else
            {
                if (Mode.Equals("Intune"))
                {
                    var MamServ = DependencyService.Get <IMAMService>();
                    MamServ.UtilMAMService();
                }
                else if (Mode.Equals("FTP"))
                {
                    // Check if FTP settings is in securestorage
                    GenericUtilsClass.CheckFTPDownload();
                }

                this.LoadConfigurationAndOpenScene(dialogs);
            }
        }