improve: put dev mode in better sections

This commit is contained in:
naturecodevoid
2023-06-01 07:26:30 -07:00
parent 3ee53e8c2b
commit f69ad9830a
2 changed files with 41 additions and 13 deletions

View File

@@ -197,6 +197,17 @@ You should only enable Developer Mode if you meet one of the following requireme
"DevModeView.skipResign" = "Skip Resign";
"DevModeView.footer" = "Skip Resign should only be used when you have an IPA that you have self signed. Otherwise, it will break things, and might make SideStore crash (there is absolutely no error handling and everything is expected to work).";
"DevModeView.minimuxer" = "minimuxer debug actions";
"DevModeView.General.header" = "General";
"DevModeView.General.console" = "Console";
"DevModeView.General.unstableFeaturesNightlyOnly" = "Unstable Features are only available on nightly builds, PR builds and debug builds.";
"DevModeView.General.disableDevMode" = "Disable Developer Mode";
"DevModeView.Files.header" = "Files";
"DevModeView.Files.dataExplorer" = "Data File Explorer";
"DevModeView.Files.tmpExplorer" = "Temporary File Explorer";
"DevModeView.Signing.header" = "Signing";
"DevModeView.Signing.skipResign" = "Skip Resign";
"DevModeView.Signing.footer" = "Skip Resign should only be used when you have an IPA that you have self signed. Otherwise, it will break things, and might make SideStore crash (there is absolutely no error handling and everything is expected to work).";
"DevModeView.Minimuxer.header" = "minimuxer debug actions";
"DevModeView.Minimuxer.dumpProfiles" = "Dump provisioning profiles to Documents directory";
"DevModeView.Minimuxer.afcExplorer" = "AFC File Explorer (check footer for notes)";
"DevModeView.Minimuxer.footer" = "Notes on AFC File Explorer:

View File

@@ -35,7 +35,7 @@ struct DevModePrompt: View {
Text(countdown <= 0 ? L10n.Action.enable + " " + L10n.DevModeView.title : L10n.DevModeView.read + " (\(countdown))")
.foregroundColor(.red)
}
.buttonStyle(FilledButtonStyle()) // TODO: set tintColor so text is more readable
.buttonStyle(FilledButtonStyle(tintColor: Color.gray.opacity(0.5)))
.disabled(countdown > 0)
}
@@ -128,6 +128,9 @@ struct DevModeMenu: View {
@AppStorage("isConsoleEnabled")
var isConsoleEnabled: Bool = false
@AppStorage("isDevModeEnabled")
var isDevModeEnabled: Bool = false
#if !UNSTABLE
@State var isUnstableAlertShowing = false
#endif
@@ -135,7 +138,7 @@ struct DevModeMenu: View {
var body: some View {
List {
Section {
Toggle(L10n.DevModeView.console, isOn: self.$isConsoleEnabled)
Toggle(L10n.DevModeView.General.console, isOn: self.$isConsoleEnabled)
.onChange(of: self.isConsoleEnabled) { value in
LCManager.shared.isVisible = value
}
@@ -148,25 +151,30 @@ struct DevModeMenu: View {
#if !UNSTABLE
.disabled(true)
.alert(isPresented: $isUnstableAlertShowing) {
Alert(title: Text(L10n.DevModeView.unstableFeaturesNightlyOnly))
Alert(title: Text(L10n.DevModeView.General.unstableFeaturesNightlyOnly))
}
.onTapGesture { isUnstableAlertShowing = true }
#endif
NavigationLink(L10n.DevModeView.dataExplorer) {
SwiftUI.Button(action: {
isDevModeEnabled = false
}, label: { Text(L10n.DevModeView.General.disableDevMode) }).foregroundColor(.red)
} header: {
Text(L10n.DevModeView.General.header)
}
Section {
NavigationLink(L10n.DevModeView.Files.dataExplorer) {
FileExplorer.normal(url: FileManager.default.altstoreSharedDirectory)
.navigationTitle(L10n.DevModeView.dataExplorer)
.navigationTitle(L10n.DevModeView.Files.dataExplorer)
}.foregroundColor(.red)
NavigationLink(L10n.DevModeView.tmpExplorer) {
NavigationLink(L10n.DevModeView.Files.tmpExplorer) {
FileExplorer.normal(url: FileManager.default.temporaryDirectory)
.navigationTitle(L10n.DevModeView.tmpExplorer)
.navigationTitle(L10n.DevModeView.Files.tmpExplorer)
}.foregroundColor(.red)
Toggle(L10n.DevModeView.skipResign, isOn: ResignAppOperation.skipResignBinding)
.foregroundColor(.red)
} footer: {
Text(L10n.DevModeView.footer)
} header: {
Text(L10n.DevModeView.Files.header)
}
Section {
@@ -184,10 +192,19 @@ struct DevModeMenu: View {
.navigationTitle(L10n.DevModeView.Minimuxer.afcExplorer)
}.foregroundColor(.red)
} header: {
Text(L10n.DevModeView.minimuxer)
Text(L10n.DevModeView.Minimuxer.header)
} footer: {
Text(L10n.DevModeView.Minimuxer.footer)
}
Section {
Toggle(L10n.DevModeView.Signing.skipResign, isOn: ResignAppOperation.skipResignBinding)
.foregroundColor(.red)
} header: {
Text(L10n.DevModeView.Signing.header)
} footer: {
Text(L10n.DevModeView.Signing.footer)
}
}
.navigationTitle(L10n.DevModeView.title)
.enableInjection()