fix(SwiftUI onboarding): make pairing file text wrap, only show full onboarding if SwiftUI unstable feature is enabled

also update anisette servers
This commit is contained in:
naturecodevoid
2023-06-03 12:40:47 -07:00
parent 7e9aafe86e
commit e7f766095a
7 changed files with 34 additions and 7 deletions

View File

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

View File

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

View File

@@ -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")
}

View File

@@ -10,7 +10,6 @@ import SwiftUI
struct OnboardingStepView<Title: View, Hero: View, Content: View, Action: View>: View {
@ViewBuilder
var title: Title

View File

@@ -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 `<UUID>.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
}

View File

@@ -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"),

View File

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