예제 #1
0
 private static void RenameSubFiles(DirectoryInfo value, string startAppend)
 {
     FileInfo[] fileInfos = value.GetFiles();
     foreach (FileInfo fileInfo in fileInfos)
     {
         ApkProcessLogic.OutPut("【I】" + fileInfo.DirectoryName + "\\" + fileInfo.Name + " 重命名为:" + startAppend + fileInfo.Name);
         string preName = fileInfo.DirectoryName + "\\" + fileInfo.Name;
         string newName = fileInfo.DirectoryName + "\\" + startAppend + fileInfo.Name;
         File.Move(preName, newName);
     }
 }
예제 #2
0
        public static void DeletFile(string UnpackPath, string relativePath)
        {
            String file = UnpackPath + "\\" + relativePath;

            if (File.Exists(file))
            {
                ApkProcessLogic.OutPut("【I】---------------------------");
                ApkProcessLogic.OutPut("【I】删除" + relativePath);

                File.Delete(file);
            }
        }
예제 #3
0
        public static void DeletDir(string UnpackPath, string relativePath)
        {
            String dir = UnpackPath + "\\" + relativePath;

            if (Directory.Exists(dir))
            {
                ApkProcessLogic.OutPut("【I】---------------------------");
                ApkProcessLogic.OutPut("【I】删除" + relativePath + "所在目录 " + dir);

                Directory.Delete(dir, true);
            }
        }
예제 #4
0
        public static void RenameFile(string UnpackPath, string relativePath, string newRelativePath)
        {
            String file    = UnpackPath + "\\" + relativePath;
            String newfile = UnpackPath + "\\" + newRelativePath;

            if (File.Exists(newfile))
            {
                File.Delete(newfile);
            }
            if (File.Exists(file))
            {
                ApkProcessLogic.OutPut("【I】---------------------------");
                ApkProcessLogic.OutPut("【I】重命名AndroidManifest.xml为manifest.txt");

                File.Move(file, newfile);
            }
        }
예제 #5
0
        public static void MoveDir(string source, string dest)
        {
            if (File.Exists(dest))
            {
                Directory.Delete(dest, true);
            }
            string destParentDir = dest.Substring(0, dest.LastIndexOf("\\"));

            checkDir(destParentDir);

            if (Directory.Exists(source))
            {
                ApkProcessLogic.OutPut("【I】---------------------------");
                ApkProcessLogic.OutPut("【I】移动目录" + source + " -> " + dest);

                Directory.Move(source, dest);
            }
        }
예제 #6
0
        public static void CopyFile(string source, string dest)
        {
            if (File.Exists(dest))
            {
                File.Delete(dest);
            }
            string destDir = Path.GetDirectoryName(dest);

            checkDir(destDir);

            if (File.Exists(source))
            {
                ApkProcessLogic.OutPut("【I】---------------------------");
                ApkProcessLogic.OutPut("【I】复制文件" + source + " -> " + dest);

                File.Copy(source, dest, true);
            }
        }
예제 #7
0
        private static void RenameValues(String UnpackPath)
        {
            string resDir = UnpackPath + "\\res";

            ApkProcessLogic.OutPut("【I】---------------------------");
            ApkProcessLogic.OutPut("【I】重命名" + resDir + "\\value目录下所有文件");

            if (Directory.Exists(resDir))
            {
                DirectoryInfo   dir       = new DirectoryInfo(resDir);
                DirectoryInfo[] valueDirs = dir.GetDirectories();

                foreach (DirectoryInfo value in valueDirs)
                {
                    string name = value.Name;
                    if (name.Equals("values") || name.StartsWith("values-"))
                    {
                        RenameSubFiles(value, "ltsdk_");
                    }
                }
            }
        }
예제 #8
0
 private static void OutPut(String info)
 {
     ApkProcessLogic.OutPut(info);
 }