mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 04:20:30 +00:00
Small fixes
This commit is contained in:
parent
9800b3be5d
commit
524143ffa0
5 changed files with 32 additions and 11 deletions
6
StikJIT/Utilities/FeatureFlags.swift
Normal file
6
StikJIT/Utilities/FeatureFlags.swift
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import Foundation
|
||||
|
||||
enum FeatureFlags {
|
||||
/// Global toggle for exposing location spoofing UI/logic.
|
||||
static let isLocationSpoofingEnabled = false
|
||||
}
|
||||
|
|
@ -3,7 +3,14 @@ import Foundation
|
|||
enum TabConfiguration {
|
||||
static let storageKey = "enabledTabIdentifiers"
|
||||
static let maxSelectableTabs = 4
|
||||
static let allowedIDs: [String] = ["home", "console", "scripts", "profiles", "processes", "deviceinfo", "location"]
|
||||
private static let baseAllowedIDs: [String] = ["home", "console", "scripts", "profiles", "processes", "deviceinfo"]
|
||||
static var allowedIDs: [String] {
|
||||
var ids = baseAllowedIDs
|
||||
if FeatureFlags.isLocationSpoofingEnabled {
|
||||
ids.append("location")
|
||||
}
|
||||
return ids
|
||||
}
|
||||
static let defaultIDs: [String] = ["home", "console", "scripts", "profiles"]
|
||||
static let defaultRawValue = serialize(defaultIDs)
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ struct MainTabView: View {
|
|||
|
||||
private var availableTabs: [TabDescriptor] {
|
||||
configurableTabs.filter { descriptor in
|
||||
descriptor.id != "location" || !isAppStoreBuild
|
||||
descriptor.id != "location" || (FeatureFlags.isLocationSpoofingEnabled && !isAppStoreBuild)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,17 +359,25 @@ struct ProfileView: View {
|
|||
}
|
||||
|
||||
func loadProfiles() async {
|
||||
working = true
|
||||
await MainActor.run { working = true }
|
||||
do {
|
||||
let profileDatas = try JITEnableContext.shared.fetchAllProfiles()
|
||||
self.profiles = profileDatas.map { Profile(data: $0) }
|
||||
let profileDatas = try await Task.detached(priority: .userInitiated) {
|
||||
try JITEnableContext.shared.fetchAllProfiles()
|
||||
}.value
|
||||
let parsedProfiles = profileDatas.map { Profile(data: $0) }
|
||||
await MainActor.run {
|
||||
self.profiles = parsedProfiles
|
||||
self.working = false
|
||||
}
|
||||
} catch {
|
||||
alertMsg = error.localizedDescription
|
||||
alertTitle = "Failed to Fetch Profiles"
|
||||
alertSuccess = false
|
||||
alert = true
|
||||
await MainActor.run {
|
||||
alertMsg = error.localizedDescription
|
||||
alertTitle = "Failed to Fetch Profiles"
|
||||
alertSuccess = false
|
||||
alert = true
|
||||
working = false
|
||||
}
|
||||
}
|
||||
working = false
|
||||
}
|
||||
|
||||
func saveProfile(profile: Profile) {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ struct SettingsView: View {
|
|||
TabOption(id: "processes", title: "Processes", detail: "Inspect running apps", icon: "rectangle.stack.person.crop", isBeta: true),
|
||||
TabOption(id: "deviceinfo", title: "Device Info", detail: "View detailed device metadata", icon: "iphone.and.arrow.forward", isBeta: false)
|
||||
]
|
||||
if !isAppStoreBuild {
|
||||
if FeatureFlags.isLocationSpoofingEnabled && !isAppStoreBuild {
|
||||
options.append(TabOption(id: "location", title: "Location Sim", detail: "Sideload only", icon: "location", isBeta: true))
|
||||
}
|
||||
return options
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue