Esempio n. 1
0
    public void InstallApk()
    {
        AppState = CurrentAppState.Installation;
        OverallNumberofInstallations = deviceDetails.Count * apkPaths.Count;

        InstallationManager.Instance.Init();
        Thread th;

        for (int i = 0; i < deviceDetails.Count; i++)
        {
            if (deviceDetails[i].toggle.isOn)
            {
                deviceDetails[i].InitForInstallation();

                installationThreadStarted = false;

                ProcessThreads.Add(th = new Thread(() =>
                                                   InstallationManager.Instance.StartInstallationForEachDevice(i)
                                                   //ADBManager.Instance.InstallApkToOneDevice(i)
                                                   ));
                th.Start();
                Thread.Sleep(100);
            }
            else
            {
                OverallNumberofInstallations -= (apkPaths.Count);
                deviceDetails[i].gameObject.SetActive(false);
            }
        }
    }
Esempio n. 2
0
    internal void OnOverallProcessCompletion()
    {
        AppState = CurrentAppState.Summary;
        installationThreadStarted = false;
        for (int i = 0; i < ProcessThreads.Count; i++)
        {
            if (ProcessThreads[i].IsAlive)
            {
                ProcessThreads[i].Abort();
            }
        }
        ProcessThreads.Clear();

        UIManager.Instance.SummaryButton.SetActive(true);
    }
Esempio n. 3
0
    private void rebuildList(params string[] e)
    {
        AppState = CurrentAppState.APKSelection;

        if (e == null || e.Equals(""))
        {
            return;
        }

        apkPaths.Clear();
        foreach (Text txt in apkRows)
        {
            Destroy(txt.gameObject.transform.parent.gameObject);
        }
        apkRows.Clear();
        apkDataList.Clear();
        for (int ii = 0; ii < e.Length; ii++)
        {
            if (e[ii].ToString().Contains("apk"))
            {
                GameObject go = Instantiate(DummyApkRow, ApkListTableView.transform);
                Text       apkFileNameText = go.transform.GetChild(1).GetComponent <Text>();
                Text       apkNameText     = go.transform.GetChild(2).GetComponent <Text>();
                string     APKName         = e[ii].ToString();
                int        LastIndex       = APKName.LastIndexOf('\\') + 1;
                apkFileNameText.text = APKName.Substring(LastIndex, APKName.Length - LastIndex);
                apkNameText.text     = FilterManager.instance.ID2Title(apkFileNameText.text.ToString().Replace(".apk", ""));

                apkPaths.Add('"' + APKName + '"');
                apkRows.Add(apkFileNameText);
                apkNames.Add(apkFileNameText.text);

                #region Add ApkData for each APP
                ApkData apkData = go.GetComponent <ApkData>();
                apkData.Path = '"' + APKName + '"';
                apkData.ID   = apkFileNameText.text.ToString().Replace(".apk", "").ToLower();
                apkData.Name = FilterManager.instance.ID2Title(apkData.ID);
                #endregion
            }
        }

        TotalAPKPerDevice            = apkPaths.Count;
        OverallNumberofInstallations = deviceDetails.Count * apkPaths.Count;

        StartCoroutine(AfterRebuildList());
        //UnityEngine.Debug.Log("totalNumberOfInstallations " + totalNumberOfInstallations + "deviceIds.Count " + deviceDetails.Count + "apkPahts.Count " + apkPaths.Count);
    }
Esempio n. 4
0
    public void RefreshConnectedDevicesList()
    {
        AppState = CurrentAppState.DeviceSelection;
        ClearConnectedDeviceVariables();

        UIManager.Instance.DeviceSelectionToggleAll.gameObject.SetActive(false);
        UIManager.Instance.ConnectDeviceResetBtn.SetActive(false);
        UIManager.Instance.DeviceLoadingPanel.SetActive(true);
        UIManager.Instance.NoDevicePanel.SetActive(false);

        ADBManager adbManager = ADBManager.Instance;

        ProcessThreads.Add(new Thread(() => adbManager.GetConnectedDevices()));
        ProcessThreads[ProcessThreads.Count - 1].Start();

        Thread.Sleep(1);
    }
Esempio n. 5
0
 /// <summary>
 /// Sets the current applcation state from the Application's Application Events.
 /// </summary>
 /// <param name="app"></param>
 /// <param name="state"></param>
 public static void SetCurrentAppState(this Application app, CurrentAppState state)
 {
     GetCurrentAppState = state;
     if (state == CurrentAppState.None)
         IsNormalOperation = true;
 }