Skip to content

Commit

Permalink
New tools for PS5, updated payloads & bug fixes
Browse files Browse the repository at this point in the history
- PS5 game library context menu actions
- Payloads for PS5 updated
- ffplay universal binary is now included
- make_fSELF GUI for PS5
- PS5 Game Assets Browser
- PS5 Game Patches Downloader
- Fix: Now uses correct Homebrew path depending on cpu arch
- Fix: PKG Merger now shows the correct success message
- Fix: Removed unused views
  • Loading branch information
SvenGDK committed Jan 7, 2024
1 parent c289e8c commit de211c7
Show file tree
Hide file tree
Showing 34 changed files with 2,084 additions and 174 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ PS Mac Tools/.DS_Store
PS Mac Tools/Assets.xcassets/.DS_Store
PS Mac Tools/Storyboards/.DS_Store
PS Mac Tools/ViewControllers/.DS_Store
.DS_Store
PS Mac Tools/Tools/ffplay
92 changes: 78 additions & 14 deletions PS Mac Tools.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions PS Mac Tools/DownloadQueueItem.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// DownloadQueueItem.swift
// PS Mac Tools
//
// Created by SvenGDK on 06/01/2024.
//

import Foundation

struct DownloadQueueItem {
var GameID: String
var FileName: String
var FileSize: String
var DownloadURL: URL
var DownloadState: String
var DownloadProgress: Double
var MergeState: String
}
19 changes: 19 additions & 0 deletions PS Mac Tools/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>gst.prod.dl.playstation.net</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
Expand Down
Binary file added PS Mac Tools/Payloads/dumpgame.bin
Binary file not shown.
Binary file removed PS Mac Tools/Payloads/etaHEN-1.1b.bin
Binary file not shown.
Binary file added PS Mac Tools/Payloads/etaHEN-1.3B.bin
Binary file not shown.
Binary file modified PS Mac Tools/Payloads/ps5-kstuff.bin
Binary file not shown.
76 changes: 38 additions & 38 deletions PS Mac Tools/Storyboards/PS3.storyboard

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions PS Mac Tools/Storyboards/PS4.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<tabViewController title="PS4 Home" selectedTabViewItemIndex="0" tabStyle="toolbar" id="7Ar-fD-s6i" sceneMemberID="viewController">
<tabViewItems>
<tabViewItem label="Backup Manager" identifier="" image="NSFolder" id="pgf-lG-IP6"/>
<tabViewItem identifier="" id="fs2-0q-P0p"/>
</tabViewItems>
<tabView key="tabView" type="noTabsNoBorder" id="6Kg-EJ-h6P">
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
Expand All @@ -50,7 +49,6 @@
<connections>
<outlet property="tabView" destination="6Kg-EJ-h6P" id="TJo-qj-B8c"/>
<segue destination="lGQ-bh-9jc" kind="relationship" relationship="tabItems" id="EuG-zK-ozj"/>
<segue destination="icf-iN-IVX" kind="relationship" relationship="tabItems" id="E5h-og-qaV"/>
</connections>
</tabViewController>
<customObject id="fRc-RN-VrV" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -363,19 +361,6 @@
</objects>
<point key="canvasLocation" x="90" y="42"/>
</scene>
<!--View Controller-->
<scene sceneID="KJe-Nx-eFX">
<objects>
<viewController id="icf-iN-IVX" sceneMemberID="viewController">
<view key="view" id="5Zd-Ri-qek">
<rect key="frame" x="0.0" y="0.0" width="1200" height="486"/>
<autoresizingMask key="autoresizingMask"/>
</view>
</viewController>
<customObject id="zXa-7Q-glp" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="90" y="748"/>
</scene>
</scenes>
<resources>
<image name="NSFolder" width="32" height="32"/>
Expand Down
285 changes: 249 additions & 36 deletions PS Mac Tools/Storyboards/PS5.storyboard

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions PS Mac Tools/TabViewControllers/PS5TabViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// PS5TabViewController.swift
// PS Mac Tools
//
// Created by SvenGDK on 07/01/2024.
//

import Cocoa

class PS5TabViewController: NSTabViewController {

}
Binary file removed PS Mac Tools/Tools/ffplay
Binary file not shown.
Binary file added PS Mac Tools/Tools/make_fself
Binary file not shown.
42 changes: 42 additions & 0 deletions PS Mac Tools/Utils.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// Utils.swift
// PS Mac Tools
//
// Created by SvenGDK on 06/01/2024.
//

import Foundation

