From 5a94ea73d9604eea17717c275c7075d7dc798e4b Mon Sep 17 00:00:00 2001 From: leminlimez Date: Tue, 15 Jul 2025 11:30:47 -0400 Subject: [PATCH] DEBUG: explore link changing --- .../Controllers/DownloadManager.swift | 1 + .../Views/NavigatorViews/ExploreView.swift | 11 ++++++++++- Pocket Poster/Views/SettingsView.swift | 18 ++++++++++++++++++ ipabuild.sh | 10 ++++++++-- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Pocket Poster/Controllers/DownloadManager.swift b/Pocket Poster/Controllers/DownloadManager.swift index 1071b48..15a862f 100644 --- a/Pocket Poster/Controllers/DownloadManager.swift +++ b/Pocket Poster/Controllers/DownloadManager.swift @@ -10,6 +10,7 @@ import UIKit class DownloadManager: ObservableObject { static let shared = DownloadManager() + static let exploreLink = "https://cowabun.ga/wallpapers?pocketposter=true" @Published var downloadURL: String? = nil diff --git a/Pocket Poster/Views/NavigatorViews/ExploreView.swift b/Pocket Poster/Views/NavigatorViews/ExploreView.swift index b891fc9..f2bc682 100644 --- a/Pocket Poster/Views/NavigatorViews/ExploreView.swift +++ b/Pocket Poster/Views/NavigatorViews/ExploreView.swift @@ -11,8 +11,17 @@ struct ExploreView: View { @State private var isLoading = true @State private var error: Error? = nil +#if DEBUG + @AppStorage("exploreLink") var exploreLink: String = DownloadManager.exploreLink +#endif + var body: some View { ZStack { +#if DEBUG + let websiteURL = URL(string: exploreLink) +#else + let websiteURL = URL(string: DownloadManager.exploreLink) +#endif if let error = error { VStack { Text(error.localizedDescription) @@ -24,7 +33,7 @@ struct ExploreView: View { Text("Retry") } } - } else if let url = URL(string: "https://cowabun.ga/wallpapers?pocketposter=true") { + } else if let url = websiteURL { WallpaperWebView(url, isLoading: $isLoading, error: $error) if isLoading { ProgressView() diff --git a/Pocket Poster/Views/SettingsView.swift b/Pocket Poster/Views/SettingsView.swift index d87ee9d..9e1abc0 100644 --- a/Pocket Poster/Views/SettingsView.swift +++ b/Pocket Poster/Views/SettingsView.swift @@ -13,6 +13,11 @@ struct SettingsView: View { @AppStorage("cpHash") var cpHash: String = "" // CarPlay hash @AppStorage("ignoreDurationLimit") var ignoreDurationLimit: Bool = false + // DEBUG +#if DEBUG + @AppStorage("exploreLink") var exploreLink: String = DownloadManager.exploreLink +#endif + @State var checkingForHash: Bool = false @State var hashCheckTask: Task? = nil @@ -53,6 +58,19 @@ struct SettingsView: View { Label("App Hash", systemImage: "lock.app.dashed") } +#if DEBUG + Section { + VStack { + Text(String("Explore Page URL")) + TextField(String("Enter Explore Page URL"), text: $exploreLink) + .textFieldStyle(RoundedBorderTextFieldStyle()) + .font(.system(.body, design: .monospaced)) + } + } header: { + Label(String("Debug"), systemImage: "ant") + } +#endif + Section { Toggle(isOn: $ignoreDurationLimit, label: { Label("Disable Video Duration Limit", systemImage: "ruler") diff --git a/ipabuild.sh b/ipabuild.sh index ca50099..39671f8 100755 --- a/ipabuild.sh +++ b/ipabuild.sh @@ -1,5 +1,11 @@ #!/bin/bash +CONFIG="Release" + +if [ "$1" == "-d" ]; then + CONFIG="Debug" +fi + set -e cd "$(dirname "$0")" @@ -15,13 +21,13 @@ cd build xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \ -scheme "$APPLICATION_NAME" \ - -configuration Release \ + -configuration "$CONFIG" \ -derivedDataPath "$WORKING_LOCATION/build/DerivedDataApp" \ -destination 'generic/platform=iOS' \ clean build \ CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO" -DD_APP_PATH="$WORKING_LOCATION/build/DerivedDataApp/Build/Products/Release-iphoneos/$APPLICATION_NAME.app" +DD_APP_PATH="$WORKING_LOCATION/build/DerivedDataApp/Build/Products/$CONFIG-iphoneos/$APPLICATION_NAME.app" TARGET_APP="$WORKING_LOCATION/build/$APPLICATION_NAME.app" cp -r "$DD_APP_PATH" "$TARGET_APP"