mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-16 18:23:53 +01:00
Add Advanced Settings in-app
This commit is contained in:
@@ -83,6 +83,7 @@
|
|||||||
1FFEF104298552DB0098374C /* AppVersionHistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FFEF103298552DB0098374C /* AppVersionHistoryView.swift */; };
|
1FFEF104298552DB0098374C /* AppVersionHistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FFEF103298552DB0098374C /* AppVersionHistoryView.swift */; };
|
||||||
4879A95F2861046500FC1BBD /* AltSign in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A95E2861046500FC1BBD /* AltSign */; };
|
4879A95F2861046500FC1BBD /* AltSign in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A95E2861046500FC1BBD /* AltSign */; };
|
||||||
4879A9622861049C00FC1BBD /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A9612861049C00FC1BBD /* OpenSSL */; };
|
4879A9622861049C00FC1BBD /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = 4879A9612861049C00FC1BBD /* OpenSSL */; };
|
||||||
|
99BCB7DF29A2AC050041D1A7 /* AdvancedSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99BCB7DE29A2AC050041D1A7 /* AdvancedSettingsView.swift */; };
|
||||||
99C4EF4D2979132100CB538D /* SemanticVersion in Frameworks */ = {isa = PBXBuildFile; productRef = 99C4EF4C2979132100CB538D /* SemanticVersion */; };
|
99C4EF4D2979132100CB538D /* SemanticVersion in Frameworks */ = {isa = PBXBuildFile; productRef = 99C4EF4C2979132100CB538D /* SemanticVersion */; };
|
||||||
99D87A60299F1B1100ED09A9 /* DevModeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99D87A5F299F1B1100ED09A9 /* DevModeView.swift */; };
|
99D87A60299F1B1100ED09A9 /* DevModeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99D87A5F299F1B1100ED09A9 /* DevModeView.swift */; };
|
||||||
99D87A62299F3EC300ED09A9 /* FileExplorer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99D87A61299F3EC300ED09A9 /* FileExplorer.swift */; };
|
99D87A62299F3EC300ED09A9 /* FileExplorer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99D87A61299F3EC300ED09A9 /* FileExplorer.swift */; };
|
||||||
@@ -640,6 +641,7 @@
|
|||||||
1FB96FF2292D0539007E68D1 /* PillButtonProgressViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillButtonProgressViewStyle.swift; sourceTree = "<group>"; };
|
1FB96FF2292D0539007E68D1 /* PillButtonProgressViewStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillButtonProgressViewStyle.swift; sourceTree = "<group>"; };
|
||||||
1FFA56C1299994390011B6F5 /* OutputCapturer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutputCapturer.swift; sourceTree = "<group>"; };
|
1FFA56C1299994390011B6F5 /* OutputCapturer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutputCapturer.swift; sourceTree = "<group>"; };
|
||||||
1FFEF103298552DB0098374C /* AppVersionHistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppVersionHistoryView.swift; sourceTree = "<group>"; };
|
1FFEF103298552DB0098374C /* AppVersionHistoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppVersionHistoryView.swift; sourceTree = "<group>"; };
|
||||||
|
99BCB7DE29A2AC050041D1A7 /* AdvancedSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsView.swift; sourceTree = "<group>"; };
|
||||||
99D87A5F299F1B1100ED09A9 /* DevModeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DevModeView.swift; sourceTree = "<group>"; };
|
99D87A5F299F1B1100ED09A9 /* DevModeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DevModeView.swift; sourceTree = "<group>"; };
|
||||||
99D87A61299F3EC300ED09A9 /* FileExplorer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileExplorer.swift; sourceTree = "<group>"; };
|
99D87A61299F3EC300ED09A9 /* FileExplorer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileExplorer.swift; sourceTree = "<group>"; };
|
||||||
99DE640029A1271100B920BF /* AsyncFallibleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncFallibleButton.swift; sourceTree = "<group>"; };
|
99DE640029A1271100B920BF /* AsyncFallibleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncFallibleButton.swift; sourceTree = "<group>"; };
|
||||||
@@ -1229,6 +1231,7 @@
|
|||||||
1FA5A6C9298E8B2F007BA946 /* RefreshAttemptsView.swift */,
|
1FA5A6C9298E8B2F007BA946 /* RefreshAttemptsView.swift */,
|
||||||
99E59E1C299BFE5D00FAF33D /* AppIconsView.swift */,
|
99E59E1C299BFE5D00FAF33D /* AppIconsView.swift */,
|
||||||
99D87A5F299F1B1100ED09A9 /* DevModeView.swift */,
|
99D87A5F299F1B1100ED09A9 /* DevModeView.swift */,
|
||||||
|
99BCB7DE29A2AC050041D1A7 /* AdvancedSettingsView.swift */,
|
||||||
);
|
);
|
||||||
path = Settings;
|
path = Settings;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -2886,6 +2889,7 @@
|
|||||||
99E59E1D299BFE5D00FAF33D /* AppIconsView.swift in Sources */,
|
99E59E1D299BFE5D00FAF33D /* AppIconsView.swift in Sources */,
|
||||||
1F0DD83F29367F6C007608A4 /* ConnectAppleIDView.swift in Sources */,
|
1F0DD83F29367F6C007608A4 /* ConnectAppleIDView.swift in Sources */,
|
||||||
1F07F56F2955FB2000F7BE95 /* AppIDsView.swift in Sources */,
|
1F07F56F2955FB2000F7BE95 /* AppIDsView.swift in Sources */,
|
||||||
|
99BCB7DF29A2AC050041D1A7 /* AdvancedSettingsView.swift in Sources */,
|
||||||
BFDB6A0822AAED73007EA6D6 /* ResignAppOperation.swift in Sources */,
|
BFDB6A0822AAED73007EA6D6 /* ResignAppOperation.swift in Sources */,
|
||||||
D593F1942717749A006E82DE /* PatchAppOperation.swift in Sources */,
|
D593F1942717749A006E82DE /* PatchAppOperation.swift in Sources */,
|
||||||
BF770E5122BB1CF6002A40FE /* InstallAppOperation.swift in Sources */,
|
BF770E5122BB1CF6002A40FE /* InstallAppOperation.swift in Sources */,
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ internal enum Asset {
|
|||||||
internal static let myApps = ImageAsset(name: "MyApps")
|
internal static let myApps = ImageAsset(name: "MyApps")
|
||||||
internal static let news = ImageAsset(name: "News")
|
internal static let news = ImageAsset(name: "News")
|
||||||
internal static let settings = ImageAsset(name: "Settings")
|
internal static let settings = ImageAsset(name: "Settings")
|
||||||
|
internal static let vistaImage = ImageAsset(name: "Vista-image")
|
||||||
}
|
}
|
||||||
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
|
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,22 @@ internal enum L10n {
|
|||||||
/// Add Source
|
/// Add Source
|
||||||
internal static let title = L10n.tr("Localizable", "AddSourceView.title", fallback: "Add Source")
|
internal static let title = L10n.tr("Localizable", "AddSourceView.title", fallback: "Add Source")
|
||||||
}
|
}
|
||||||
|
internal enum AdvancedSettingsView {
|
||||||
|
/// Anisette Server
|
||||||
|
internal static let anisette = L10n.tr("Localizable", "AdvancedSettingsView.anisette", fallback: "Anisette Server")
|
||||||
|
/// Danger Zone
|
||||||
|
internal static let dangerZone = L10n.tr("Localizable", "AdvancedSettingsView.dangerZone", fallback: "Danger Zone")
|
||||||
|
/// If you disable "Use preferred servers" then SideStore will use the server you input into the "Anisette URL" box rather than one selected in "Anisette Server".
|
||||||
|
internal static let dangerZoneInfo = L10n.tr("Localizable", "AdvancedSettingsView.dangerZoneInfo", fallback: "If you disable \"Use preferred servers\" then SideStore will use the server you input into the \"Anisette URL\" box rather than one selected in \"Anisette Server\".")
|
||||||
|
/// AdvancedSettingsView
|
||||||
|
internal static let title = L10n.tr("Localizable", "AdvancedSettingsView.title", fallback: "Advanced Settings")
|
||||||
|
internal enum DangerZone {
|
||||||
|
/// Anisette URL
|
||||||
|
internal static let anisetteURL = L10n.tr("Localizable", "AdvancedSettingsView.DangerZone.anisetteURL", fallback: "Anisette URL")
|
||||||
|
/// Use preferred servers
|
||||||
|
internal static let usePreferred = L10n.tr("Localizable", "AdvancedSettingsView.DangerZone.usePreferred", fallback: "Use preferred servers")
|
||||||
|
}
|
||||||
|
}
|
||||||
internal enum AppAction {
|
internal enum AppAction {
|
||||||
/// Activate
|
/// Activate
|
||||||
internal static let activate = L10n.tr("Localizable", "AppAction.activate", fallback: "Activate")
|
internal static let activate = L10n.tr("Localizable", "AppAction.activate", fallback: "Activate")
|
||||||
|
|||||||
@@ -189,3 +189,11 @@ You should only enable Developer Mode if you meet one of the following requireme
|
|||||||
|
|
||||||
/* AsyncFallibleButton */
|
/* AsyncFallibleButton */
|
||||||
"AsyncFallibleButton.error" = "An error occurred";
|
"AsyncFallibleButton.error" = "An error occurred";
|
||||||
|
|
||||||
|
/* AdvancedSettingsView */
|
||||||
|
"AdvancedSettingsView.title" = "Advanced Settings";
|
||||||
|
"AdvancedSettingsView.anisette" = "Anisette Server";
|
||||||
|
"AdvancedSettingsView.dangerZone" = "Danger Zone";
|
||||||
|
"AdvancedSettingsView.dangerZoneInfo" = "If you disable \"Use preferred servers\" then SideStore will use the server you input into the \"Anisette URL\" box rather than one selected in \"Anisette Server\".";
|
||||||
|
"AdvancedSettingsView.DangerZone.usePreferred" = "Use preferred servers";
|
||||||
|
"AdvancedSettingsView.DangerZone.anisetteURL" = "Anisette URL";
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import AsyncImage
|
|||||||
|
|
||||||
struct AppIconView: View {
|
struct AppIconView: View {
|
||||||
@ObservedObject private var iO = Inject.observer
|
@ObservedObject private var iO = Inject.observer
|
||||||
|
|
||||||
@ObservedObject private var sideStoreIconData = AppIconsData.shared
|
@ObservedObject private var sideStoreIconData = AppIconsData.shared
|
||||||
|
|
||||||
let iconUrl: URL?
|
let iconUrl: URL?
|
||||||
|
|||||||
71
AltStore/Views/Settings/AdvancedSettingsView.swift
Normal file
71
AltStore/Views/Settings/AdvancedSettingsView.swift
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//
|
||||||
|
// AdvancedSettingsView.swift
|
||||||
|
// SideStore
|
||||||
|
//
|
||||||
|
// Created by naturecodevoid on 2/19/23.
|
||||||
|
// Copyright © 2023 SideStore. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
private struct Server: Identifiable {
|
||||||
|
var id: String { value }
|
||||||
|
var display: String
|
||||||
|
var value: String
|
||||||
|
}
|
||||||
|
|
||||||
|
struct AdvancedSettingsView: View {
|
||||||
|
@ObservedObject private var iO = Inject.observer
|
||||||
|
|
||||||
|
private let anisetteServers = [
|
||||||
|
Server(display: "SideStore", value: "http://ani.sidestore.io"),
|
||||||
|
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"),
|
||||||
|
Server(display: "jkcoxson (AltServer)", value: "http://jkcoxson.com:2095"),
|
||||||
|
Server(display: "jkcoxson (Provision)", value: "http://jkcoxson.com:2052"),
|
||||||
|
Server(display: "Sideloadly", value: "https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx"),
|
||||||
|
Server(display: "Nick", value: "http://45.33.29.114"),
|
||||||
|
Server(display: "Jawshoeadan", value: "https://anisette.jawshoeadan.me"),
|
||||||
|
Server(display: "crystall1nedev", value: "https://anisette.crystall1ne.software/"),
|
||||||
|
]
|
||||||
|
|
||||||
|
@AppStorage("textServer")
|
||||||
|
var usePreferred: Bool = true
|
||||||
|
|
||||||
|
@AppStorage("textInputAnisetteURL")
|
||||||
|
var anisetteURL: String = ""
|
||||||
|
|
||||||
|
@AppStorage("customAnisetteURL")
|
||||||
|
var selectedAnisetteServer: String = ""
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
List {
|
||||||
|
Section {
|
||||||
|
Picker(L10n.AdvancedSettingsView.anisette, selection: $selectedAnisetteServer) {
|
||||||
|
ForEach(anisetteServers) { server in
|
||||||
|
Text(server.display)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Toggle(L10n.AdvancedSettingsView.DangerZone.usePreferred, isOn: $usePreferred)
|
||||||
|
|
||||||
|
TextField(L10n.AdvancedSettingsView.DangerZone.anisetteURL, text: $anisetteURL)
|
||||||
|
} header: {
|
||||||
|
Text(L10n.AdvancedSettingsView.dangerZone)
|
||||||
|
} footer: {
|
||||||
|
Text(L10n.AdvancedSettingsView.dangerZoneInfo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.navigationTitle(L10n.AdvancedSettingsView.title)
|
||||||
|
.enableInjection()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct AdvancedSettingsView_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
AdvancedSettingsView()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -72,6 +72,7 @@ class AppIconsData: ObservableObject {
|
|||||||
|
|
||||||
struct AppIconsView: View {
|
struct AppIconsView: View {
|
||||||
@ObservedObject private var iO = Inject.observer
|
@ObservedObject private var iO = Inject.observer
|
||||||
|
|
||||||
@ObservedObject private var data = AppIconsData.shared
|
@ObservedObject private var data = AppIconsData.shared
|
||||||
|
|
||||||
private let artists = [
|
private let artists = [
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import AltStoreCore
|
|||||||
import Intents
|
import Intents
|
||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
|
@ObservedObject private var iO = Inject.observer
|
||||||
|
|
||||||
var connectedAppleID: Team? {
|
var connectedAppleID: Team? {
|
||||||
DatabaseManager.shared.activeTeam()
|
DatabaseManager.shared.activeTeam()
|
||||||
@@ -174,8 +175,10 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SwiftUI.Button(L10n.SettingsView.switchToUIKit, action: self.switchToUIKit)
|
SwiftUI.Button(L10n.SettingsView.switchToUIKit, action: self.switchToUIKit)
|
||||||
|
|
||||||
SwiftUI.Button("Advanced Settings", action: self.showAdvancedSettings)
|
NavigationLink(L10n.AdvancedSettingsView.title) {
|
||||||
|
AdvancedSettingsView()
|
||||||
|
}.foregroundColor(.accentColor)
|
||||||
|
|
||||||
SwiftUI.Button(L10n.SettingsView.resetImageCache, action: self.resetImageCache)
|
SwiftUI.Button(L10n.SettingsView.resetImageCache, action: self.resetImageCache)
|
||||||
.foregroundColor(.red)
|
.foregroundColor(.red)
|
||||||
@@ -194,8 +197,7 @@ struct SettingsView: View {
|
|||||||
if isDevModeEnabled {
|
if isDevModeEnabled {
|
||||||
NavigationLink(L10n.DevModeView.title, isActive: self.$isShowingDevModeMenu) {
|
NavigationLink(L10n.DevModeView.title, isActive: self.$isShowingDevModeMenu) {
|
||||||
DevModeMenu()
|
DevModeMenu()
|
||||||
}
|
}.foregroundColor(.red)
|
||||||
.foregroundColor(.red)
|
|
||||||
} else {
|
} else {
|
||||||
SwiftUI.Button(L10n.DevModeView.title) {
|
SwiftUI.Button(L10n.DevModeView.title) {
|
||||||
self.isShowingDevModePrompt = true
|
self.isShowingDevModePrompt = true
|
||||||
@@ -234,6 +236,7 @@ struct SettingsView: View {
|
|||||||
.sheet(item: $externalURLToShow) { url in
|
.sheet(item: $externalURLToShow) { url in
|
||||||
SafariView(url: url)
|
SafariView(url: url)
|
||||||
}
|
}
|
||||||
|
.enableInjection()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -316,16 +319,6 @@ struct SettingsView: View {
|
|||||||
exit(0)
|
exit(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func showAdvancedSettings() {
|
|
||||||
// Create the URL that deep links to our app's custom settings.
|
|
||||||
guard let url = URL(string: UIApplication.openSettingsURLString) else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ask the system to open that URL.
|
|
||||||
UIApplication.shared.open(url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SettingsView_Previews: PreviewProvider {
|
struct SettingsView_Previews: PreviewProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user