diff --git a/AmpFin.xcodeproj/project.pbxproj b/AmpFin.xcodeproj/project.pbxproj index edbf9210..33fce884 100644 --- a/AmpFin.xcodeproj/project.pbxproj +++ b/AmpFin.xcodeproj/project.pbxproj @@ -47,6 +47,14 @@ 3A3EA5A72ACC206500600BC5 /* DownloadIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3EA5A62ACC206500600BC5 /* DownloadIndicator.swift */; }; 3A3F113A2B010FB600E205DA /* HistoryTip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3F11392B010FB600E205DA /* HistoryTip.swift */; }; 3A3FEECD2AF7A3C8001F8AA0 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 3A3FEECC2AF7A3C8001F8AA0 /* Localizable.xcstrings */; }; + 3A442BE52B483C0B008FECE2 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A442BE42B483C0B008FECE2 /* WidgetKit.framework */; }; + 3A442BE72B483C0B008FECE2 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A442BE62B483C0B008FECE2 /* SwiftUI.framework */; }; + 3A442BEA2B483C0B008FECE2 /* WidgetExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A442BE92B483C0B008FECE2 /* WidgetExtension.swift */; }; + 3A442BF22B483C0D008FECE2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3A442BF12B483C0D008FECE2 /* Assets.xcassets */; }; + 3A442BF62B483C0D008FECE2 /* widget Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 3A442BE32B483C0B008FECE2 /* widget Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 3A442BFC2B483EC9008FECE2 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 3A442BFB2B483EC9008FECE2 /* Localizable.xcstrings */; }; + 3A442BFE2B484026008FECE2 /* DebugTokenWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A442BFD2B484026008FECE2 /* DebugTokenWidget.swift */; }; + 3A442C002B48410A008FECE2 /* AFBaseKit in Frameworks */ = {isa = PBXBuildFile; productRef = 3A442BFF2B48410A008FECE2 /* AFBaseKit */; }; 3A5B470F2B3B37A60075118F /* UIImage+IsLight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B470E2B3B37A60075118F /* UIImage+IsLight.swift */; }; 3A6565D72AAAADC400C1FBE9 /* NowPlayingSheet+Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6565D62AAAADC400C1FBE9 /* NowPlayingSheet+Queue.swift */; }; 3A6F50A72AACA3D600FC8A29 /* SearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6F50A62AACA3D600FC8A29 /* SearchView.swift */; }; @@ -99,6 +107,30 @@ 3AF815DD2AAA1A80004BA444 /* NowPlayingSheet+Lyrics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AF815DC2AAA1A80004BA444 /* NowPlayingSheet+Lyrics.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 3A442BF42B483C0D008FECE2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3ABAFCA22AA7D6C40011BFD6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3A442BE22B483C0B008FECE2; + remoteInfo = widgetsExtension; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 3A442BF72B483C0D008FECE2 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 3A442BF62B483C0D008FECE2 /* widget Extension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 3A07CD922B4401BD00F9AB19 /* PlaylistAddSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistAddSheet.swift; sourceTree = ""; }; 3A11013A2AC0362B004CF731 /* FavoritesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoritesView.swift; sourceTree = ""; }; @@ -140,6 +172,15 @@ 3A3EA5A62ACC206500600BC5 /* DownloadIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadIndicator.swift; sourceTree = ""; }; 3A3F11392B010FB600E205DA /* HistoryTip.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryTip.swift; sourceTree = ""; }; 3A3FEECC2AF7A3C8001F8AA0 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; + 3A442BE32B483C0B008FECE2 /* widget Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "widget Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3A442BE42B483C0B008FECE2 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + 3A442BE62B483C0B008FECE2 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + 3A442BE92B483C0B008FECE2 /* WidgetExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetExtension.swift; sourceTree = ""; }; + 3A442BF12B483C0D008FECE2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3A442BF32B483C0D008FECE2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3A442BFB2B483EC9008FECE2 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; + 3A442BFD2B484026008FECE2 /* DebugTokenWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugTokenWidget.swift; sourceTree = ""; }; + 3A442C012B4844A6008FECE2 /* Entitlements.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Entitlements.entitlements; sourceTree = ""; }; 3A5B470E2B3B37A60075118F /* UIImage+IsLight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+IsLight.swift"; sourceTree = ""; }; 3A6565D62AAAADC400C1FBE9 /* NowPlayingSheet+Queue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NowPlayingSheet+Queue.swift"; sourceTree = ""; }; 3A6F50A62AACA3D600FC8A29 /* SearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchView.swift; sourceTree = ""; }; @@ -168,7 +209,7 @@ 3AB697A12B386B20009000DD /* LibraryDataProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryDataProvider.swift; sourceTree = ""; }; 3AB697A22B386B20009000DD /* MockLibraryDataProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockLibraryDataProvider.swift; sourceTree = ""; }; 3AB697A32B386B20009000DD /* OfflineLibraryDataProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OfflineLibraryDataProvider.swift; sourceTree = ""; }; - 3ABAFCAA2AA7D6C40011BFD6 /* iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3ABAFCAA2AA7D6C40011BFD6 /* AmpFin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AmpFin.app; sourceTree = BUILT_PRODUCTS_DIR; }; 3ADE8E902AA924E8009826A3 /* AlbumView+Header.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AlbumView+Header.swift"; sourceTree = ""; }; 3ADE8E972AA92B47009826A3 /* UIColor+IsLight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+IsLight.swift"; sourceTree = ""; }; 3ADE8E9C2AA93A2F009826A3 /* Date+Get.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Get.swift"; sourceTree = ""; }; @@ -192,6 +233,16 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 3A442BE02B483C0B008FECE2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3A442BE72B483C0B008FECE2 /* SwiftUI.framework in Frameworks */, + 3A442C002B48410A008FECE2 /* AFBaseKit in Frameworks */, + 3A442BE52B483C0B008FECE2 /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 3ABAFCA72AA7D6C40011BFD6 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -316,6 +367,19 @@ path = Artist; sourceTree = ""; }; + 3A442BE82B483C0B008FECE2 /* widget Extension */ = { + isa = PBXGroup; + children = ( + 3A442BE92B483C0B008FECE2 /* WidgetExtension.swift */, + 3A442BFD2B484026008FECE2 /* DebugTokenWidget.swift */, + 3A442BF32B483C0D008FECE2 /* Info.plist */, + 3A442BF12B483C0D008FECE2 /* Assets.xcassets */, + 3A442BFB2B483EC9008FECE2 /* Localizable.xcstrings */, + 3A442C012B4844A6008FECE2 /* Entitlements.entitlements */, + ); + path = "widget Extension"; + sourceTree = ""; + }; 3A6FC1F52ACC0BE30070301B /* Intents */ = { isa = PBXGroup; children = ( @@ -411,6 +475,8 @@ 3AB897A52B029A9400AF783D /* Frameworks */ = { isa = PBXGroup; children = ( + 3A442BE42B483C0B008FECE2 /* WidgetKit.framework */, + 3A442BE62B483C0B008FECE2 /* SwiftUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -420,6 +486,7 @@ children = ( 3A8286492AEC0D3400384BC9 /* README.md */, 3AEB32192AA7EC3C00853210 /* iOS */, + 3A442BE82B483C0B008FECE2 /* widget Extension */, 3A844DF12B398C150021BC63 /* AmpFinKit */, 3ABAFCAB2AA7D6C40011BFD6 /* Products */, 3AB897A52B029A9400AF783D /* Frameworks */, @@ -429,7 +496,8 @@ 3ABAFCAB2AA7D6C40011BFD6 /* Products */ = { isa = PBXGroup; children = ( - 3ABAFCAA2AA7D6C40011BFD6 /* iOS.app */, + 3ABAFCAA2AA7D6C40011BFD6 /* AmpFin.app */, + 3A442BE32B483C0B008FECE2 /* widget Extension.appex */, ); name = Products; sourceTree = ""; @@ -545,6 +613,27 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 3A442BE22B483C0B008FECE2 /* widget Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3A442BFA2B483C0D008FECE2 /* Build configuration list for PBXNativeTarget "widget Extension" */; + buildPhases = ( + 3A442BDF2B483C0B008FECE2 /* Sources */, + 3A442BE02B483C0B008FECE2 /* Frameworks */, + 3A442BE12B483C0B008FECE2 /* Resources */, + 3A442C032B4849B2008FECE2 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "widget Extension"; + packageProductDependencies = ( + 3A442BFF2B48410A008FECE2 /* AFBaseKit */, + ); + productName = widgetsExtension; + productReference = 3A442BE32B483C0B008FECE2 /* widget Extension.appex */; + productType = "com.apple.product-type.app-extension"; + }; 3ABAFCA92AA7D6C40011BFD6 /* iOS */ = { isa = PBXNativeTarget; buildConfigurationList = 3ABAFCBB2AA7D6C50011BFD6 /* Build configuration list for PBXNativeTarget "iOS" */; @@ -552,11 +641,13 @@ 3ABAFCA62AA7D6C40011BFD6 /* Sources */, 3ABAFCA72AA7D6C40011BFD6 /* Frameworks */, 3ABAFCA82AA7D6C40011BFD6 /* Resources */, + 3A442BF72B483C0D008FECE2 /* Embed Foundation Extensions */, 3A8E330D2B1E89DF00424958 /* ShellScript */, ); buildRules = ( ); dependencies = ( + 3A442BF52B483C0D008FECE2 /* PBXTargetDependency */, ); name = iOS; packageProductDependencies = ( @@ -567,7 +658,7 @@ 3A844DF72B398C5F0021BC63 /* AFPlaybackKit */, ); productName = JellyfinMusic; - productReference = 3ABAFCAA2AA7D6C40011BFD6 /* iOS.app */; + productReference = 3ABAFCAA2AA7D6C40011BFD6 /* AmpFin.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -577,9 +668,12 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1500; + LastSwiftUpdateCheck = 1510; LastUpgradeCheck = 1510; TargetAttributes = { + 3A442BE22B483C0B008FECE2 = { + CreatedOnToolsVersion = 15.1; + }; 3ABAFCA92AA7D6C40011BFD6 = { CreatedOnToolsVersion = 15.0; }; @@ -604,11 +698,21 @@ projectRoot = ""; targets = ( 3ABAFCA92AA7D6C40011BFD6 /* iOS */, + 3A442BE22B483C0B008FECE2 /* widget Extension */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 3A442BE12B483C0B008FECE2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3A442BFC2B483EC9008FECE2 /* Localizable.xcstrings in Resources */, + 3A442BF22B483C0D008FECE2 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 3ABAFCA82AA7D6C40011BFD6 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -622,6 +726,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 3A442C032B4849B2008FECE2 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"${CONFIGURATION}\" = \"Release\" ]; then\n buildNumber=$(git rev-list --count head)\n /usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"\nfi\n"; + }; 3A8E330D2B1E89DF00424958 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -643,6 +765,15 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 3A442BDF2B483C0B008FECE2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3A442BFE2B484026008FECE2 /* DebugTokenWidget.swift in Sources */, + 3A442BEA2B483C0B008FECE2 /* WidgetExtension.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 3ABAFCA62AA7D6C40011BFD6 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -734,7 +865,72 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 3A442BF52B483C0D008FECE2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3A442BE22B483C0B008FECE2 /* widget Extension */; + targetProxy = 3A442BF42B483C0D008FECE2 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ + 3A442BF82B483C0D008FECE2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = "widget Extension/Entitlements.entitlements"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = N8AA4S3S96; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "widget Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = widgets; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.rfk.ampfin.widgets; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3A442BF92B483C0D008FECE2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CODE_SIGN_ENTITLEMENTS = "widget Extension/Entitlements.entitlements"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = N8AA4S3S96; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "widget Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = widgets; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.rfk.ampfin.widgets; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 3ABAFCB92AA7D6C50011BFD6 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -770,11 +966,12 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = DEVELOPMENT; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -789,11 +986,15 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music"; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; @@ -833,11 +1034,12 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = DEVELOPMENT; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -846,10 +1048,14 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music"; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; }; name = Release; }; @@ -861,12 +1067,10 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = iOS/Entitlements.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = DEVELOPMENT; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = N8AA4S3S96; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = iOS/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AmpFin; @@ -881,17 +1085,13 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 1.0.10; PRODUCT_BUNDLE_IDENTIFIER = io.rfk.ampfin; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = AmpFin; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; - SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; @@ -905,12 +1105,10 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = iOS/Entitlements.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = DEVELOPMENT; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = N8AA4S3S96; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = iOS/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AmpFin; @@ -925,17 +1123,13 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 14.0; - MARKETING_VERSION = 1.0.10; PRODUCT_BUNDLE_IDENTIFIER = io.rfk.ampfin; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = AmpFin; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; - SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; @@ -944,6 +1138,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 3A442BFA2B483C0D008FECE2 /* Build configuration list for PBXNativeTarget "widget Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3A442BF82B483C0D008FECE2 /* Debug */, + 3A442BF92B483C0D008FECE2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 3ABAFCA52AA7D6C40011BFD6 /* Build configuration list for PBXProject "AmpFin" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -984,6 +1187,10 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 3A442BFF2B48410A008FECE2 /* AFBaseKit */ = { + isa = XCSwiftPackageProductDependency; + productName = AFBaseKit; + }; 3A844DF32B398C5F0021BC63 /* AFBaseKit */ = { isa = XCSwiftPackageProductDependency; productName = AFBaseKit; diff --git a/AmpFin.xcodeproj/project.xcworkspace/xcuserdata/rasmus.xcuserdatad/UserInterfaceState.xcuserstate b/AmpFin.xcodeproj/project.xcworkspace/xcuserdata/rasmus.xcuserdatad/UserInterfaceState.xcuserstate index 838ecf54..09bc536e 100644 Binary files a/AmpFin.xcodeproj/project.xcworkspace/xcuserdata/rasmus.xcuserdatad/UserInterfaceState.xcuserstate and b/AmpFin.xcodeproj/project.xcworkspace/xcuserdata/rasmus.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AmpFin.xcodeproj/xcshareddata/xcschemes/Widget Extension.xcscheme b/AmpFin.xcodeproj/xcshareddata/xcschemes/Widget Extension.xcscheme new file mode 100644 index 00000000..c0eb27c4 --- /dev/null +++ b/AmpFin.xcodeproj/xcshareddata/xcschemes/Widget Extension.xcscheme @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AmpFin.xcodeproj/xcuserdata/rasmus.xcuserdatad/xcschemes/xcschememanagement.plist b/AmpFin.xcodeproj/xcuserdata/rasmus.xcuserdatad/xcschemes/xcschememanagement.plist index 31091f46..d5a7aac4 100644 --- a/AmpFin.xcodeproj/xcuserdata/rasmus.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/AmpFin.xcodeproj/xcuserdata/rasmus.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,14 +9,24 @@ orderHint 0 - iOS.xcscheme_^#shared#^_ + Widget Extension.xcscheme_^#shared#^_ orderHint 1 + iOS.xcscheme_^#shared#^_ + + orderHint + 0 + SuppressBuildableAutocreation + 3A442BE22B483C0B008FECE2 + + primary + + 3AB897902B02969100AF783D primary diff --git a/AmpFinKit/.swiftpm/xcode/xcshareddata/xcschemes/AmpFinKit-Package.xcscheme b/AmpFinKit/.swiftpm/xcode/xcshareddata/xcschemes/AmpFinKit.xcscheme similarity index 100% rename from AmpFinKit/.swiftpm/xcode/xcshareddata/xcschemes/AmpFinKit-Package.xcscheme rename to AmpFinKit/.swiftpm/xcode/xcshareddata/xcschemes/AmpFinKit.xcscheme diff --git a/AmpFinKit/Sources/AFBaseKit/HTTP/JellyfinClient.swift b/AmpFinKit/Sources/AFBaseKit/HTTP/JellyfinClient.swift index b2f1203c..114ea9af 100644 --- a/AmpFinKit/Sources/AFBaseKit/HTTP/JellyfinClient.swift +++ b/AmpFinKit/Sources/AFBaseKit/HTTP/JellyfinClient.swift @@ -28,9 +28,11 @@ public class JellyfinClient { #endif let logger = Logger(subsystem: "io.rfk.ampfin", category: "Download") - static let defaults = UserDefaults(suiteName: "group.io.rfk.shelfplayer")! + static let defaults = UserDefaults(suiteName: JellyfinClient.groupIdentifier)! init(serverUrl: URL!, token: String?, userId: String?) { + logger.info("Using group identifier \(Self.groupIdentifier)") + self.serverUrl = serverUrl self.token = token self.userId = userId @@ -87,6 +89,38 @@ extension JellyfinClient { } } +extension JellyfinClient { + public static var groupIdentifier: String { + let fallback = "group.io.rfk.ampfin" + let queryLoad: [String: AnyObject] = [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrAccount as String: "bundleSeedID" as AnyObject, + kSecAttrService as String: "AmpFin" as AnyObject, + kSecReturnAttributes as String: kCFBooleanTrue, + ] + + var result: AnyObject? + var status = withUnsafeMutablePointer(to: &result) { + SecItemCopyMatching(queryLoad as CFDictionary, UnsafeMutablePointer($0)) + } + + if status == errSecItemNotFound { + status = withUnsafeMutablePointer(to: &result) { + SecItemAdd(queryLoad as CFDictionary, UnsafeMutablePointer($0)) + } + } + + if status == noErr, + let resultDict = result as? [String: Any], let accessGroup = resultDict[kSecAttrAccessGroup as String] as? String, + let seedID = accessGroup.components(separatedBy: ".").first, + seedID != "N8AA4S3S96" { + return "\(fallback).\(seedID)" + } + + return fallback + } +} + // MARK: Singleton extension JellyfinClient { diff --git a/AmpFinKit/Sources/AFOfflineKit/PersistenceManager.swift b/AmpFinKit/Sources/AFOfflineKit/PersistenceManager.swift index 73c1b260..d68f9372 100644 --- a/AmpFinKit/Sources/AFOfflineKit/PersistenceManager.swift +++ b/AmpFinKit/Sources/AFOfflineKit/PersistenceManager.swift @@ -7,6 +7,7 @@ import Foundation import SwiftData +import AFBaseKit public struct PersistenceManager { public let modelContainer: ModelContainer = { @@ -19,7 +20,7 @@ public struct PersistenceManager { OfflinePlay.self, OfflineFavorite.self, ]) - let modelConfiguration = ModelConfiguration("AmpFin", schema: schema, isStoredInMemoryOnly: false, allowsSave: true, groupContainer: .identifier("group.io.rfk.ampfin")) + let modelConfiguration = ModelConfiguration("AmpFin", schema: schema, isStoredInMemoryOnly: false, allowsSave: true, groupContainer: .identifier(JellyfinClient.groupIdentifier)) do { return try ModelContainer(for: schema, configurations: [modelConfiguration]) diff --git a/iOS/Localizable.xcstrings b/iOS/Localizable.xcstrings index 03fe9afa..3f8fe9a3 100644 --- a/iOS/Localizable.xcstrings +++ b/iOS/Localizable.xcstrings @@ -274,6 +274,7 @@ } }, "developedBy" : { + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { diff --git a/widget Extension/Assets.xcassets/AccentColor.colorset/Contents.json b/widget Extension/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/widget Extension/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/widget Extension/Assets.xcassets/AppIcon.appiconset/Contents.json b/widget Extension/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..13613e3e --- /dev/null +++ b/widget Extension/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/widget Extension/Assets.xcassets/Contents.json b/widget Extension/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/widget Extension/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/widget Extension/Assets.xcassets/WidgetBackground.colorset/Contents.json b/widget Extension/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/widget Extension/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/widget Extension/DebugTokenWidget.swift b/widget Extension/DebugTokenWidget.swift new file mode 100644 index 00000000..2dfb6b66 --- /dev/null +++ b/widget Extension/DebugTokenWidget.swift @@ -0,0 +1,49 @@ +// +// DebugTokenTimelineProvider.swift +// widget Extension +// +// Created by Rasmus Krämer on 05.01.24. +// + +import SwiftUI +import WidgetKit +import AFBaseKit + +struct DebugTokenWidget: Widget { + var body: some WidgetConfiguration { + StaticConfiguration( + kind: "io.rfk.ampfin.debug.token", + provider: DebugTokenTimelineProvider()) { entry in + Text(entry.token) + .containerBackground(.ultraThickMaterial, for: .widget) + } + .configurationDisplayName(String(localized: "debug.title")) + .description(String(localized: "debug.description")) + } +} + +struct DebugTokenTimelineProvider: TimelineProvider { + typealias Entry = DebugTokenEntry + + func placeholder(in context: Context) -> DebugTokenEntry { + DebugTokenEntry(date: Date()) + } + + func getSnapshot(in context: Context, completion: @escaping (Entry) -> Void) { + completion(DebugTokenEntry(date: Date())) + } + func getTimeline(in context: Context, completion: @escaping (Timeline) -> Void) { + completion(Timeline(entries: [DebugTokenEntry(date: Date())], policy: .never)) + } +} + +struct DebugTokenEntry: TimelineEntry { + var date: Date + let token = JellyfinClient.shared.token ?? String(localized: "token.missing") +} + +#Preview(as: .systemSmall) { + DebugTokenWidget() +} timeline: { + DebugTokenEntry(date: Date()) +} diff --git a/widget Extension/Entitlements.entitlements b/widget Extension/Entitlements.entitlements new file mode 100644 index 00000000..2577a5b1 --- /dev/null +++ b/widget Extension/Entitlements.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.io.rfk.ampfin + + + diff --git a/widget Extension/Info.plist b/widget Extension/Info.plist new file mode 100644 index 00000000..0f118fb7 --- /dev/null +++ b/widget Extension/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/widget Extension/Localizable.xcstrings b/widget Extension/Localizable.xcstrings new file mode 100644 index 00000000..1f89a459 --- /dev/null +++ b/widget Extension/Localizable.xcstrings @@ -0,0 +1,15 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "debug.description" : { + + }, + "debug.title" : { + + }, + "token.missing" : { + + } + }, + "version" : "1.0" +} \ No newline at end of file diff --git a/widget Extension/WidgetExtension.swift b/widget Extension/WidgetExtension.swift new file mode 100644 index 00000000..2e0bd5b2 --- /dev/null +++ b/widget Extension/WidgetExtension.swift @@ -0,0 +1,16 @@ +// +// widgetsBundle.swift +// widgets +// +// Created by Rasmus Krämer on 05.01.24. +// + +import WidgetKit +import SwiftUI + +@main +struct WidgetExtension: WidgetBundle { + var body: some Widget { + DebugTokenWidget() + } +}