class Utils {

public var Arch: String?

func CPUType() -> Int {
var cputype = UInt32(0)
var size = cputype.bitWidth
let result = sysctlbyname("hw.cputype", &cputype, &size, nil, 0)
if result == -1 {
if errno == ENOENT {
return 0
}
return -1
}
return Int(cputype)
}

let CPU_ARCH_MASK = 0xff // Mask for architecture bits
let CPU_TYPE_X86 = cpu_type_t(7)
let CPU_TYPE_ARM = cpu_type_t(12)

public func CPUTypeString() {
let type: Int = CPUType()
let cpu_arch = type & CPU_ARCH_MASK
if cpu_arch == CPU_TYPE_X86 {
Arch = "x86"
}
if cpu_arch == CPU_TYPE_ARM {
Arch = "arm64"
}
}

}
35 changes: 4 additions & 31 deletions PS Mac Tools/ViewControllers/PS3/CopyWindowViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class CopyWindowViewController: NSViewController, FileManagerDelegate {

sourceFolderContentCount = try! FileManager.default.subpathsOfDirectory(atPath: sourceFolder).count
copyProgressBar.maxValue = Double(sourceFolderContentCount)
print(sourceFolderContentCount)

copyMainText.stringValue = "Preparing to copy " + URL.init(string: sourceFolder)!.lastPathComponent
copyDetailsText.stringValue = "Waiting for destination folder ..."
Expand Down Expand Up @@ -118,8 +117,8 @@ class CopyWindowViewController: NSViewController, FileManagerDelegate {
cancelCopyButton.isEnabled = false

if !sourceFolder.contains(".iso") {
let gameName = URL.init(string: sourceFolder)?.lastPathComponent // BLES-00000
let destinationGameFolder = destinationTextField.stringValue + "/" + gameName! // /Volumes/Untitled/BLES-00000
let gameName = URL.init(string: sourceFolder)?.lastPathComponent
let destinationGameFolder = destinationTextField.stringValue + "/" + gameName!

copyMainText.stringValue = "Copying..."
copyToDestination(destinationFolder: destinationGameFolder)
Expand All @@ -144,7 +143,6 @@ class CopyWindowViewController: NSViewController, FileManagerDelegate {

// Create GAME Directory
if !FileManager.default.fileExists(atPath: destinationFolder) {
print("Game directory does not exist! Creating...")

try! FileManager.default.createDirectory(atPath: destinationFolder, withIntermediateDirectories: true, attributes: nil)
}
Expand All @@ -159,21 +157,15 @@ class CopyWindowViewController: NSViewController, FileManagerDelegate {

if gameFileManager.fileExists(atPath: self.sourceFolder + "/" + destinationFile, isDirectory:&isDir) {
if isDir.boolValue {
print("Found directory in gamefolder, creating folder at destination...")

try! FileManager.default.createDirectory(atPath: destinationFolder + "/" + destinationFile, withIntermediateDirectories: true, attributes: nil)

self.dirsCopied += 1
self.totalCopied += 1
print("Created: " + self.dirsCopied.description + " directories.")
} else {
print("Found file in gamefolder, copying to destination...")

try! FileManager.default.copyItem(atPath: self.sourceFolder + "/" + destinationFile, toPath: destinationFolder + "/" + destinationFile)

self.filesCopied += 1
self.totalCopied += 1
print("Copied: " + self.filesCopied.description + " files.")
}
}

Expand All @@ -182,7 +174,7 @@ class CopyWindowViewController: NSViewController, FileManagerDelegate {
self.copyDetailsText.stringValue = "Copied " + self.dirsCopied.description + " directories and " + self.filesCopied.description + " files."

if self.copyProgressBar.doubleValue == Double(self.sourceFolderContentCount) {
print("DONE")

}
}

Expand Down Expand Up @@ -227,7 +219,6 @@ class CopyWindowViewController: NSViewController, FileManagerDelegate {
self.progressPercent = Double(targetFileSize)/Double(sourceFileSize)
print(self.progressPercent)


}
bytes_read = read(open_source, &buffer, bufferSize);
}
Expand Down Expand Up @@ -256,32 +247,14 @@ class CopyWindowViewController: NSViewController, FileManagerDelegate {
}

}

func sizeForLocalFilePath(filePath:String) -> UInt64 {
do {
let sizeWatcher = FileManager()
let fileAttributes = try sizeWatcher.attributesOfItem(atPath: filePath)
if let fileSize = fileAttributes[FileAttributeKey.size] {
return (fileSize as! NSNumber).uint64Value
} else {
print("Failed to get a size attribute from path: \(filePath)")
}
} catch {
print("Failed to get file attributes for local path: \(filePath) with error: \(error)")
}
return 0
}

@IBAction func controlBackgroundPlayer(_ sender: NSButton) {

backgroundAudioPlayerCopy.terminate()
muteCheckBox.isEnabled = false

}

@IBAction func cancelCopy(_ sender: NSButton) {

self.dismiss(self)
self.view.window?.close()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class HomebrewPS3ViewController: NSViewController, NSTableViewDelegate, NSTableV
}

func urlSession(_ dlSession: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {
let documentsUrl = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first
let documentsUrl = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first
let destinationUrl = documentsUrl!.appendingPathComponent(self.DLUrl!.lastPathComponent)
let dataFromURL = NSData(contentsOf: location)
dataFromURL?.write(to: destinationUrl, atomically: true)
Expand Down
Loading

0 comments on commit de211c7

Please sign in to comment.