コード例 #1
0
ファイル: IOSDeviceManger.cs プロジェクト: rajeshwarn/racer
        public bool CheckItunes()
        {
            string addpath1 = "", addpath2 = "";

            if (EnvInfo.GetSystemBits() == 64)
            {
                RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Apple Inc.\Apple Mobile Device Support");
                if (reg == null)
                {
                    return(false);
                }
                object temp = reg.GetValue("InstallDir");
                if (temp == null)
                {
                    return(false);
                }
                addpath1 = temp.ToString();
                RegistryKey reg2 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Apple Inc.\Apple Application Support");
                if (reg2 == null)
                {
                    return(false);
                }
                temp = reg2.GetValue("InstallDir");
                if (temp == null)
                {
                    return(false);
                }
                addpath2 = temp.ToString();
            }
            else
            {
                RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Apple Inc.\Apple Mobile Device Support");
                if (reg == null)
                {
                    return(false);
                }
                object temp = reg.GetValue("InstallDir");
                if (temp == null)
                {
                    return(false);
                }
                addpath1 = temp.ToString();
                RegistryKey reg2 = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Apple Inc.\Apple Application Support");
                if (reg2 == null)
                {
                    return(false);
                }
                temp = reg2.GetValue("InstallDir");
                if (temp == null)
                {
                    return(false);
                }
                addpath2 = temp.ToString();
            }
            Environment.SetEnvironmentVariable("path", Environment.GetEnvironmentVariable("path") + ";" + addpath1 + ";" + addpath2);
            return(true);
        }
コード例 #2
0
ファイル: Config.cs プロジェクト: rajeshwarn/racer
        private Config()
        {
            config = new Hashtable();
            string startPath = EnvInfo.GetStartPath();
            int    OSBits    = EnvInfo.GetSystemBits();

            if (OSBits == 32)
            {
                OSBits = 86;
            }
            config.Add("InstExePath", startPath + "\\tools\\DriverInst_x" + OSBits + ".exe");
            config.Add("DriverPath", startPath + "\\tools\\driver\\google_x" + OSBits + "_inf\\android_winusb.inf");
            config.Add("ADBExePath", startPath + "\\tools\\51adb.exe");
            config.Add("AppDirPath", startPath + "\\app\\");
            config.Add("Wav", startPath + "\\tools\\wav.wav");
            config.Add("HOST", "http://10.2.26.88/");
            config.Add("API", "http://10.2.26.88/api/a/type/xml/interface/");
        }
コード例 #3
0
        public static List <AppPackage> GetPackList(Panel panel)
        {
            XmlDocument xmlDom    = new XmlDocument();
            string      xmlString = EnvInfo.HttpGet(api + "package");

            xmlDom.LoadXml(xmlString);
            XmlNode           node     = xmlDom.ChildNodes[1].ChildNodes[2];
            List <AppPackage> tempList = new List <AppPackage>();

            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                string          packName = node.ChildNodes[i].SelectSingleNode("title").InnerText;
                string          ids      = node.ChildNodes[i].SelectSingleNode("description").InnerText;
                List <ImageApp> apps     = API.GetAppList(1, ids);
                AppPackage      pack     = new AppPackage(packName, apps, panel);
                pack.Location = new Point(10 + i * 180, 9);
                tempList.Add(pack);
            }
            return(tempList);
        }
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      userName  = textBox1.Text;
            string      password  = textBox2.Text;
            string      xmlString = EnvInfo.HttpGet(string.Format(api, userName, password));
            XmlDocument xmlDom    = new XmlDocument();

            xmlDom.LoadXml(xmlString);
            XmlNode node = xmlDom.ChildNodes[1].ChildNodes[2];

            if (node.SelectSingleNode("code").InnerText != "0")
            {
                MessageBox.Show(node.SelectSingleNode("message").InnerText);
            }
            else
            {
                new Form1(new UserInfo {
                    ID = node.SelectSingleNode("uid").InnerText, NickName = userName
                }).Show();
                this.Hide();
            }
        }
コード例 #5
0
        public static List <ImageApp> GetAppList(int type = 1, string ids = "")
        {
            string      ext       = type == 1 ? ".apk" : ".ipa";
            XmlDocument xmlDom    = new XmlDocument();
            string      xmlString = EnvInfo.HttpGet(api + "app/platform/" + type + "/ids/" + ids.Replace(',', '-'));

            xmlDom.LoadXml(xmlString);
            XmlNode         node     = xmlDom.ChildNodes[1].ChildNodes[2];
            List <ImageApp> tempList = new List <ImageApp>();

            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                string   appId         = node.ChildNodes[i].SelectSingleNode("cid").InnerText;
                string   appName       = node.ChildNodes[i].SelectSingleNode("title").InnerText;
                string   appPath       = appDir + appId + ext;
                string   appUrlPath    = uploads + node.ChildNodes[i].SelectSingleNode("down_link").InnerText;
                string   appImgPath    = appDir + appId + ".jpg";
                string   appImgUrlPath = uploads + node.ChildNodes[i].SelectSingleNode("thumb").InnerText;
                ImageApp app           = new ImageApp(appId, appName, appPath, appUrlPath, appImgPath, appImgUrlPath);
                app.Location = new Point(10 + i * 80, 10);
                tempList.Add(app);
            }
            return(tempList);
        }
コード例 #6
0
 public static void Install(string uid, string username, string aid, string deviceid)
 {
     EnvInfo.HttpGet(api + "install/?uid=" + uid + "&aid=" + aid + "&username="******"&deviceid=" + deviceid);
 }
コード例 #7
0
ファイル: ADBHelper.cs プロジェクト: rajeshwarn/racer
 private string SendMessage(string message)
 {
     return(EnvInfo.StartProcess(exePath, message));
 }
コード例 #8
0
ファイル: ADBHelper.cs プロジェクト: rajeshwarn/racer
 private ADBHelper(string exePath)
 {
     this.exePath = exePath;
     EnvInfo.StartProcess(exePath, "fork-server server", false);
 }
コード例 #9
0
        public void InstallDriver(string device)
        {
            string command = "\"" + device + "\" \"" + driverPath + "\"";

            EnvInfo.StartProcess(exePath, command);
        }
コード例 #10
0
ファイル: IOSDeviceManger.cs プロジェクト: rajeshwarn/racer
        public void InstallVCRuntime()
        {
            string fileName = EnvInfo.GetStartPath() + "\\tools\\vcredist_x86.exe";

            EnvInfo.StartProcess(fileName, "");
        }