App builds in xcodeproj (todo widget)

This commit is contained in:
Joe Mattiello
2023-03-02 00:40:11 -05:00
parent 4c9c5b1a56
commit f49fa24743
49 changed files with 498 additions and 295 deletions

View File

@@ -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: ''

View File

@@ -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

View File

@@ -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

View File

@@ -1,5 +1,8 @@
import DangerSwiftCoverage // package: https://github.com/f-meloni/danger-swift-coverage.git import DangerSwiftCoverage // package: https://github.com/f-meloni/danger-swift-coverage.git
import DangerSwiftLint // package: https://github.com/ashfurrow/danger-swiftlint.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 // swift run danger-swift [ci, pr] --dangerfile ./Dangerfile.swift
// xcodebuild test -scheme DangerSwiftCoverage-Package -derivedDataPath Build/ -enableCodeCoverage YES // xcodebuild test -scheme DangerSwiftCoverage-Package -derivedDataPath Build/ -enableCodeCoverage YES

92
Project.swift Normal file
View File

@@ -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: [
// ]
// ),
]
)

View File

@@ -29,21 +29,14 @@
B34AFC1329B032DF000F318E /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC0B29B032DF000F318E /* WidgetView.swift */; }; B34AFC1329B032DF000F318E /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC0B29B032DF000F318E /* WidgetView.swift */; };
B34AFC1429B032DF000F318E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B34AFC0D29B032DF000F318E /* Assets.xcassets */; }; B34AFC1429B032DF000F318E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B34AFC0D29B032DF000F318E /* Assets.xcassets */; };
B34AFC1629B032DF000F318E /* SideWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC1029B032DF000F318E /* SideWidget.swift */; }; B34AFC1629B032DF000F318E /* SideWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC1029B032DF000F318E /* SideWidget.swift */; };
B34AFC1829B03406000F318E /* Shared in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFC1729B03406000F318E /* Shared */; }; B3C40F5229B05B4200C93D50 /* SideWidget in Frameworks */ = {isa = PBXBuildFile; productRef = B3C40F5129B05B4200C93D50 /* SideWidget */; };
BF989177250AABF4002ACF50 /* SideWidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = BF989167250AABF3002ACF50 /* SideWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 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, ); }; }; D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8B62727841800A9B5DD /* libAppleArchive.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
/* End PBXBuildFile section */ /* 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 */ /* Begin PBXCopyFilesBuildPhase section */
BF088D2B2501A087008082D9 /* Embed Frameworks */ = { BF088D2B2501A087008082D9 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase; isa = PBXCopyFilesBuildPhase;
@@ -55,17 +48,6 @@
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; 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 */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
@@ -104,6 +86,8 @@
B34AFC0E29B032DF000F318E /* SideWidgetExtension.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = SideWidgetExtension.entitlements; sourceTree = "<group>"; }; B34AFC0E29B032DF000F318E /* SideWidgetExtension.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = SideWidgetExtension.entitlements; sourceTree = "<group>"; };
B34AFC0F29B032DF000F318E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; B34AFC0F29B032DF000F318E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B34AFC1029B032DF000F318E /* SideWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideWidget.swift; sourceTree = "<group>"; }; B34AFC1029B032DF000F318E /* SideWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideWidget.swift; sourceTree = "<group>"; };
B34AFC1929B04EBB000F318E /* Dangerfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dangerfile.swift; sourceTree = "<group>"; };
B34AFC1A29B04EBB000F318E /* Project.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Project.swift; sourceTree = "<group>"; };
B39575F4284F29E20080B4FF /* Roxas.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Roxas.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = "<group>"; }; B3C39606284F4C8400DA9E2F /* CodeSigning.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = CodeSigning.xcconfig; sourceTree = "<group>"; };
B3C39607284F4C8400DA9E2F /* Build.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = "<group>"; }; B3C39607284F4C8400DA9E2F /* Build.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Build.xcconfig; sourceTree = "<group>"; };
@@ -129,7 +113,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
B34AFC1829B03406000F318E /* Shared in Frameworks */, B3C40F5229B05B4200C93D50 /* SideWidget in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@@ -280,6 +264,8 @@
B3C39607284F4C8400DA9E2F /* Build.xcconfig */, B3C39607284F4C8400DA9E2F /* Build.xcconfig */,
B3C39606284F4C8400DA9E2F /* CodeSigning.xcconfig */, B3C39606284F4C8400DA9E2F /* CodeSigning.xcconfig */,
B3C39608284F4C8400DA9E2F /* CodeSigning.xcconfig.sample */, B3C39608284F4C8400DA9E2F /* CodeSigning.xcconfig.sample */,
B34AFC1929B04EBB000F318E /* Dangerfile.swift */,
B34AFC1A29B04EBB000F318E /* Project.swift */,
B34AFBD629B0324C000F318E /* SideStore */, B34AFBD629B0324C000F318E /* SideStore */,
B34AFC0829B032DF000F318E /* SideWidget */, B34AFC0829B032DF000F318E /* SideWidget */,
B3CD301229AF876000374AF8 /* Configurations */, B3CD301229AF876000374AF8 /* Configurations */,
@@ -328,7 +314,7 @@
); );
name = SideWidgetExtension; name = SideWidgetExtension;
packageProductDependencies = ( packageProductDependencies = (
B34AFC1729B03406000F318E /* Shared */, B3C40F5129B05B4200C93D50 /* SideWidget */,
); );
productName = AltWidgetExtension; productName = AltWidgetExtension;
productReference = BF989167250AABF3002ACF50 /* SideWidgetExtension.appex */; productReference = BF989167250AABF3002ACF50 /* SideWidgetExtension.appex */;
@@ -342,12 +328,10 @@
BFD247672284B9A500981D42 /* Frameworks */, BFD247672284B9A500981D42 /* Frameworks */,
BFD247682284B9A500981D42 /* Resources */, BFD247682284B9A500981D42 /* Resources */,
BF088D2B2501A087008082D9 /* Embed Frameworks */, BF088D2B2501A087008082D9 /* Embed Frameworks */,
BF98917B250AABF4002ACF50 /* Embed App Extensions */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
BF989176250AABF4002ACF50 /* PBXTargetDependency */,
); );
name = SideStore; name = SideStore;
packageProductDependencies = ( 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"; compatibilityVersion = "Xcode 9.3";
developmentRegion = en; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
@@ -420,9 +404,13 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
B3C40F5729B06A6400C93D50 /* Settings.bundle in Resources */,
B3C40F5529B06A3200C93D50 /* Authentication.storyboard in Resources */,
B34AFBFE29B0327E000F318E /* AppBannerView.xib in Resources */, B34AFBFE29B0327E000F318E /* AppBannerView.xib in Resources */,
B34AFC0129B0327E000F318E /* UpdateCollectionViewCell.xib in Resources */, B34AFC0129B0327E000F318E /* UpdateCollectionViewCell.xib in Resources */,
B34AFC0229B0327E000F318E /* InstalledAppsCollectionHeaderView.xib in Resources */, B34AFC0229B0327E000F318E /* InstalledAppsCollectionHeaderView.xib in Resources */,
B3C40F5429B06A2B00C93D50 /* LaunchScreen.storyboard in Resources */,
B3C40F5329B06A0000C93D50 /* PatchApp.storyboard in Resources */,
B34AFBFF29B0327E000F318E /* AboutPatreonHeaderView.xib in Resources */, B34AFBFF29B0327E000F318E /* AboutPatreonHeaderView.xib in Resources */,
B34AFC0429B03288000F318E /* Silence.m4a in Resources */, B34AFC0429B03288000F318E /* Silence.m4a in Resources */,
B34AFBFB29B03279000F318E /* Main.storyboard in Resources */, B34AFBFB29B03279000F318E /* Main.storyboard in Resources */,
@@ -462,14 +450,6 @@
}; };
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
BF989176250AABF4002ACF50 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = BF989166250AABF3002ACF50 /* SideWidgetExtension */;
targetProxy = BF989175250AABF4002ACF50 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
B34AFBE629B0324C000F318E /* LaunchScreen.storyboard */ = { B34AFBE629B0324C000F318E /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
@@ -603,6 +583,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2; IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
@@ -665,6 +646,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2; IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
OTHER_CPLUSPLUSFLAGS = ( OTHER_CPLUSPLUSFLAGS = (
@@ -685,10 +667,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = B3CD301829AF876000374AF8 /* SideStore.xcconfig */; baseConfigurationReference = B3CD301829AF876000374AF8 /* SideStore.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; 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_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
@@ -699,11 +680,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = "$(inherited)";
"$(inherited)",
"$(PROJECT_DIR)/Dependencies/fragmentzip",
"$(PROJECT_DIR)/Dependencies/libcurl",
);
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@@ -718,10 +695,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = B3CD301829AF876000374AF8 /* SideStore.xcconfig */; baseConfigurationReference = B3CD301829AF876000374AF8 /* SideStore.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; 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_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
@@ -732,11 +708,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = "$(inherited)";
"$(inherited)",
"$(PROJECT_DIR)/Dependencies/fragmentzip",
"$(PROJECT_DIR)/Dependencies/libcurl",
);
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@@ -758,7 +730,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
BFD247652284B9A500981D42 /* Build configuration list for PBXProject "SideStore-SPM" */ = { BFD247652284B9A500981D42 /* Build configuration list for PBXProject "SideStore" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
BFD2477C2284B9A700981D42 /* Debug */, BFD2477C2284B9A700981D42 /* Debug */,
@@ -783,9 +755,9 @@
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
productName = SideStoreAppKit; productName = SideStoreAppKit;
}; };
B34AFC1729B03406000F318E /* Shared */ = { B3C40F5129B05B4200C93D50 /* SideWidget */ = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
productName = Shared; productName = SideWidget;
}; };
/* End XCSwiftPackageProductDependency section */ /* End XCSwiftPackageProductDependency section */
}; };

