Improved macOS strings and agent update.

Ylian Saint-Hilaire committed Dec 7, 2020 at 22:55 UTC 5046161a5d0eba05bb7d6d857cb5bcef01b7de34
3 files changed +32 -11
meshagent.js
+11 -1
@@ -234,7 +234,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
234 else if (cmdid == 12) { // MeshCommand_AgentHash
235 if ((msg.length == 52) && (obj.agentExeInfo != null) && (obj.agentExeInfo.update == true)) {
236 const agenthash = msg.substring(4);
237 - if ((agenthash != obj.agentExeInfo.hash) && (agenthash != '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0')) {
237 + if (compareAgentBinaryHash(obj.agentExeInfo, agenthash)) {
238 // Mesh agent update required, do it using task limiter so not to flood the network. Medium priority task.
239 parent.parent.taskLimiter.launch(function (argument, taskid, taskLimiterQueue) {
240 if (obj.authenticated != 2) { parent.parent.taskLimiter.completed(taskid); return; } // If agent disconnection, complete and exit now.
@@ -1655,6 +1655,16 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1655 });
1656 }
1657
1658 + // Check if we need to update this agent, return true if agent binary update required.
1659 + function compareAgentBinaryHash(agentExeInfo, agentHash) {
1660 + // If the hash matches or is null, no update required.
1661 + if ((agentExeInfo.hash == agentHash) || (agentHash == '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0')) return false;
1662 + // If this is a macOS x86 or ARM agent type and it matched the universal binary, no update required.
1663 + if (((agentExeInfo.id == 16) || (agentExeInfo.id == 29)) && (parent.parent.meshAgentBinaries[10005].hash == agentHash)) return false;
1664 + // No match, update the agent.
1665 + return true;
1666 + }
1667 +
1668 // Request that the core dump file on this agent be uploaded to the server
1669 obj.RequestCoreDump = function (agenthashhex, corehashhex) {
1670 if (agenthashhex.length > 16) { agenthashhex = agenthashhex.substring(0, 16); }
translate/translate.json
+20 -9
@@ -4865,6 +4865,12 @@
4865 "default.handlebars->29->327"
4866 ]
4867 },
4868 + {
4869 + "en": "Apple Silicon",
4870 + "xloc": [
4871 + "default.handlebars->29->42"
4872 + ]
4873 + },
4874 {
4875 "cs": "Apple macOS",
4876 "de": "Apple macOS",
@@ -37619,7 +37625,6 @@
37625 "default.handlebars->29->2036",
37626 "default.handlebars->29->2051",
37627 "default.handlebars->29->2052",
37622 - "default.handlebars->29->42",
37628 "default.handlebars->29->435",
37629 "default.handlebars->29->989",
37630 "default.handlebars->29->996"
@@ -41998,10 +42003,7 @@
42003 "ru": "macOS 32bit",
42004 "tr": "macOS 32bit",
42005 "zh-chs": "macOS 32位",
42001 - "zh-cht": "macOS 32位",
42002 - "xloc": [
42003 - "default.handlebars->29->24"
42004 - ]
42006 + "zh-cht": "macOS 32位"
42007 },
42008 {
42009 "cs": "macOS 64bit",
@@ -42018,10 +42020,7 @@
42020 "ru": "macOS 64bit",
42021 "tr": "macOS 64bit",
42022 "zh-chs": "macOS 64位",
42021 - "zh-cht": "macOS 64位",
42022 - "xloc": [
42023 - "default.handlebars->29->29"
42024 - ]
42023 + "zh-cht": "macOS 64位"
42024 },
42025 {
42026 "en": "macOS ARM (64bit)",
@@ -42035,6 +42034,18 @@
42034 "default.handlebars->29->814"
42035 ]
42036 },
42037 + {
42038 + "en": "macOS x86-32bit",
42039 + "xloc": [
42040 + "default.handlebars->29->24"
42041 + ]
42042 + },
42043 + {
42044 + "en": "macOS x86-64bit",
42045 + "xloc": [
42046 + "default.handlebars->29->29"
42047 + ]
42048 + },
42049 {
42050 "cs": "MeshAgenta",
42051 "de": "Mesh-Agent",
views/default.handlebars
+1 -1
@@ -1262,7 +1262,7 @@
1262 var autoReconnect = true;
1263 var powerStatetable = ['', "Powered", "Sleep", "Sleep", "Sleep", "Hibernating", "Power off", "Present"];
1264 var StatusStrs = ["Disconnected", "Connecting...", "Setup...", "Connected", "Intel® AMT Connected"];
1265 - var agentsStr = ["Unknown", "Windows 32bit console", "Windows 64bit console", "Windows 32bit service", "Windows 64bit service", "Linux 32bit", "Linux 64bit", "MIPS", "XENx86", "Android ARM", "Linux ARM", "macOS 32bit", "Android x86", "PogoPlug ARM", "Android APK", "Linux Poky x86-32bit", "macOS 64bit", "ChromeOS", "Linux Poky x86-64bit", "Linux NoKVM x86-32bit", "Linux NoKVM x86-64bit", "Windows MinCore console", "Windows MinCore service", "NodeJS", "ARM-Linaro", "ARMv6l / ARMv7l", "ARMv8 64bit", "ARMv6l / ARMv7l / NoKVM", "MIPS24KC (OpenWRT)", "Unknown", "FreeBSD x86-64"];
1265 + var agentsStr = ["Unknown", "Windows 32bit console", "Windows 64bit console", "Windows 32bit service", "Windows 64bit service", "Linux 32bit", "Linux 64bit", "MIPS", "XENx86", "Android ARM", "Linux ARM", "macOS x86-32bit", "Android x86", "PogoPlug ARM", "Android APK", "Linux Poky x86-32bit", "macOS x86-64bit", "ChromeOS", "Linux Poky x86-64bit", "Linux NoKVM x86-32bit", "Linux NoKVM x86-64bit", "Windows MinCore console", "Windows MinCore service", "NodeJS", "ARM-Linaro", "ARMv6l / ARMv7l", "ARMv8 64bit", "ARMv6l / ARMv7l / NoKVM", "MIPS24KC (OpenWRT)", "Apple Silicon", "FreeBSD x86-64"];
1266 var sort = 0;
1267 var searchFocus = 0;
1268 var mapSearchFocus = 0;