Ejemplo n.º 1
0
        private void SetupAndroidCtrl()
        {
            // Extract AndroidCtrl files if none are found
            if (!ADB.IntegrityCheck())
            {
                _log.Info("ADB files missing, deploying");
                // If AndroidCtrl path is empty, deply to ./ToolkitData/adb
                if (String.IsNullOrEmpty(Settings.Default.ACtrl_Location))
                {
                    Deploy.ADB("./ToolkitData/platform-tools");
                    _log.Info("ADB deployed to ./ToolkitData/platform-tools");
                }
                else
                {
                    Deploy.ADB(Settings.Default.ACtrl_Location);
                    _log.Info($"ADB deployed to {Settings.Default.ACtrl_Location}");
                }
            }

            if (!Fastboot.IntegrityCheck())
            {
                _log.Info("fastboot files missing, deploying");
                // If AndroidCtrl path is empty, deply to ./ToolkitData/adb
                if (String.IsNullOrEmpty(Settings.Default.ACtrl_Location))
                {
                    Deploy.Fastboot("./ToolkitData/platform-tools");
                    _log.Info("ADB deployed to ./ToolkitData/platform-tools");
                }
                else
                {
                    Deploy.Fastboot(Settings.Default.ACtrl_Location);
                    _log.Info($"ADB deployed to {Settings.Default.ACtrl_Location}");
                }
            }

            // Start Monitoring services
            // Check if ADB server is already running, and check if it is mismatched

            if (!ADB.IsStarted || !ADB.IntegrityVersionCheck())
            {
                _log.Warn("ADB server outdated or not started");
                ADB.Stop();
                _log.Info("Starting ADB server...");
                ADB.Start();
            }
        }
Ejemplo n.º 2
0
 public void CheckandDeploy()
 {
     if (ADB.IntegrityCheck() == false)
     {
         Deploy.ADB();
     }
     if (Fastboot.IntegrityCheck() == false)
     {
         Deploy.Fastboot();
     }
     // Check if ADB is running
     if (ADB.IsStarted)
     {
         ADB.Stop();             // Stop ADB
         ADB.Stop(true);         // Force Stop ADB
     }
     else
     {
         ADB.Start();
     }                           // Start ADB
 }