Exemplo n.º 1
0
        //获取配置文件的信息
        private void InitDataShow()
        {
            Dictionary <string, string> dictionary = XmlDataUtil.GetManifestXML();

            if (dictionary != null)
            {
                foreach (KeyValuePair <String, String> keyValue in dictionary)
                {
                    switch (keyValue.Key)
                    {
                    case "apktoolPath":
                        tb_apktool.Text = keyValue.Value;
                        break;

                    case "signerPath":
                        tb_signer_path.Text = keyValue.Value;
                        break;

                    case "signerPassword":
                        tb_signer_password.Text = keyValue.Value;
                        break;

                    case "alias":
                        tb_alias.Text = keyValue.Value;
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        //获取别名后的操作
        public void GetAliasEnd(string alias)
        {
            iMain.AliasValue(alias ?? "");

            Dictionary <string, string> keyValues = new Dictionary <string, string>
            {
                { "apktoolPath", mainEntity.ApktoolPath },
                { "signerPath", mainEntity.SignerPath },
                { "signerPassword", mainEntity.SignerPassword },
                { "alias", mainEntity.Alias }
            };

            XmlDataUtil.CreateXMLForData(keyValues);

            fileUtil = new FileUtil();
            GetChannelList();
            if (CommonUtil.IsEmpty(mainEntity.ApktoolPath))
            {
                DecodeEnd();
            }
            else
            {
                if (Directory.Exists(mainEntity.ApkPath))
                {
                    string[] apkPathFiles = Directory.GetFiles(mainEntity.ApkPath);
                    mainEntity.ApkPathList     = new List <string>();
                    mainEntity.PackageNameList = new List <string>();
                    int i = 0;
                    foreach (var apkPathFile in apkPathFiles)
                    {
                        if (File.Exists(apkPathFile) && Path.GetExtension(apkPathFile).Equals(".apk"))
                        {
                            ++i;
                            mainEntity.ApkPathList.Add(apkPathFile);
                            if (mainEntity.PackageNameList == null)
                            {
                                mainEntity.PackageNameList = new List <string>();
                            }
                            if (mainEntity.PackageNameList.Count < i)
                            {
                                if (!CommonUtil.IsEmpty(mainEntity.PackageName))
                                {
                                    mainEntity.PackageNameList.Add(mainEntity.PackageName + i);
                                }
                            }
                        }
                    }
                    if (mainEntity.ApkPathList.Count > 0)
                    {
                        mainEntity.ApkPath = mainEntity.ApkPathList[0];
                    }
                }
                processUtil.ExecuteDecodeCMD();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// PackageDescriptor Constructor
        /// </summary>
        /// <param name="descriptorXmlInfo"></param>
        public PackageDescriptor(string descriptorXmlInfo)
        {
            var xmlData = XElement.Parse(descriptorXmlInfo);

            Name          = XmlDataUtil.GetValue <string>(xmlData, "name");
            ModelVersion  = XmlDataUtil.GetValue <string>(xmlData, "version");
            Author        = XmlDataUtil.GetValue(xmlData, "author", "default.author");
            GroupId       = XmlDataUtil.GetValue(xmlData, "groupid", "com.nerve.group");
            Priority      = XmlDataUtil.GetValue(xmlData, "priority", "low");
            GuidData      = Guid.NewGuid().ToString();
            PackageStatus = Status.Active;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Digest Route Information
        /// </summary>
        private void Exec(XElement routeElement)
        {
            if (routeElement == null)
            {
                return;
            }

            try
            {
                var description = XmlDataUtil.Attribute <string>(routeElement, TagConstant.Description);
                var routeObj    = new Route {
                    Description = description, PackageDescriptor = _packageDescriptor
                };
                RouteStep nextRouteStepProcessorToLink = null;

                //read all steps in route
                foreach (var xmlStep in routeElement.Elements())
                {
                    if (routeObj.CurrentRouteStep == null)
                    {
                        routeObj.CurrentRouteStep    = new RouteStep(xmlStep, routeObj);
                        nextRouteStepProcessorToLink = routeObj.CurrentRouteStep;
                    }
                    else
                    {
                        var nextStep = new RouteStep(xmlStep, routeObj);
                        if (nextRouteStepProcessorToLink == null)
                        {
                            continue;
                        }

                        nextRouteStepProcessorToLink.NextRouteStep = nextStep;
                        nextRouteStepProcessorToLink = nextRouteStepProcessorToLink.NextRouteStep;
                    }
                }

                //add route for execution
                SynapseContext.SetRoute(routeObj);
            }
            catch (Exception exception)
            {
                var msg = exception.Message;
            }
        }
Exemplo n.º 5
0
 // 商品类别(小)
 public IEnumerable <string> StyleSmallList(string styleBig)
 {
     return(XmlDataUtil.QueryElementsAllowToElementById(styleBig));
 }
Exemplo n.º 6
0
 // 商品类别(大)
 public IEnumerable <string> StyleBigList()
 {
     return(XmlDataUtil.QueryElementsById("styleBig"));
 }
Exemplo n.º 7
0
 // 单位(小)
 public IEnumerable <string> SmallUnitList()
 {
     return(XmlDataUtil.QueryElementsAllowToElementById("单位(小)"));
 }
Exemplo n.º 8
0
 // 是否高毒
 public IEnumerable <string> IsHighToxicityList()
 {
     return(XmlDataUtil.QueryElementsAllowToElementById("是否高毒"));
 }
Exemplo n.º 9
0
 // 制单人
 public IEnumerable <string> ZhiDanRen()
 {
     return(XmlDataUtil.QueryElementsAllowToElementById("制单人"));
 }