diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cec7e0..0aa0fe4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,17 +14,17 @@ jobs: fail-fast: false matrix: os: - - { prettyName: Windows, platform: windows-latest, configurationName: Windows, extraArgs: "", buildPath: "Release/net8.0-windows/publish"} - - { prettyName: Linux, platform: ubuntu-latest, configurationName: Linux, extraArgs: "", buildPath: "Release/net8.0/publish"} + - { prettyName: Windows, platform: windows-latest, configurationName: Windows, extraArgs: "", buildPath: "Release/net6.0-windows/publish"} + - { prettyName: Linux, platform: ubuntu-latest, configurationName: Linux, extraArgs: "", buildPath: "Release/net6.0/publish"} # - { prettyName: MacOS, platform: ubuntu-latest, configurationName: Release, platform: osx-x64 } steps: - name: Checkout uses: actions/checkout@v2 - - name: Install .NET 8.0 + - name: Install .NET 6.0 uses: actions/setup-dotnet@v1 with: - dotnet-version: "8.0.x" + dotnet-version: "6.0.x" - name: Compile for ${{ matrix.os.prettyName }} run: dotnet publish -c ${{ matrix.os.configurationName }} ${{ matrix.os.extraArgs }} diff --git a/UnionPatcher.Cli/UnionPatcher.Cli.csproj b/UnionPatcher.Cli/UnionPatcher.Cli.csproj index 5c6e24d..a4adeee 100644 --- a/UnionPatcher.Cli/UnionPatcher.Cli.csproj +++ b/UnionPatcher.Cli/UnionPatcher.Cli.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net6.0 enable enable UnionPatcher diff --git a/UnionPatcher.Gui.Linux/UnionPatcher.Gui.Linux.csproj b/UnionPatcher.Gui.Linux/UnionPatcher.Gui.Linux.csproj index 74f3bd8..f9f7aa8 100644 --- a/UnionPatcher.Gui.Linux/UnionPatcher.Gui.Linux.csproj +++ b/UnionPatcher.Gui.Linux/UnionPatcher.Gui.Linux.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net6.0 linux-x64 LBPUnion.UnionPatcher.Gui.Linux LBPUnion.UnionPatcher.Gui.Linux diff --git a/UnionPatcher.Gui.MacOS/Info.plist b/UnionPatcher.Gui.MacOS/Info.plist deleted file mode 100755 index 883a4ac..0000000 --- a/UnionPatcher.Gui.MacOS/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleIdentifier - com.lbpunion.unionpatcher - NSHumanReadableCopyright - Copyright LBP Union 2024© - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - CFBundleDevelopmentRegion - en - CFBundleIconFile - Icon.icns - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleSignature - ???? - NSPrincipalClass - NSApplication - CFBundleName - UnionPatcher - CFBundleExecutable - LBPUnion.UnionPatcher.Gui.MacOS - LSMinimumSystemVersion - 10.14 - NSRequiresAquaSystemAppearance - False - - diff --git a/UnionPatcher.Gui.MacOS/UnionPatcher.Gui.MacOS.csproj b/UnionPatcher.Gui.MacOS/UnionPatcher.Gui.MacOS.csproj index e4eb4d3..62fb7a3 100644 --- a/UnionPatcher.Gui.MacOS/UnionPatcher.Gui.MacOS.csproj +++ b/UnionPatcher.Gui.MacOS/UnionPatcher.Gui.MacOS.csproj @@ -2,13 +2,11 @@ Exe - net8.0 + net6.0 osx-x64;osx-arm64 LBPUnion.UnionPatcher.Gui.MacOS LBPUnion.UnionPatcher.Gui.MacOS Icon64.ico - true - true diff --git a/UnionPatcher.Gui.Windows/UnionPatcher.Gui.Windows.csproj b/UnionPatcher.Gui.Windows/UnionPatcher.Gui.Windows.csproj index 8c18143..f754306 100644 --- a/UnionPatcher.Gui.Windows/UnionPatcher.Gui.Windows.csproj +++ b/UnionPatcher.Gui.Windows/UnionPatcher.Gui.Windows.csproj @@ -2,7 +2,7 @@ WinExe - net8.0-windows + net6.0-windows LBPUnion.UnionPatcher.Gui.Windows LBPUnion.UnionPatcher.Gui.Windows Icon64.ico diff --git a/UnionPatcher.Gui/Forms/ModeSelectionForm.cs b/UnionPatcher.Gui/Forms/ModeSelectionForm.cs index 1b3ffbc..a39a4bd 100644 --- a/UnionPatcher.Gui/Forms/ModeSelectionForm.cs +++ b/UnionPatcher.Gui/Forms/ModeSelectionForm.cs @@ -1,12 +1,8 @@ using System; -using System.IO; -using System.Reflection; -using System.Text; -using Eto; using Eto.Drawing; using Eto.Forms; -namespace LBPUnion.UnionPatcher.Gui.Forms; +namespace LBPUnion.UnionPatcher.Gui.Forms; public class ModeSelectionForm : Form { #region UI @@ -27,32 +23,10 @@ public class ModeSelectionForm : Form { new TableCell(new Button(openFilePatcher) { Text = "File Patch (PS3/RPCS3)" }) ), }, - }; + }; } - - private void openRemotePatcher(object sender, EventArgs e) - { - // If we're on macOS then set the CWD to the app bundle MacOS folder, so that SCETool can be found. - if (OSUtil.GetPlatform() == OSPlatform.OSX) Directory.SetCurrentDirectory(OSUtil.GetExecutablePath()); - - if (!Directory.Exists($"{OSUtil.GetExecutablePath()}/scetool")) - { - // This will always occur on macOS, so don't show this message for macOS users. - if (OSUtil.GetPlatform() != OSPlatform.OSX) Gui.CreateOkDialog("Workaround Triggered", ".NET could not locate the required files, triggering workaround."); - Gui.CreateOkDialog("Workaround", "UnionPatcher RemotePatcher requires a staging folder on macOS or in special circumstances on Windows, please set this to the directory of the UnionPatcher app or executable!"); - SelectFolderDialog dialog = new SelectFolderDialog(); - if (dialog.ShowDialog(this) != DialogResult.Ok) - { - Gui.CreateOkDialog("Workaround", "User did not specify a staging folder, aborting!"); - return; - } - Directory.SetCurrentDirectory(dialog.Directory); - if (!Directory.Exists("scetool")) - { - Gui.CreateOkDialog("Workaround", "Invalid folder, remember to set the folder to the directory of the UnionPatcher app or executable!"); - return; - } - } + + private void openRemotePatcher(object sender, EventArgs e) { RemotePatchForm rpForm = new RemotePatchForm(); rpForm.Show(); rpForm.Closed += OnSubFormClose; diff --git a/UnionPatcher.Gui/Gui.cs b/UnionPatcher.Gui/Gui.cs index fec6065..808094f 100644 --- a/UnionPatcher.Gui/Gui.cs +++ b/UnionPatcher.Gui/Gui.cs @@ -1,4 +1,5 @@ -using Eto.Forms; +using Eto.Drawing; +using Eto.Forms; using LBPUnion.UnionPatcher.Gui.Forms; namespace LBPUnion.UnionPatcher.Gui; @@ -9,7 +10,7 @@ public static class Gui { } public static void CreateOkDialog(string title, string errorMessage) { - MessageBox.Show(errorMessage, title, MessageBoxButtons.OK); + MessageBox.Show(errorMessage, title, MessageBoxButtons.OK, MessageBoxType.Information); } public static bool CreateConfirmationDialog(string title, string errorMessage) { DialogResult result = MessageBox.Show(errorMessage, title, MessageBoxButtons.YesNo, MessageBoxType.Question); diff --git a/UnionPatcher.Gui/UnionPatcher.Gui.csproj b/UnionPatcher.Gui/UnionPatcher.Gui.csproj index 7915919..1400570 100644 --- a/UnionPatcher.Gui/UnionPatcher.Gui.csproj +++ b/UnionPatcher.Gui/UnionPatcher.Gui.csproj @@ -7,11 +7,11 @@ - net8.0 + net6.0 - net8.0-windows + net6.0-windows diff --git a/UnionPatcher/OSUtil.cs b/UnionPatcher/OSUtil.cs index 4aa26f3..b4eb0da 100644 --- a/UnionPatcher/OSUtil.cs +++ b/UnionPatcher/OSUtil.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using System.Linq; -using System.Reflection; using System.Runtime.InteropServices; namespace LBPUnion.UnionPatcher @@ -32,17 +29,6 @@ namespace LBPUnion.UnionPatcher return EnumeratePlatforms().FirstOrDefault(p => RuntimeInformation.IsOSPlatform(p.Value.RuntimePlatform))?.Platform ?? default; } - - public static string GetExecutablePath() - { - var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location); - if (string.IsNullOrEmpty(path)) - path = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName); - if (string.IsNullOrEmpty(path)) - path = AppContext.BaseDirectory; - - return path; - } } } diff --git a/UnionPatcher/RemotePatch.cs b/UnionPatcher/RemotePatch.cs index 2e56bee..8642559 100644 --- a/UnionPatcher/RemotePatch.cs +++ b/UnionPatcher/RemotePatch.cs @@ -91,23 +91,16 @@ public class RemotePatch { Console.WriteLine("Restoring original EBOOT.BIN from EBOOT.BIN.BAK"); - string workingDir = "."; - if (OSUtil.GetPlatform() == OSPlatform.OSX) - { - workingDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)}/UnionPatcher"; - Directory.CreateDirectory(workingDir); - } - // Create a simple directory structure - Directory.CreateDirectory($@"{workingDir}/eboot"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}/original"); + Directory.CreateDirectory(@"eboot"); + Directory.CreateDirectory($@"eboot/{gameID}"); + Directory.CreateDirectory($@"eboot/{gameID}/original"); // Now we'll check and see if a backup exists on the server, if so download it and then upload it back as EBOOT.BIN if (FTP.FileExists($"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN.BAK", user, pass)) { - FTP.DownloadFile($"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN.BAK", @$"{workingDir}/eboot/{gameID}/original/EBOOT.BIN.BAK", user, pass); - FTP.UploadFile(@$"{workingDir}/eboot/{gameID}/original/EBOOT.BIN.BAK", $"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN", user, pass); + FTP.DownloadFile($"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN.BAK", @$"eboot/{gameID}/original/EBOOT.BIN.BAK", user, pass); + FTP.UploadFile(@$"eboot/{gameID}/original/EBOOT.BIN.BAK", $"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN", user, pass); } else { @@ -118,13 +111,6 @@ public class RemotePatch public void PSNEBOOTRemotePatch(string ps3ip, string gameID, string serverURL, string user, string pass) { Console.WriteLine("Detected Digital Copy - Running in Full Mode"); - - string workingDir = "."; - if (OSUtil.GetPlatform() == OSPlatform.OSX) - { - workingDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)}/UnionPatcher"; - Directory.CreateDirectory(workingDir); - } string idps = ""; string contentID = ""; @@ -135,25 +121,25 @@ public class RemotePatch this._ps3Mapi.PS3.Notify("UnionRemotePatcher Connected! Patching..."); // Create simple directory structure - Directory.CreateDirectory($@"{workingDir}/rifs"); - Directory.CreateDirectory($@"{workingDir}/eboot"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}/original"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}/patched"); + Directory.CreateDirectory(@"rifs"); + Directory.CreateDirectory(@"eboot"); + Directory.CreateDirectory($@"eboot/{gameID}"); + Directory.CreateDirectory($@"eboot/{gameID}/original"); + Directory.CreateDirectory($@"eboot/{gameID}/patched"); // Let's grab and backup our EBOOT FTP.DownloadFile($"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN", - @$"{workingDir}/eboot/{gameID}/original/EBOOT.BIN", user, pass); + @$"eboot/{gameID}/original/EBOOT.BIN", user, pass); // Now we'll check and see if a backup exists on the server or not, if we don't have one on the server, then upload one if (!FTP.FileExists($"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN.BAK", user, pass)) - FTP.UploadFile(@$"{workingDir}/eboot/{gameID}/original/EBOOT.BIN", + FTP.UploadFile(@$"eboot/{gameID}/original/EBOOT.BIN", $"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN.BAK", user, pass); // Start getting idps and act.dat - these will help us decrypt a PSN eboot idps = PS3MAPI.PS3MAPIClientServer.PS3_GetIDPS(); - File.WriteAllBytes($@"data/idps", IDPSHelper.StringToByteArray(idps)); + File.WriteAllBytes(@"data/idps", IDPSHelper.StringToByteArray(idps)); // Scan the users on the system users = GetUsers(ps3ip, user, pass); @@ -167,12 +153,12 @@ public class RemotePatch $"ftp://{ps3ip}/dev_hdd0/home/{currentUser}/exdata/", user, pass)) if (fileName.Contains(gameID)) { - FTP.DownloadFile($"ftp://{ps3ip}/dev_hdd0/home/{currentUser}/exdata/act.dat", $@"{workingDir}/data/act.dat", + FTP.DownloadFile($"ftp://{ps3ip}/dev_hdd0/home/{currentUser}/exdata/act.dat", @"data/act.dat", user, pass); FTP.DownloadFile($"ftp://{ps3ip}/dev_hdd0/home/{currentUser}/exdata/{fileName}", - @$"{workingDir}/rifs/{fileName}", user, pass); + @$"rifs/{fileName}", user, pass); contentID = fileName.Substring(0, fileName.Length - 4); @@ -182,10 +168,10 @@ public class RemotePatch } // Finally, let's decrypt the EBOOT.BIN - LaunchSCETool($" -v -d \"{Path.GetFullPath(@$"{workingDir}/eboot/{gameID}/original/EBOOT.BIN")}\" \"{Path.GetFullPath(@$"{workingDir}/eboot/{gameID}/original/EBOOT.ELF")}\""); + LaunchSCETool($" -v -d \"{Path.GetFullPath(@$"eboot/{gameID}/original/EBOOT.BIN")}\" \"{Path.GetFullPath(@$"eboot/{gameID}/original/EBOOT.ELF")}\""); // Now, patch the EBOOT; - Patcher.PatchFile($"{workingDir}/eboot/{gameID}/original/EBOOT.ELF", serverURL, $"{workingDir}/eboot/{gameID}/patched/EBOOT.ELF"); + Patcher.PatchFile($"eboot/{gameID}/original/EBOOT.ELF", serverURL, $"eboot/{gameID}/patched/EBOOT.ELF"); // Encrypt the EBOOT (PSN) LaunchSCETool($"--verbose " + @@ -205,10 +191,10 @@ public class RemotePatch $" --np-app-type=SPRX" + $" --np-content-id={contentID}" + $" --np-real-fname=EBOOT.BIN" + - $" --encrypt {workingDir}/eboot/{gameID}/patched/EBOOT.ELF {workingDir}/eboot/{gameID}/patched/EBOOT.BIN"); + $" --encrypt eboot/{gameID}/patched/EBOOT.ELF eboot/{gameID}/patched/EBOOT.BIN"); // And upload the encrypted, patched EBOOT to the system. - FTP.UploadFile(@$"{workingDir}/eboot/{gameID}/patched/EBOOT.BIN", + FTP.UploadFile(@$"eboot/{gameID}/patched/EBOOT.BIN", $"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN", user, pass); } @@ -217,45 +203,38 @@ public class RemotePatch { Console.WriteLine("Detected Disc Copy - Running in Simplified Mode"); - string workingDir = "."; - if (OSUtil.GetPlatform() == OSPlatform.OSX) - { - workingDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)}/UnionPatcher"; - Directory.CreateDirectory(workingDir); - } - // Create a simple directory structure - Directory.CreateDirectory($@"{workingDir}/eboot"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}/original"); - Directory.CreateDirectory($@"{workingDir}/eboot/{gameID}/patched"); + Directory.CreateDirectory(@"eboot"); + Directory.CreateDirectory($@"eboot/{gameID}"); + Directory.CreateDirectory($@"eboot/{gameID}/original"); + Directory.CreateDirectory($@"eboot/{gameID}/patched"); // Let's grab and backup our EBOOT FTP.DownloadFile($"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN", - @$"{workingDir}/eboot/{gameID}/original/EBOOT.BIN", user, pass); + @$"eboot/{gameID}/original/EBOOT.BIN", user, pass); // Now we'll check and see if a backup exists on the server or not, if we don't have one on the server, then upload one if (!FTP.FileExists($"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN.BAK", user, pass)) - FTP.UploadFile(@$"{workingDir}/eboot/{gameID}/original/EBOOT.BIN", + FTP.UploadFile(@$"eboot/{gameID}/original/EBOOT.BIN", $"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN.BAK", user, pass); // Check for keys in the data directory - if (!File.Exists($"./data/keys")) + if (!File.Exists("data/keys")) throw new FileNotFoundException( "UnionRemotePatcher cannot find the keys, ldr_curves, or vsh_curves files required to continue. Please make sure you have copies of these files placed in the data directory where you found the executable to run UnionRemotePatcher. Without them, we can't patch your game."); // Decrypt the EBOOT - LaunchSCETool($"-v -d {workingDir}/eboot/{gameID}/original/EBOOT.BIN {workingDir}/eboot/{gameID}/original/EBOOT.ELF"); + LaunchSCETool($"-v -d eboot/{gameID}/original/EBOOT.BIN eboot/{gameID}/original/EBOOT.ELF"); // Now, patch the EBOOT; - Patcher.PatchFile($"{workingDir}/eboot/{gameID}/original/EBOOT.ELF", serverURL, $"{workingDir}/eboot/{gameID}/patched/EBOOT.ELF"); + Patcher.PatchFile($"eboot/{gameID}/original/EBOOT.ELF", serverURL, $"eboot/{gameID}/patched/EBOOT.ELF"); // Encrypt the EBOOT (Disc) LaunchSCETool( - $" -v --sce-type=SELF --skip-sections=FALSE --key-revision=0A --self-app-version=0001000000000000 --self-auth-id=1010000001000003 --self-vendor-id=01000002 --self-ctrl-flags=0000000000000000000000000000000000000000000000000000000000000000 --self-cap-flags=00000000000000000000000000000000000000000000003B0000000100040000 --self-type=APP --self-fw-version=0003005500000000 --compress-data true --encrypt \"{Path.GetFullPath(@$"{workingDir}/eboot/{gameID}/patched/EBOOT.ELF")}\" \"{Path.GetFullPath(@$"{workingDir}/eboot/{gameID}/patched/EBOOT.BIN")}\""); + $" -v --sce-type=SELF --skip-sections=FALSE --key-revision=0A --self-app-version=0001000000000000 --self-auth-id=1010000001000003 --self-vendor-id=01000002 --self-ctrl-flags=0000000000000000000000000000000000000000000000000000000000000000 --self-cap-flags=00000000000000000000000000000000000000000000003B0000000100040000 --self-type=APP --self-fw-version=0003005500000000 --compress-data true --encrypt \"{Path.GetFullPath(@$"eboot/{gameID}/patched/EBOOT.ELF")}\" \"{Path.GetFullPath(@$"eboot/{gameID}/patched/EBOOT.BIN")}\""); // And upload the encrypted, patched EBOOT to the system. - FTP.UploadFile(@$"{workingDir}/eboot/{gameID}/patched/EBOOT.BIN", + FTP.UploadFile(@$"eboot/{gameID}/patched/EBOOT.BIN", $"ftp://{ps3ip}/dev_hdd0/game/{gameID}/USRDIR/EBOOT.BIN", user, pass); } } diff --git a/UnionPatcher/UnionPatcher.csproj b/UnionPatcher/UnionPatcher.csproj index b55e086..00942c0 100644 --- a/UnionPatcher/UnionPatcher.csproj +++ b/UnionPatcher/UnionPatcher.csproj @@ -3,7 +3,7 @@ LBPUnion.UnionPatcher LBPUnion.UnionPatcher Debug;Release;Windows - net8.0 + net6.0 AnyCPU Icon64.ico diff --git a/build-all.sh b/build-all.sh index d9a116c..daf126a 100755 --- a/build-all.sh +++ b/build-all.sh @@ -1,4 +1,4 @@ -mkdir -p builds +mkdir -p builds; #dotnet clean; dotnet publish -c Windows -r win-x64 --self-contained @@ -13,19 +13,19 @@ dotnet publish -c MacOS -r osx-arm64 --self-contained # $1: Name.zip # $2: Path to zip function createBuild() { - currentDirectory=$(pwd) - cd $2 || return 1 - - zip -r "$1" * - cd $currentDirectory || return 1 - mv "$2/$1" builds/ + currentDirectory=$(pwd) + cd $2 || return 1; + + zip -r "$1" *; + cd $currentDirectory || return 1; + mv "$2/$1" builds/ } -createBuild "UnionPatcher-Windows-x64.zip" "UnionPatcher.Gui.Windows/bin/Release/net8.0-windows/win-x64/publish/" +createBuild "UnionPatcher-Windows-x64.zip" "UnionPatcher.Gui.Windows/bin/Release/net6.0-windows/win-x64/publish/" -createBuild "UnionPatcher-Linux-x64.zip" "UnionPatcher.Gui.Linux/bin/Release/net8.0/linux-x64/publish/" -createBuild "UnionPatcher-Linux-arm.zip" "UnionPatcher.Gui.Linux/bin/Release/net8.0/linux-arm/publish/" -createBuild "UnionPatcher-Linux-arm64.zip" "UnionPatcher.Gui.Linux/bin/Release/net8.0/linux-arm64/publish/" +createBuild "UnionPatcher-Linux-x64.zip" "UnionPatcher.Gui.Linux/bin/Release/net6.0/linux-x64/publish/" +createBuild "UnionPatcher-Linux-arm.zip" "UnionPatcher.Gui.Linux/bin/Release/net6.0/linux-arm/publish/" +createBuild "UnionPatcher-Linux-arm64.zip" "UnionPatcher.Gui.Linux/bin/Release/net6.0/linux-arm64/publish/" -# CODESIGN_IDENTITY is the certificate that you want to use for codesigning for mac, if not present then will not be signed -./build-mac.sh $CODESIGN_IDENTITY +createBuild "UnionPatcher-macOS-x64.zip" "UnionPatcher.Gui.MacOS/bin/Release/net6.0/osx-x64/publish/" +createBuild "UnionPatcher-macOS-arm64.zip" "UnionPatcher.Gui.MacOS/bin/Release/net6.0/osx-arm64/publish/" \ No newline at end of file diff --git a/build-mac.sh b/build-mac.sh deleted file mode 100755 index 4e22f6e..0000000 --- a/build-mac.sh +++ /dev/null @@ -1,21 +0,0 @@ -# Script to build UnionPatcher for mac, builds a universal binary, and zips it up. also codesigns if $1 is specified - -dotnet clean -dotnet publish UnionPatcher.Gui.MacOS --configuration Release /p:Platform="Any CPU" --self-contained -o macbuild -dotnet publish UnionPatcher.Gui.MacOS --configuration Release /p:Platform="Any CPU" --arch x64 --self-contained -o macbuildx86 - -rm -rf macbuilduniversal -mkdir macbuilduniversal -cp -r macbuild/UnionPatcher.Gui.MacOS.app macbuilduniversal/UnionPatcher.app -cp UnionPatcher.Gui.MacOS/Info.plist macbuilduniversal/UnionPatcher.app/Contents/Info.plist -rm -rf macbuilduniversal/UnionPatcher.app/Contents/MacOS/scetool/linux* -rm -rf macbuilduniversal/UnionPatcher.app/Contents/MacOS/scetool/win* - -lipo -create -output macbuilduniversal/UnionPatcher.app/Contents/MacOS/LBPUnion.UnionPatcher.Gui.MacOS macbuildx86/LBPUnion.UnionPatcher.Gui.MacOS macbuild/LBPUnion.UnionPatcher.Gui.MacOS -touch macbuilduniversal/UnionPatcher.app - -if [ -z ${1+x} ]; then - codesign -f --deep -s "$1" macbuilduniversal/UnionPatcher.app -fi -cd macbuilduniversal -zip -r UnionPatcher-macOS-universal.zip UnionPatcher.app