diff --git a/AltStore/LaunchViewController.swift b/AltStore/LaunchViewController.swift index f3734c63..ac09b0f1 100644 --- a/AltStore/LaunchViewController.swift +++ b/AltStore/LaunchViewController.swift @@ -62,7 +62,7 @@ final class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDeleg #endif #if !targetEnvironment(simulator) - if !UserDefaults.standard.onboardingComplete { + if UnstableFeatures.enabled(.swiftUI) && !UserDefaults.standard.onboardingComplete { self.showOnboarding() return } diff --git a/AltStore/Resources/en.lproj/Localizable.strings b/AltStore/Resources/en.lproj/Localizable.strings index 63de2028..271d99fc 100644 --- a/AltStore/Resources/en.lproj/Localizable.strings +++ b/AltStore/Resources/en.lproj/Localizable.strings @@ -215,7 +215,7 @@ You should only enable Developer Mode if you meet one of the following requireme - Very buggy - There are multiple unimplemented actions"; "DevModeView.Mdc.header" = "MDC"; -"DevModeView.Mdc.fakeUndo3AppLimitPatch" = "Tell SideStore installd has not been patched"; +"DevModeView.Mdc.fakeUndo3AppLimitPatch" = "Tell SideStore installd has not been patched (may cause undefined behavior or boot loop if run on a real device!!)"; /* AsyncFallibleButton */ "AsyncFallibleButton.error" = "An error occurred"; diff --git a/AltStore/SwiftUI/Generated/Localizations.swift b/AltStore/SwiftUI/Generated/Localizations.swift index 96f949e3..208f1133 100644 --- a/AltStore/SwiftUI/Generated/Localizations.swift +++ b/AltStore/SwiftUI/Generated/Localizations.swift @@ -296,8 +296,8 @@ internal enum L10n { internal static let unstableFeaturesNightlyOnly = L10n.tr("Localizable", "DevModeView.General.unstableFeaturesNightlyOnly", fallback: "Unstable Features are only available on nightly builds, PR builds and debug builds.") } internal enum Mdc { - /// Tell SideStore installd has not been patched - internal static let fakeUndo3AppLimitPatch = L10n.tr("Localizable", "DevModeView.Mdc.fakeUndo3AppLimitPatch", fallback: "Tell SideStore installd has not been patched") + /// Tell SideStore installd has not been patched (may cause undefined behavior or boot loop if run on a real device!!) + internal static let fakeUndo3AppLimitPatch = L10n.tr("Localizable", "DevModeView.Mdc.fakeUndo3AppLimitPatch", fallback: "Tell SideStore installd has not been patched (may cause undefined behavior or boot loop if run on a real device!!)") /// MDC internal static let header = L10n.tr("Localizable", "DevModeView.Mdc.header", fallback: "MDC") } diff --git a/AltStore/SwiftUI/Views/Onboarding/OnboardingStepView.swift b/AltStore/SwiftUI/Views/Onboarding/OnboardingStepView.swift index 095fa46c..6a8c6c42 100644 --- a/AltStore/SwiftUI/Views/Onboarding/OnboardingStepView.swift +++ b/AltStore/SwiftUI/Views/Onboarding/OnboardingStepView.swift @@ -10,7 +10,6 @@ import SwiftUI struct OnboardingStepView: View { - @ViewBuilder var title: Title diff --git a/AltStore/SwiftUI/Views/Onboarding/OnboardingView.swift b/AltStore/SwiftUI/Views/Onboarding/OnboardingView.swift index 9aae7a94..810c6064 100644 --- a/AltStore/SwiftUI/Views/Onboarding/OnboardingView.swift +++ b/AltStore/SwiftUI/Views/Onboarding/OnboardingView.swift @@ -108,7 +108,7 @@ struct OnboardingView: View { Text("SideStore supports on-device sideloading even on non-jailbroken devices.") Text("For it to work, you have to generate a pairing file as described [here in our documentation](https://wiki.sidestore.io/guides/install#pairing-process).") Text("Once you have the `.mobiledevicepairing`, import it using the button below.") - } + }.lineLimit(nil) }, action: { ModalNavigationLink("Select Pairing File") { DocumentPicker(selectedUrl: self.$pairingFileURL, @@ -117,6 +117,7 @@ struct OnboardingView: View { .buttonStyle(FilledButtonStyle()) .onChange(of: self.pairingFileURL) { newValue in guard let url = newValue else { + // TODO: show error that nothing was selected return } diff --git a/AltStore/SwiftUI/Views/Settings/AdvancedSettingsView.swift b/AltStore/SwiftUI/Views/Settings/AdvancedSettingsView.swift index 40709951..4beca5df 100644 --- a/AltStore/SwiftUI/Views/Settings/AdvancedSettingsView.swift +++ b/AltStore/SwiftUI/Views/Settings/AdvancedSettingsView.swift @@ -19,7 +19,7 @@ struct AdvancedSettingsView: View { @ObservedObject private var iO = Inject.observer private let anisetteServers = [ - Server(display: "SideStore", value: "https://ani.sidestore.io"), + Server(display: "SideStore", value: "http://ani.sidestore.io:6969"), Server(display: "Macley (US)", value: "http://us1.sternserv.tech"), Server(display: "Macley (DE)", value: "http://de1.sternserv.tech"), Server(display: "DrPudding", value: "https://sign.rheaa.xyz"), diff --git a/AltStore/SwiftUI/Views/Settings/DevModeView.swift b/AltStore/SwiftUI/Views/Settings/DevModeView.swift index 4f6c850a..a47b4f03 100644 --- a/AltStore/SwiftUI/Views/Settings/DevModeView.swift +++ b/AltStore/SwiftUI/Views/Settings/DevModeView.swift @@ -9,6 +9,7 @@ import SwiftUI import LocalConsole import minimuxer +import AltStoreCore // Yes, we know the password is right here. It's not supposed to be a secret, just something to hopefully prevent people breaking SideStore with dev mode and then complaining to us. let DEV_MODE_PASSWORD = "devmode" @@ -131,6 +132,8 @@ struct DevModeMenu: View { @AppStorage("isDevModeEnabled") var isDevModeEnabled: Bool = false + @State var selectedOnboardingStep: String = "None" + #if !UNSTABLE @State var isUnstableAlertShowing = false #endif @@ -206,6 +209,30 @@ struct DevModeMenu: View { Text(L10n.DevModeView.Signing.footer) } + Section { + Picker("Show onboarding step", selection: $selectedOnboardingStep) { + Text("None").tag("None") + ForEach(OnboardingStep.allCases, id: \.self) { server in + Text(String(describing: server)).tag(String(describing: server)) + } + }.onChange(of: selectedOnboardingStep) { selectedOnboardingStep in + guard let selectedOnboardingStep = OnboardingStep.allCases.first(where: { String(describing: $0) == selectedOnboardingStep }) else { return } + let onboardingView = OnboardingView(onDismiss: { UIApplication.topController?.dismiss(animated: true) }, enabledSteps: [selectedOnboardingStep]) + .environment(\.managedObjectContext, DatabaseManager.shared.viewContext) + let navigationController = UINavigationController(rootViewController: UIHostingController(rootView: onboardingView)) + navigationController.isNavigationBarHidden = true + navigationController.isModalInPresentation = true + UIApplication.topController?.present(navigationController, animated: true) + } + + SwiftUI.Button(action: { + UserDefaults.shared.onboardingComplete = false + UIApplication.alert(title: L10n.Action.success) + }, label: { Text("Tell SideStore onboarding has not been completed") }) + } header: { + Text("Onboarding") + } + #if MDC Section { SwiftUI.Button(action: {