diff --git a/Reveil/DataModels/Presets/SecurityPresets.swift b/Reveil/DataModels/Presets/SecurityPresets.swift index 56c2892..b5a21f5 100644 --- a/Reveil/DataModels/Presets/SecurityPresets.swift +++ b/Reveil/DataModels/Presets/SecurityPresets.swift @@ -72,9 +72,11 @@ struct SecurityPresets: Codable { var secureEntitlementKeys: Set = [ "get-task-allow", "application-identifier", + "keychain-access-groups", "com.apple.developer.team-identifier", "com.apple.security.app-sandbox", "com.apple.security.network.client", + "com.apple.private.security.container-required", ] var secureMainBundleIdentifiers: Set = [ diff --git a/Reveil/Pages/AboutView.swift b/Reveil/Pages/AboutView.swift index 1b263ff..45800f3 100644 --- a/Reveil/Pages/AboutView.swift +++ b/Reveil/Pages/AboutView.swift @@ -65,10 +65,10 @@ struct AboutView: View { ) } - Link(destination: URL(string: "https://twitter.com/82Flex")!) { + Link(destination: URL(string: "https://github.com/Lessica")!) { LinkCell( label: NSLocalizedString("DEVELOPER", comment: "Developer"), - description: "@82Flex", + description: "@Lessica", hasClosure: true ) } @@ -99,7 +99,7 @@ struct AboutView: View { description: gBuildDateString ) } footer: { - Text(NSLocalizedString("COPYRIGHT_STRING", comment: "Copyright © 2023-2024 82Flex Team.\nAll rights reserved.")) + Text(NSLocalizedString("COPYRIGHT_STRING", comment: "Copyright © 2023-2024 Lessica & Lakr Aream.\nAll rights reserved.")) .font(Font.system(.footnote)) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) .multilineTextAlignment(.center) diff --git a/Reveil/Pages/DashboardView.swift b/Reveil/Pages/DashboardView.swift index 05ec170..8437197 100644 --- a/Reveil/Pages/DashboardView.swift +++ b/Reveil/Pages/DashboardView.swift @@ -17,7 +17,9 @@ struct DashboardView: View { var body: some View { ScrollView(.vertical) { VStack { - Section { CheckmarkWidget() } + if PinStorage.shared.isPinned(forKey: .Security) { + Section { CheckmarkWidget() } + } ForEach(viewModel.entries, id: \.key) { entry in Section { diff --git a/Reveil/Pages/Details/BatteryInformationListView.swift b/Reveil/Pages/Details/BatteryInformationListView.swift index 21aacdf..bea30a1 100644 --- a/Reveil/Pages/Details/BatteryInformationListView.swift +++ b/Reveil/Pages/Details/BatteryInformationListView.swift @@ -28,7 +28,7 @@ struct BatteryInformationListView: View, ModuleListView { ) .navigationTitle(module.moduleName) .navigationBarItems(trailing: PinButton(pin: AppCodableStorage( - wrappedValue: Pin(false), String(describing: BatteryInformation.self), + wrappedValue: Pin(false), .BatteryInformation, store: PinStorage.shared.userDefaults ))) .onReceive(GlobalTimer.shared.$tick) { _ in diff --git a/Reveil/Pages/Details/CPUInformationListView.swift b/Reveil/Pages/Details/CPUInformationListView.swift index 461924f..4ccb199 100644 --- a/Reveil/Pages/Details/CPUInformationListView.swift +++ b/Reveil/Pages/Details/CPUInformationListView.swift @@ -28,7 +28,7 @@ struct CPUInformationListView: View, ModuleListView { ) .navigationTitle(module.moduleName) .navigationBarItems(trailing: PinButton(pin: AppCodableStorage( - wrappedValue: Pin(true), String(describing: CPUInformation.self), + wrappedValue: Pin(true), EntryKey.CPUInformation, store: PinStorage.shared.userDefaults ))) .onReceive(GlobalTimer.shared.$tick) { _ in diff --git a/Reveil/Pages/Details/DiskSpaceListView.swift b/Reveil/Pages/Details/DiskSpaceListView.swift index 0f704a4..e4b2f12 100644 --- a/Reveil/Pages/Details/DiskSpaceListView.swift +++ b/Reveil/Pages/Details/DiskSpaceListView.swift @@ -28,7 +28,7 @@ struct DiskSpaceListView: View, ModuleListView { ) .navigationTitle(module.moduleName) .navigationBarItems(trailing: PinButton(pin: AppCodableStorage( - wrappedValue: Pin(true), String(describing: DiskSpace.self), + wrappedValue: Pin(true), .DiskSpace, store: PinStorage.shared.userDefaults ))) .onReceive(GlobalTimer.shared.$tick) { _ in diff --git a/Reveil/Pages/Details/FileSystemsListView.swift b/Reveil/Pages/Details/FileSystemsListView.swift index d9b5bc0..20b4163 100644 --- a/Reveil/Pages/Details/FileSystemsListView.swift +++ b/Reveil/Pages/Details/FileSystemsListView.swift @@ -39,7 +39,7 @@ struct FileSystemsListView: View, ModuleListView { .navigationTitle(module.moduleName) .navigationBarItems( trailing: PinButton(pin: AppCodableStorage( - wrappedValue: Pin(false), String(describing: FileSystems.self), + wrappedValue: Pin(false), .FileSystems, store: PinStorage.shared.userDefaults )) ) diff --git a/Reveil/Pages/Details/MemoryInformationListView.swift b/Reveil/Pages/Details/MemoryInformationListView.swift index fd9eb3b..7b2efdf 100644 --- a/Reveil/Pages/Details/MemoryInformationListView.swift +++ b/Reveil/Pages/Details/MemoryInformationListView.swift @@ -28,7 +28,7 @@ struct MemoryInformationListView: View, ModuleListView { ) .navigationTitle(module.moduleName) .navigationBarItems(trailing: PinButton(pin: AppCodableStorage( - wrappedValue: Pin(true), String(describing: MemoryInformation.self), + wrappedValue: Pin(true), .MemoryInformation, store: PinStorage.shared.userDefaults ))) .onReceive(GlobalTimer.shared.$tick) { _ in diff --git a/Reveil/Pages/Details/NetworkInterfacesListView.swift b/Reveil/Pages/Details/NetworkInterfacesListView.swift index 1e6366d..340cc67 100644 --- a/Reveil/Pages/Details/NetworkInterfacesListView.swift +++ b/Reveil/Pages/Details/NetworkInterfacesListView.swift @@ -39,7 +39,7 @@ struct NetworkInterfacesListView: View, ModuleListView { .navigationTitle(module.moduleName) .navigationBarItems( trailing: PinButton(pin: AppCodableStorage( - wrappedValue: Pin(false), String(describing: NetworkInterfaces.self), + wrappedValue: Pin(false), .NetworkInterfaces, store: PinStorage.shared.userDefaults )) ) diff --git a/Reveil/Pages/Details/NetworkUsageListView.swift b/Reveil/Pages/Details/NetworkUsageListView.swift index e00ad3a..cb237c5 100644 --- a/Reveil/Pages/Details/NetworkUsageListView.swift +++ b/Reveil/Pages/Details/NetworkUsageListView.swift @@ -28,7 +28,7 @@ struct NetworkUsageListView: View, ModuleListView { ) .navigationTitle(module.moduleName) .navigationBarItems(trailing: PinButton(pin: AppCodableStorage( - wrappedValue: Pin(false), String(describing: NetworkUsage.self), + wrappedValue: Pin(false), .NetworkUsage, store: PinStorage.shared.userDefaults ))) .onReceive(GlobalTimer.shared.$tick) { _ in diff --git a/Reveil/Pages/SecurityView.swift b/Reveil/Pages/SecurityView.swift index e7ab84d..2f637b1 100644 --- a/Reveil/Pages/SecurityView.swift +++ b/Reveil/Pages/SecurityView.swift @@ -15,5 +15,9 @@ struct SecurityView: View { var body: some View { DetailsListView(basicEntries: securityModel.basicEntries) .navigationTitle(NSLocalizedString("SECURITY", comment: "Security")) + .navigationBarItems(trailing: PinButton(pin: AppCodableStorage( + wrappedValue: Pin(true), .Security, + store: PinStorage.shared.userDefaults + ))) } } diff --git a/Reveil/Resources/PinStorage.plist b/Reveil/Resources/PinStorage.plist index d63745f..462c2e6 100644 Binary files a/Reveil/Resources/PinStorage.plist and b/Reveil/Resources/PinStorage.plist differ diff --git a/Reveil/Storage/AppCodableStorage.swift b/Reveil/Storage/AppCodableStorage.swift index c096205..63cfbe7 100644 --- a/Reveil/Storage/AppCodableStorage.swift +++ b/Reveil/Storage/AppCodableStorage.swift @@ -6,8 +6,8 @@ struct AppCodableStorage: DynamicProperty { private let triggerUpdate: ObservedObject> private let writer: DefaultsWriter - init(wrappedValue: Value, _ key: String, store: UserDefaults? = nil) { - writer = DefaultsWriter.shared(defaultValue: wrappedValue, key: key, defaults: store ?? .standard) + init(wrappedValue: Value, _ key: EntryKey, store: UserDefaults? = nil) { + writer = DefaultsWriter.shared(defaultValue: wrappedValue, key: key.rawValue, defaults: store ?? .standard) triggerUpdate = .init(wrappedValue: writer) } diff --git a/Reveil/Storage/PinStorage.swift b/Reveil/Storage/PinStorage.swift index 75bfd61..69b6fba 100644 --- a/Reveil/Storage/PinStorage.swift +++ b/Reveil/Storage/PinStorage.swift @@ -29,6 +29,10 @@ final class PinStorage: ObservableObject { @Published var pinnedEntryKeys: [EntryKey] + func isPinned(forKey key: EntryKey) -> Bool { + return pinnedEntryKeys.contains(key) + } + func reloadData() { guard let dictRepr = persistentDomain else { return diff --git a/Reveil/ViewModels/Enums/EntryKey.swift b/Reveil/ViewModels/Enums/EntryKey.swift index f149d57..90a8f4f 100644 --- a/Reveil/ViewModels/Enums/EntryKey.swift +++ b/Reveil/ViewModels/Enums/EntryKey.swift @@ -10,6 +10,9 @@ import Foundation enum EntryKey: Codable, Equatable, Hashable, RawRepresentable { typealias RawValue = String + // Security + case Security + // Device Information case DeviceName case MarketingName @@ -205,6 +208,8 @@ enum EntryKey: Codable, Equatable, Hashable, RawRepresentable { init?(rawValue: String) { switch rawValue { + case "Security": + self = .Security case "DeviceName": self = .DeviceName case "MarketingName": @@ -467,6 +472,8 @@ enum EntryKey: Codable, Equatable, Hashable, RawRepresentable { var rawValue: String { switch self { + case .Security: + "Security" case .DeviceName: "DeviceName" case .MarketingName: diff --git a/Reveil/Views/Dashboard/ActivityWidget.swift b/Reveil/Views/Dashboard/ActivityWidget.swift index bae892b..ead281d 100644 --- a/Reveil/Views/Dashboard/ActivityWidget.swift +++ b/Reveil/Views/Dashboard/ActivityWidget.swift @@ -44,7 +44,7 @@ struct ActivityWidget: View { HStack { AnimatedText(String(format: "%.2f%%", Double(entry.values.last ?? 0) * 100.0)) - .font(Font.system(.title).weight(.medium)) + .font(Font.system(.title).weight(.medium).monospacedDigit()) .foregroundColor(.accentColor) .lineLimit(1) Spacer() diff --git a/Reveil/Views/Dashboard/FieldWidget.swift b/Reveil/Views/Dashboard/FieldWidget.swift index bab0ed6..ef8dcac 100644 --- a/Reveil/Views/Dashboard/FieldWidget.swift +++ b/Reveil/Views/Dashboard/FieldWidget.swift @@ -26,7 +26,7 @@ struct FieldWidget: View { HStack { Text(entry.value) - .font(Font.system(.body).weight(.regular)) + .font(Font.system(.body).weight(.regular).monospacedDigit()) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) .multilineTextAlignment(.leading) .lineLimit(3) diff --git a/Reveil/Views/Dashboard/TrafficWidget.swift b/Reveil/Views/Dashboard/TrafficWidget.swift index 6f085f2..7b57195 100644 --- a/Reveil/Views/Dashboard/TrafficWidget.swift +++ b/Reveil/Views/Dashboard/TrafficWidget.swift @@ -132,8 +132,8 @@ struct TrafficWidget: View { .font(Font.system(.body).weight(.regular)) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) - AnimatedText(receivedDescription) - .font(Font.system(.body).weight(.regular)) + Text(receivedDescription) + .font(Font.system(.body).weight(.regular).monospacedDigit()) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) .lineLimit(1) } @@ -164,8 +164,8 @@ struct TrafficWidget: View { .font(Font.system(.body).weight(.regular)) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) - AnimatedText(sentDescription) - .font(Font.system(.body).weight(.regular)) + Text(sentDescription) + .font(Font.system(.body).weight(.regular).monospacedDigit()) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) .lineLimit(1) } diff --git a/Reveil/Views/Dashboard/UsageWidget.swift b/Reveil/Views/Dashboard/UsageWidget.swift index ae45d12..1ce3b89 100644 --- a/Reveil/Views/Dashboard/UsageWidget.swift +++ b/Reveil/Views/Dashboard/UsageWidget.swift @@ -31,14 +31,14 @@ struct UsageWidget: View { HStack(alignment: .lastTextBaseline) { AnimatedText(String(format: "%.2f%%", (entry.firstRatio ?? 0.0) * 100.0)) - .font(Font.system(.title).weight(.medium)) + .font(Font.system(.title).weight(.medium).monospacedDigit()) .foregroundColor(.accentColor) .lineLimit(1) Spacer() if let lastDescription = entry.lastDescription { Text(lastDescription) - .font(Font.system(.body).weight(.regular)) + .font(Font.system(.body).weight(.regular).monospacedDigit()) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) .lineLimit(1) } diff --git a/Reveil/Views/Details/FieldCell.swift b/Reveil/Views/Details/FieldCell.swift index 5c89358..a5b5da0 100644 --- a/Reveil/Views/Details/FieldCell.swift +++ b/Reveil/Views/Details/FieldCell.swift @@ -65,7 +65,7 @@ private struct FieldCell_Internal: View { Spacer() Text(description) - .font(.system(.body)) + .font(.system(.body).monospacedDigit()) .foregroundColor(Color(PlatformColor.secondaryLabelAlias)) .multilineTextAlignment(.trailing) } @@ -84,9 +84,9 @@ struct FieldCell: View { delegate: delegate, isPinnable: entry.key.isPinnable, pin: entry.key.isPinnable ? AppCodableStorage( - wrappedValue: Pin(false), entry.key.rawValue, + wrappedValue: Pin(false), entry.key, store: PinStorage.shared.userDefaults - ) : AppCodableStorage(wrappedValue: Pin(false), String()) + ) : AppCodableStorage(wrappedValue: Pin(false), .Custom(name: String())) ) } } diff --git a/Reveil/Views/PinButton.swift b/Reveil/Views/PinButton.swift index a4a6027..b5e7bf9 100644 --- a/Reveil/Views/PinButton.swift +++ b/Reveil/Views/PinButton.swift @@ -26,6 +26,6 @@ struct PinButton: View { struct PinButton_Previews: PreviewProvider { static var previews: some View { - PinButton(pin: AppCodableStorage(wrappedValue: Pin(false), "PinButton.Pinned")) + PinButton(pin: AppCodableStorage(wrappedValue: Pin(false), .Security)) } } diff --git a/Reveil/en.lproj/Localizable.strings b/Reveil/en.lproj/Localizable.strings index 1e846d4..587573b 100644 --- a/Reveil/en.lproj/Localizable.strings +++ b/Reveil/en.lproj/Localizable.strings @@ -109,8 +109,8 @@ /* Copied to clipboard */ "COPIED_TO_CLIPBOARD" = "Copied to clipboard"; -/* Copyright © 2023-2024 82Flex Team.\nAll rights reserved. */ -"COPYRIGHT_STRING" = "Copyright © 2023-2024 82Flex Team.\nAll rights reserved."; +/* Copyright © 2023-2024 Lessica & Lakr Aream.\nAll rights reserved. */ +"COPYRIGHT_STRING" = "Copyright © 2023-2024 Lessica & Lakr Aream.\nAll rights reserved."; /* COW Faults */ "COW_FAULTS" = "COW Faults"; diff --git a/Reveil/zh-Hans.lproj/Localizable.strings b/Reveil/zh-Hans.lproj/Localizable.strings index 0c84bf5..7918587 100644 --- a/Reveil/zh-Hans.lproj/Localizable.strings +++ b/Reveil/zh-Hans.lproj/Localizable.strings @@ -109,8 +109,8 @@ /* Copied to clipboard */ "COPIED_TO_CLIPBOARD" = "已拷贝到剪贴板"; -/* Copyright © 2023-2024 82Flex Team.\nAll rights reserved. */ -"COPYRIGHT_STRING" = "版权所有 © 2023-2024 82Flex Team.\n保留所有权利"; +/* Copyright © 2023-2024 Lessica & Lakr Aream.\nAll rights reserved. */ +"COPYRIGHT_STRING" = "版权所有 © 2023-2024 Lessica & Lakr Aream.\n保留所有权利"; /* COW Faults */ "COW_FAULTS" = "写时复制错误";