diff --git a/Cartfile b/Cartfile index 3c108d7c7..d4dae331c 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "PlayCover/PlayTools" "3.0.0-staging" +github "hguandl/PlayTools" "MaaTools" diff --git a/Cartfile.resolved b/Cartfile.resolved index 3c108d7c7..1adcfc2a8 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "PlayCover/PlayTools" "3.0.0-staging" +github "hguandl/PlayTools" "a93656743041d60d2d0a3f779a1c51f7f10ef1af" diff --git a/PlayCover.xcodeproj/project.pbxproj b/PlayCover.xcodeproj/project.pbxproj index a3bd37373..79867b2d8 100644 --- a/PlayCover.xcodeproj/project.pbxproj +++ b/PlayCover.xcodeproj/project.pbxproj @@ -609,7 +609,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [[ -z \"$FASTLANE\" ]]; then\n\tset -euo pipefail\n\techo \"Bootstraping carthage\"\n\n\tif [ -x /usr/local/bin/carthage ]; then\n\t\tcarthage=/usr/local/bin/carthage\n\telif [ -x /opt/homebrew/bin/carthage ]; then\n\t\tcarthage=/opt/homebrew/bin/carthage\n\telse\n\t\techo \"Cannot find carthage\"\n\t\texit 1\n\tfi\n\n\t$carthage update --use-xcframeworks\nfi\n"; + shellScript = "if [ -x /usr/local/bin/gh ]; then\n gh=/usr/local/bin/gh\nelif [ -x /opt/homebrew/bin/gh ]; then\n gh=/opt/homebrew/bin/gh\nfi\n\nif [[ -n $gh ]]; then\n echo \"Checking dependency\"\n\n LOCAL_SHA=$(cat Cartfile.resolved | grep \"hguandl/PlayTools\" | awk '{print $3}' | tr -d '\"\\n')\n REMOTE_SHA=$($gh api /repos/hguandl/PlayTools/commits/MaaTools\"?per_page=1\" -q .sha | tr -d '\\n')\n\n if [[ \"$LOCAL_SHA\" = \"$REMOTE_SHA\" ]]; then\n echo \"Up-to-date.\"\n exit 0\n fi\nfi\n\nif [[ -z \"$FASTLANE\" ]]; then\n\tset -euo pipefail\n\techo \"Bootstraping carthage\"\n\n\tif [ -x /usr/local/bin/carthage ]; then\n\t\tcarthage=/usr/local/bin/carthage\n\telif [ -x /opt/homebrew/bin/carthage ]; then\n\t\tcarthage=/opt/homebrew/bin/carthage\n\telse\n\t\techo \"Cannot find carthage\"\n\t\texit 1\n\tfi\n\n\t$carthage update --use-xcframeworks\nfi\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -784,14 +784,14 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; BUNDLE_ID_SUFFIX = ""; CODE_SIGN_ENTITLEMENTS = PlayCover/PlayCoverRelease.entitlements; - CODE_SIGN_IDENTITY = "Developer ID Application"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 233; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "PlayCover/Preview\\ Content"; - DEVELOPMENT_TEAM = 792V9HMJW3; + DEVELOPMENT_TEAM = 29V29Y67P2; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; EXCLUDED_ARCHS = x86_64; @@ -807,7 +807,7 @@ OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = io.playcover.PlayCover; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match Direct io.playcover.PlayCover macos"; + PROVISIONING_PROFILE_SPECIFIER = ""; RUN_DOCUMENTATION_COMPILER = YES; SWIFT_ENFORCE_EXCLUSIVE_ACCESS = off; SWIFT_OBJC_BRIDGING_HEADER = "./PlayCover/PlayCover-Bridging-Header.h"; @@ -887,14 +887,14 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; BUNDLE_ID_SUFFIX = .dev; CODE_SIGN_ENTITLEMENTS = PlayCover/PlayCoverRelease.entitlements; - CODE_SIGN_IDENTITY = "Developer ID Application"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 233; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "PlayCover/Preview\\ Content"; - DEVELOPMENT_TEAM = 792V9HMJW3; + DEVELOPMENT_TEAM = 29V29Y67P2; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; EXCLUDED_ARCHS = x86_64; @@ -910,7 +910,7 @@ OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = io.playcover.PlayCover; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match Direct io.playcover.PlayCover macos"; + PROVISIONING_PROFILE_SPECIFIER = ""; RUN_DOCUMENTATION_COMPILER = YES; SWIFT_ENFORCE_EXCLUSIVE_ACCESS = off; SWIFT_OBJC_BRIDGING_HEADER = "./PlayCover/PlayCover-Bridging-Header.h"; diff --git a/PlayCover/Model/AppSettings.swift b/PlayCover/Model/AppSettings.swift index 8243ef2d9..ad9b7c489 100644 --- a/PlayCover/Model/AppSettings.swift +++ b/PlayCover/Model/AppSettings.swift @@ -29,6 +29,9 @@ struct AppSettingsData: Codable { var windowFixMethod = 0 var injectIntrospection = false + var maaTools = false + var maaToolsPort = 1717 + init() {} // handle old 2.x settings where PlayChain did not exist yet @@ -54,6 +57,9 @@ struct AppSettingsData: Codable { metalHUD = try container.decodeIfPresent(Bool.self, forKey: .metalHUD) ?? false windowFixMethod = try container.decodeIfPresent(Int.self, forKey: .windowFixMethod) ?? 0 injectIntrospection = try container.decodeIfPresent(Bool.self, forKey: .injectIntrospection) ?? false + + maaTools = try container.decodeIfPresent(Bool.self, forKey: .maaTools) ?? false + maaToolsPort = try container.decodeIfPresent(Int.self, forKey: .maaToolsPort) ?? 1717 } } diff --git a/PlayCover/Views/AppSettingsView.swift b/PlayCover/Views/AppSettingsView.swift index cbcce9b3b..ee4e379b3 100644 --- a/PlayCover/Views/AppSettingsView.swift +++ b/PlayCover/Views/AppSettingsView.swift @@ -428,6 +428,21 @@ struct BypassesView: View { .help("settings.toggle.introspection.help") Spacer() } + Spacer() + .frame(height: 20) + HStack { + Toggle("MaaTools", isOn: $settings.settings.maaTools) + Spacer() + Text("Port:") + Stepper(value: $settings.settings.maaToolsPort, in: 1024 ... 65535) { + TextField("MaaTools Port", + value: $settings.settings.maaToolsPort, + formatter: GraphicsView.number) + .frame(width: 125) + } + .disabled(!settings.settings.maaTools) + Spacer() + } } .padding() } diff --git a/PlayCover/Views/Sparkle.swift b/PlayCover/Views/Sparkle.swift index ab5910033..f6ec2cd88 100644 --- a/PlayCover/Views/Sparkle.swift +++ b/PlayCover/Views/Sparkle.swift @@ -17,10 +17,13 @@ final class UpdaterViewModel: ObservableObject { var automaticallyCheckForUpdates: Bool { get { - updaterController.updater.automaticallyChecksForUpdates +// updaterController.updater.automaticallyChecksForUpdates + false } set(newValue) { - updaterController.updater.automaticallyChecksForUpdates = newValue +// updaterController.updater.automaticallyChecksForUpdates = newValue + _ = newValue + updaterController.updater.automaticallyChecksForUpdates = false } } @@ -41,7 +44,7 @@ final class UpdaterViewModel: ObservableObject { } func checkForUpdates() { - updaterController.checkForUpdates(nil) +// updaterController.checkForUpdates(nil) } } diff --git a/release.sh b/release.sh new file mode 100755 index 000000000..b3fc53f9f --- /dev/null +++ b/release.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -eu -o pipefail + +xcodebuild clean archive -scheme PlayCover -configuration Release -archivePath build/PlayCover.xcarchive + +APP_BUNDLE="build/PlayCover.xcarchive/Products/Applications/PlayCover.app" +codesign -s "Developer ID Application: Hao Guan (29V29Y67P2)" -f -o runtime --deep --timestamp $APP_BUNDLE/Contents/Frameworks/PlayTools.framework/PlugIns/AKInterface.bundle +codesign -s "Developer ID Application: Hao Guan (29V29Y67P2)" -f -o runtime --deep --timestamp $APP_BUNDLE/Contents/Frameworks/PlayTools.framework +codesign -s "Developer ID Application: Hao Guan (29V29Y67P2)" -f -o runtime --deep --timestamp $APP_BUNDLE/Contents/Frameworks/Sparkle.framework +codesign -s "Developer ID Application: Hao Guan (29V29Y67P2)" -f -o runtime --deep --timestamp $APP_BUNDLE + +mkdir -p build/PlayCover +ln -sfh /Applications build/PlayCover/Applications +mv $APP_BUNDLE build/PlayCover +hdiutil create -srcfolder build/PlayCover -format UDBZ build/PlayCover.dmg + +xcrun notarytool submit build/PlayCover.dmg --keychain-profile "HG_NOTARY_PWD" --wait +xcrun stapler staple build/PlayCover.dmg +mv build/PlayCover.dmg build/PlayCover-$(date -u +"%Y%m%dT%H%M%SZ").dmg +open build