View File

@@ -1,12 +1,21 @@
{ {
"pins" : [ "pins" : [
{
"identity" : "aexml",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tadija/AEXML",
"state" : {
"revision" : "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0",
"version" : "4.3.3"
}
},
{ {
"identity" : "altsign", "identity" : "altsign",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/SideStore/AltSign", "location" : "https://github.com/SideStore/AltSign",
"state" : { "state" : {
"revision" : "9c63397f0fc6038c04b930dd2d10b030d508d6fa", "revision" : "eb4c74dcf6be2fb00a3edc0381aae59fbbdb4cf3",
"version" : "1.0.2" "version" : "1.0.3"
} }
}, },
{ {
@@ -18,15 +27,6 @@
"version" : "4.4.3" "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", "identity" : "down",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
@@ -37,12 +37,12 @@
} }
}, },
{ {
"identity" : "files", "identity" : "ignore",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/JohnSundell/Files.git", "location" : "https://github.com/IgorMuzyka/ignore",
"state" : { "state" : {
"revision" : "a84615f4558151fab52ac38df697ce2442991f93", "revision" : "49780cf3d46053eb40f4c425a46aaaf662f0665c",
"version" : "2.3.0" "version" : "0.0.2"
} }
}, },
{ {
@@ -75,21 +75,12 @@
{ {
"identity" : "logger", "identity" : "logger",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/shibapm/Logger", "location" : "https://github.com/f-meloni/Logger",
"state" : { "state" : {
"revision" : "53c3ecca5abe8cf46697e33901ee774236d94cce", "revision" : "53c3ecca5abe8cf46697e33901ee774236d94cce",
"version" : "0.2.3" "version" : "0.2.3"
} }
}, },
{
"identity" : "marathon",
"kind" : "remoteSourceControl",
"location" : "https://github.com/JohnSundell/Marathon",
"state" : {
"revision" : "35b672e05ac411fb104e462fbfd6541f995abc17",
"version" : "3.3.0"
}
},
{ {
"identity" : "matchable", "identity" : "matchable",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
@@ -108,15 +99,6 @@
"version" : "7.6.3" "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", "identity" : "openssl",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
@@ -135,6 +117,24 @@
"revision" : "7fe63ad12b50bad5d86e6abaef5a944f931ce765" "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", "identity" : "plcrashreporter",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
@@ -144,33 +144,6 @@
"version" : "1.10.2" "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", "identity" : "roxas",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
@@ -207,15 +180,6 @@
"version" : "0.3.5" "version" : "0.3.5"
} }
}, },
{
"identity" : "shellout",
"kind" : "remoteSourceControl",
"location" : "https://github.com/JohnSundell/ShellOut",
"state" : {
"revision" : "e1577acf2b6e90086d01a6d5e2b8efdaae033568",
"version" : "2.3.0"
}
},
{ {
"identity" : "sidekit", "identity" : "sidekit",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
@@ -226,21 +190,12 @@
} }
}, },
{ {
"identity" : "sourcekitten", "identity" : "spectre",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/SourceKitten.git", "location" : "https://github.com/kylef/Spectre.git",
"state" : { "state" : {
"revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56", "revision" : "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53",
"version" : "0.34.1" "version" : "0.9.2"
}
},
{
"identity" : "swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/danger/swift.git",
"state" : {
"revision" : "33d35bf94f54155be505ffecfca745e4cc1cd0cc",
"version" : "1.6.5"
} }
}, },
{ {
@@ -298,21 +253,12 @@
} }
}, },
{ {
"identity" : "swiftsafeurl", "identity" : "swiftshell",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/baguio/SwiftSafeURL", "location" : "https://github.com/kareman/SwiftShell",
"state" : { "state" : {
"revision" : "b124e5280c3fb4588db38df1047628f52f2713ac", "revision" : "beebe43c986d89ea5359ac3adcb42dac94e5e08a",
"version" : "0.4.2" "version" : "4.1.2"
}
},
{
"identity" : "swxmlhash",
"kind" : "remoteSourceControl",
"location" : "https://github.com/drmohundro/SWXMLHash.git",
"state" : {
"revision" : "4d0f62f561458cbe1f732171e625f03195151b60",
"version" : "7.0.1"
} }
}, },
{ {
@@ -325,12 +271,12 @@
} }
}, },
{ {
"identity" : "xcodeissuereporting", "identity" : "xcodeproj",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/baguio/XcodeIssueReporting", "location" : "https://github.com/tuist/xcodeproj.git",
"state" : { "state" : {
"revision" : "76165bb2c12adee23d3d9f4ed0b475c9c438d94a", "revision" : "065f348754b6155b8037dc43876a8f2ee354b95d",
"version" : "1.4.1" "version" : "6.7.0"
} }
}, },
{ {

View File

@@ -0,0 +1 @@
#include "SideStore.xconfig"

View File

@@ -0,0 +1 @@
#include "SideStore.xconfig"

View File

@@ -29,7 +29,7 @@ let unsafe_flags_cxx: [String] = INHIBIT_UPSTREAM_WARNINGS ?
let dependencies: [Package.Dependency] = [ let dependencies: [Package.Dependency] = [
// Side Store // 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/iMobileDevice.swift", from: "1.0.5"),
.package(url: "https://github.com/SideStore/SideKit", from: "0.1.0"), .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") // let validUrl = URL(safeString: "https://example.tld")
// This won't // This won't
// let invalidUrl = URL(safeString: "https://example./tld") // 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` // Secrets manager using `.env`
.package(url: "https://github.com/vdka/SecretsManager.git", from: "1.0.0"), .package(url: "https://github.com/vdka/SecretsManager.git", from: "1.0.0"),
@@ -89,8 +89,11 @@ let dependencies: [Package.Dependency] = [
*/ */
// Old style plugins // 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 ] // + dependencies_cargo
let package = Package( let package = Package(
@@ -100,7 +103,7 @@ let package = Package(
.iOS(.v14), .iOS(.v14),
.tvOS(.v14), .tvOS(.v14),
.macCatalyst(.v14), .macCatalyst(.v14),
.macOS(.v11), .macOS(.v12),
], ],
products: [ products: [
@@ -110,12 +113,6 @@ let package = Package(
targets: ["SideStore"] targets: ["SideStore"]
), ),
// SideWidget Executable
.executable(
name: "SideWidget",
targets: ["SideWidget"]
),
// SideStoreAppKit // SideStoreAppKit
.library( .library(
name: "SideStoreAppKit", name: "SideStoreAppKit",
@@ -146,20 +143,20 @@ let package = Package(
type: .dynamic, type: .dynamic,
targets: ["SideStoreCore"]), targets: ["SideStoreCore"]),
// Shared (for widget) // WidgetKit
.library( .library(
name: "Shared", name: "SideWidget",
targets: ["Shared"]), targets: ["SideWidget"]),
.library( .library(
name: "Shared-Static", name: "SideWidget-Static",
type: .static, type: .static,
targets: ["Shared"]), targets: ["SideWidget"]),
.library( .library(
name: "Shared-Dynamic", name: "SideWidget-Dynamic",
type: .dynamic, type: .dynamic,
targets: ["Shared"]), targets: ["SideWidget"]),
// Plugins // Plugins
.plugin(name: "CargoPlugin", targets: ["CargoPlugin"]), .plugin(name: "CargoPlugin", targets: ["CargoPlugin"]),
@@ -225,17 +222,17 @@ let package = Package(
.linkedFramework("AudioToolbox", .when(platforms: [.iOS, .macCatalyst])), .linkedFramework("AudioToolbox", .when(platforms: [.iOS, .macCatalyst])),
.linkedFramework("WidgetKit", .when(platforms: [.iOS, .macCatalyst])), .linkedFramework("WidgetKit", .when(platforms: [.iOS, .macCatalyst])),
.linkedFramework("UserNotifications", .when(platforms: [.iOS, .macCatalyst])), .linkedFramework("UserNotifications", .when(platforms: [.iOS, .macCatalyst])),
.linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .macCatalyst])), .linkedFramework("MobileCoreServiceGits", .when(platforms: [.iOS, .macCatalyst])),
.linkedLibrary("AppleArchive") .linkedLibrary("AppleArchive")
], ],
plugins: [ plugins: [
.plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"),
.plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"),
// .plugin(name: "VersionatorPlugin", package: "Versionator"),
.plugin(name: "InfomaticPlugin", package: "InfomaticPlugin"), .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: "SecretsManagerPlugin", package: "SecretsManager"),
// .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"),
// .plugin(name: "VersionatorPlugin", package: "Versionator"),
] ]
), ),
@@ -251,6 +248,9 @@ let package = Package(
"Down", "Down",
"AltSign", "AltSign",
"SideKit", "SideKit",
"KeychainAccess",
.product(name: "libimobiledevice", package: "iMobileDevice.swift"),
.product(name: "CCoreCrypto", package: "AltSign"),
.product(name: "Roxas", package: "Roxas"), .product(name: "Roxas", package: "Roxas"),
.product(name: "RoxasUI", package: "Roxas"), .product(name: "RoxasUI", package: "Roxas"),
.product(name: "AppCenterAnalytics", package: "appcenter-sdk-apple"), .product(name: "AppCenterAnalytics", package: "appcenter-sdk-apple"),
@@ -282,23 +282,33 @@ let package = Package(
plugins: [ plugins: [
.plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"),
.plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"),
.plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), // .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"),
] ]
), ),
// MARK: - SideWidget // MARK: - SideWidget
.executableTarget( .target(
name: "SideWidget", name: "SideWidget",
dependencies: [ dependencies: [
"Shared", "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: [ plugins: [
.plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"),
.plugin(name: "LoggerPlugin", package: "SwiftPMPlugins") .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins")
] ]
), ),
// MARK: - EmotionalDamage // MARK: - EmotionalDamage
@@ -348,7 +358,6 @@ let package = Package(
.product(name: "libimobiledevice", package: "iMobileDevice.swift") .product(name: "libimobiledevice", package: "iMobileDevice.swift")
], ],
plugins: [ plugins: [
.plugin(name: "LoggerPlugin", package: "SwiftPMPlugins")
] ]
), ),
@@ -379,9 +388,10 @@ let package = Package(
dependencies: [ dependencies: [
"SideKit", "SideKit",
"AltSign", "AltSign",
.product(name: "CCoreCrypto", package: "AltSign"),
], ],
plugins: [ plugins: [
.plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"),
] ]
), ),
@@ -398,7 +408,10 @@ let package = Package(
.executableTarget( .executableTarget(
name: "SideBackup", name: "SideBackup",
dependencies: [] dependencies: [],
plugins: [
.plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"),
]
), ),
@@ -416,7 +429,6 @@ let package = Package(
plugins: [ plugins: [
.plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"),
.plugin(name: "LoggerPlugin", 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", capability: .buildTool()),
// .plugin(name: "CargoPlugin-Generate", capability: .command(intent: PluginCommandIntent)), // .plugin(name: "CargoPlugin-Generate", capability: .command(intent: PluginCommandIntent)),
.target(name: "PackageConfigs", dependencies: [
"IgnoreConfig",
])
// MARK: Danger.swift // 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], swiftLanguageVersions: [.v5],
@@ -452,6 +472,14 @@ func envBool(_ key: String) -> Bool {
return trueValues.contains(value.lowercased()) 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 // MARK: - SideDaemon
// .executable( // .executable(

View File

@@ -1,5 +1,6 @@
import ArgumentParser import ArgumentParser
import SwiftLintFramework import SwiftLintFramework
import os.log
extension Cargo { extension Cargo {
struct Version: ParsableCommand { struct Version: ParsableCommand {
@@ -12,8 +13,8 @@ extension Cargo {
func run() throws { func run() throws {
if verbose, let buildID = ExecutableInfo.buildID { if verbose, let buildID = ExecutableInfo.buildID {
print("Version:", Self.value) os_log("Version: %@", type: .info , Self.value)
print("Build ID:", buildID) os_log("Build ID: %@", type: .info , buildID)
} else { } else {
print(Self.value) print(Self.value)
} }

View File

@@ -1,5 +1,6 @@
import ArgumentParser import ArgumentParser
import SwiftLintFramework import SwiftLintFramework
import os.log
extension SwiftLint { extension SwiftLint {
struct Version: ParsableCommand { struct Version: ParsableCommand {
@@ -12,8 +13,8 @@ extension SwiftLint {
func run() throws { func run() throws {
if verbose, let buildID = ExecutableInfo.buildID { if verbose, let buildID = ExecutableInfo.buildID {
print("Version:", Self.value) os_log("Version: %@", type: .info , Self.value)
print("Build ID:", buildID) os_log("Build ID: %@", type: .info , buildID)
} else { } else {
print(Self.value) print(Self.value)
} }

View File

@@ -9,6 +9,7 @@
import Foundation import Foundation
import Network import Network
import SideKit import SideKit
import os.log
public protocol SideConnection: Connection { public protocol SideConnection: Connection {
func __send(_ data: Data, completionHandler: @escaping (Bool, Error?) -> Void) func __send(_ data: Data, completionHandler: @escaping (Bool, Error?) -> Void)
@@ -74,7 +75,7 @@ public extension SideConnection {
func receiveRequest(completionHandler: @escaping (Result<ServerRequest, ALTServerError>) -> Void) { func receiveRequest(completionHandler: @escaping (Result<ServerRequest, ALTServerError>) -> Void) {
let size = MemoryLayout<Int32>.size let size = MemoryLayout<Int32>.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 receiveData(expectedSize: size) { result in
do { do {
let data = try result.get() let data = try result.get()
@@ -87,7 +88,7 @@ public extension SideConnection {
let data = try result.get() let data = try result.get()
let request = try JSONDecoder().decode(ServerRequest.self, from: data) 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)) completionHandler(.success(request))
} catch { } catch {
completionHandler(.failure(ALTServerError(error))) completionHandler(.failure(ALTServerError(error)))

View File

@@ -9,6 +9,7 @@
import Foundation import Foundation
import Network import Network
import SideKit import SideKit
import os.log
public protocol RequestHandler { public protocol RequestHandler {
func handleAnisetteDataRequest(_ request: AnisetteDataRequest, for connection: Connection, completionHandler: @escaping (Result<AnisetteDataResponse, Error>) -> Void) func handleAnisetteDataRequest(_ request: AnisetteDataRequest, for connection: Connection, completionHandler: @escaping (Result<AnisetteDataResponse, Error>) -> Void)
@@ -102,18 +103,18 @@ private extension ConnectionManager {
do { do {
let response = try result.get() let response = try result.get()
connection.send(response, shouldDisconnect: true) { result in 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 { } catch {
let response = ErrorResponse(error: ALTServerError(error)) let response = ErrorResponse(error: ALTServerError(error))
connection.send(response, shouldDisconnect: true) { result in 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 connection.receiveRequest { result in
print("Received request with result:", result) os_log("Received request with result: %@", type: .info, String(describing: result))
switch result { switch result {
case let .failure(error): finish(Result<ErrorResponse, Error>.failure(error)) case let .failure(error): finish(Result<ErrorResponse, Error>.failure(error))

View File

@@ -8,6 +8,7 @@
import Foundation import Foundation
import SideKit import SideKit
import os.log
@objc private protocol XPCConnectionProxy { @objc private protocol XPCConnectionProxy {
func ping(completionHandler: @escaping () -> Void) func ping(completionHandler: @escaping () -> Void)
@@ -56,7 +57,7 @@ public class XPCConnection: NSObject, SideConnection {
private extension XPCConnection { private extension XPCConnection {
func makeProxy(errorHandler: @escaping (Error) -> Void) -> XPCConnectionProxy { func makeProxy(errorHandler: @escaping (Error) -> Void) -> XPCConnectionProxy {
let proxy = xpcConnection.remoteObjectProxyWithErrorHandler { error in 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 self.error = error
errorHandler(error) errorHandler(error)
} as! XPCConnectionProxy } as! XPCConnectionProxy

View File

@@ -7,6 +7,7 @@
// //
import UIKit import UIKit
import os.log
extension AppDelegate { extension AppDelegate {
static let startBackupNotification = Notification.Name("io.altstore.StartBackup") static let startBackupNotification = Notification.Name("io.altstore.StartBackup")
@@ -104,7 +105,7 @@ private extension AppDelegate {
DispatchQueue.main.async { DispatchQueue.main.async {
UIApplication.shared.open(responseURL, options: [:]) { success in 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)
} }
} }
} }

View File

@@ -7,6 +7,8 @@
// //
import Foundation import Foundation
import AltSign
import os.log
extension ErrorUserInfoKey { extension ErrorUserInfoKey {
static let sourceFile: String = "alt_sourceFile" static let sourceFile: String = "alt_sourceFile"
@@ -144,11 +146,11 @@ class BackupController: NSObject {
// Replace previous backup with new backup. // Replace previous backup with new backup.
_ = try FileManager.default.replaceItemAt(appBackupDirectory, withItemAt: temporaryAppBackupDirectory) _ = 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(())) completionHandler(.success(()))
} catch { } 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)) completionHandler(.failure(error))
} }
@@ -239,7 +241,7 @@ private extension BackupController {
print("Copied item from \(fileURL) to \(destinationURL)") print("Copied item from \(fileURL) to \(destinationURL)")
} catch let error where fileURL.lastPathComponent == "Inbox" && fileURL.deletingLastPathComponent().lastPathComponent == "Documents" { } catch let error where fileURL.lastPathComponent == "Inbox" && fileURL.deletingLastPathComponent().lastPathComponent == "Documents" {
// Ignore errors for /Documents/Inbox // Ignore errors for /Documents/Inbox
print("Failed to copy Inbox directory:", error) os_log("Failed to copy Inbox directory: %@", type: .error , error.localizedDescription)
} catch { } catch {
print(error) print(error)
throw error throw error

View File

@@ -27,7 +27,7 @@ struct AnisetteDataManager {
} }
func requestAnisetteData() throws -> ALTAnisetteData { 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" request.httpMethod = "POST"
let akAppleIDSession = unsafeBitCast(NSClassFromString("AKAppleIDSession")!, to: AKAppleIDSession.Type.self) let akAppleIDSession = unsafeBitCast(NSClassFromString("AKAppleIDSession")!, to: AKAppleIDSession.Type.self)

View File

@@ -71,7 +71,7 @@ struct AppManager {
if installingBundleIDs.contains(profile.bundleIdentifier) || (activeProfiles?.contains(profile.bundleIdentifier) == false && profile.isFreeProvisioningProfile) { if installingBundleIDs.contains(profile.bundleIdentifier) || (activeProfiles?.contains(profile.bundleIdentifier) == false && profile.isFreeProvisioningProfile) {
try FileManager.default.removeItem(at: fileURL) try FileManager.default.removeItem(at: fileURL)
} else { } else {
print("Ignoring:", profile.bundleIdentifier, profile.uuid) os_log("Ignoring: %@ %@", type: .info , profile.bundleIdentifier, profile.uuid)
} }
} }

View File

@@ -9,6 +9,7 @@
import Foundation import Foundation
import Shared import Shared
import SideKit import SideKit
import os.log
typealias DaemonConnectionManager = ConnectionManager<DaemonRequestHandler> typealias DaemonConnectionManager = ConnectionManager<DaemonRequestHandler>
@@ -39,7 +40,7 @@ struct DaemonRequestHandler: RequestHandler {
print("Awaiting begin installation request...") print("Awaiting begin installation request...")
connection.receiveRequest { result in 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 { do {
guard case let .beginInstallation(request) = try result.get() else { throw ALTServerError(.unknownRequest) } 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 AppManager.shared.installApp(at: fileURL, bundleIdentifier: bundleIdentifier, activeProfiles: request.activeProfiles) { result in
let result = result.map { InstallationProgressResponse(progress: 1.0) } 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) completionHandler(result)
} }
@@ -62,11 +63,11 @@ struct DaemonRequestHandler: RequestHandler {
AppManager.shared.install(request.provisioningProfiles, activeProfiles: request.activeProfiles) { result in AppManager.shared.install(request.provisioningProfiles, activeProfiles: request.activeProfiles) { result in
switch result { switch result {
case let .failure(error): 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)) completionHandler(.failure(error))
case .success: 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() let response = InstallProvisioningProfilesResponse()
completionHandler(.success(response)) completionHandler(.success(response))
@@ -79,11 +80,11 @@ struct DaemonRequestHandler: RequestHandler {
AppManager.shared.removeProvisioningProfiles(forBundleIdentifiers: request.bundleIdentifiers) { result in AppManager.shared.removeProvisioningProfiles(forBundleIdentifiers: request.bundleIdentifiers) { result in
switch result { switch result {
case let .failure(error): 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)) completionHandler(.failure(error))
case .success: case .success:
print("Removed profiles:", request.bundleIdentifiers) os_log("Removed profiles: %@", type: .info , request.bundleIdentifiers)
let response = RemoveProvisioningProfilesResponse() let response = RemoveProvisioningProfilesResponse()
completionHandler(.success(response)) completionHandler(.success(response))
@@ -95,11 +96,11 @@ struct DaemonRequestHandler: RequestHandler {
AppManager.shared.removeApp(forBundleIdentifier: request.bundleIdentifier) { result in AppManager.shared.removeApp(forBundleIdentifier: request.bundleIdentifier) { result in
switch result { switch result {
case let .failure(error): 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)) completionHandler(.failure(error))
case .success: case .success:
print("Removed app:", request.bundleIdentifier) os_log("Removed app: %@", type: .info , request.bundleIdentifier)
let response = RemoveAppResponse() let response = RemoveAppResponse()
completionHandler(.success(response)) completionHandler(.success(response))

View File

@@ -16,6 +16,7 @@ import SideStoreCore
import SideStoreAppKit import SideStoreAppKit
import EmotionalDamage import EmotionalDamage
import RoxasUIKit import RoxasUIKit
import os.log
@UIApplicationMain @UIApplicationMain
final class AppDelegate: SideStoreAppDelegate { final class AppDelegate: SideStoreAppDelegate {
@@ -49,9 +50,9 @@ final class AppDelegate: SideStoreAppDelegate {
DatabaseManager.shared.start { error in DatabaseManager.shared.start { error in
if let error = error { 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 { } 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 DatabaseManager.shared.purgeLoggedErrors(before: midnightOneMonthAgo) { result in
switch result { switch result {
case .success: break 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() 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) { func application(_ application: UIApplication, didReceiveRemoteNotification _: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
@@ -245,7 +246,7 @@ extension AppDelegate {
BackgroundTaskManager.shared.performExtendedBackgroundTask { taskResult, taskCompletionHandler in BackgroundTaskManager.shared.performExtendedBackgroundTask { taskResult, taskCompletionHandler in
if let error = taskResult.error { 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) backgroundFetchCompletionHandler(.failed)
taskCompletionHandler() taskCompletionHandler()
return return
@@ -361,7 +362,7 @@ private extension AppDelegate {
completionHandler(.success(sources)) completionHandler(.success(sources))
} catch { } catch {
print("Error fetching apps:", error) os_log("Error fetching apps: %@", type: .error, error.localizedDescription)
completionHandler(.failure(error)) completionHandler(.failure(error))
} }
} }

View File

@@ -10,6 +10,7 @@ import SideStoreCore
import EmotionalDamage import EmotionalDamage
import SideStoreAppKit import SideStoreAppKit
import UIKit import UIKit
import os.log
@available(iOS 13, *) @available(iOS 13, *)
final class SceneDelegate: UIResponder, UIWindowSceneDelegate { final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
@@ -57,7 +58,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
DatabaseManager.shared.purgeLoggedErrors(before: midnightOneMonthAgo) { result in DatabaseManager.shared.purgeLoggedErrors(before: midnightOneMonthAgo) { result in
switch result { switch result {
case .success: break 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)
} }
} }
} }

View File

@@ -10,6 +10,7 @@ import UIKit
import SideStoreCore import SideStoreCore
import RoxasUIKit import RoxasUIKit
import os.log
import Nuke import Nuke
@@ -156,7 +157,7 @@ private extension AppContentViewController {
cell.imageView.image = image cell.imageView.image = image
if let error = error { if let error = error {
print("Error loading image:", error) os_log("Error loading image: %@", type: .error, error.localizedDescription)
} }
} }

View File

@@ -9,6 +9,7 @@
import Foundation import Foundation
import SideStoreCore import SideStoreCore
import Intents import Intents
import os.log
@available(iOS 14, *) @available(iOS 14, *)
public final class IntentHandler: NSObject, RefreshAllIntentHandling { public final class IntentHandler: NSObject, RefreshAllIntentHandling {
@@ -107,7 +108,7 @@ private extension IntentHandler {
} catch RefreshError.noInstalledApps { } catch RefreshError.noInstalledApps {
self.finish(intent, response: RefreshAllIntentResponse(code: .success, userActivity: nil)) self.finish(intent, response: RefreshAllIntentResponse(code: .success, userActivity: nil))
} catch let error as NSError { } 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)) self.finish(intent, response: RefreshAllIntentResponse.failure(localizedDescription: error.localizedFailureReason ?? error.localizedDescription))
} }

View File

@@ -9,14 +9,17 @@
import Intents import Intents
import Shared import Shared
import SideStoreCore import SideStoreCore
import os.log
@available(iOS 14, *) @available(iOS 14, *)
public class ViewAppIntentHandler: NSObject, ViewAppIntentHandling { public class ViewAppIntentHandler: NSObject, ViewAppIntentHandling {
public func provideAppOptionsCollection(for _: ViewAppIntent, with completion: @escaping (INObjectCollection<App>?, Error?) -> Void) { public func provideAppOptionsCollection(for intent: ViewAppIntent, with completion: @escaping (INObjectCollection<App>?, Error?) -> Void) {
DatabaseManager.shared.start { error in DatabaseManager.shared.start { error in
if let error = error { 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 DatabaseManager.shared.persistentContainer.performBackgroundTask { context in
let apps = InstalledApp.all(in: context).map { installedApp in let apps = InstalledApp.all(in: context).map { installedApp in

View File

@@ -9,6 +9,7 @@
import UIKit import UIKit
import RoxasUIKit import RoxasUIKit
import os.log
import Nuke import Nuke
@@ -68,7 +69,7 @@ private extension BrowseCollectionViewCell {
cell.imageView.image = image cell.imageView.image = image
if let error = error { if let error = error {
print("Error loading image:", error) os_log("Error loading image: %@", type: .error , error.localizedDescription)
} }
} }

View File

@@ -10,6 +10,7 @@ import UIKit
import SideStoreCore import SideStoreCore
import RoxasUIKit import RoxasUIKit
import os.log
import Nuke import Nuke
@@ -140,7 +141,7 @@ private extension BrowseViewController {
cell.bannerView.iconImageView.image = image cell.bannerView.iconImageView.image = image
if let error = error { 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) let toastView = ToastView(error: error)
toastView.show(in: self) 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]) self.collectionView.reloadItems(at: [indexPath])

View File

@@ -7,6 +7,7 @@
// //
import Foundation import Foundation
import os.log
extension FileManager { extension FileManager {
func directorySize(at directoryURL: URL) -> Int? { func directorySize(at directoryURL: URL) -> Int? {
@@ -21,7 +22,7 @@ extension FileManager {
total += fileSize total += fileSize
} catch { } 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)
} }
} }

View File

@@ -19,6 +19,7 @@ import AltSign
import SideKit import SideKit
import SideStoreCore import SideStoreCore
import RoxasUIKit import RoxasUIKit
import os.log
public extension AppManager { public extension AppManager {
static let didFetchSourceNotification = Notification.Name("io.altstore.AppManager.didFetchSource") static let didFetchSourceNotification = Notification.Name("io.altstore.AppManager.didFetchSource")
@@ -166,7 +167,7 @@ public extension AppManager {
try context.save() try context.save()
} catch { } catch {
print("Error while fetching installed apps.", error) os_log("Error while fetching installed apps. %@", type: .error , error.localizedDescription)
} }
#endif #endif
@@ -182,15 +183,15 @@ public extension AppManager {
guard let isDirectory = resourceValues.isDirectory, let bundleID = resourceValues.name else { continue } guard let isDirectory = resourceValues.isDirectory, let bundleID = resourceValues.name else { continue }
if isDirectory && !installedAppBundleIDs.contains(bundleID) && !self.isActivelyManagingApp(withBundleID: bundleID) { 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) try FileManager.default.removeItem(at: appDirectory)
} }
} catch { } catch {
print("Failed to remove cached app directory.", error) os_log("Failed to remove cached app directory. %@", type: .error , error.localizedDescription)
} }
} }
} catch { } 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 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 // 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) let fetchAppIDsOperation = FetchAppIDsOperation(context: authenticationOperation.context)
@@ -382,7 +383,7 @@ public extension AppManager {
try result.get() try result.get()
self.updatePatronsResult = .success(()) self.updatePatronsResult = .success(())
} catch { } catch {
print("Error updating Friend Zone Patrons:", error) os_log("Error updating Friend Zone Patrons: %@", type: .error , error.localizedDescription)
self.updatePatronsResult = .failure(error) self.updatePatronsResult = .failure(error)
} }
@@ -564,7 +565,7 @@ public extension AppManager {
removeAppBackupOperation.resultHandler = { result in removeAppBackupOperation.resultHandler = { result in
switch result { switch result {
case .success: break 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, // Throw the error from removeAppOperation,
@@ -664,7 +665,7 @@ public extension AppManager {
public extension AppManager { public extension AppManager {
@discardableResult @discardableResult
public func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void) -> BackgroundRefreshAppsOperation { func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void) -> BackgroundRefreshAppsOperation {
let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps) let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps)
backgroundRefreshAppsOperation.resultHandler = completionHandler backgroundRefreshAppsOperation.resultHandler = completionHandler
backgroundRefreshAppsOperation.presentsFinishedNotification = presentsNotifications backgroundRefreshAppsOperation.presentsFinishedNotification = presentsNotifications
@@ -1185,7 +1186,7 @@ private extension AppManager {
switch result { switch result {
case let .failure(error): case let .failure(error):
// Don't report error, since it doesn't really matter. // 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 case .success: break
} }
@@ -1383,7 +1384,7 @@ private extension AppManager {
let bundleIcons = ["CFBundlePrimaryIcon": ["CFBundleIconFiles": [iconFileURL.lastPathComponent]]] let bundleIcons = ["CFBundlePrimaryIcon": ["CFBundleIconFiles": [iconFileURL.lastPathComponent]]]
infoDictionary["CFBundleIcons"] = bundleIcons infoDictionary["CFBundleIcons"] = bundleIcons
} catch { } 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() 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 { } catch {
group.set(.failure(error), forAppWithBundleIdentifier: operation.bundleIdentifier) group.set(.failure(error), forAppWithBundleIdentifier: operation.bundleIdentifier)
@@ -1527,7 +1528,11 @@ private extension AppManager {
_ = LoggedError(error: sanitizedError, app: app, operation: loggedErrorOperation, context: context) _ = LoggedError(error: sanitizedError, app: app, operation: loggedErrorOperation, context: context)
try context.save() try context.save()
} catch let saveError { } 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)
} }
} }
} }

View File

@@ -14,6 +14,7 @@ import UIKit
import AltSign import AltSign
import SideStoreCore import SideStoreCore
import RoxasUIKit import RoxasUIKit
import os.log
import Nuke import Nuke
@@ -242,7 +243,7 @@ private extension MyAppsViewController {
cell.bannerView.iconImageView.image = image cell.bannerView.iconImageView.image = image
if let error = error { 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() let (_, context) = try result.get()
try context.save() try context.save()
} catch { } 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() let interaction = INInteraction.refreshAllApps()
interaction.donate { error in interaction.donate { error in
guard let error = error else { return } 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]) self.collectionView.reloadItems(at: [indexPath])
case .success: 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. // No need to reload, since the the update cell is gone now.
} }
@@ -774,7 +775,7 @@ private extension MyAppsViewController {
completion(.success(())) completion(.success(()))
app.managedObjectContext?.perform { app.managedObjectContext?.perform {
print("Successfully installed app:", app.bundleIdentifier) os_log("Successfully installed app: %@", type: .info , app.bundleIdentifier)
} }
case .failure(OperationError.cancelled): 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 { } catch OperationError.cancelled {
// Ignore // Ignore
} catch { } catch {
print("Failed to activate app:", error) os_log("Failed to activate app: %@", type: .error , error.localizedDescription)
DispatchQueue.main.async { DispatchQueue.main.async {
installedApp.isActive = false installedApp.isActive = false
@@ -977,9 +986,9 @@ private extension MyAppsViewController {
let app = try result.get() let app = try result.get()
try? app.managedObjectContext?.save() try? app.managedObjectContext?.save()
print("Finished deactivating app:", app.bundleIdentifier) os_log("Finished deactivating app: %@", type: .info , app.bundleIdentifier)
} catch { } catch {
print("Failed to activate app:", error) os_log("Failed to activate app: %@", type: .error , error.localizedDescription)
DispatchQueue.main.async { DispatchQueue.main.async {
installedApp.isActive = true installedApp.isActive = true
@@ -1035,9 +1044,9 @@ private extension MyAppsViewController {
let app = try result.get() let app = try result.get()
try? app.managedObjectContext?.save() try? app.managedObjectContext?.save()
print("Finished backing up app:", app.bundleIdentifier) os_log("Finished backing up app: %@", type: .info , app.bundleIdentifier)
} catch { } catch {
print("Failed to back up app:", error) os_log("Failed to back up app: %@", type: .error , error.localizedDescription)
DispatchQueue.main.async { DispatchQueue.main.async {
let toastView = ToastView(error: error) let toastView = ToastView(error: error)
@@ -1066,9 +1075,9 @@ private extension MyAppsViewController {
let app = try result.get() let app = try result.get()
try? app.managedObjectContext?.save() try? app.managedObjectContext?.save()
print("Finished restoring app:", app.bundleIdentifier) os_log("Finished restoring app: %@", type: .info , app.bundleIdentifier)
} catch { } catch {
print("Failed to restore app:", error) os_log("Failed to restore app: %@", type: .error , error.localizedDescription)
DispatchQueue.main.async { DispatchQueue.main.async {
let toastView = ToastView(error: error) let toastView = ToastView(error: error)
@@ -1131,7 +1140,7 @@ private extension MyAppsViewController {
} }
} }
} catch { } catch {
print("Failed to change app icon.", error) os_log("Failed to change app icon. %@", type: .error , error.localizedDescription)
DispatchQueue.main.async { DispatchQueue.main.async {
let toastView = ToastView(error: error) let toastView = ToastView(error: error)
@@ -1160,7 +1169,7 @@ private extension MyAppsViewController {
@objc func didFetchSource(_: Notification) { @objc func didFetchSource(_: Notification) {
DispatchQueue.main.async { DispatchQueue.main.async {
if self.updatesDataSource.fetchedResultsController.fetchedObjects == nil { 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() self.update()
@@ -1179,7 +1188,7 @@ private extension MyAppsViewController {
do { do {
try FileManager.default.removeItem(at: url) try FileManager.default.removeItem(at: url)
} catch { } 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) actions.append(restoreBackupAction)
} }
} else if let error = outError { } 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 { switch controller.documentPickerMode {
case .import, .open: case .import, .open:
sideloadApp(at: fileURL) { result in 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 case .exportToService, .moveToService: break

View File

@@ -13,6 +13,7 @@ import SideStoreCore
import RoxasUIKit import RoxasUIKit
import Nuke import Nuke
import os.log
private final class AppBannerFooterView: UICollectionReusableView { private final class AppBannerFooterView: UICollectionReusableView {
let bannerView = AppBannerView(frame: .zero) let bannerView = AppBannerView(frame: .zero)
@@ -159,7 +160,7 @@ private extension NewsViewController {
cell.imageView.image = image cell.imageView.image = image
if let error = error { 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) let toastView = ToastView(error: error)
toastView.show(in: self) toastView.show(in: self)
case .success: print("Installed app:", storeApp.bundleIdentifier) case .success: os_log("Installed app: %@", type: .info, storeApp.bundleIdentifier)
} }
UIView.performWithoutAnimation { UIView.performWithoutAnimation {

View File

@@ -9,7 +9,7 @@
import Foundation import Foundation
import Network import Network
import RoxasUIKit import RoxasUIKit
import os.log
import AltSign import AltSign
import SideStoreCore import SideStoreCore
@@ -178,7 +178,11 @@ public final class AuthenticationOperation: ResultOperation<(ALTTeam, ALTCertifi
override func finish(_ result: Result<(ALTTeam, ALTCertificate, ALTAppleAPISession), Error>) { override func finish(_ result: Result<(ALTTeam, ALTCertificate, ALTAppleAPISession), Error>) {
guard !isFinished else { return } 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() let context = DatabaseManager.shared.persistentContainer.newBackgroundContext()
context.perform { context.perform {

View File

@@ -8,6 +8,7 @@
import CoreData import CoreData
import UIKit import UIKit
import os.log
import SideStoreCore import SideStoreCore
import EmotionalDamage import EmotionalDamage
@@ -85,7 +86,7 @@ public final class BackgroundRefreshAppsOperation: ResultOperation<[String: Resu
start_em_proxy(bind_addr: Consts.Proxy.serverURL) start_em_proxy(bind_addr: Consts.Proxy.serverURL)
managedObjectContext.perform { managedObjectContext.perform {
print("Apps to refresh:", self.installedApps.map(\.bundleIdentifier)) os_log("Apps to refresh: %@", type: .error , self.installedApps.map(\.bundleIdentifier))
self.startListeningForRunningApps() self.startListeningForRunningApps()
@@ -95,7 +96,7 @@ public final class BackgroundRefreshAppsOperation: ResultOperation<[String: Resu
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
self.managedObjectContext.perform { self.managedObjectContext.perform {
let filteredApps = self.installedApps.filter { !self.runningApplications.contains($0.bundleIdentifier) } 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) let group = AppManager.shared.refresh(filteredApps, presentingViewController: nil)
group.beginInstallationHandler = { installedApp in group.beginInstallationHandler = { installedApp in
@@ -179,7 +180,7 @@ private extension BackgroundRefreshAppsOperation {
} catch RefreshError.noInstalledApps { } catch RefreshError.noInstalledApps {
shouldPresentAlert = false shouldPresentAlert = false
} catch { } 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.title = NSLocalizedString("Failed to Refresh Apps", comment: "")
content.body = error.localizedDescription content.body = error.localizedDescription
@@ -218,7 +219,7 @@ private extension BackgroundRefreshAppsOperation {
context.performAndWait { context.performAndWait {
_ = RefreshAttempt(identifier: self.refreshIdentifier, result: result, context: context) _ = 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) }
} }
} }

View File

@@ -13,6 +13,7 @@ import AltSign
import SideKit import SideKit
import SideStoreCore import SideStoreCore
import Shared import Shared
import os.log
private extension DownloadAppOperation { private extension DownloadAppOperation {
struct DependencyError: ALTLocalizedError { struct DependencyError: ALTLocalizedError {
@@ -63,7 +64,7 @@ final class DownloadAppOperation: ResultOperation<ALTApplication> {
return return
} }
print("Downloading App:", bundleIdentifier) os_log("Downloading App: %@", type: .info , bundleIdentifier)
guard let sourceURL = sourceURL else { return finish(.failure(OperationError.appNotFound)) } guard let sourceURL = sourceURL else { return finish(.failure(OperationError.appNotFound)) }
@@ -104,7 +105,7 @@ final class DownloadAppOperation: ResultOperation<ALTApplication> {
do { do {
try FileManager.default.removeItem(at: temporaryDirectory) try FileManager.default.removeItem(at: temporaryDirectory)
} catch { } 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) super.finish(result)

View File

@@ -17,7 +17,7 @@ private extension URL {
} }
public extension FetchTrustedSourcesOperation { public extension FetchTrustedSourcesOperation {
public struct TrustedSource: Decodable { struct TrustedSource: Decodable {
public var identifier: String public var identifier: String
public var sourceURL: URL? public var sourceURL: URL?
} }

View File

@@ -13,6 +13,7 @@ import SideStoreCore
import RoxasUIKit import RoxasUIKit
import MiniMuxerSwift import MiniMuxerSwift
import minimuxer import minimuxer
import os.log
@objc(InstallAppOperation) @objc(InstallAppOperation)
final class InstallAppOperation: ResultOperation<InstalledApp> { final class InstallAppOperation: ResultOperation<InstalledApp> {
@@ -156,7 +157,7 @@ final class InstallAppOperation: ResultOperation<InstalledApp> {
do { do {
try FileManager.default.removeItem(at: fileURL) try FileManager.default.removeItem(at: fileURL)
} catch { } 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 { do {
try FileManager.default.removeItem(at: context.temporaryDirectory) try FileManager.default.removeItem(at: context.temporaryDirectory)
} catch { } catch {
print("Failed to remove temporary directory.", error) os_log("Failed to remove temporary directory. %@", type: .error , error.localizedDescription)
} }
} }
} }

View File

@@ -12,6 +12,7 @@ import UIKit
import AltSign import AltSign
import SideStoreCore import SideStoreCore
import RoxasUIKit import RoxasUIKit
import os.log
@available(iOS 14.0, *) @available(iOS 14.0, *)
extension PatchViewController { extension PatchViewController {
@@ -75,7 +76,7 @@ public final class PatchViewController: UIViewController {
do { do {
try FileManager.default.createDirectory(at: temporaryDirectory, withIntermediateDirectories: true, attributes: nil) try FileManager.default.createDirectory(at: temporaryDirectory, withIntermediateDirectories: true, attributes: nil)
} catch { } catch {
print("Failed to create temporary directory:", error) os_log("Failed to create temporary directory: %@", type: .error , error.localizedDescription)
} }
update() update()
@@ -178,7 +179,7 @@ private extension PatchViewController {
do { do {
try FileManager.default.removeItem(at: temporaryDirectory) try FileManager.default.removeItem(at: temporaryDirectory)
} catch { } catch {
print("Failed to remove temporary directory:", error) os_log("Failed to remove temporary directory: %@", type: .error , error.localizedDescription)
} }
if let observation = didEnterBackgroundObservation { if let observation = didEnterBackgroundObservation {
@@ -275,7 +276,7 @@ private extension PatchViewController {
self.resignedApp = ALTApplication(fileURL: resignedAppURL) self.resignedApp = ALTApplication(fileURL: resignedAppURL)
} catch { } catch {
print("Error unzipping app bundle:", error) os_log("Error unzipping app bundle: %@", type: .error , error.localizedDescription)
unzippingError = error unzippingError = error
} }
} }

View File

@@ -7,6 +7,7 @@
// //
import Foundation import Foundation
import os.log
@objc(RemoveAppBackupOperation) @objc(RemoveAppBackupOperation)
final class RemoveAppBackupOperation: ResultOperation<Void> { final class RemoveAppBackupOperation: ResultOperation<Void> {
@@ -53,12 +54,12 @@ final class RemoveAppBackupOperation: ResultOperation<Void> {
#else #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)) self.finish(.failure(error))
#endif #endif
} catch { } 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)) self.finish(.failure(error))
} }
} }

View File

@@ -11,7 +11,7 @@ import RoxasUIKit
import AltSign import AltSign
import SideStoreCore import SideStoreCore
import os.log
@objc(ResignAppOperation) @objc(ResignAppOperation)
final class ResignAppOperation: ResultOperation<ALTApplication> { final class ResignAppOperation: ResultOperation<ALTApplication> {
@@ -47,7 +47,7 @@ final class ResignAppOperation: ResultOperation<ALTApplication> {
let prepareAppBundleProgress = prepareAppBundle(for: app, profiles: profiles) { result in let prepareAppBundleProgress = prepareAppBundle(for: app, profiles: profiles) { result in
guard let appBundleURL = self.process(result) else { return } 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 // Resign app bundle
let resignProgress = self.resignAppBundle(at: appBundleURL, team: team, certificate: certificate, profiles: Array(profiles.values)) { result in let resignProgress = self.resignAppBundle(at: appBundleURL, team: team, certificate: certificate, profiles: Array(profiles.values)) { result in

View File

@@ -14,6 +14,7 @@ import RoxasUIKit
import SideKit import SideKit
import Nuke import Nuke
import QuickLook import QuickLook
import os.log
final class ErrorLogViewController: UITableViewController { final class ErrorLogViewController: UITableViewController {
private lazy var dataSource = self.makeDataSource() private lazy var dataSource = self.makeDataSource()
@@ -248,7 +249,7 @@ extension ErrorLogViewController {
try context.save() try context.save()
completion(true) completion(true)
} catch { } 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) completion(false)
} }
} }

View File

@@ -11,6 +11,7 @@ import UIKit
import SideStoreCore import SideStoreCore
import RoxasUIKit import RoxasUIKit
import os.log
struct SourceError: LocalizedError { struct SourceError: LocalizedError {
enum Code { enum Code {
@@ -285,12 +286,12 @@ private extension SourcesViewController {
DispatchQueue.main.async { DispatchQueue.main.async {
do { do {
let sources = try result.get() 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) let sectionUpdate = RSTCellContentChange(type: .update, sectionIndex: 0)
self.trustedSourcesDataSource.setItems(sources, with: [sectionUpdate]) self.trustedSourcesDataSource.setItems(sources, with: [sectionUpdate])
} catch { } catch {
print("Error fetching trusted sources:", error) os_log("Error fetching trusted sources: %@", type: .error , error.localizedDescription)
let sectionUpdate = RSTCellContentChange(type: .update, sectionIndex: 0) let sectionUpdate = RSTCellContentChange(type: .update, sectionIndex: 0)
self.trustedSourcesDataSource.setItems([], with: [sectionUpdate]) self.trustedSourcesDataSource.setItems([], with: [sectionUpdate])

View File

@@ -10,6 +10,7 @@ import CoreData
import AltSign import AltSign
import Roxas import Roxas
import os.log
private extension CFNotificationName { private extension CFNotificationName {
static let willAccessDatabase = CFNotificationName("com.rileytestut.AltStore.WillAccessDatabase" as CFString) static let willAccessDatabase = CFNotificationName("com.rileytestut.AltStore.WillAccessDatabase" as CFString)
@@ -117,7 +118,7 @@ public extension DatabaseManager {
completionHandler(nil) completionHandler(nil)
} catch { } catch {
print("Failed to save when signing out.", error) os_log("Failed to save when signing out. %@", type: .error , error.localizedDescription )
completionHandler(error) completionHandler(error)
} }
} }
@@ -265,7 +266,7 @@ private extension DatabaseManager {
try FileManager.default.copyItem(at: temporaryFileURL, to: fileURL, shouldReplace: true) try FileManager.default.copyItem(at: temporaryFileURL, to: fileURL, shouldReplace: true)
} catch { } 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(())) finish(.success(()))
} catch { } 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)) finish(.failure(error))
} }
} }

View File

@@ -9,6 +9,7 @@
import CoreData import CoreData
import Roxas import Roxas
import os.log
open class MergePolicy: RSTRelationshipPreservingMergePolicy { open class MergePolicy: RSTRelationshipPreservingMergePolicy {
override open func resolve(constraintConflicts conflicts: [NSConstraintConflict]) throws { 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 }), if let primaryAppVersion = conflictingAppVersions.first(where: { $0.latestVersionApp?.latestVersion == $0 }),
let secondaryAppVersion = conflictingAppVersions.first(where: { $0 != primaryAppVersion }) { let secondaryAppVersion = conflictingAppVersions.first(where: { $0 != primaryAppVersion }) {
secondaryAppVersion.managedObjectContext?.delete(secondaryAppVersion) 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: default:
@@ -65,7 +69,11 @@ open class MergePolicy: RSTRelationshipPreservingMergePolicy {
if let contextApp = conflict.conflictingObjects.first as? StoreApp { if let contextApp = conflict.conflictingObjects.first as? StoreApp {
let contextVersions = Set(contextApp._versions.lazy.compactMap { $0 as? AppVersion }.map { $0.version }) 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) { 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) appVersion.managedObjectContext?.delete(appVersion)
} }
} }

View File

@@ -9,6 +9,7 @@
import AuthenticationServices import AuthenticationServices
import CoreData import CoreData
import Foundation import Foundation
import os.log
private let clientID = "ZMx0EGUWe4TVWYXNZZwK_fbIK5jHFVWoUf1Qb-sqNXmT-YzAGwDPxxq7ak3_W5Q2" private let clientID = "ZMx0EGUWe4TVWYXNZZwK_fbIK5jHFVWoUf1Qb-sqNXmT-YzAGwDPxxq7ak3_W5Q2"
private let clientSecret = "1hktsZB89QyN69cB4R0tu55R4TCPQGXxvebYUUh7Y-5TLSnRswuxs6OUjdJ74IJt" private let clientSecret = "1hktsZB89QyN69cB4R0tu55R4TCPQGXxvebYUUh7Y-5TLSnRswuxs6OUjdJ74IJt"
@@ -242,7 +243,7 @@ public extension PatreonAPI {
try account.managedObjectContext?.save() try account.managedObjectContext?.save()
} catch { } catch {
print("Failed to fetch Patreon account.", error) os_log("Failed to fetch Patreon account. %@", type: .error , error.localizedDescription)
} }
} }
} }

View File

@@ -1,6 +1,6 @@
// //
// Countdown.swift // Countdown.swift
// AltWidgetExtension // SideWidgetExtension
// //
// Created by Riley Testut on 7/6/20. // Created by Riley Testut on 7/6/20.
// Copyright © 2020 Riley Testut. All rights reserved. // Copyright © 2020 Riley Testut. All rights reserved.

View File

@@ -10,7 +10,7 @@
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>AltWidget</string> <string>SideWidget</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>

View File

@@ -1,6 +1,6 @@
// //
// AltWidget.swift // SideWidget.swift
// AltWidget // SideWidget
// //
// Created by Riley Testut on 6/26/20. // Created by Riley Testut on 6/26/20.
// Copyright © 2020 Riley Testut. All rights reserved. // Copyright © 2020 Riley Testut. All rights reserved.
@@ -15,6 +15,7 @@ import AltSign
import SideStoreCore import SideStoreCore
import Roxas import Roxas
import RoxasUIKit import RoxasUIKit
import os.log
struct AppEntry: TimelineEntry { struct AppEntry: TimelineEntry {
var date: Date var date: Date
@@ -66,7 +67,7 @@ struct Provider: IntentTimelineProvider {
let entry = AppEntry(date: Date(), app: snapshot) let entry = AppEntry(date: Date(), app: snapshot)
completion(entry) completion(entry)
} catch { } catch {
print("Error preparing widget snapshot:", error) os_log(" %@", type: .error , error.localizedDescription)
let entry = AppEntry(date: Date(), app: nil) let entry = AppEntry(date: Date(), app: nil)
completion(entry) completion(entry)
@@ -131,7 +132,7 @@ struct Provider: IntentTimelineProvider {
let timeline = Timeline(entries: entries, policy: .atEnd) let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline) completion(timeline)
} catch { } catch {
print("Error preparing widget timeline:", error) os_log(" %@", type: .error , error.localizedDescription)
let entry = AppEntry(date: Date(), app: nil) let entry = AppEntry(date: Date(), app: nil)
let timeline = Timeline(entries: [entry], policy: .atEnd) let timeline = Timeline(entries: [entry], policy: .atEnd)
@@ -164,7 +165,7 @@ struct HomeScreenWidget: Widget {
WidgetView(entry: entry) WidgetView(entry: entry)
} }
.supportedFamilies([.systemSmall]) .supportedFamilies([.systemSmall])
.configurationDisplayName("AltWidget") .configurationDisplayName("SideWidget")
.description("View remaining days until your sideloaded apps expire.") .description("View remaining days until your sideloaded apps expire.")
} }
} }
@@ -180,7 +181,7 @@ struct TextLockScreenWidget: Widget {
ComplicationView(entry: entry, style: .text) ComplicationView(entry: entry, style: .text)
} }
.supportedFamilies([.accessoryCircular]) .supportedFamilies([.accessoryCircular])
.configurationDisplayName("AltWidget (Text)") .configurationDisplayName("SideWidget (Text)")
.description("View remaining days until SideStore expires.") .description("View remaining days until SideStore expires.")
} else { } else {
return EmptyWidgetConfiguration() return EmptyWidgetConfiguration()
@@ -199,7 +200,7 @@ struct IconLockScreenWidget: Widget {
ComplicationView(entry: entry, style: .icon) ComplicationView(entry: entry, style: .icon)
} }
.supportedFamilies([.accessoryCircular]) .supportedFamilies([.accessoryCircular])
.configurationDisplayName("AltWidget (Icon)") .configurationDisplayName("SideWidget (Icon)")
.description("View remaining days until SideStore expires.") .description("View remaining days until SideStore expires.")
} else { } else {
return EmptyWidgetConfiguration() return EmptyWidgetConfiguration()
@@ -221,7 +222,7 @@ struct IconLockScreenWidget: Widget {
// ComplicationView(entry: entry, style: .icon) // ComplicationView(entry: entry, style: .icon)
// } // }
// .supportedFamilies([.accessoryCircular]) // .supportedFamilies([.accessoryCircular])
// .configurationDisplayName("AltWidget") // .configurationDisplayName("SideWidget")
// .description("View remaining days until SideStore expires.") // .description("View remaining days until SideStore expires.")
// } // }
// else // else
@@ -232,7 +233,7 @@ struct IconLockScreenWidget: Widget {
// } // }
@main @main
struct AltWidgets: WidgetBundle { struct SideWidgets: WidgetBundle {
var body: some Widget { var body: some Widget {
HomeScreenWidget() HomeScreenWidget()
IconLockScreenWidget() IconLockScreenWidget()