Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion StikJIT/StikJITApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import Network
import UniformTypeIdentifiers
import NetworkExtension

// Register default settings before the app starts
private func registerAdvancedOptionsDefault() {
let os = ProcessInfo.processInfo.operatingSystemVersion
// Enable advanced options by default on iOS 19/26 and above
let enabled = os.majorVersion >= 19
UserDefaults.standard.register(defaults: ["enableAdvancedOptions": enabled])
}

// MARK: - Welcome Sheet

struct WelcomeSheetView: View {
Expand Down Expand Up @@ -461,8 +469,9 @@ struct HeartbeatApp: App {
"DDI/Image.dmg",
"DDI/Image.dmg.trustcache"
]

init() {
registerAdvancedOptionsDefault()
newVerCheck()
let fixMethod = class_getInstanceMethod(UIDocumentPickerViewController.self, #selector(UIDocumentPickerViewController.fix_init(forOpeningContentTypes:asCopy:)))!
let origMethod = class_getInstanceMethod(UIDocumentPickerViewController.self, #selector(UIDocumentPickerViewController.init(forOpeningContentTypes:asCopy:)))!
Expand Down
3 changes: 2 additions & 1 deletion StikJIT/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct HomeView: View {
@State private var viewDidAppeared = false
@State private var pendingBundleIdToEnableJIT : String? = nil
@State private var pendingPIDToEnableJIT : Int? = nil
@AppStorage("enableAdvancedOptions") private var enableAdvancedOptions = false

@AppStorage("useDefaultScript") private var useDefaultScript = false
@State var scriptViewShow = false
Expand Down Expand Up @@ -107,7 +108,7 @@ struct HomeView: View {
}
.padding(.horizontal, 20)

if pairingFileExists {
if pairingFileExists && enableAdvancedOptions {
Button(action: {
pidTextAlertShow = true
}) {
Expand Down
11 changes: 7 additions & 4 deletions StikJIT/Views/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SwiftUI

struct MainTabView: View {
@AppStorage("customAccentColor") private var customAccentColorHex: String = ""
@AppStorage("enableAdvancedOptions") private var enableAdvancedOptions = false

private var accentColor: Color {
if customAccentColorHex.isEmpty {
Expand All @@ -24,10 +25,12 @@ struct MainTabView: View {
.tabItem {
Label("Home", systemImage: "house")
}
ScriptListView()
.tabItem {
Label("Scripts", systemImage: "scroll")
}
if enableAdvancedOptions {
ScriptListView()
.tabItem {
Label("Scripts", systemImage: "scroll")
}
}
SettingsView()
.tabItem {
Label("Settings", systemImage: "gearshape.fill")
Expand Down
5 changes: 5 additions & 0 deletions StikJIT/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct SettingsView: View {
@AppStorage("customAccentColor") private var customAccentColorHex: String = ""
@AppStorage("selectedAppIcon") private var selectedAppIcon: String = "AppIcon"
@AppStorage("useDefaultScript") private var useDefaultScript = false
@AppStorage("enableAdvancedOptions") private var enableAdvancedOptions = false

@State private var isShowingPairingFilePicker = false
@Environment(\.colorScheme) private var colorScheme
Expand Down Expand Up @@ -274,6 +275,10 @@ struct SettingsView: View {
Toggle("Run Default Script After Connecting", isOn: $useDefaultScript)
.foregroundColor(.primary)
.padding(.vertical, 6)

Toggle("Enable Advanced Options", isOn: $enableAdvancedOptions)
.foregroundColor(.primary)
.padding(.vertical, 6)
}
.padding(.vertical, 20)
.padding(.horizontal, 16)
Expand Down
2 changes: 2 additions & 0 deletions StikJIT/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@
"StikJIT only supports 17.4 and above. Your device is running iOS/iPadOS %@" = "StikJIT only supports 17.4 and above. Your device is running iOS/iPadOS %@";
"Cancel" = "Cancel";
"OK" = "OK";

"Enable Advanced Options" = "Enable Advanced Options";
2 changes: 2 additions & 0 deletions StikJIT/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@
"StikJIT only supports 17.4 and above. Your device is running iOS/iPadOS %@" = "StikJIT solo es compatible con la versi\u00f3n 17.4 o superior. Tu dispositivo ejecuta iOS/iPadOS %@";
"Cancel" = "Cancelar";
"OK" = "Aceptar";

"Enable Advanced Options" = "Habilitar opciones avanzadas";