mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Send key validation error to security config
This commit is contained in:
parent
2840d334e3
commit
647bb690f0
2 changed files with 6 additions and 2 deletions
|
|
@ -713,6 +713,8 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
let message = CocoaMQTTMessage(topic: decodedInfo.mqttClientProxyMessage.topic, payload: [UInt8](decodedInfo.mqttClientProxyMessage.data), retained: decodedInfo.mqttClientProxyMessage.retained)
|
||||
mqttManager.mqttClientProxy?.publish(message)
|
||||
} else if decodedInfo.payloadVariant == FromRadio.OneOf_PayloadVariant.clientNotification(decodedInfo.clientNotification) {
|
||||
|
||||
var path = "meshtastic:///settings/debugLogs"
|
||||
if decodedInfo.clientNotification.hasReplyID {
|
||||
/// Set Sent bool on TraceRouteEntity to false if we got rate limited
|
||||
if decodedInfo.clientNotification.message.starts(with: "TraceRoute") {
|
||||
|
|
@ -726,6 +728,8 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
let nsError = error as NSError
|
||||
Logger.data.error("💥 [TraceRouteEntity] Error Updating Core Data: \(nsError, privacy: .public)")
|
||||
}
|
||||
} else if decodedInfo.clientNotification.message.starts(with: "You Device is configured with a low entropy") || decodedInfo.clientNotification.message.starts(with: "Compromised keys detected") {
|
||||
path = "meshtastic:///settings/security"
|
||||
}
|
||||
}
|
||||
let manager = LocalNotificationManager()
|
||||
|
|
@ -736,7 +740,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
subtitle: "\(decodedInfo.clientNotification.level)".capitalized,
|
||||
content: decodedInfo.clientNotification.message,
|
||||
target: "settings",
|
||||
path: "meshtastic:///settings/debugLogs"
|
||||
path: path
|
||||
)
|
||||
]
|
||||
manager.schedule()
|
||||
|
|
|
|||
|
|
@ -123,8 +123,8 @@ struct SecurityConfig: View {
|
|||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
}
|
||||
Section(header: Text("Administration")) {
|
||||
if adminKey.length > 0 || UserDefaults.enableAdministration {
|
||||
Section(header: Text("Administration")) {
|
||||
Toggle(isOn: $isManaged) {
|
||||
Label("Managed Device", systemImage: "gearshape.arrow.triangle.2.circlepath")
|
||||
Text("Device is managed by a mesh administrator, the user is unable to access any of the device settings.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue