mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge pull request #1253 from meshtastic/2.6.5
Merging this as a hot fix release to get factory reset including keys in place
This commit is contained in:
commit
ea35f44f93
9 changed files with 78 additions and 134 deletions
|
|
@ -2809,34 +2809,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"All device and app data will be deleted." : {
|
||||
"localizations" : {
|
||||
"it" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Tutti i dati del dispositivo e delle app verranno eliminati."
|
||||
}
|
||||
},
|
||||
"sr" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Сви подаци о уређају и апликацији ће бити избрисани."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "所有设备以及 App 数据都会被删除。"
|
||||
}
|
||||
},
|
||||
"zh-Hant-TW" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "全部的設備及App資料將會被刪除。"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Allow incoming device control over the insecure legacy admin channel." : {
|
||||
"localizations" : {
|
||||
"de" : {
|
||||
|
|
@ -8139,6 +8111,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Delete all config, keys and BLE bonds? " : {
|
||||
|
||||
},
|
||||
"Delete all config? " : {
|
||||
|
||||
},
|
||||
"Delete all device metrics?" : {
|
||||
"localizations" : {
|
||||
|
|
@ -10719,61 +10697,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"Enabling Ethernet will disable the bluetooth connection to the app." : {
|
||||
"localizations" : {
|
||||
"it" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Abilitando l'Ethernet si disabilita la connessione bluetooth all'applicazione."
|
||||
}
|
||||
},
|
||||
"sr" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Омогућавање етернета ће онемогућити блутут везу са апликацијом."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "启用以太网将禁用应用程序的蓝牙连接。"
|
||||
}
|
||||
},
|
||||
"zh-Hant-TW" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "啟用乙太網路後,將會停用與應用程式的藍牙連線。"
|
||||
}
|
||||
}
|
||||
}
|
||||
"Enabling Ethernet will disable the bluetooth connection to the app. TCP node connections are not available on Apple devices." : {
|
||||
|
||||
},
|
||||
"Enabling WiFi will disable the bluetooth connection to the app." : {
|
||||
"localizations" : {
|
||||
"it" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "L'attivazione del WiFi disabilita la connessione bluetooth all'applicazione."
|
||||
}
|
||||
},
|
||||
"sr" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Омогућавање ВајФаја ће онемогућити блутут везу са апликацијом."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "启用 WiFi 将禁用应用程序的蓝牙连接。"
|
||||
}
|
||||
},
|
||||
"zh-Hant-TW" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "啟用 Wi-Fi 後,將會停用與應用程式的藍牙連線。"
|
||||
}
|
||||
}
|
||||
}
|
||||
"Enabling WiFi will disable the bluetooth connection to the app. TCP node connections are not available on Apple devices." : {
|
||||
|
||||
},
|
||||
"Encoder Press Event" : {
|
||||
"localizations" : {
|
||||
|
|
@ -11673,33 +11601,8 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"Factory reset your device and app? " : {
|
||||
"localizations" : {
|
||||
"de" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Gerät und App auf Werkseinstellungen zurücksetzen?"
|
||||
}
|
||||
},
|
||||
"it" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Resettare il dispositivo e l'applicazione? "
|
||||
}
|
||||
},
|
||||
"sr" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Вратите уређај и апликацију на фабричка подешавања?"
|
||||
}
|
||||
},
|
||||
"zh-Hant-TW" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "要將您的裝置與應用程式恢復原廠設定嗎?"
|
||||
}
|
||||
}
|
||||
}
|
||||
"Factory reset will delete device and app data." : {
|
||||
|
||||
},
|
||||
"Failed to encode message content" : {
|
||||
"localizations" : {
|
||||
|
|
@ -24451,6 +24354,7 @@
|
|||
}
|
||||
},
|
||||
"Replying to a message" : {
|
||||
"extractionState" : "stale",
|
||||
"localizations" : {
|
||||
"zh-Hant-TW" : {
|
||||
"stringUnit" : {
|
||||
|
|
|
|||
|
|
@ -767,6 +767,7 @@
|
|||
children = (
|
||||
DDD5BB0E2C285F92007E03CA /* Logs */,
|
||||
DD93800C2BA74CE3008BEC06 /* Channels */,
|
||||
DD61937A2863876A00E59241 /* Config */,
|
||||
DD97E96728EFE9A00056DDA4 /* About.swift */,
|
||||
DDD5BB152C28B1E4007E03CA /* AppData.swift */,
|
||||
DDD5BB082C285DDC007E03CA /* AppLog.swift */,
|
||||
|
|
@ -780,7 +781,6 @@
|
|||
DD3501882852FC3B000FC853 /* Settings.swift */,
|
||||
DD3CC6B428E33FD100FA9159 /* ShareChannels.swift */,
|
||||
DDCE4E2B2869F92900BE9F8F /* UserConfig.swift */,
|
||||
DD61937A2863876A00E59241 /* Config */,
|
||||
DD1B8F3F2B35E2F10022AABC /* GPSStatus.swift */,
|
||||
);
|
||||
path = Settings;
|
||||
|
|
@ -801,6 +801,7 @@
|
|||
DD61937A2863876A00E59241 /* Config */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DD61937B2863877A00E59241 /* Module */,
|
||||
D93068DC2B81CA820066FBC8 /* ConfigHeader.swift */,
|
||||
D93069072B81DF040066FBC8 /* SaveConfigButton.swift */,
|
||||
DDB6ABD528AE742000384BA1 /* BluetoothConfig.swift */,
|
||||
|
|
@ -811,7 +812,6 @@
|
|||
DD2553582855B52700E55709 /* PositionConfig.swift */,
|
||||
D93068DA2B81C85E0066FBC8 /* PowerConfig.swift */,
|
||||
DD1BD0F22C63C65E008C0C70 /* SecurityConfig.swift */,
|
||||
DD61937B2863877A00E59241 /* Module */,
|
||||
);
|
||||
path = Config;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -1807,7 +1807,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.4;
|
||||
MARKETING_VERSION = 2.6.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
|
|
@ -1840,7 +1840,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.4;
|
||||
MARKETING_VERSION = 2.6.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
|
|
@ -1871,7 +1871,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.4;
|
||||
MARKETING_VERSION = 2.6.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
|
@ -1903,7 +1903,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.4;
|
||||
MARKETING_VERSION = 2.6.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
|
|
|||
|
|
@ -1532,9 +1532,13 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
return false
|
||||
}
|
||||
|
||||
public func sendFactoryReset(fromUser: UserEntity, toUser: UserEntity) -> Bool {
|
||||
public func sendFactoryReset(fromUser: UserEntity, toUser: UserEntity, resetDevice: Bool = false) -> Bool {
|
||||
var adminPacket = AdminMessage()
|
||||
adminPacket.factoryResetConfig = 5
|
||||
if resetDevice {
|
||||
adminPacket.factoryResetDevice = 5
|
||||
} else {
|
||||
adminPacket.factoryResetConfig = 5
|
||||
}
|
||||
if fromUser != toUser {
|
||||
adminPacket.sessionPasskey = toUser.userNode?.sessionPasskey ?? Data()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,12 +136,11 @@ struct ChannelMessageList: View {
|
|||
Spacer(minLength: 50)
|
||||
}
|
||||
}
|
||||
|
||||
.overlay {
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(.blue, lineWidth: 2)
|
||||
.opacity(((messageToHighlight == message.messageId) || (replyMessageId == message.messageId)) ? 1 : 0)
|
||||
}
|
||||
// .overlay {
|
||||
// RoundedRectangle(cornerRadius: 18)
|
||||
// .stroke(.blue, lineWidth: 2)
|
||||
// .opacity(((messageToHighlight == message.messageId) || (replyMessageId == message.messageId)) ? 1 : 0)
|
||||
// }
|
||||
.padding([.leading, .trailing])
|
||||
.frame(maxWidth: .infinity)
|
||||
.id(message.messageId)
|
||||
|
|
|
|||
|
|
@ -39,8 +39,9 @@ struct TextMessageField: View {
|
|||
} label: {
|
||||
Image(systemName: "x.circle.fill")
|
||||
}
|
||||
Text("Replying to a message")
|
||||
Text("Reply")
|
||||
}
|
||||
.padding(.top)
|
||||
}
|
||||
|
||||
ZStack {
|
||||
|
|
|
|||
|
|
@ -123,11 +123,11 @@ struct UserMessageList: View {
|
|||
Spacer(minLength: 50)
|
||||
}
|
||||
}
|
||||
.overlay {
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(.blue, lineWidth: 2)
|
||||
.opacity(((messageToHighlight == message.messageId) || (replyMessageId == message.messageId)) ? 1 : 0)
|
||||
}
|
||||
// .overlay {
|
||||
// RoundedRectangle(cornerRadius: 10)
|
||||
// .stroke(.blue, lineWidth: 2)
|
||||
// .opacity(((messageToHighlight == message.messageId) || (replyMessageId == message.messageId)) ? 1 : 0)
|
||||
// }
|
||||
.padding([.leading, .trailing])
|
||||
.frame(maxWidth: .infinity)
|
||||
.id(message.messageId)
|
||||
|
|
|
|||
|
|
@ -122,6 +122,31 @@ struct NodeDetail: View {
|
|||
.textSelection(.enabled)
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
|
||||
if node.user?.keyMatch ?? false {
|
||||
if let publicKey = node.user?.publicKey {
|
||||
HStack {
|
||||
Label {
|
||||
Text("Public Key")
|
||||
} icon: {
|
||||
Image(systemName: "lock.fill")
|
||||
.foregroundColor(.green)
|
||||
}
|
||||
Spacer()
|
||||
Button(action: {
|
||||
context.perform{
|
||||
UIPasteboard.general.string = publicKey.base64EncodedString()
|
||||
}
|
||||
}) {
|
||||
HStack {
|
||||
Image(systemName: "key.horizontal.fill")
|
||||
Text("Copy")
|
||||
}
|
||||
}
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
}
|
||||
}
|
||||
|
||||
if let metadata = node.metadata {
|
||||
HStack {
|
||||
|
|
|
|||
|
|
@ -204,11 +204,11 @@ struct DeviceConfig: View {
|
|||
.controlSize(.regular)
|
||||
.padding(.trailing)
|
||||
.confirmationDialog(
|
||||
"All device and app data will be deleted.",
|
||||
"Factory reset will delete device and app data.",
|
||||
isPresented: $isPresentingFactoryResetConfirm,
|
||||
titleVisibility: .visible
|
||||
) {
|
||||
Button("Factory reset your device and app? ", role: .destructive) {
|
||||
Button("Delete all config? ", role: .destructive) {
|
||||
if bleManager.sendFactoryReset(fromUser: node!.user!, toUser: node!.user!) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
bleManager.disconnectPeripheral()
|
||||
|
|
@ -218,6 +218,16 @@ struct DeviceConfig: View {
|
|||
Logger.mesh.error("Factory Reset Failed")
|
||||
}
|
||||
}
|
||||
Button("Delete all config, keys and BLE bonds? ", role: .destructive) {
|
||||
if bleManager.sendFactoryReset(fromUser: node!.user!, toUser: node!.user!, resetDevice: true) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
bleManager.disconnectPeripheral()
|
||||
clearCoreDataDatabase(context: context, includeRoutes: false)
|
||||
}
|
||||
} else {
|
||||
Logger.mesh.error("Factory Reset Failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ struct NetworkConfig: View {
|
|||
|
||||
Toggle(isOn: $wifiEnabled) {
|
||||
Label("Enabled", systemImage: "wifi")
|
||||
Text("Enabling WiFi will disable the bluetooth connection to the app.")
|
||||
Text("Enabling WiFi will disable the bluetooth connection to the app. TCP node connections are not available on Apple devices.")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
|
||||
|
|
@ -83,9 +83,9 @@ struct NetworkConfig: View {
|
|||
Section(header: Text("Ethernet Options")) {
|
||||
Toggle(isOn: $ethEnabled) {
|
||||
Label("Enabled", systemImage: "network")
|
||||
Text("Enabling Ethernet will disable the bluetooth connection to the app.")
|
||||
Text("Enabling Ethernet will disable the bluetooth connection to the app. TCP node connections are not available on Apple devices.")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
.tint(.accentColor)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -95,6 +95,7 @@ struct NetworkConfig: View {
|
|||
Label("Enabled", systemImage: "point.3.connected.trianglepath.dotted")
|
||||
Text("Enable broadcasting packets via UDP over the local network.")
|
||||
}
|
||||
.tint(.accentColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue