Skip to content

Commit 77e56c9

Browse files
author
Javier Acuna
committed
Merge branch 'develop' into 'master'
Develop See merge request prey/js/prey-node-client!1292
2 parents a17e2a4 + 980ecb3 commit 77e56c9

File tree

12 files changed

+237
-138
lines changed

12 files changed

+237
-138
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log
22

3+
## [v1.13.21](https://github.com/prey/prey-node-client/tree/v1.13.21) (2025-11-07)
4+
[Full Changelog](https://github.com/prey/prey-node-client/compare/v1.13.20..v1.13.21)
5+
6+
- Fix: Adds restrictions to changing some of the database settings for Prey software. ([SoraKenji](https://github.com/SoraKenji))
7+
8+
- Fix: Improves the code that handles obtaining Wi-Fi network information in Ubuntu, which is used to triangulate the device's location. ([SoraKenji](https://github.com/SoraKenji))
9+
10+
- feat: It adds a piece of code to identify MacOS devices with a T2 security chip and report potential problems with Apple's Factory Reset. ([SoraKenji](https://github.com/SoraKenji))
11+
12+
- Fix: It ensures that if a database backup exists in temporary files and needs to be recovered, it marks and deletes it to avoid causing potential errors in the future. ([SoraKenji](https://github.com/SoraKenji))
13+
14+
- Chore: Adds newest wpxsvc binary version 2.0.29 and updater.exe version 1.0.6 to Prey Windows client. ([SoraKenji](https://github.com/SoraKenji))
315

416
## [v1.13.20](https://github.com/prey/prey-node-client/tree/v1.13.20) (2025-08-29)
517
[Full Changelog](https://github.com/prey/prey-node-client/compare/v1.13.19..v1.13.20)

bin/updater.exe

56 Bytes
Binary file not shown.

bin/wpxsvc.exe

6.63 MB
Binary file not shown.

lib/agent/index.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable consistent-return */
12
const common = require('./common');
23
const updater = require('./updater');
34
const hooks = require('./hooks');
@@ -10,10 +11,12 @@ const providers = require('./providers');
1011
const {
1112
correctPreyConf, getDataDb, readWithoutVerification,
1213
} = require('./utils/prey-configuration/preyconf');
14+
15+
const { saveToDbKey } = require('../utils/configutil');
1316
const storage = require('./utils/storage');
1417
const { restore } = require('./utils/storage/restore');
1518
const setup = require('./control-panel/setup');
16-
const skippedPermissions = require('./../utils/skippedPermissions');
19+
const skippedPermissions = require('../utils/skippedPermissions');
1720

1821
const logo = require('./utils/logo');
1922
const controlPanel = require('./control-panel');
@@ -23,7 +26,6 @@ const {
2326
system, logger, program, exceptions, os_name, os_release,
2427
} = common;
2528

26-
const { isBoolean } = require('./utils/utilsprey');
2729
const config = require('../utils/configfile');
2830
const fetchEnvVar = require('../utils/fetch-env-var');
2931

@@ -33,8 +35,6 @@ let startedAt = null;
3335
let runningAs = null;
3436

3537
const isRunning = () => running;
36-
37-
// eslint-disable-next-line consistent-return
3838
const runFromCommandLine = () => {
3939
if (!program.debug) logger.pause();
4040

@@ -52,8 +52,6 @@ const isNetworkError = (err) => {
5252
const codes = ['ENETDOWN', 'ENETUNREACH', 'EADDRINFO', 'ENOTFOUND'];
5353
return codes.indexOf(err.code) !== -1;
5454
};
55-
56-
// eslint-disable-next-line consistent-return
5755
const connectionDown = () => {
5856
if (!config.getData('auto_connect')) { return false; }
5957

@@ -177,7 +175,6 @@ const preyConfReconf = () => {
177175
setTimeout(correctDataTimedOut, 1000 * 60 * 5);
178176
setInterval(correctDataTimedOut, 1000 * 60 * 30);
179177
} else {
180-
// eslint-disable-next-line consistent-return
181178
getDataDb('preyconf', (_errorGetData, dataFromDb) => {
182179
if (dataFromDb && dataFromDb.length > 0) {
183180
const preyConfData = JSON.parse(dataFromDb[0].value);
@@ -192,7 +189,6 @@ const preyConfReconf = () => {
192189
const preyConfDataInside = JSON.parse(dataFromDbInside[0].value);
193190
if ((!dataShould || dataShould.localeCompare('false') === 0)
194191
&& preyConfDataInside['control-panel.device_key'] && preyConfDataInside['control-panel.api_key']) {
195-
// eslint-disable-next-line consistent-return
196192
return getDataFromShouldPreyCFile(reactToDataFromShouldPreyCFile);
197193
}
198194
}
@@ -213,9 +209,7 @@ const run = () => {
213209
if (running) return;
214210
running = true;
215211

216-
// eslint-disable-next-line consistent-return
217212
if (program.run) { return runFromCommandLine(); }
218-
// eslint-disable-next-line consistent-return
219213
config.load(() => {
220214
skippedPermissions.load(() => {
221215
try {
@@ -243,25 +237,24 @@ const run = () => {
243237
startedAt = new Date();
244238
writeHeader();
245239

246-
// eslint-disable-next-line consistent-return
247240
if (config.getData('auto_update') === false) return boot();
248241

249242
preyConfReconf();
250243
try {
251244
hasDeviceKeyApiKey(() => {
252245
updater.check_for_update((err) => {
253-
// eslint-disable-next-line consistent-return
254246
restore((msg) => {
247+
saveToDbKey('fenixReady', 'true', () => {});
255248
if (typeof msg === 'string') logger.info(msg);
256-
// eslint-disable-next-line consistent-return
249+
257250
if (err) return boot();
258251
});
259252
});
260253
});
261254
} catch (exception) {
262255
boot();
263256
}
264-
})
257+
});
265258
});
266259
};
267260

lib/agent/providers/hardware/mac.js

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,41 @@ const parseSystemProfilerProperties = (str) => {
2626
return obj;
2727
};
2828

29-
const callSystemProfiler = (type, cb) => {
30-
const cmd = `/usr/sbin/system_profiler ${type}`;
29+
const callSystemProfiler = (type, cb, json = false) => {
30+
const cmd = `/usr/sbin/system_profiler ${type} ${json ? '-json' : ''}`;
3131
exec(cmd, cb);
3232
};
3333

34-
const getSystemProfilerData = (type, cb) => {
34+
const getSystemProfilerData = (type, cb, json = false) => {
3535
callSystemProfiler(type, (err, stdout) => {
3636
if (err) return cb(err);
3737
const obj = parseSystemProfilerProperties(stdout);
3838
cb(null, obj);
39-
});
39+
}, json);
4040
};
4141

4242
exports.get_firmware_info = (callback) => {
4343
getSystemProfilerData('SPHardwareDataType', (err, spData) => {
4444
if (err) return callback(err);
45-
const data = {
46-
device_type: spData.model_name.indexOf('Book') === -1 ? 'Desktop' : 'Laptop',
47-
model_name: spData.model_name,
48-
vendor_name: 'Apple',
49-
bios_vendor: 'Apple',
50-
bios_version: spData.boot_rom_version,
51-
mb_version: (system.is_m1_or_m2()) ? system.get_info_chip() : spData['smc_version_(system)'],
52-
serial_number: spData['serial_number_(system)'],
53-
uuid: spData.hardware_uuid,
54-
};
55-
callback(null, data);
45+
getSystemProfilerData('SPiBridgeDataType', (errSpi, spiData) => {
46+
let modelNameSecurityChip = '';
47+
if (!errSpi && spiData && Object.prototype.hasOwnProperty.call(spiData, 'ibridge_model_name')) {
48+
modelNameSecurityChip = spiData.ibridge_model_name;
49+
}
50+
const data = {
51+
device_type: spData.model_name.indexOf('Book') === -1 ? 'Desktop' : 'Laptop',
52+
model_name: spData.model_name,
53+
vendor_name: 'Apple',
54+
bios_vendor: 'Apple',
55+
bios_version: spData.boot_rom_version,
56+
mb_version: (system.is_m1_or_m2()) ? system.get_info_chip() : spData['smc_version_(system)'],
57+
serial_number: spData['serial_number_(system)'],
58+
uuid: spData.hardware_uuid,
59+
apple_security_chip: modelNameSecurityChip,
60+
};
61+
62+
callback(null, data);
63+
}, true);
5664
});
5765
};
5866

@@ -111,8 +119,7 @@ exports.get_osquery_running = (cb) => {
111119
const matchResult = stdout.match(/\d+/);
112120
if (matchResult && !Number.isNaN(Number(matchResult[0]))) {
113121
return cb(null, true, 'osquery_running');
114-
} else {
115-
return cb(null, false, 'osquery_running');
116122
}
123+
return cb(null, false, 'osquery_running');
117124
});
118125
};

0 commit comments

Comments
 (0)