diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 49d521ecc..c550929e0 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -60,7 +60,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -https://discord.gg/rMv5qxGTGC. +[https://discord.gg/RNCHsQHr3S](https://discord.gg/RNCHsQHr3S). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/Cartfile.resolved b/Cartfile.resolved index dbf0d6589..0938d930b 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "hguandl/PlayTools" "867c234efbae787b1ce22fdc61ffd73ed70da66b" +github "hguandl/PlayTools" "2dbc2f7578b708f617e9acf9bbd655f4ea7a6ee1" diff --git a/PlayCover.xcodeproj/project.pbxproj b/PlayCover.xcodeproj/project.pbxproj index 92cdc1d53..7eb0026aa 100644 --- a/PlayCover.xcodeproj/project.pbxproj +++ b/PlayCover.xcodeproj/project.pbxproj @@ -573,7 +573,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/zsh; - shellScript = "set -euo pipefail\n\nif [ -x /usr/local/bin/carthage ]; then\n carthage=/usr/local/bin/carthage\nelif [ -x /opt/homebrew/bin/carthage ]; then\n carthage=/opt/homebrew/bin/carthage\nelif [ -x /opt/local/bin/carthage ]; then\n carthage=/opt/local/bin/carthage\nelse\n echo \"Cannot find carthage\"\n exit 1\nfi\n\necho \"Converting to maccatalyst\"\nvtool \\\n -set-build-version maccatalyst 11.0 14.0 \\\n -replace -output \\\n \"${SCRIPT_INPUT_FILE_0}/PlayTools\" \\\n \"${SCRIPT_INPUT_FILE_0}/PlayTools\"\n\necho \"Codesigning PlayTools\"\n\n$carthage copy-frameworks\n\necho cp -rf ${SRCROOT}/Carthage/Build/PlayTools.xcframework/ios-arm64/PlayTools.framework/PlugIns/AKInterface.bundle ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/PlayTools.framework/PlugIns/AKInterface.bundle\n\nrm -rf ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/PlayTools.framework/PlugIns/AKInterface.bundle\ncp -rf ${SRCROOT}/Carthage/Build/PlayTools.xcframework/ios-arm64/PlayTools.framework/PlugIns/AKInterface.bundle ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/PlayTools.framework/PlugIns/AKInterface.bundle\n"; + shellScript = "set -euo pipefail\n\nif [ -x /usr/local/bin/carthage ]; then\n carthage=/usr/local/bin/carthage\nelif [ -x /opt/homebrew/bin/carthage ]; then\n carthage=/opt/homebrew/bin/carthage\nelif [ -x /opt/local/bin/carthage ]; then\n carthage=/opt/local/bin/carthage\nelse\n echo \"Cannot find carthage\"\n exit 1\nfi\n\necho \"Codesigning PlayTools\"\n\n$carthage copy-frameworks\n\necho cp -rf ${SCRIPT_INPUT_FILE_0}/PlugIns/AKInterface.bundle ${SCRIPT_OUTPUT_FILE_0}/PlugIns/AKInterface.bundle\n\nrm -rf ${SCRIPT_OUTPUT_FILE_0}/PlugIns/AKInterface.bundle\ncp -rf ${SCRIPT_INPUT_FILE_0}/PlugIns/AKInterface.bundle ${SCRIPT_OUTPUT_FILE_0}/PlugIns/AKInterface.bundle\n\necho \"Converting to maccatalyst\"\nvtool \\\n -set-build-version maccatalyst 11.0 14.0 \\\n -replace -output \\\n \"${SCRIPT_OUTPUT_FILE_0}/PlayTools\" \\\n \"${SCRIPT_OUTPUT_FILE_0}/PlayTools\"\n"; }; AAC28F222899A05B005057FB /* Codesign sparkle */ = { isa = PBXShellScriptBuildPhase; @@ -794,7 +794,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 310; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "PlayCover/Preview\\ Content"; @@ -897,7 +897,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 310; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "PlayCover/Preview\\ Content"; diff --git a/PlayCover/AppInstaller/Downloader.swift b/PlayCover/AppInstaller/Downloader.swift index 223e3144e..91d84ba31 100644 --- a/PlayCover/AppInstaller/Downloader.swift +++ b/PlayCover/AppInstaller/Downloader.swift @@ -142,7 +142,7 @@ class DownloadApp { } } - private func verifyChecksum(checksum: String?, file: URL?, completion: @escaping(Bool) -> Void) { + private func verifyChecksum(checksum: String?, file: URL?, completion: @escaping (Bool) -> Void) { Task { if let originalSum = checksum, !originalSum.isEmpty, let fileURL = file { if let sha256 = fileURL.sha256, originalSum != sha256 { @@ -155,7 +155,7 @@ class DownloadApp { } } - private func checksumAlert(originalSum: String, givenSum: String, completion: @escaping(Bool) -> Void) { + private func checksumAlert(originalSum: String, givenSum: String, completion: @escaping (Bool) -> Void) { Task { @MainActor in let alert = NSAlert() alert.messageText = NSLocalizedString("playapp.download.differentChecksum", comment: "") diff --git a/PlayCover/Services/SoundDeviceService.swift b/PlayCover/Services/SoundDeviceService.swift index bb85a13fc..cacaadb09 100644 --- a/PlayCover/Services/SoundDeviceService.swift +++ b/PlayCover/Services/SoundDeviceService.swift @@ -27,7 +27,9 @@ class SoundDeviceService { result: inout T ) -> OSStatus { var size = UInt32(MemoryLayout.size) - return AudioObjectGetPropertyData(objectID, &address, UInt32(0), nil, &size, &result) + return withUnsafeMutablePointer(to: &result) { result in + AudioObjectGetPropertyData(objectID, &address, UInt32(0), nil, &size, result) + } } private func setAudioPropertyData( @@ -36,7 +38,9 @@ class SoundDeviceService { value: inout T) -> OSStatus { let size = UInt32(MemoryLayout.size) - return AudioObjectSetPropertyData(objectID, &address, UInt32(0), nil, size, &value) + return withUnsafeMutablePointer(to: &value) { value in + AudioObjectSetPropertyData(objectID, &address, UInt32(0), nil, size, value) + } } private func getSoundDevice() -> AudioDeviceID? { diff --git a/PlayCover/Utils/Extensions/URLExtensions.swift b/PlayCover/Utils/Extensions/URLExtensions.swift index ede8b3c5a..866c90814 100644 --- a/PlayCover/Utils/Extensions/URLExtensions.swift +++ b/PlayCover/Utils/Extensions/URLExtensions.swift @@ -77,7 +77,7 @@ extension URL { func enumerateContents(blocking: Bool = true, includingPropertiesForKeys keys: [URLResourceKey]? = nil, options: FileManager.DirectoryEnumerationOptions? = nil, - _ callback: @escaping(URL, URLResourceValues) throws -> Void) { + _ callback: @escaping (URL, URLResourceValues) throws -> Void) { guard let enumerator = FileManager.default.enumerator( at: self, includingPropertiesForKeys: keys ?? [.isRegularFileKey], diff --git a/PlayCover/Utils/Shell.swift b/PlayCover/Utils/Shell.swift index c16c8b98e..329e8c2b3 100644 --- a/PlayCover/Utils/Shell.swift +++ b/PlayCover/Utils/Shell.swift @@ -20,15 +20,15 @@ class Shell: ObservableObject { let output = try pipe.fileHandleForReading.readToEnd() ?? Data() if print { - Log.shared.log(String(decoding: output, as: UTF8.self)) + Log.shared.log(String(data: output, encoding: .utf8) ?? "Shell error occured") } process.waitUntilExit() let status = process.terminationStatus if status != 0 { - throw String(decoding: output, as: UTF8.self) + throw String(data: output, encoding: .utf8) ?? "Shell error occured" } - return String(decoding: output, as: UTF8.self) + return String(data: output, encoding: .utf8) ?? "Shell error occured" } static func runSu(_ args: [String], _ argc: String) -> Bool { @@ -121,8 +121,8 @@ class Shell: ObservableObject { } } -extension String: Error { } +extension Swift.String: Swift.Error { } -extension String: LocalizedError { +extension Swift.String: Foundation.LocalizedError { public var errorDescription: String? { self } } diff --git a/PlayCover/Views/AppSettingsView.swift b/PlayCover/Views/AppSettingsView.swift index b05c35cf8..44fdd33ca 100644 --- a/PlayCover/Views/AppSettingsView.swift +++ b/PlayCover/Views/AppSettingsView.swift @@ -586,8 +586,11 @@ struct MiscView: View { app.info.applicationCategoryType = applicationCategoryType Task.detached { do { - try Shell.signApp(app.executable) - task = .none + try await Shell.signApp(app.executable) + + Task { @MainActor in + task = .none + } } catch { Log.shared.error(error) } @@ -694,8 +697,6 @@ struct MiscView: View { } Spacer() .frame(height: 20) - // swiftlint:disable:next todo - // TODO: Test and remove before 3.0 release HStack { Toggle("settings.toggle.rootWorkDir", isOn: $settings.settings.rootWorkDir) .disabled(!(hasPlayTools ?? true)) diff --git a/PlayCover/Views/MainView.swift b/PlayCover/Views/MainView.swift index 4afa7f227..a2ea5f74b 100644 --- a/PlayCover/Views/MainView.swift +++ b/PlayCover/Views/MainView.swift @@ -60,7 +60,7 @@ struct MainView: View { } if showSourceFolders { ForEach(store.sourcesData, id: \.hashValue) { source in - NavigationLink { + NavigationLink(tag: source.hashValue, selection: $selectedView) { IPASourceView(storeVM: store, selectedBackgroundColor: $selectedBackgroundColor, selectedTextColor: $selectedTextColor, diff --git a/PlayCover/Views/MenuBarView.swift b/PlayCover/Views/MenuBarView.swift index b2386d232..42d60827d 100644 --- a/PlayCover/Views/MenuBarView.swift +++ b/PlayCover/Views/MenuBarView.swift @@ -48,7 +48,7 @@ struct PlayCoverHelpMenuView: Commands { } } Button("menubar.discord") { - if let url = URL(string: "https://discord.gg/PlayCover") { + if let url = URL(string: "https://discord.gg/RNCHsQHr3S") { NSWorkspace.shared.open(url) } } @@ -73,6 +73,7 @@ struct PlayCoverViewMenuView: Commands { } else if DownloadVM.shared.inProgress { Log.shared.error(PlayCoverError.waitDownload) } else { + // remove await for Swift 6 (no async operation occurs) await NSOpenPanel.selectIPA { result in if case .success(let url) = result { Task { @@ -86,11 +87,10 @@ struct PlayCoverViewMenuView: Commands { config.promptsUserIfNeeded = true let url = NSWorkspace.shared .urlForApplication(withBundleIdentifier: - "com.sideloadly.sideloadly") - if url != nil { - let unwrap = url.unsafelyUnwrapped - try await NSWorkspace.shared - .open([ipa], withApplicationAt: unwrap, configuration: config) + "io.sideloadly.sideloadly") + if let url = url { + NSWorkspace.shared + .open([ipa], withApplicationAt: url, configuration: config) } else { Log.shared.error("Could not find Sideloadly!") } diff --git a/README.md b/README.md index c060b33cd..81dbdae4b 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@
Documentation · - Discord + Discord · Website