From f49fa24743d975708ab9c5644a437a66f3d94d20 Mon Sep 17 00:00:00 2001 From: Joe Mattiello Date: Thu, 2 Mar 2023 00:40:11 -0500 Subject: [PATCH] App builds in xcodeproj (todo widget) --- .../workflows/.disabled/sidestore-project.yml | 20 +++ Configurations/SideStore.xcconfig | 22 +++ Configurations/SideStoreProject.xcconfig | 62 ++++++++ Dangerfile.swift | 3 + Project.swift | 92 +++++++++++ .../project.pbxproj | 78 +++------- .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcshareddata/swiftpm/Package.resolved | 146 ++++++------------ .../Configurations/SideStore-Debug.xcconfig | 1 + .../Configurations/SideStore-Release.xcconfig | 1 + SideStoreApp/Package.swift | 92 +++++++---- .../Sources/Cargo/Commands/Version.swift | 5 +- .../Cargo/swiftlint/Commands/Version.swift | 5 +- .../Shared/Connections/Connection.swift | 5 +- .../Connections/ConnectionManager.swift | 7 +- .../Shared/Connections/XPCConnection.swift | 3 +- .../Sources/SideBackup/AppDelegate.swift | 3 +- .../Sources/SideBackup/BackupController.swift | 8 +- .../SideDaemon/AnisetteDataManager.swift | 2 +- .../Sources/SideDaemon/AppManager.swift | 2 +- .../SideDaemon/DaemonRequestHandler.swift | 17 +- .../Sources/SideStore/AppDelegate.swift | 13 +- .../Sources/SideStore/SceneDelegate.swift | 3 +- .../App Detail/AppContentViewController.swift | 3 +- .../Intents/IntentHandler.swift | 3 +- .../Intents/ViewAppIntentHandler.swift | 9 +- .../Browse/BrowseCollectionViewCell.swift | 3 +- .../Browse/BrowseViewController.swift | 5 +- .../FileManager+DirectorySize.swift | 3 +- .../Managing Apps/AppManager.swift | 29 ++-- .../My Apps/MyAppsViewController.swift | 45 +++--- .../News/NewsViewController.swift | 5 +- .../Operations/AuthenticationOperation.swift | 8 +- .../BackgroundRefreshAppsOperation.swift | 9 +- .../Operations/DownloadAppOperation.swift | 5 +- .../FetchTrustedSourcesOperation.swift | 2 +- .../Operations/InstallAppOperation.swift | 5 +- .../Patch App/PatchViewController.swift | 7 +- .../Operations/RemoveAppBackupOperation.swift | 5 +- .../Operations/ResignAppOperation.swift | 4 +- .../Error Log/ErrorLogViewController.swift | 3 +- .../Sources/SourcesViewController.swift | 5 +- .../SideStoreCore/Model/DatabaseManager.swift | 7 +- .../SideStoreCore/Model/MergePolicy.swift | 12 +- .../SideStoreCore/Patreon/PatreonAPI.swift | 3 +- .../Sources/SideWidget/Countdown.swift | 2 +- .../Sources/SideWidget/Resources/Info.plist | 2 +- .../Sources/SideWidget/SideWidget.swift | 19 +-- 49 files changed, 498 insertions(+), 295 deletions(-) create mode 100644 .github/workflows/.disabled/sidestore-project.yml create mode 100644 Configurations/SideStore.xcconfig create mode 100644 Configurations/SideStoreProject.xcconfig create mode 100644 Project.swift rename {SideStore-SPM.xcodeproj => SideStore.xcodeproj}/project.pbxproj (93%) rename {SideStore-SPM.xcodeproj => SideStore.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) rename {SideStore-SPM.xcodeproj => SideStore.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {SideStore-SPM.xcodeproj => SideStore.xcodeproj}/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (70%) create mode 100644 SideStoreApp/Configurations/SideStore-Debug.xcconfig create mode 100644 SideStoreApp/Configurations/SideStore-Release.xcconfig diff --git a/.github/workflows/.disabled/sidestore-project.yml b/.github/workflows/.disabled/sidestore-project.yml new file mode 100644 index 00000000..3f9fc699 --- /dev/null +++ b/.github/workflows/.disabled/sidestore-project.yml @@ -0,0 +1,20 @@ +# .github/workflows/sidestore-project.yml +name: SideStore Project + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + name: Build + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: tuist/tuist-action@0.13.0 + with: + command: 'build' + arguments: '' + diff --git a/Configurations/SideStore.xcconfig b/Configurations/SideStore.xcconfig new file mode 100644 index 00000000..34718936 --- /dev/null +++ b/Configurations/SideStore.xcconfig @@ -0,0 +1,22 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=YES +ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon +CLANG_ENABLE_MODULES=YES +CODE_SIGN_ENTITLEMENTS=Sources/SideStore/Resources/AltStore.entitlements +CODE_SIGN_IDENTITY=iPhone Developer +CODE_SIGN_STYLE=Automatic +DEVELOPMENT_TEAM=$(DEVELOPMENT_TEAM) +ENABLE_BITCODE=NO +INFOPLIST_FILE=Sources/SideStore/Resources/Info.plist +IPHONEOS_DEPLOYMENT_TARGET=14.0 +PRODUCT_BUNDLE_IDENTIFIER=$(PRODUCT_BUNDLE_IDENTIFIER) +PRODUCT_NAME=$(TARGET_NAME) +PROVISIONING_PROFILE_SPECIFIER= +SUPPORTED_PLATFORMS=iphonesimulator iphoneos +SWIFT_VERSION=5.0 +TARGETED_DEVICE_FAMILY=1,2 + +LD_RUNPATH_SEARCH_PATHS[config=Debug]=["$(inherited)", "@executable_path/Frameworks"] +LD_RUNPATH_SEARCH_PATHS[config=Release]=["$(inherited)", "@executable_path/Frameworks"] +LIBRARY_SEARCH_PATHS[config=Debug]=["$(inherited)", "$(PROJECT_DIR)/Dependencies/fragmentzip", "$(PROJECT_DIR)/Dependencies/libcurl"] +LIBRARY_SEARCH_PATHS[config=Release]=["$(inherited)", "$(PROJECT_DIR)/Dependencies/fragmentzip", "$(PROJECT_DIR)/Dependencies/libcurl"] +SWIFT_OPTIMIZATION_LEVEL[config=Debug]=-Onone \ No newline at end of file diff --git a/Configurations/SideStoreProject.xcconfig b/Configurations/SideStoreProject.xcconfig new file mode 100644 index 00000000..90d03d34 --- /dev/null +++ b/Configurations/SideStoreProject.xcconfig @@ -0,0 +1,62 @@ +ALWAYS_SEARCH_USER_PATHS=NO +CLANG_ANALYZER_NONNULL=YES +CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION=YES_AGGRESSIVE +CLANG_CXX_LANGUAGE_STANDARD=gnu++14 +CLANG_CXX_LIBRARY=libc++ +CLANG_ENABLE_MODULES=YES +CLANG_ENABLE_OBJC_ARC=YES +CLANG_ENABLE_OBJC_WEAK=YES +CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING=YES +CLANG_WARN_BOOL_CONVERSION=YES +CLANG_WARN_COMMA=YES +CLANG_WARN_CONSTANT_CONVERSION=YES +CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS=YES +CLANG_WARN_DIRECT_OBJC_ISA_USAGE=YES_ERROR +CLANG_WARN_DOCUMENTATION_COMMENTS=NO +CLANG_WARN_EMPTY_BODY=YES +CLANG_WARN_ENUM_CONVERSION=YES +CLANG_WARN_INFINITE_RECURSION=YES +CLANG_WARN_INT_CONVERSION=YES +CLANG_WARN_NON_LITERAL_NULL_CONVERSION=YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF=YES +CLANG_WARN_OBJC_LITERAL_CONVERSION=YES +CLANG_WARN_OBJC_ROOT_CLASS=YES_ERROR +CLANG_WARN_RANGE_LOOP_ANALYSIS=YES +CLANG_WARN_STRICT_PROTOTYPES=YES +CLANG_WARN_SUSPICIOUS_MOVE=YES +CLANG_WARN_UNGUARDED_AVAILABILITY=YES_AGGRESSIVE +CLANG_WARN_UNREACHABLE_CODE=YES +CLANG_WARN__DUPLICATE_METHOD_MATCH=YES +CODE_SIGN_IDENTITY=iPhone Developer +COPY_PHASE_STRIP=NO +DEBUG_INFORMATION_FORMAT=dwarf-with-dsym +ENABLE_STRICT_OBJC_MSGSEND=YES +GCC_C_LANGUAGE_STANDARD=gnu11 +GCC_NO_COMMON_BLOCKS=YES +GCC_WARN_64_TO_32_BIT_CONVERSION=YES +GCC_WARN_ABOUT_RETURN_TYPE=YES_ERROR +GCC_WARN_UNDECLARED_SELECTOR=YES +GCC_WARN_UNINITIALIZED_AUTOS=YES_AGGRESSIVE +GCC_WARN_UNUSED_FUNCTION=YES +GCC_WARN_UNUSED_VARIABLE=YES +IPHONEOS_DEPLOYMENT_TARGET=12.2 +MTL_FAST_MATH=YES +SDKROOT=iphoneos +SUPPORTED_PLATFORMS=iphonesimulator iphoneos macosx +SWIFT_ACTIVE_COMPILATION_CONDITIONS=DEBUG BETA +SYSTEM_HEADER_SEARCH_PATHS="$(SRCROOT)/Dependencies/AltSign/Dependencies" + +ENABLE_NS_ASSERTIONS[config=Release]=NO +ENABLE_TESTABILITY[config=Debug]=YES +GCC_DYNAMIC_NO_PIC[config=Debug]=NO +GCC_OPTIMIZATION_LEVEL[config=Debug]=0 +GCC_PREPROCESSOR_DEFINITIONS[config=Debug]=["DEBUG=1", "$(inherited)"] +MTL_ENABLE_DEBUG_INFO[config=Debug]=INCLUDE_SOURCE +MTL_ENABLE_DEBUG_INFO[config=Release]=NO +ONLY_ACTIVE_ARCH[config=Debug]=YES +OTHER_CPLUSPLUSFLAGS[config=Debug]=["$(OTHER_CFLAGS)", "-Wno-module-import-in-extern-c"] +OTHER_CPLUSPLUSFLAGS[config=Release]=["$(OTHER_CFLAGS)", "-Wno-module-import-in-extern-c"] +SWIFT_COMPILATION_MODE[config=Release]=wholemodule +SWIFT_OPTIMIZATION_LEVEL[config=Debug]=-Onone +SWIFT_OPTIMIZATION_LEVEL[config=Release]=-O +VALIDATE_PRODUCT[config=Release]=YES \ No newline at end of file diff --git a/Dangerfile.swift b/Dangerfile.swift index f90a78cb..18ed9aa0 100644 --- a/Dangerfile.swift +++ b/Dangerfile.swift @@ -1,5 +1,8 @@ import DangerSwiftCoverage // package: https://github.com/f-meloni/danger-swift-coverage.git import DangerSwiftLint // package: https://github.com/ashfurrow/danger-swiftlint.git +import DangerXCodeSummary // package: https://github.com/f-meloni/danger-swift-xcodesummary.git + +let danger = Danger() // swift run danger-swift [ci, pr] --dangerfile ./Dangerfile.swift // xcodebuild test -scheme DangerSwiftCoverage-Package -derivedDataPath Build/ -enableCodeCoverage YES diff --git a/Project.swift b/Project.swift new file mode 100644 index 00000000..052d0d04 --- /dev/null +++ b/Project.swift @@ -0,0 +1,92 @@ +import ProjectDescription + +let project = Project( + name: "SideStore", + organizationName: "SideStore.io", + targets: [ + Target( + name: "SideStore", + platform: .iOS, + product: .app, + bundleId: "com.SideStore.SideStore", + infoPlist: "Info.plist", + sources: ["SideStoreApp/Sources/SideStore/**"], + resources: ["SideStoreApp/Sources/SideStore/Resources/**"], + headers: .headers( + public: [], + private: [], + project: [] + ), + entitlements: "SideStoreApp/Sources/SideStore/Resources/SideStore.entitlements", + dependencies: [ + .package(product: "SideStoreAppKit"), + .target(name: "SideWidget"), + ], + settings: .settings(configurations: [ + .debug(name: "Debug", xcconfig: "SideStoreApp/Configurations/SideStore-Debug.xcconfig"), + .release(name: "Release", xcconfig: "SideStoreApp/Configurations/SideStore-Release.xcconfig"), + ]) + ), + // Target( + // name: "SideStoreTests", + // platform: .iOS, + // product: .unitTests, + // bundleId: "com.SideStore.SideStoreTests", + // infoPlist: "Info.plist", + // sources: ["SideStoreApp/Tests/SideStoreAppTests/**"], + // dependencies: [ + // .target(name: "SideStore") + // ] + // ), + Target( + name: "SideWidget", + platform: .iOS, + product: .appExtension, + bundleId: "com.SideStore.SideStore.SideWidget", + infoPlist: .extendingDefault(with: [ + "ALTAppGroups": [ + "group.com.SideStore.SideStore", + "group.$(APP_GROUP_IDENTIFIER)", + ], + "CFBundleDisplayName": "$(PRODUCT_NAME)", + "NSExtension": [ + "NSExtensionPointIdentifier": "com.apple.widgetkit-extension", + "NSExtensionPrincipalClass": "$(PRODUCT_MODULE_NAME).NotificationService" + ] + ]), + sources: ["SideStoreApp/Sources/SideWidget/**"], + entitlements: "SideStoreApp/Sources/SideWidget/Resources/SideWidgetExtension.entitlements", + dependencies: [ + .package(product: "Shared"), + .package(product: "AltStoreCore") + ] + ), +// Target( +// name: "SideStore", +// platform: .tvOS, +// product: .app, +// bundleId: "com.SideStore.SideStore", +// infoPlist: "Info.plist", +// sources: ["SideStoreApp/Sources/SideStoreTV/**"], +// dependencies: [ +// .target(name: "TopShelfExtension"), +// ] +// ), +// Target( +// name: "TopShelfExtension", +// platform: .tvOS, +// product: .tvTopShelfExtension, +// bundleId: "com.SideStore.SideStore.TopShelfExtension", +// infoPlist: .extendingDefault(with: [ +// "CFBundleDisplayName": "$(PRODUCT_NAME)", +// "NSExtension": [ +// "NSExtensionPointIdentifier": "com.apple.tv-top-shelf", +// "NSExtensionPrincipalClass": "$(PRODUCT_MODULE_NAME).ContentProvider", +// ], +// ]), +// sources: "SideStoreApp/Sources/TopShelfExtension/**", +// dependencies: [ +// ] +// ), + ] +) diff --git a/SideStore-SPM.xcodeproj/project.pbxproj b/SideStore.xcodeproj/project.pbxproj similarity index 93% rename from SideStore-SPM.xcodeproj/project.pbxproj rename to SideStore.xcodeproj/project.pbxproj index 18edfd6b..5ba1f675 100644 --- a/SideStore-SPM.xcodeproj/project.pbxproj +++ b/SideStore.xcodeproj/project.pbxproj @@ -29,21 +29,14 @@ B34AFC1329B032DF000F318E /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC0B29B032DF000F318E /* WidgetView.swift */; }; B34AFC1429B032DF000F318E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B34AFC0D29B032DF000F318E /* Assets.xcassets */; }; B34AFC1629B032DF000F318E /* SideWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC1029B032DF000F318E /* SideWidget.swift */; }; - B34AFC1829B03406000F318E /* Shared in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFC1729B03406000F318E /* Shared */; }; - BF989177250AABF4002ACF50 /* SideWidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = BF989167250AABF3002ACF50 /* SideWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + B3C40F5229B05B4200C93D50 /* SideWidget in Frameworks */ = {isa = PBXBuildFile; productRef = B3C40F5129B05B4200C93D50 /* SideWidget */; }; + B3C40F5329B06A0000C93D50 /* PatchApp.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBD929B0324C000F318E /* PatchApp.storyboard */; }; + B3C40F5429B06A2B00C93D50 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBE629B0324C000F318E /* LaunchScreen.storyboard */; }; + B3C40F5529B06A3200C93D50 /* Authentication.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBDA29B0324C000F318E /* Authentication.storyboard */; }; + B3C40F5729B06A6400C93D50 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBE529B0324C000F318E /* Settings.bundle */; }; D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8B62727841800A9B5DD /* libAppleArchive.tbd */; settings = {ATTRIBUTES = (Weak, ); }; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - BF989175250AABF4002ACF50 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFD247622284B9A500981D42 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BF989166250AABF3002ACF50; - remoteInfo = AltWidgetExtension; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ BF088D2B2501A087008082D9 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -55,17 +48,6 @@ name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; - BF98917B250AABF4002ACF50 /* Embed App Extensions */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 13; - files = ( - BF989177250AABF4002ACF50 /* SideWidgetExtension.appex in Embed App Extensions */, - ); - name = "Embed App Extensions"; - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -104,6 +86,8 @@ B34AFC0E29B032DF000F318E /* SideWidgetExtension.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = SideWidgetExtension.entitlements; sourceTree = ""; }; B34AFC0F29B032DF000F318E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B34AFC1029B032DF000F318E /* SideWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideWidget.swift; sourceTree = ""; }; + B34AFC1929B04EBB000F318E /* Dangerfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dangerfile.swift; sourceTree = ""; }; + B34AFC1A29B04EBB000F318E /* Project.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Project.swift; sourceTree = ""; }; B39575F4284F29E20080B4FF /* Roxas.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Roxas.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B3C39606284F4C8400DA9E2F /* CodeSigning.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = CodeSigning.xcconfig; sourceTree = ""; }; B3C39607284F4C8400DA9E2F /* Build.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = ""; }; @@ -129,7 +113,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B34AFC1829B03406000F318E /* Shared in Frameworks */, + B3C40F5229B05B4200C93D50 /* SideWidget in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -280,6 +264,8 @@ B3C39607284F4C8400DA9E2F /* Build.xcconfig */, B3C39606284F4C8400DA9E2F /* CodeSigning.xcconfig */, B3C39608284F4C8400DA9E2F /* CodeSigning.xcconfig.sample */, + B34AFC1929B04EBB000F318E /* Dangerfile.swift */, + B34AFC1A29B04EBB000F318E /* Project.swift */, B34AFBD629B0324C000F318E /* SideStore */, B34AFC0829B032DF000F318E /* SideWidget */, B3CD301229AF876000374AF8 /* Configurations */, @@ -328,7 +314,7 @@ ); name = SideWidgetExtension; packageProductDependencies = ( - B34AFC1729B03406000F318E /* Shared */, + B3C40F5129B05B4200C93D50 /* SideWidget */, ); productName = AltWidgetExtension; productReference = BF989167250AABF3002ACF50 /* SideWidgetExtension.appex */; @@ -342,12 +328,10 @@ BFD247672284B9A500981D42 /* Frameworks */, BFD247682284B9A500981D42 /* Resources */, BF088D2B2501A087008082D9 /* Embed Frameworks */, - BF98917B250AABF4002ACF50 /* Embed App Extensions */, ); buildRules = ( ); dependencies = ( - BF989176250AABF4002ACF50 /* PBXTargetDependency */, ); name = SideStore; packageProductDependencies = ( @@ -386,7 +370,7 @@ }; }; }; - buildConfigurationList = BFD247652284B9A500981D42 /* Build configuration list for PBXProject "SideStore-SPM" */; + buildConfigurationList = BFD247652284B9A500981D42 /* Build configuration list for PBXProject "SideStore" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -420,9 +404,13 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + B3C40F5729B06A6400C93D50 /* Settings.bundle in Resources */, + B3C40F5529B06A3200C93D50 /* Authentication.storyboard in Resources */, B34AFBFE29B0327E000F318E /* AppBannerView.xib in Resources */, B34AFC0129B0327E000F318E /* UpdateCollectionViewCell.xib in Resources */, B34AFC0229B0327E000F318E /* InstalledAppsCollectionHeaderView.xib in Resources */, + B3C40F5429B06A2B00C93D50 /* LaunchScreen.storyboard in Resources */, + B3C40F5329B06A0000C93D50 /* PatchApp.storyboard in Resources */, B34AFBFF29B0327E000F318E /* AboutPatreonHeaderView.xib in Resources */, B34AFC0429B03288000F318E /* Silence.m4a in Resources */, B34AFBFB29B03279000F318E /* Main.storyboard in Resources */, @@ -462,14 +450,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - BF989176250AABF4002ACF50 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BF989166250AABF3002ACF50 /* SideWidgetExtension */; - targetProxy = BF989175250AABF4002ACF50 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ B34AFBE629B0324C000F318E /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; @@ -603,6 +583,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.2; + MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -665,6 +646,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.2; + MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; OTHER_CPLUSPLUSFLAGS = ( @@ -685,10 +667,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = B3CD301829AF876000374AF8 /* SideStore.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = SideStoreAppSources/SideStore/Resources/SideStore.entitlements; + CODE_SIGN_ENTITLEMENTS = SideStoreApp/Sources/SideStore/Resources/SideStore.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; @@ -699,11 +680,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Dependencies/fragmentzip", - "$(PROJECT_DIR)/Dependencies/libcurl", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -718,10 +695,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = B3CD301829AF876000374AF8 /* SideStore.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = SideStoreAppSources/SideStore/Resources/SideStore.entitlements; + CODE_SIGN_ENTITLEMENTS = SideStoreApp/Sources/SideStore/Resources/SideStore.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; @@ -732,11 +708,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Dependencies/fragmentzip", - "$(PROJECT_DIR)/Dependencies/libcurl", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -758,7 +730,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - BFD247652284B9A500981D42 /* Build configuration list for PBXProject "SideStore-SPM" */ = { + BFD247652284B9A500981D42 /* Build configuration list for PBXProject "SideStore" */ = { isa = XCConfigurationList; buildConfigurations = ( BFD2477C2284B9A700981D42 /* Debug */, @@ -783,9 +755,9 @@ isa = XCSwiftPackageProductDependency; productName = SideStoreAppKit; }; - B34AFC1729B03406000F318E /* Shared */ = { + B3C40F5129B05B4200C93D50 /* SideWidget */ = { isa = XCSwiftPackageProductDependency; - productName = Shared; + productName = SideWidget; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/SideStore-SPM.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SideStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from SideStore-SPM.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to SideStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/SideStore-SPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SideStore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from SideStore-SPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to SideStore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/SideStore-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SideStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved similarity index 70% rename from SideStore-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename to SideStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index da823699..77024429 100644 --- a/SideStore-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/SideStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,12 +1,21 @@ { "pins" : [ + { + "identity" : "aexml", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tadija/AEXML", + "state" : { + "revision" : "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0", + "version" : "4.3.3" + } + }, { "identity" : "altsign", "kind" : "remoteSourceControl", "location" : "https://github.com/SideStore/AltSign", "state" : { - "revision" : "9c63397f0fc6038c04b930dd2d10b030d508d6fa", - "version" : "1.0.2" + "revision" : "eb4c74dcf6be2fb00a3edc0381aae59fbbdb4cf3", + "version" : "1.0.3" } }, { @@ -18,15 +27,6 @@ "version" : "4.4.3" } }, - { - "identity" : "danger-swift-coverage", - "kind" : "remoteSourceControl", - "location" : "https://github.com/f-meloni/danger-swift-coverage", - "state" : { - "revision" : "104ded872b6e1af1def04b897bc3a29fe04865ba", - "version" : "0.3.0" - } - }, { "identity" : "down", "kind" : "remoteSourceControl", @@ -37,12 +37,12 @@ } }, { - "identity" : "files", + "identity" : "ignore", "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/Files.git", + "location" : "https://github.com/IgorMuzyka/ignore", "state" : { - "revision" : "a84615f4558151fab52ac38df697ce2442991f93", - "version" : "2.3.0" + "revision" : "49780cf3d46053eb40f4c425a46aaaf662f0665c", + "version" : "0.0.2" } }, { @@ -75,21 +75,12 @@ { "identity" : "logger", "kind" : "remoteSourceControl", - "location" : "https://github.com/shibapm/Logger", + "location" : "https://github.com/f-meloni/Logger", "state" : { "revision" : "53c3ecca5abe8cf46697e33901ee774236d94cce", "version" : "0.2.3" } }, - { - "identity" : "marathon", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/Marathon", - "state" : { - "revision" : "35b672e05ac411fb104e462fbfd6541f995abc17", - "version" : "3.3.0" - } - }, { "identity" : "matchable", "kind" : "remoteSourceControl", @@ -108,15 +99,6 @@ "version" : "7.6.3" } }, - { - "identity" : "octokit.swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/nerdishbynature/octokit.swift", - "state" : { - "revision" : "f762f1566f7cd0e683b9329f169c28ab6ef993cc", - "version" : "0.12.0" - } - }, { "identity" : "openssl", "kind" : "remoteSourceControl", @@ -135,6 +117,24 @@ "revision" : "7fe63ad12b50bad5d86e6abaef5a944f931ce765" } }, + { + "identity" : "packageconfig", + "kind" : "remoteSourceControl", + "location" : "https://github.com/orta/PackageConfig.git", + "state" : { + "revision" : "bf90dc69fa0792894b08a0b74cf34029694ae486", + "version" : "0.13.0" + } + }, + { + "identity" : "pathkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kylef/PathKit", + "state" : { + "revision" : "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0", + "version" : "0.9.2" + } + }, { "identity" : "plcrashreporter", "kind" : "remoteSourceControl", @@ -144,33 +144,6 @@ "version" : "1.10.2" } }, - { - "identity" : "releases", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/Releases.git", - "state" : { - "revision" : "ea62f33a429185b0ed21344c2355862c5bc4fcce", - "version" : "4.0.0" - } - }, - { - "identity" : "requestkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/nerdishbynature/RequestKit.git", - "state" : { - "revision" : "8b0258ea2a4345cbcac90509b764faacea12efb0", - "version" : "3.2.1" - } - }, - { - "identity" : "require", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/Require.git", - "state" : { - "revision" : "7cfbd0d8a2dede0e01f6f0d8ab2c7acef1df112e", - "version" : "2.0.1" - } - }, { "identity" : "roxas", "kind" : "remoteSourceControl", @@ -207,15 +180,6 @@ "version" : "0.3.5" } }, - { - "identity" : "shellout", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/ShellOut", - "state" : { - "revision" : "e1577acf2b6e90086d01a6d5e2b8efdaae033568", - "version" : "2.3.0" - } - }, { "identity" : "sidekit", "kind" : "remoteSourceControl", @@ -226,21 +190,12 @@ } }, { - "identity" : "sourcekitten", + "identity" : "spectre", "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/SourceKitten.git", + "location" : "https://github.com/kylef/Spectre.git", "state" : { - "revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56", - "version" : "0.34.1" - } - }, - { - "identity" : "swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/danger/swift.git", - "state" : { - "revision" : "33d35bf94f54155be505ffecfca745e4cc1cd0cc", - "version" : "1.6.5" + "revision" : "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53", + "version" : "0.9.2" } }, { @@ -298,21 +253,12 @@ } }, { - "identity" : "swiftsafeurl", + "identity" : "swiftshell", "kind" : "remoteSourceControl", - "location" : "https://github.com/baguio/SwiftSafeURL", + "location" : "https://github.com/kareman/SwiftShell", "state" : { - "revision" : "b124e5280c3fb4588db38df1047628f52f2713ac", - "version" : "0.4.2" - } - }, - { - "identity" : "swxmlhash", - "kind" : "remoteSourceControl", - "location" : "https://github.com/drmohundro/SWXMLHash.git", - "state" : { - "revision" : "4d0f62f561458cbe1f732171e625f03195151b60", - "version" : "7.0.1" + "revision" : "beebe43c986d89ea5359ac3adcb42dac94e5e08a", + "version" : "4.1.2" } }, { @@ -325,12 +271,12 @@ } }, { - "identity" : "xcodeissuereporting", + "identity" : "xcodeproj", "kind" : "remoteSourceControl", - "location" : "https://github.com/baguio/XcodeIssueReporting", + "location" : "https://github.com/tuist/xcodeproj.git", "state" : { - "revision" : "76165bb2c12adee23d3d9f4ed0b475c9c438d94a", - "version" : "1.4.1" + "revision" : "065f348754b6155b8037dc43876a8f2ee354b95d", + "version" : "6.7.0" } }, { diff --git a/SideStoreApp/Configurations/SideStore-Debug.xcconfig b/SideStoreApp/Configurations/SideStore-Debug.xcconfig new file mode 100644 index 00000000..2285292e --- /dev/null +++ b/SideStoreApp/Configurations/SideStore-Debug.xcconfig @@ -0,0 +1 @@ +#include "SideStore.xconfig" diff --git a/SideStoreApp/Configurations/SideStore-Release.xcconfig b/SideStoreApp/Configurations/SideStore-Release.xcconfig new file mode 100644 index 00000000..2285292e --- /dev/null +++ b/SideStoreApp/Configurations/SideStore-Release.xcconfig @@ -0,0 +1 @@ +#include "SideStore.xconfig" diff --git a/SideStoreApp/Package.swift b/SideStoreApp/Package.swift index 013d79b2..d3a7e19d 100644 --- a/SideStoreApp/Package.swift +++ b/SideStoreApp/Package.swift @@ -29,7 +29,7 @@ let unsafe_flags_cxx: [String] = INHIBIT_UPSTREAM_WARNINGS ? let dependencies: [Package.Dependency] = [ // Side Store - .package(url: "https://github.com/SideStore/AltSign", from: "1.0.2"), + .package(url: "https://github.com/SideStore/AltSign", from: "1.0.3"), .package(url: "https://github.com/SideStore/iMobileDevice.swift", from: "1.0.5"), .package(url: "https://github.com/SideStore/SideKit", from: "0.1.0"), @@ -71,7 +71,7 @@ let dependencies: [Package.Dependency] = [ // let validUrl = URL(safeString: "https://example.tld") // This won't // let invalidUrl = URL(safeString: "https://example./tld") - .package(url: "https://github.com/baguio/SwiftSafeURL", from: "0.4.2"), +// .package(url: "https://github.com/JoeMatt/SwiftSafeURL", branch: "main"),//from: "0.4.2"), // Secrets manager using `.env` .package(url: "https://github.com/vdka/SecretsManager.git", from: "1.0.0"), @@ -89,8 +89,11 @@ let dependencies: [Package.Dependency] = [ */ // Old style plugins - .package(url: "https://github.com/f-meloni/danger-swift-coverage", from: "0.1.0") // dev - + // `Danger` https://danger.systems/swift/ for CI/CD + // Additinal plugins https://github.com/danger/awesome-danger +// .package(url: "https://github.com/danger/swift.git", from: "3.0.0"), // dev +// .package(url: "https://github.com/f-meloni/danger-swift-coverage", from: "0.1.0") // dev + .package(url: "https://github.com/IgorMuzyka/ignore", from: "0.0.2"), ] // + dependencies_cargo let package = Package( @@ -100,7 +103,7 @@ let package = Package( .iOS(.v14), .tvOS(.v14), .macCatalyst(.v14), - .macOS(.v11), + .macOS(.v12), ], products: [ @@ -110,12 +113,6 @@ let package = Package( targets: ["SideStore"] ), - // SideWidget Executable - .executable( - name: "SideWidget", - targets: ["SideWidget"] - ), - // SideStoreAppKit .library( name: "SideStoreAppKit", @@ -146,20 +143,20 @@ let package = Package( type: .dynamic, targets: ["SideStoreCore"]), - // Shared (for widget) + // WidgetKit .library( - name: "Shared", - targets: ["Shared"]), + name: "SideWidget", + targets: ["SideWidget"]), .library( - name: "Shared-Static", + name: "SideWidget-Static", type: .static, - targets: ["Shared"]), + targets: ["SideWidget"]), .library( - name: "Shared-Dynamic", + name: "SideWidget-Dynamic", type: .dynamic, - targets: ["Shared"]), + targets: ["SideWidget"]), // Plugins .plugin(name: "CargoPlugin", targets: ["CargoPlugin"]), @@ -225,17 +222,17 @@ let package = Package( .linkedFramework("AudioToolbox", .when(platforms: [.iOS, .macCatalyst])), .linkedFramework("WidgetKit", .when(platforms: [.iOS, .macCatalyst])), .linkedFramework("UserNotifications", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .macCatalyst])), + .linkedFramework("MobileCoreServiceGits", .when(platforms: [.iOS, .macCatalyst])), .linkedLibrary("AppleArchive") ], plugins: [ .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), -// .plugin(name: "VersionatorPlugin", package: "Versionator"), .plugin(name: "InfomaticPlugin", package: "InfomaticPlugin"), - .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), - .plugin(name: "packageBuildInfoPlugin", package: "PackageBuildInfo"), + .plugin(name: "PackageBuildInfoPlugin", package: "PackageBuildInfo"), .plugin(name: "SecretsManagerPlugin", package: "SecretsManager"), +// .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), +// .plugin(name: "VersionatorPlugin", package: "Versionator"), ] ), @@ -251,6 +248,9 @@ let package = Package( "Down", "AltSign", "SideKit", + "KeychainAccess", + .product(name: "libimobiledevice", package: "iMobileDevice.swift"), + .product(name: "CCoreCrypto", package: "AltSign"), .product(name: "Roxas", package: "Roxas"), .product(name: "RoxasUI", package: "Roxas"), .product(name: "AppCenterAnalytics", package: "appcenter-sdk-apple"), @@ -282,23 +282,33 @@ let package = Package( plugins: [ .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), - .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), +// .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), ] ), // MARK: - SideWidget - .executableTarget( - name: "SideWidget", + .target( + name: "SideWidget", dependencies: [ "Shared", - "SideStoreCore" + "SideStoreCore", + "AltSign", + "SideKit", + "SemanticVersion", + "KeychainAccess", + .product(name: "RoxasUI", package: "Roxas"), + .product(name: "CCoreCrypto", package: "AltSign"), + ], + exclude: [ + "Resources/Info.plist", + "Resources/SideWidgetExtension.entitlements", ], plugins: [ .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins") ] - ), + ), // MARK: - EmotionalDamage @@ -348,7 +358,6 @@ let package = Package( .product(name: "libimobiledevice", package: "iMobileDevice.swift") ], plugins: [ - .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins") ] ), @@ -379,9 +388,10 @@ let package = Package( dependencies: [ "SideKit", "AltSign", + .product(name: "CCoreCrypto", package: "AltSign"), ], plugins: [ - .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), + .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), ] ), @@ -398,7 +408,10 @@ let package = Package( .executableTarget( name: "SideBackup", - dependencies: [] + dependencies: [], + plugins: [ + .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), + ] ), @@ -416,7 +429,6 @@ let package = Package( plugins: [ .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), - .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), ] ), @@ -435,8 +447,16 @@ let package = Package( .plugin(name: "CargoPlugin", capability: .buildTool()), // .plugin(name: "CargoPlugin-Generate", capability: .command(intent: PluginCommandIntent)), + .target(name: "PackageConfigs", dependencies: [ + "IgnoreConfig", + ]) // MARK: Danger.swift - .target(name: "DangerDependencies", dependencies: ["Danger", "DangerSwiftCoverage"]), // dev +// .target( +// name: "DangerDependencies", +// dependencies: [ +// .product(name: "Danger", package: "swift"), +// .product(name: "DangerSwiftCoverage", package: "danger-swift-coverage"), +// ]), // dev ], swiftLanguageVersions: [.v5], @@ -452,6 +472,14 @@ func envBool(_ key: String) -> Bool { return trueValues.contains(value.lowercased()) } +#if canImport(IgnoreConfig) +// https://github.com/IgorMuzyka/ignore +// Ignore warnings in Packages +import IgnoreConfig + +// add the list of targets you wish to preserve the warnings for as excluded +IgnoreConfig(excludedTargets: ["YourMainTarget", "SomeOtherTargetOfYours"]).write() +#endif // MARK: - SideDaemon // .executable( diff --git a/SideStoreApp/Sources/Cargo/Commands/Version.swift b/SideStoreApp/Sources/Cargo/Commands/Version.swift index d9edd205..abf82250 100644 --- a/SideStoreApp/Sources/Cargo/Commands/Version.swift +++ b/SideStoreApp/Sources/Cargo/Commands/Version.swift @@ -1,5 +1,6 @@ import ArgumentParser import SwiftLintFramework +import os.log extension Cargo { struct Version: ParsableCommand { @@ -12,8 +13,8 @@ extension Cargo { func run() throws { if verbose, let buildID = ExecutableInfo.buildID { - print("Version:", Self.value) - print("Build ID:", buildID) + os_log("Version: %@", type: .info , Self.value) + os_log("Build ID: %@", type: .info , buildID) } else { print(Self.value) } diff --git a/SideStoreApp/Sources/Cargo/swiftlint/Commands/Version.swift b/SideStoreApp/Sources/Cargo/swiftlint/Commands/Version.swift index 8cbcb082..6a8c45ee 100644 --- a/SideStoreApp/Sources/Cargo/swiftlint/Commands/Version.swift +++ b/SideStoreApp/Sources/Cargo/swiftlint/Commands/Version.swift @@ -1,5 +1,6 @@ import ArgumentParser import SwiftLintFramework +import os.log extension SwiftLint { struct Version: ParsableCommand { @@ -12,8 +13,8 @@ extension SwiftLint { func run() throws { if verbose, let buildID = ExecutableInfo.buildID { - print("Version:", Self.value) - print("Build ID:", buildID) + os_log("Version: %@", type: .info , Self.value) + os_log("Build ID: %@", type: .info , buildID) } else { print(Self.value) } diff --git a/SideStoreApp/Sources/Shared/Connections/Connection.swift b/SideStoreApp/Sources/Shared/Connections/Connection.swift index 5cd1ae2c..f6e958a8 100644 --- a/SideStoreApp/Sources/Shared/Connections/Connection.swift +++ b/SideStoreApp/Sources/Shared/Connections/Connection.swift @@ -9,6 +9,7 @@ import Foundation import Network import SideKit +import os.log public protocol SideConnection: Connection { func __send(_ data: Data, completionHandler: @escaping (Bool, Error?) -> Void) @@ -74,7 +75,7 @@ public extension SideConnection { func receiveRequest(completionHandler: @escaping (Result) -> Void) { let size = MemoryLayout.size - print("Receiving request size from connection:", self) + os_log("Receiving request size from connection: %@", type: .info , String(describing: self)) receiveData(expectedSize: size) { result in do { let data = try result.get() @@ -87,7 +88,7 @@ public extension SideConnection { let data = try result.get() let request = try JSONDecoder().decode(ServerRequest.self, from: data) - print("Received request:", request) + os_log("Received request: %@", type: .info , String(describing: request)) completionHandler(.success(request)) } catch { completionHandler(.failure(ALTServerError(error))) diff --git a/SideStoreApp/Sources/Shared/Connections/ConnectionManager.swift b/SideStoreApp/Sources/Shared/Connections/ConnectionManager.swift index f2ab04ac..ae04c913 100644 --- a/SideStoreApp/Sources/Shared/Connections/ConnectionManager.swift +++ b/SideStoreApp/Sources/Shared/Connections/ConnectionManager.swift @@ -9,6 +9,7 @@ import Foundation import Network import SideKit +import os.log public protocol RequestHandler { func handleAnisetteDataRequest(_ request: AnisetteDataRequest, for connection: Connection, completionHandler: @escaping (Result) -> Void) @@ -102,18 +103,18 @@ private extension ConnectionManager { do { let response = try result.get() connection.send(response, shouldDisconnect: true) { result in - print("Sent response \(response) with result:", result) + os_log("Sent response %@ with result: %@", type: .error , response.identifier, String(describing: result)) } } catch { let response = ErrorResponse(error: ALTServerError(error)) connection.send(response, shouldDisconnect: true) { result in - print("Sent error response \(response) with result:", result) + os_log("Sent error response %@ with result: %@", type: .error , response.error.localizedDescription, String(describing: result)) } } } connection.receiveRequest { result in - print("Received request with result:", result) + os_log("Received request with result: %@", type: .info, String(describing: result)) switch result { case let .failure(error): finish(Result.failure(error)) diff --git a/SideStoreApp/Sources/Shared/Connections/XPCConnection.swift b/SideStoreApp/Sources/Shared/Connections/XPCConnection.swift index d7bc27ca..064ec3ae 100644 --- a/SideStoreApp/Sources/Shared/Connections/XPCConnection.swift +++ b/SideStoreApp/Sources/Shared/Connections/XPCConnection.swift @@ -8,6 +8,7 @@ import Foundation import SideKit +import os.log @objc private protocol XPCConnectionProxy { func ping(completionHandler: @escaping () -> Void) @@ -56,7 +57,7 @@ public class XPCConnection: NSObject, SideConnection { private extension XPCConnection { func makeProxy(errorHandler: @escaping (Error) -> Void) -> XPCConnectionProxy { let proxy = xpcConnection.remoteObjectProxyWithErrorHandler { error in - print("Error messaging remote object proxy:", error) + os_log("Error messaging remote object proxy: %@", type: .error , error.localizedDescription) self.error = error errorHandler(error) } as! XPCConnectionProxy diff --git a/SideStoreApp/Sources/SideBackup/AppDelegate.swift b/SideStoreApp/Sources/SideBackup/AppDelegate.swift index 7ae80900..ef5b2ca8 100644 --- a/SideStoreApp/Sources/SideBackup/AppDelegate.swift +++ b/SideStoreApp/Sources/SideBackup/AppDelegate.swift @@ -7,6 +7,7 @@ // import UIKit +import os.log extension AppDelegate { static let startBackupNotification = Notification.Name("io.altstore.StartBackup") @@ -104,7 +105,7 @@ private extension AppDelegate { DispatchQueue.main.async { UIApplication.shared.open(responseURL, options: [:]) { success in - print("Sent response to app with success:", success) + os_log("Sent response to app with success: %@", type: .info , success) } } } diff --git a/SideStoreApp/Sources/SideBackup/BackupController.swift b/SideStoreApp/Sources/SideBackup/BackupController.swift index f365b47d..155268d7 100644 --- a/SideStoreApp/Sources/SideBackup/BackupController.swift +++ b/SideStoreApp/Sources/SideBackup/BackupController.swift @@ -7,6 +7,8 @@ // import Foundation +import AltSign +import os.log extension ErrorUserInfoKey { static let sourceFile: String = "alt_sourceFile" @@ -144,11 +146,11 @@ class BackupController: NSObject { // Replace previous backup with new backup. _ = try FileManager.default.replaceItemAt(appBackupDirectory, withItemAt: temporaryAppBackupDirectory) - print("Replaced previous backup with new backup:", temporaryAppBackupDirectory) + os_log("Replaced previous backup with new backup: %@", type: .info , temporaryAppBackupDirectory) completionHandler(.success(())) } catch { - do { try FileManager.default.removeItem(at: temporaryAppBackupDirectory) } catch { print("Failed to remove temporary directory.", error) } + do { try FileManager.default.removeItem(at: temporaryAppBackupDirectory) } catch { os_log("Failed to remove temporary directory. %@", type: .error , error.localizedDescription) } completionHandler(.failure(error)) } @@ -239,7 +241,7 @@ private extension BackupController { print("Copied item from \(fileURL) to \(destinationURL)") } catch let error where fileURL.lastPathComponent == "Inbox" && fileURL.deletingLastPathComponent().lastPathComponent == "Documents" { // Ignore errors for /Documents/Inbox - print("Failed to copy Inbox directory:", error) + os_log("Failed to copy Inbox directory: %@", type: .error , error.localizedDescription) } catch { print(error) throw error diff --git a/SideStoreApp/Sources/SideDaemon/AnisetteDataManager.swift b/SideStoreApp/Sources/SideDaemon/AnisetteDataManager.swift index 0bb15d19..9fef521d 100644 --- a/SideStoreApp/Sources/SideDaemon/AnisetteDataManager.swift +++ b/SideStoreApp/Sources/SideDaemon/AnisetteDataManager.swift @@ -27,7 +27,7 @@ struct AnisetteDataManager { } func requestAnisetteData() throws -> ALTAnisetteData { - var request = URLRequest(url: URL(string: "https://developerservices2.apple.com/services/QH65B2/listTeams.action?clientId=XABBG36SBA")!) + var request = URLRequest(url: URL(string: "https://developerservices2.apple.com/services/QH65B2/listTeams.action?clientId=XABBG36SBA")!) request.httpMethod = "POST" let akAppleIDSession = unsafeBitCast(NSClassFromString("AKAppleIDSession")!, to: AKAppleIDSession.Type.self) diff --git a/SideStoreApp/Sources/SideDaemon/AppManager.swift b/SideStoreApp/Sources/SideDaemon/AppManager.swift index d13b8638..9bbfd4d4 100644 --- a/SideStoreApp/Sources/SideDaemon/AppManager.swift +++ b/SideStoreApp/Sources/SideDaemon/AppManager.swift @@ -71,7 +71,7 @@ struct AppManager { if installingBundleIDs.contains(profile.bundleIdentifier) || (activeProfiles?.contains(profile.bundleIdentifier) == false && profile.isFreeProvisioningProfile) { try FileManager.default.removeItem(at: fileURL) } else { - print("Ignoring:", profile.bundleIdentifier, profile.uuid) + os_log("Ignoring: %@ %@", type: .info , profile.bundleIdentifier, profile.uuid) } } diff --git a/SideStoreApp/Sources/SideDaemon/DaemonRequestHandler.swift b/SideStoreApp/Sources/SideDaemon/DaemonRequestHandler.swift index cb67accc..b3f53e2c 100644 --- a/SideStoreApp/Sources/SideDaemon/DaemonRequestHandler.swift +++ b/SideStoreApp/Sources/SideDaemon/DaemonRequestHandler.swift @@ -9,6 +9,7 @@ import Foundation import Shared import SideKit +import os.log typealias DaemonConnectionManager = ConnectionManager @@ -39,7 +40,7 @@ struct DaemonRequestHandler: RequestHandler { print("Awaiting begin installation request...") connection.receiveRequest { result in - print("Received begin installation request with result:", result) + os_log("Received begin installation request with result: %@", type: .info , String(describing: result)) do { guard case let .beginInstallation(request) = try result.get() else { throw ALTServerError(.unknownRequest) } @@ -47,7 +48,7 @@ struct DaemonRequestHandler: RequestHandler { AppManager.shared.installApp(at: fileURL, bundleIdentifier: bundleIdentifier, activeProfiles: request.activeProfiles) { result in let result = result.map { InstallationProgressResponse(progress: 1.0) } - print("Installed app with result:", result) + os_log("Installed app with result: %@", type: .info, String(describing: result)) completionHandler(result) } @@ -62,11 +63,11 @@ struct DaemonRequestHandler: RequestHandler { AppManager.shared.install(request.provisioningProfiles, activeProfiles: request.activeProfiles) { result in switch result { case let .failure(error): - print("Failed to install profiles \(request.provisioningProfiles.map { $0.bundleIdentifier }):", error) + os_log("Failed to install profiles %@ : %@", type: .error , request.provisioningProfiles.map { $0.bundleIdentifier }.joined(separator: "\n"), error.localizedDescription) completionHandler(.failure(error)) case .success: - print("Installed profiles:", request.provisioningProfiles.map { $0.bundleIdentifier }) + os_log("Installed profiles: %@", type: .info , request.provisioningProfiles.map { $0.bundleIdentifier }.joined(separator: "\n")) let response = InstallProvisioningProfilesResponse() completionHandler(.success(response)) @@ -79,11 +80,11 @@ struct DaemonRequestHandler: RequestHandler { AppManager.shared.removeProvisioningProfiles(forBundleIdentifiers: request.bundleIdentifiers) { result in switch result { case let .failure(error): - print("Failed to remove profiles \(request.bundleIdentifiers):", error) + os_log("Failed to remove profiles %@ : %@", type: .error, request.bundleIdentifiers, error.localizedDescription) completionHandler(.failure(error)) case .success: - print("Removed profiles:", request.bundleIdentifiers) + os_log("Removed profiles: %@", type: .info , request.bundleIdentifiers) let response = RemoveProvisioningProfilesResponse() completionHandler(.success(response)) @@ -95,11 +96,11 @@ struct DaemonRequestHandler: RequestHandler { AppManager.shared.removeApp(forBundleIdentifier: request.bundleIdentifier) { result in switch result { case let .failure(error): - print("Failed to remove app \(request.bundleIdentifier):", error) + os_log("Failed to remove app %@ : %@", type: .error , request.bundleIdentifier, error.localizedDescription) completionHandler(.failure(error)) case .success: - print("Removed app:", request.bundleIdentifier) + os_log("Removed app: %@", type: .info , request.bundleIdentifier) let response = RemoveAppResponse() completionHandler(.success(response)) diff --git a/SideStoreApp/Sources/SideStore/AppDelegate.swift b/SideStoreApp/Sources/SideStore/AppDelegate.swift index 0aad8000..fbcb92ab 100644 --- a/SideStoreApp/Sources/SideStore/AppDelegate.swift +++ b/SideStoreApp/Sources/SideStore/AppDelegate.swift @@ -16,6 +16,7 @@ import SideStoreCore import SideStoreAppKit import EmotionalDamage import RoxasUIKit +import os.log @UIApplicationMain final class AppDelegate: SideStoreAppDelegate { @@ -49,9 +50,9 @@ final class AppDelegate: SideStoreAppDelegate { DatabaseManager.shared.start { error in if let error = error { - print("Failed to start DatabaseManager. Error:", error as Any) + os_log("Failed to start DatabaseManager. Error: %@", type: .error , error.localizedDescription) } else { - print("Started DatabaseManager.") + os_log("Started DatabaseManager.", type: .info) } } @@ -86,7 +87,7 @@ final class AppDelegate: SideStoreAppDelegate { DatabaseManager.shared.purgeLoggedErrors(before: midnightOneMonthAgo) { result in switch result { case .success: break - case let .failure(error): print("[ALTLog] Failed to purge logged errors before \(midnightOneMonthAgo).", error) + case let .failure(error): os_log("[ALTLog] Failed to purge logged errors before %@. %@", type: .error , midnightOneMonthAgo.debugDescription, error.localizedDescription) } } } @@ -221,7 +222,7 @@ extension AppDelegate { } let token = tokenParts.joined() - print("Push Token:", token) + os_log("Push Token: %@", type: .debug , token) } func application(_ application: UIApplication, didReceiveRemoteNotification _: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { @@ -245,7 +246,7 @@ extension AppDelegate { BackgroundTaskManager.shared.performExtendedBackgroundTask { taskResult, taskCompletionHandler in if let error = taskResult.error { - print("Error starting extended background task. Aborting.", error) + os_log("Error starting extended background task. Aborting. %@", type: .error, error.localizedDescription) backgroundFetchCompletionHandler(.failed) taskCompletionHandler() return @@ -361,7 +362,7 @@ private extension AppDelegate { completionHandler(.success(sources)) } catch { - print("Error fetching apps:", error) + os_log("Error fetching apps: %@", type: .error, error.localizedDescription) completionHandler(.failure(error)) } } diff --git a/SideStoreApp/Sources/SideStore/SceneDelegate.swift b/SideStoreApp/Sources/SideStore/SceneDelegate.swift index c10529b6..506e4ae8 100644 --- a/SideStoreApp/Sources/SideStore/SceneDelegate.swift +++ b/SideStoreApp/Sources/SideStore/SceneDelegate.swift @@ -10,6 +10,7 @@ import SideStoreCore import EmotionalDamage import SideStoreAppKit import UIKit +import os.log @available(iOS 13, *) final class SceneDelegate: UIResponder, UIWindowSceneDelegate { @@ -57,7 +58,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { DatabaseManager.shared.purgeLoggedErrors(before: midnightOneMonthAgo) { result in switch result { case .success: break - case let .failure(error): print("[ALTLog] Failed to purge logged errors before \(midnightOneMonthAgo).", error) + case let .failure(error): os_log("[ALTLog] Failed to purge logged errors before %@. %@", type: .error, midnightOneMonthAgo.debugDescription, error.localizedDescription) } } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewController.swift index 9a583fe8..e02ebe0c 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewController.swift @@ -10,6 +10,7 @@ import UIKit import SideStoreCore import RoxasUIKit +import os.log import Nuke @@ -156,7 +157,7 @@ private extension AppContentViewController { cell.imageView.image = image if let error = error { - print("Error loading image:", error) + os_log("Error loading image: %@", type: .error, error.localizedDescription) } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/IntentHandler.swift b/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/IntentHandler.swift index 3e1d1398..e030953a 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/IntentHandler.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/IntentHandler.swift @@ -9,6 +9,7 @@ import Foundation import SideStoreCore import Intents +import os.log @available(iOS 14, *) public final class IntentHandler: NSObject, RefreshAllIntentHandling { @@ -107,7 +108,7 @@ private extension IntentHandler { } catch RefreshError.noInstalledApps { self.finish(intent, response: RefreshAllIntentResponse(code: .success, userActivity: nil)) } catch let error as NSError { - print("Failed to refresh apps in background.", error) + os_log("Failed to refresh apps in background. %@", type: .error , error.localizedDescription) self.finish(intent, response: RefreshAllIntentResponse.failure(localizedDescription: error.localizedFailureReason ?? error.localizedDescription)) } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/ViewAppIntentHandler.swift b/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/ViewAppIntentHandler.swift index 2ac5afdd..e23754d7 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/ViewAppIntentHandler.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Authentication/Intents/ViewAppIntentHandler.swift @@ -9,14 +9,17 @@ import Intents import Shared import SideStoreCore +import os.log @available(iOS 14, *) public class ViewAppIntentHandler: NSObject, ViewAppIntentHandling { - public func provideAppOptionsCollection(for _: ViewAppIntent, with completion: @escaping (INObjectCollection?, Error?) -> Void) { + public func provideAppOptionsCollection(for intent: ViewAppIntent, with completion: @escaping (INObjectCollection?, Error?) -> Void) { DatabaseManager.shared.start { error in if let error = error { - print("Error starting extension:", error) - } + os_log("Error starting extension: %@", type: .error , error.localizedDescription) + } else { + os_log("Started extension: %@", type: .info , intent.debugDescription) + } DatabaseManager.shared.persistentContainer.performBackgroundTask { context in let apps = InstalledApp.all(in: context).map { installedApp in diff --git a/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseCollectionViewCell.swift b/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseCollectionViewCell.swift index 3429cb11..ab16ad4b 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseCollectionViewCell.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseCollectionViewCell.swift @@ -9,6 +9,7 @@ import UIKit import RoxasUIKit +import os.log import Nuke @@ -68,7 +69,7 @@ private extension BrowseCollectionViewCell { cell.imageView.image = image if let error = error { - print("Error loading image:", error) + os_log("Error loading image: %@", type: .error , error.localizedDescription) } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseViewController.swift index f3aabf83..2673ac95 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Browse/BrowseViewController.swift @@ -10,6 +10,7 @@ import UIKit import SideStoreCore import RoxasUIKit +import os.log import Nuke @@ -140,7 +141,7 @@ private extension BrowseViewController { cell.bannerView.iconImageView.image = image if let error = error { - print("Error loading image:", error) + os_log("Error loading image: %@", type: .error , error.localizedDescription) } } @@ -240,7 +241,7 @@ private extension BrowseViewController { let toastView = ToastView(error: error) toastView.show(in: self) - case .success: print("Installed app:", app.bundleIdentifier) + case .success: os_log("Installed app: %@", type: .info , app.bundleIdentifier) } self.collectionView.reloadItems(at: [indexPath]) diff --git a/SideStoreApp/Sources/SideStoreAppKit/Extensions/FileManager+DirectorySize.swift b/SideStoreApp/Sources/SideStoreAppKit/Extensions/FileManager+DirectorySize.swift index d6585be6..0cf3d09c 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Extensions/FileManager+DirectorySize.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Extensions/FileManager+DirectorySize.swift @@ -7,6 +7,7 @@ // import Foundation +import os.log extension FileManager { func directorySize(at directoryURL: URL) -> Int? { @@ -21,7 +22,7 @@ extension FileManager { total += fileSize } catch { - print("Failed to read file size for item: \(fileURL).", error) + os_log("Failed to read file size for item: %@. %@", type: .error, fileURL.absoluteString, error.localizedDescription) } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Managing Apps/AppManager.swift b/SideStoreApp/Sources/SideStoreAppKit/Managing Apps/AppManager.swift index 6bd311aa..9ab04b1f 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Managing Apps/AppManager.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Managing Apps/AppManager.swift @@ -19,6 +19,7 @@ import AltSign import SideKit import SideStoreCore import RoxasUIKit +import os.log public extension AppManager { static let didFetchSourceNotification = Notification.Name("io.altstore.AppManager.didFetchSource") @@ -166,7 +167,7 @@ public extension AppManager { try context.save() } catch { - print("Error while fetching installed apps.", error) + os_log("Error while fetching installed apps. %@", type: .error , error.localizedDescription) } #endif @@ -182,15 +183,15 @@ public extension AppManager { guard let isDirectory = resourceValues.isDirectory, let bundleID = resourceValues.name else { continue } if isDirectory && !installedAppBundleIDs.contains(bundleID) && !self.isActivelyManagingApp(withBundleID: bundleID) { - print("DELETING CACHED APP:", bundleID) + os_log("DELETING CACHED APP: %@", type: .info , bundleID) try FileManager.default.removeItem(at: appDirectory) } } catch { - print("Failed to remove cached app directory.", error) + os_log("Failed to remove cached app directory. %@", type: .error , error.localizedDescription) } } } catch { - print("Failed to remove cached apps.", error) + os_log("Failed to remove cached apps. %@", type: .error , error.localizedDescription) } } } @@ -350,7 +351,7 @@ public extension AppManager { { let authenticationOperation = self.authenticate(presentingViewController: nil) { (result) in // result contains name, email, auth token, OTP and other possibly personal/account specific info. we don't want this logged - //print("Authenticated for fetching App IDs with result:", result) + //os_log("Authenticated for fetching App IDs with result: %@", type: .info , result) } let fetchAppIDsOperation = FetchAppIDsOperation(context: authenticationOperation.context) @@ -382,7 +383,7 @@ public extension AppManager { try result.get() self.updatePatronsResult = .success(()) } catch { - print("Error updating Friend Zone Patrons:", error) + os_log("Error updating Friend Zone Patrons: %@", type: .error , error.localizedDescription) self.updatePatronsResult = .failure(error) } @@ -564,7 +565,7 @@ public extension AppManager { removeAppBackupOperation.resultHandler = { result in switch result { case .success: break - case let .failure(error): print("Failed to remove app backup.", error) + case let .failure(error): os_log("Failed to remove app backup. %@", type: .error , error.localizedDescription) } // Throw the error from removeAppOperation, @@ -664,7 +665,7 @@ public extension AppManager { public extension AppManager { @discardableResult - public func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result], Error>) -> Void) -> BackgroundRefreshAppsOperation { + func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result], Error>) -> Void) -> BackgroundRefreshAppsOperation { let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps) backgroundRefreshAppsOperation.resultHandler = completionHandler backgroundRefreshAppsOperation.presentsFinishedNotification = presentsNotifications @@ -1185,7 +1186,7 @@ private extension AppManager { switch result { case let .failure(error): // Don't report error, since it doesn't really matter. - print("Failed to delete app backup.", error) + os_log("Failed to delete app backup. %@", type: .error , error.localizedDescription) case .success: break } @@ -1383,7 +1384,7 @@ private extension AppManager { let bundleIcons = ["CFBundlePrimaryIcon": ["CFBundleIconFiles": [iconFileURL.lastPathComponent]]] infoDictionary["CFBundleIcons"] = bundleIcons } catch { - print("Failed to write app icon data.", error) + os_log("Failed to write app icon data. %@", type: .error , error.localizedErrorCode) } } } @@ -1473,7 +1474,7 @@ private extension AppManager { WidgetCenter.shared.reloadAllTimelines() } - do { try installedApp.managedObjectContext?.save() } catch { print("Error saving installed app.", error) } + do { try installedApp.managedObjectContext?.save() } catch { os_log("Error saving installed app. %@", type: .error, error.localizedDescription) } } catch { group.set(.failure(error), forAppWithBundleIdentifier: operation.bundleIdentifier) @@ -1527,7 +1528,11 @@ private extension AppManager { _ = LoggedError(error: sanitizedError, app: app, operation: loggedErrorOperation, context: context) try context.save() } catch let saveError { - print("[ALTLog] Failed to log error \(sanitizedError.domain) code \(sanitizedError.code) for \(app.bundleIdentifier):", saveError) + os_log("[ALTLog] Failed to log error %@ code %@ for %@: %@", type: .error, + sanitizedError.domain, + sanitizedError.code, + app.bundleIdentifier, + saveError.localizedErrorCode) } } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsViewController.swift index 9eaaeab3..bc6cf379 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsViewController.swift @@ -14,6 +14,7 @@ import UIKit import AltSign import SideStoreCore import RoxasUIKit +import os.log import Nuke @@ -242,7 +243,7 @@ private extension MyAppsViewController { cell.bannerView.iconImageView.image = image if let error = error { - print("Error loading image:", error) + os_log("Error loading image: %@", type: .error , error.localizedDescription) } } @@ -442,7 +443,7 @@ private extension MyAppsViewController { let (_, context) = try result.get() try context.save() } catch { - print("Failed to fetch App IDs.", error) + os_log("Failed to fetch App IDs. %@", type: .error , error.localizedDescription) } } } @@ -575,7 +576,7 @@ private extension MyAppsViewController { let interaction = INInteraction.refreshAllApps() interaction.donate { error in guard let error = error else { return } - print("Failed to donate intent \(interaction.intent).", error) + os_log("Failed to donate intent %@ . %@", type: .error , interaction.intent, error.localizedDescription) } } } @@ -605,7 +606,7 @@ private extension MyAppsViewController { self.collectionView.reloadItems(at: [indexPath]) case .success: - print("Updated app:", installedApp.bundleIdentifier) + os_log("Updated app: %@", type: .info , installedApp.bundleIdentifier) // No need to reload, since the the update cell is gone now. } @@ -774,7 +775,7 @@ private extension MyAppsViewController { completion(.success(())) app.managedObjectContext?.perform { - print("Successfully installed app:", app.bundleIdentifier) + os_log("Successfully installed app: %@", type: .info , app.bundleIdentifier) } case .failure(OperationError.cancelled): @@ -900,7 +901,15 @@ private extension MyAppsViewController { } } - print("Finished refreshing with results:", results.map { ($0, $1.error?.localizedDescription ?? "success") }) + + let errors = results.filter({ $1.error != nil }).map{ ($0, $1.error?.localizedDescription ?? "no description") } + let successes = results.filter({ $1.error == nil }).map{ ($0, "success") } + if !errors.isEmpty { + os_log("Finished refreshing Errors: %@", type: .error, errors.map { "\($0.0) - \($0.1)" }.joined(separator: "\n")) + } + if !successes.isEmpty { + os_log("Finished refreshing success: %@", type: .info, successes.map { "\($0.0) - \($0.1)" }.joined(separator: "\n")) + } } } @@ -914,7 +923,7 @@ private extension MyAppsViewController { } catch OperationError.cancelled { // Ignore } catch { - print("Failed to activate app:", error) + os_log("Failed to activate app: %@", type: .error , error.localizedDescription) DispatchQueue.main.async { installedApp.isActive = false @@ -977,9 +986,9 @@ private extension MyAppsViewController { let app = try result.get() try? app.managedObjectContext?.save() - print("Finished deactivating app:", app.bundleIdentifier) + os_log("Finished deactivating app: %@", type: .info , app.bundleIdentifier) } catch { - print("Failed to activate app:", error) + os_log("Failed to activate app: %@", type: .error , error.localizedDescription) DispatchQueue.main.async { installedApp.isActive = true @@ -1035,9 +1044,9 @@ private extension MyAppsViewController { let app = try result.get() try? app.managedObjectContext?.save() - print("Finished backing up app:", app.bundleIdentifier) + os_log("Finished backing up app: %@", type: .info , app.bundleIdentifier) } catch { - print("Failed to back up app:", error) + os_log("Failed to back up app: %@", type: .error , error.localizedDescription) DispatchQueue.main.async { let toastView = ToastView(error: error) @@ -1066,9 +1075,9 @@ private extension MyAppsViewController { let app = try result.get() try? app.managedObjectContext?.save() - print("Finished restoring app:", app.bundleIdentifier) + os_log("Finished restoring app: %@", type: .info , app.bundleIdentifier) } catch { - print("Failed to restore app:", error) + os_log("Failed to restore app: %@", type: .error , error.localizedDescription) DispatchQueue.main.async { let toastView = ToastView(error: error) @@ -1131,7 +1140,7 @@ private extension MyAppsViewController { } } } catch { - print("Failed to change app icon.", error) + os_log("Failed to change app icon. %@", type: .error , error.localizedDescription) DispatchQueue.main.async { let toastView = ToastView(error: error) @@ -1160,7 +1169,7 @@ private extension MyAppsViewController { @objc func didFetchSource(_: Notification) { DispatchQueue.main.async { if self.updatesDataSource.fetchedResultsController.fetchedObjects == nil { - do { try self.updatesDataSource.fetchedResultsController.performFetch() } catch { print("Error fetching:", error) } + do { try self.updatesDataSource.fetchedResultsController.performFetch() } catch { os_log("Error fetching: %@", type: .error , error.localizedDescription) } } self.update() @@ -1179,7 +1188,7 @@ private extension MyAppsViewController { do { try FileManager.default.removeItem(at: url) } catch { - print("Unable to remove imported .ipa.", error) + os_log("Unable to remove imported .ipa. %@", type: .error , error.localizedDescription) } } } @@ -1415,7 +1424,7 @@ extension MyAppsViewController { actions.append(restoreBackupAction) } } else if let error = outError { - print("Unable to check if backup exists:", error) + os_log("Unable to check if backup exists: %@", type: .error , error.localizedDescription) } } @@ -1784,7 +1793,7 @@ extension MyAppsViewController: UIDocumentPickerDelegate { switch controller.documentPickerMode { case .import, .open: sideloadApp(at: fileURL) { result in - print("Sideloaded app at \(fileURL) with result:", result) + os_log("Sideloaded app at %@ with result: %@", type: .info , fileURL.absoluteString, String(describing: result)) } case .exportToService, .moveToService: break diff --git a/SideStoreApp/Sources/SideStoreAppKit/News/NewsViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/News/NewsViewController.swift index 98bd3715..e8690f10 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/News/NewsViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/News/NewsViewController.swift @@ -13,6 +13,7 @@ import SideStoreCore import RoxasUIKit import Nuke +import os.log private final class AppBannerFooterView: UICollectionReusableView { let bannerView = AppBannerView(frame: .zero) @@ -159,7 +160,7 @@ private extension NewsViewController { cell.imageView.image = image if let error = error { - print("Error loading image:", error) + os_log("Error loading image: %@", type: .error , error.localizedDescription) } } @@ -278,7 +279,7 @@ private extension NewsViewController { let toastView = ToastView(error: error) toastView.show(in: self) - case .success: print("Installed app:", storeApp.bundleIdentifier) + case .success: os_log("Installed app: %@", type: .info, storeApp.bundleIdentifier) } UIView.performWithoutAnimation { diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/AuthenticationOperation.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/AuthenticationOperation.swift index 5e9a8df8..01373582 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/AuthenticationOperation.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/AuthenticationOperation.swift @@ -9,7 +9,7 @@ import Foundation import Network import RoxasUIKit - +import os.log import AltSign import SideStoreCore @@ -178,7 +178,11 @@ public final class AuthenticationOperation: ResultOperation<(ALTTeam, ALTCertifi override func finish(_ result: Result<(ALTTeam, ALTCertificate, ALTAppleAPISession), Error>) { guard !isFinished else { return } - print("Finished authenticating with result:", result.error?.localizedDescription ?? "success") + if let error = result.error { + os_log("Failed to finish authenticating wirth error: %@", type: .error, error.localizedDescription) + } else { + os_log("Successfully authenticating", type: .info) + } let context = DatabaseManager.shared.persistentContainer.newBackgroundContext() context.perform { diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/BackgroundRefreshAppsOperation.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/BackgroundRefreshAppsOperation.swift index d86b5a84..9b33e067 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/BackgroundRefreshAppsOperation.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/BackgroundRefreshAppsOperation.swift @@ -8,6 +8,7 @@ import CoreData import UIKit +import os.log import SideStoreCore import EmotionalDamage @@ -85,7 +86,7 @@ public final class BackgroundRefreshAppsOperation: ResultOperation<[String: Resu start_em_proxy(bind_addr: Consts.Proxy.serverURL) managedObjectContext.perform { - print("Apps to refresh:", self.installedApps.map(\.bundleIdentifier)) + os_log("Apps to refresh: %@", type: .error , self.installedApps.map(\.bundleIdentifier)) self.startListeningForRunningApps() @@ -95,7 +96,7 @@ public final class BackgroundRefreshAppsOperation: ResultOperation<[String: Resu DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { self.managedObjectContext.perform { let filteredApps = self.installedApps.filter { !self.runningApplications.contains($0.bundleIdentifier) } - print("Filtered Apps to Refresh:", filteredApps.map { $0.bundleIdentifier }) + os_log("Filtered Apps to Refresh: %@", type: .info , filteredApps.map { $0.bundleIdentifier }.joined(separator: "\n")) let group = AppManager.shared.refresh(filteredApps, presentingViewController: nil) group.beginInstallationHandler = { installedApp in @@ -179,7 +180,7 @@ private extension BackgroundRefreshAppsOperation { } catch RefreshError.noInstalledApps { shouldPresentAlert = false } catch { - print("Failed to refresh apps in background.", error) + os_log("Failed to refresh apps in background. %@", type: .error , error.localizedDescription) content.title = NSLocalizedString("Failed to Refresh Apps", comment: "") content.body = error.localizedDescription @@ -218,7 +219,7 @@ private extension BackgroundRefreshAppsOperation { context.performAndWait { _ = RefreshAttempt(identifier: self.refreshIdentifier, result: result, context: context) - do { try context.save() } catch { print("Failed to save refresh attempt.", error) } + do { try context.save() } catch { os_log("Failed to save refresh attempt. %@", type: .error , error.localizedDescription) } } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/DownloadAppOperation.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/DownloadAppOperation.swift index 64371729..f1b08750 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/DownloadAppOperation.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/DownloadAppOperation.swift @@ -13,6 +13,7 @@ import AltSign import SideKit import SideStoreCore import Shared +import os.log private extension DownloadAppOperation { struct DependencyError: ALTLocalizedError { @@ -63,7 +64,7 @@ final class DownloadAppOperation: ResultOperation { return } - print("Downloading App:", bundleIdentifier) + os_log("Downloading App: %@", type: .info , bundleIdentifier) guard let sourceURL = sourceURL else { return finish(.failure(OperationError.appNotFound)) } @@ -104,7 +105,7 @@ final class DownloadAppOperation: ResultOperation { do { try FileManager.default.removeItem(at: temporaryDirectory) } catch { - print("Failed to remove DownloadAppOperation temporary directory: \(temporaryDirectory).", error) + os_log("Failed to remove DownloadAppOperation temporary directory: %@. %@", type: .error , temporaryDirectory.absoluteString, error.localizedDescription) } super.finish(result) diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/FetchTrustedSourcesOperation.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/FetchTrustedSourcesOperation.swift index b578bbb4..d8575445 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/FetchTrustedSourcesOperation.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/FetchTrustedSourcesOperation.swift @@ -17,7 +17,7 @@ private extension URL { } public extension FetchTrustedSourcesOperation { - public struct TrustedSource: Decodable { + struct TrustedSource: Decodable { public var identifier: String public var sourceURL: URL? } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/InstallAppOperation.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/InstallAppOperation.swift index 0996f0f3..10b3662e 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/InstallAppOperation.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/InstallAppOperation.swift @@ -13,6 +13,7 @@ import SideStoreCore import RoxasUIKit import MiniMuxerSwift import minimuxer +import os.log @objc(InstallAppOperation) final class InstallAppOperation: ResultOperation { @@ -156,7 +157,7 @@ final class InstallAppOperation: ResultOperation { do { try FileManager.default.removeItem(at: fileURL) } catch { - print("Failed to remove refreshed .ipa:", error) + os_log("Failed to remove refreshed .ipa: %@", type: .error , error.localizedDescription) } } @@ -172,7 +173,7 @@ private extension InstallAppOperation { do { try FileManager.default.removeItem(at: context.temporaryDirectory) } catch { - print("Failed to remove temporary directory.", error) + os_log("Failed to remove temporary directory. %@", type: .error , error.localizedDescription) } } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/Patch App/PatchViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/Patch App/PatchViewController.swift index c7da6498..8975f628 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/Patch App/PatchViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/Patch App/PatchViewController.swift @@ -12,6 +12,7 @@ import UIKit import AltSign import SideStoreCore import RoxasUIKit +import os.log @available(iOS 14.0, *) extension PatchViewController { @@ -75,7 +76,7 @@ public final class PatchViewController: UIViewController { do { try FileManager.default.createDirectory(at: temporaryDirectory, withIntermediateDirectories: true, attributes: nil) } catch { - print("Failed to create temporary directory:", error) + os_log("Failed to create temporary directory: %@", type: .error , error.localizedDescription) } update() @@ -178,7 +179,7 @@ private extension PatchViewController { do { try FileManager.default.removeItem(at: temporaryDirectory) } catch { - print("Failed to remove temporary directory:", error) + os_log("Failed to remove temporary directory: %@", type: .error , error.localizedDescription) } if let observation = didEnterBackgroundObservation { @@ -275,7 +276,7 @@ private extension PatchViewController { self.resignedApp = ALTApplication(fileURL: resignedAppURL) } catch { - print("Error unzipping app bundle:", error) + os_log("Error unzipping app bundle: %@", type: .error , error.localizedDescription) unzippingError = error } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/RemoveAppBackupOperation.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/RemoveAppBackupOperation.swift index e03587bd..2024477f 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/RemoveAppBackupOperation.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/RemoveAppBackupOperation.swift @@ -7,6 +7,7 @@ // import Foundation +import os.log @objc(RemoveAppBackupOperation) final class RemoveAppBackupOperation: ResultOperation { @@ -53,12 +54,12 @@ final class RemoveAppBackupOperation: ResultOperation { #else - print("Failed to remove app backup directory:", error) + os_log("Failed to remove app backup directory: %@", type: .error , error.localizedDescription) self.finish(.failure(error)) #endif } catch { - print("Failed to remove app backup directory:", error) + os_log("Failed to remove app backup directory: %@", type: .error , error.localizedDescription) self.finish(.failure(error)) } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Operations/ResignAppOperation.swift b/SideStoreApp/Sources/SideStoreAppKit/Operations/ResignAppOperation.swift index 67e4cb18..efdf50f5 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Operations/ResignAppOperation.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Operations/ResignAppOperation.swift @@ -11,7 +11,7 @@ import RoxasUIKit import AltSign import SideStoreCore - +import os.log @objc(ResignAppOperation) final class ResignAppOperation: ResultOperation { @@ -47,7 +47,7 @@ final class ResignAppOperation: ResultOperation { let prepareAppBundleProgress = prepareAppBundle(for: app, profiles: profiles) { result in guard let appBundleURL = self.process(result) else { return } - print("Resigning App:", self.context.bundleIdentifier) + os_log("Resigning App: %@", type: .info , self.context.bundleIdentifier) // Resign app bundle let resignProgress = self.resignAppBundle(at: appBundleURL, team: team, certificate: certificate, profiles: Array(profiles.values)) { result in diff --git a/SideStoreApp/Sources/SideStoreAppKit/Settings/Error Log/ErrorLogViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/Settings/Error Log/ErrorLogViewController.swift index d34083b8..a4cc3f0b 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Settings/Error Log/ErrorLogViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Settings/Error Log/ErrorLogViewController.swift @@ -14,6 +14,7 @@ import RoxasUIKit import SideKit import Nuke import QuickLook +import os.log final class ErrorLogViewController: UITableViewController { private lazy var dataSource = self.makeDataSource() @@ -248,7 +249,7 @@ extension ErrorLogViewController { try context.save() completion(true) } catch { - print("[ALTLog] Failed to delete LoggedError \(loggedError.objectID):", error) + os_log("[ALTLog] Failed to delete LoggedError %@: %@", type: .error , loggedError.objectID, error.localizedDescription) completion(false) } } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Sources/SourcesViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/Sources/SourcesViewController.swift index 13e372a9..d15e1df3 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Sources/SourcesViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Sources/SourcesViewController.swift @@ -11,6 +11,7 @@ import UIKit import SideStoreCore import RoxasUIKit +import os.log struct SourceError: LocalizedError { enum Code { @@ -285,12 +286,12 @@ private extension SourcesViewController { DispatchQueue.main.async { do { let sources = try result.get() - print("Fetched trusted sources:", sources.map { $0.identifier }) + os_log("Fetched trusted sources: %@", type: .info , sources.map { $0.identifier }.joined(separator: "\n")) let sectionUpdate = RSTCellContentChange(type: .update, sectionIndex: 0) self.trustedSourcesDataSource.setItems(sources, with: [sectionUpdate]) } catch { - print("Error fetching trusted sources:", error) + os_log("Error fetching trusted sources: %@", type: .error , error.localizedDescription) let sectionUpdate = RSTCellContentChange(type: .update, sectionIndex: 0) self.trustedSourcesDataSource.setItems([], with: [sectionUpdate]) diff --git a/SideStoreApp/Sources/SideStoreCore/Model/DatabaseManager.swift b/SideStoreApp/Sources/SideStoreCore/Model/DatabaseManager.swift index 2304944a..c0fa89d7 100644 --- a/SideStoreApp/Sources/SideStoreCore/Model/DatabaseManager.swift +++ b/SideStoreApp/Sources/SideStoreCore/Model/DatabaseManager.swift @@ -10,6 +10,7 @@ import CoreData import AltSign import Roxas +import os.log private extension CFNotificationName { static let willAccessDatabase = CFNotificationName("com.rileytestut.AltStore.WillAccessDatabase" as CFString) @@ -117,7 +118,7 @@ public extension DatabaseManager { completionHandler(nil) } catch { - print("Failed to save when signing out.", error) + os_log("Failed to save when signing out. %@", type: .error , error.localizedDescription ) completionHandler(error) } } @@ -265,7 +266,7 @@ private extension DatabaseManager { try FileManager.default.copyItem(at: temporaryFileURL, to: fileURL, shouldReplace: true) } catch { - print("Failed to copy AltStore app bundle to its proper location.", error) + os_log("Failed to copy AltStore app bundle to its proper location. %@", type: .error , error.localizedDescription ) } } } @@ -349,7 +350,7 @@ private extension DatabaseManager { finish(.success(())) } catch { - print("Failed to migrate database to app group:", error) + os_log("Failed to migrate database to app group: %@", type: .error , error.localizedDescription ) finish(.failure(error)) } } diff --git a/SideStoreApp/Sources/SideStoreCore/Model/MergePolicy.swift b/SideStoreApp/Sources/SideStoreCore/Model/MergePolicy.swift index 7cdfcd60..6fb9eb6a 100644 --- a/SideStoreApp/Sources/SideStoreCore/Model/MergePolicy.swift +++ b/SideStoreApp/Sources/SideStoreCore/Model/MergePolicy.swift @@ -9,6 +9,7 @@ import CoreData import Roxas +import os.log open class MergePolicy: RSTRelationshipPreservingMergePolicy { override open func resolve(constraintConflicts conflicts: [NSConstraintConflict]) throws { @@ -40,7 +41,10 @@ open class MergePolicy: RSTRelationshipPreservingMergePolicy { if let primaryAppVersion = conflictingAppVersions.first(where: { $0.latestVersionApp?.latestVersion == $0 }), let secondaryAppVersion = conflictingAppVersions.first(where: { $0 != primaryAppVersion }) { secondaryAppVersion.managedObjectContext?.delete(secondaryAppVersion) - print("[ALTLog] Resolving AppVersion context-level conflict. Most likely due to migrating from pre-AppVersion model version.", primaryAppVersion) + os_log( + "[ALTLog] Resolving AppVersion context-level conflict. Most likely due to migrating from pre-AppVersion model version. %@", + type: .error , + primaryAppVersion ) } default: @@ -65,7 +69,11 @@ open class MergePolicy: RSTRelationshipPreservingMergePolicy { if let contextApp = conflict.conflictingObjects.first as? StoreApp { let contextVersions = Set(contextApp._versions.lazy.compactMap { $0 as? AppVersion }.map { $0.version }) for case let appVersion as AppVersion in databaseObject._versions where !contextVersions.contains(appVersion.version) { - print("[ALTLog] Deleting cached app version: \(appVersion.appBundleID + "_" + appVersion.version), not in:", contextApp.versions.map { $0.appBundleID + "_" + $0.version }) + os_log("[ALTLog] Deleting cached app version: %@_%@, not in: %@", + type: .info, + appVersion.appBundleID, + appVersion.version, + contextApp.versions.map { $0.appBundleID + "_" + $0.version }) appVersion.managedObjectContext?.delete(appVersion) } } diff --git a/SideStoreApp/Sources/SideStoreCore/Patreon/PatreonAPI.swift b/SideStoreApp/Sources/SideStoreCore/Patreon/PatreonAPI.swift index 6447bc1e..a75167e7 100644 --- a/SideStoreApp/Sources/SideStoreCore/Patreon/PatreonAPI.swift +++ b/SideStoreApp/Sources/SideStoreCore/Patreon/PatreonAPI.swift @@ -9,6 +9,7 @@ import AuthenticationServices import CoreData import Foundation +import os.log private let clientID = "ZMx0EGUWe4TVWYXNZZwK_fbIK5jHFVWoUf1Qb-sqNXmT-YzAGwDPxxq7ak3_W5Q2" private let clientSecret = "1hktsZB89QyN69cB4R0tu55R4TCPQGXxvebYUUh7Y-5TLSnRswuxs6OUjdJ74IJt" @@ -242,7 +243,7 @@ public extension PatreonAPI { try account.managedObjectContext?.save() } catch { - print("Failed to fetch Patreon account.", error) + os_log("Failed to fetch Patreon account. %@", type: .error , error.localizedDescription) } } } diff --git a/SideStoreApp/Sources/SideWidget/Countdown.swift b/SideStoreApp/Sources/SideWidget/Countdown.swift index aeebdee3..016fc0cb 100644 --- a/SideStoreApp/Sources/SideWidget/Countdown.swift +++ b/SideStoreApp/Sources/SideWidget/Countdown.swift @@ -1,6 +1,6 @@ // // Countdown.swift -// AltWidgetExtension +// SideWidgetExtension // // Created by Riley Testut on 7/6/20. // Copyright © 2020 Riley Testut. All rights reserved. diff --git a/SideStoreApp/Sources/SideWidget/Resources/Info.plist b/SideStoreApp/Sources/SideWidget/Resources/Info.plist index 88c39aef..39acef97 100644 --- a/SideStoreApp/Sources/SideWidget/Resources/Info.plist +++ b/SideStoreApp/Sources/SideWidget/Resources/Info.plist @@ -10,7 +10,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - AltWidget + SideWidget CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/SideStoreApp/Sources/SideWidget/SideWidget.swift b/SideStoreApp/Sources/SideWidget/SideWidget.swift index 649173e1..021d04ca 100644 --- a/SideStoreApp/Sources/SideWidget/SideWidget.swift +++ b/SideStoreApp/Sources/SideWidget/SideWidget.swift @@ -1,6 +1,6 @@ // -// AltWidget.swift -// AltWidget +// SideWidget.swift +// SideWidget // // Created by Riley Testut on 6/26/20. // Copyright © 2020 Riley Testut. All rights reserved. @@ -15,6 +15,7 @@ import AltSign import SideStoreCore import Roxas import RoxasUIKit +import os.log struct AppEntry: TimelineEntry { var date: Date @@ -66,7 +67,7 @@ struct Provider: IntentTimelineProvider { let entry = AppEntry(date: Date(), app: snapshot) completion(entry) } catch { - print("Error preparing widget snapshot:", error) + os_log(" %@", type: .error , error.localizedDescription) let entry = AppEntry(date: Date(), app: nil) completion(entry) @@ -131,7 +132,7 @@ struct Provider: IntentTimelineProvider { let timeline = Timeline(entries: entries, policy: .atEnd) completion(timeline) } catch { - print("Error preparing widget timeline:", error) + os_log(" %@", type: .error , error.localizedDescription) let entry = AppEntry(date: Date(), app: nil) let timeline = Timeline(entries: [entry], policy: .atEnd) @@ -164,7 +165,7 @@ struct HomeScreenWidget: Widget { WidgetView(entry: entry) } .supportedFamilies([.systemSmall]) - .configurationDisplayName("AltWidget") + .configurationDisplayName("SideWidget") .description("View remaining days until your sideloaded apps expire.") } } @@ -180,7 +181,7 @@ struct TextLockScreenWidget: Widget { ComplicationView(entry: entry, style: .text) } .supportedFamilies([.accessoryCircular]) - .configurationDisplayName("AltWidget (Text)") + .configurationDisplayName("SideWidget (Text)") .description("View remaining days until SideStore expires.") } else { return EmptyWidgetConfiguration() @@ -199,7 +200,7 @@ struct IconLockScreenWidget: Widget { ComplicationView(entry: entry, style: .icon) } .supportedFamilies([.accessoryCircular]) - .configurationDisplayName("AltWidget (Icon)") + .configurationDisplayName("SideWidget (Icon)") .description("View remaining days until SideStore expires.") } else { return EmptyWidgetConfiguration() @@ -221,7 +222,7 @@ struct IconLockScreenWidget: Widget { // ComplicationView(entry: entry, style: .icon) // } // .supportedFamilies([.accessoryCircular]) -// .configurationDisplayName("AltWidget") +// .configurationDisplayName("SideWidget") // .description("View remaining days until SideStore expires.") // } // else @@ -232,7 +233,7 @@ struct IconLockScreenWidget: Widget { // } @main -struct AltWidgets: WidgetBundle { +struct SideWidgets: WidgetBundle { var body: some Widget { HomeScreenWidget() IconLockScreenWidget()