Example #1
0
        private static void PackPS3(string sourcePath, string saveFileName, Platform platform, bool updateSng)
        {
            Pack2014(sourcePath, saveFileName, platform, updateSng);

            var edatDir = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "edat");

            if (!Directory.Exists(edatDir))
            {
                Directory.CreateDirectory(edatDir);
            }

            var sourceCleanPackage = saveFileName + ".psarc";
            var destCleanPackage   = Path.Combine(edatDir, Path.GetFileName(saveFileName) + ".psarc");
            var encryptedPackage   = destCleanPackage + ".edat";

            if (File.Exists(sourceCleanPackage))
            {
                File.Move(sourceCleanPackage, destCleanPackage);
            }

            var outputMessage = RijndaelEncryptor.EncryptPS3Edat();

            if (outputMessage.IndexOf("Encrypt all EDAT files successfully") > 0)
            {
                if (File.Exists(destCleanPackage))
                {
                    File.Delete(destCleanPackage);
                }

                if (File.Exists(encryptedPackage))
                {
                    File.Move(encryptedPackage, sourceCleanPackage + ".edat");
                }
            }
        }
        private static void PackPS3(string sourcePath, string saveFileName, Platform platform, bool updateSng, bool updateManifest)
        {
            Pack2014(sourcePath, saveFileName, platform, updateSng, updateManifest);

            if (!Directory.Exists(PS3_WORKDIR))
            {
                Directory.CreateDirectory(PS3_WORKDIR);
            }

            foreach (var junk in Directory.EnumerateFiles(PS3_WORKDIR, "*.*"))
            {
                File.Delete(junk);
            }

            var sourceCleanPackage = saveFileName + ".psarc";
            var destCleanPackage   = Path.Combine(PS3_WORKDIR, Path.GetFileName(saveFileName) + ".psarc");
            var encryptedPackage   = destCleanPackage + ".edat";

            if (File.Exists(sourceCleanPackage))
            {
                File.Move(sourceCleanPackage, destCleanPackage);
            }

            var outputMessage = RijndaelEncryptor.EncryptPS3Edat();

            if (outputMessage.IndexOf("Encrypt all EDAT files successfully") > 0)
            {
                if (File.Exists(destCleanPackage))
                {
                    File.Delete(destCleanPackage);
                }

                if (File.Exists(encryptedPackage))
                {
                    File.Move(encryptedPackage, sourceCleanPackage + ".edat");
                }
            }
        }