From c5379db46d121f3d0ed9038e438ab35b57d30f81 Mon Sep 17 00:00:00 2001 From: javo Date: Thu, 28 Jun 2018 15:39:57 -0400 Subject: [PATCH] Force wifi on and exceptions post fix --- lib/agent/providers/network/index.js | 8 ++++---- .../triggers/auto-connect/bin/ManagedWifi.dll | Bin 0 -> 40960 bytes lib/agent/triggers/auto-connect/bin/wifion.exe | Bin 0 -> 15944 bytes lib/agent/triggers/auto-connect/windows.js | 6 ++++-- lib/agent/triggers/connection/index.js | 11 +++++++++-- lib/conf/tasks/index.js | 2 +- lib/exceptions.js | 3 ++- 7 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 lib/agent/triggers/auto-connect/bin/ManagedWifi.dll create mode 100644 lib/agent/triggers/auto-connect/bin/wifion.exe diff --git a/lib/agent/providers/network/index.js b/lib/agent/providers/network/index.js index 7b94dc7ba..0058a61d6 100644 --- a/lib/agent/providers/network/index.js +++ b/lib/agent/providers/network/index.js @@ -95,12 +95,13 @@ exp.get_active_access_point = function(callback) { if (callback) ap_callbacks.push(callback); if (getting_ap) return; + getting_ap = true; var done = function(err, ap) { + getting_ap = false; if (!err & ap) active_access_point = ap; if (ap_callbacks.length >= 1) { fire_callbacks(err, ap); } - getting_ap = false; } var fire_callbacks = function(err, ap) { @@ -111,13 +112,12 @@ exp.get_active_access_point = function(callback) { }); } - getting_ap = true; os_functions.get_active_access_point_mac(function(err, ap_mac) { if (err || !ap_mac) - return callback(err || new Error('No active access point found.')); + return done(err || new Error('No active access point found.')); exp.get_access_points_list(function(err, aps) { - if (err) return callback(err); + if (err) return done(err); var padded_mac = ap_mac.toString().trim().replace(/(^|:)(?=[0-9a-fA-F](?::|$))/g, "$10"); diff --git a/lib/agent/triggers/auto-connect/bin/ManagedWifi.dll b/lib/agent/triggers/auto-connect/bin/ManagedWifi.dll new file mode 100644 index 0000000000000000000000000000000000000000..5b524a67693a4f43d571c197a3e5b44a992fefbd GIT binary patch literal 40960 zcmeHwdw5&bmG3&|NJkGpV%d2(@k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(E?G zepQnhb9(jmHS?E>-AU6^!8vmt*`2BP`u_X|$J9k*RxGs$o!eu^K)VmMa{_sf^I5(% z7dtLC?`ah4TjsjL)-N?S&AsH3NJRV?GbP$>kMN`TI}On{;UT}v{oY5T0$&fGIr*1W zhr-UyQEv0H+xOD@3eoG2>DOluKef8l>*L*;*n+a literal 0 HcmV?d00001 diff --git a/lib/agent/triggers/auto-connect/windows.js b/lib/agent/triggers/auto-connect/windows.js index c6faaedf7..8e4749cab 100644 --- a/lib/agent/triggers/auto-connect/windows.js +++ b/lib/agent/triggers/auto-connect/windows.js @@ -2,6 +2,7 @@ var fs = require('fs'), join = require('path').join, xml2js = require('xml2js'), exec = require('child_process').exec, + wifion = join(__dirname, 'bin', 'wifion'), tmpdir = process.platform == 'win32' ? process.env.WINDIR + '\\Temp' : '/tmp'; var profile_json = { @@ -52,8 +53,9 @@ var generate_xml = function(ssid, cb) { } exports.enable_wifi = function(cb) { - // To Do: Find a way to turn on wifi on windows - return cb(); + exec(wifion, function(err) { + return cb(); + }); } var delete_xml = function(ssid, cb) { diff --git a/lib/agent/triggers/connection/index.js b/lib/agent/triggers/connection/index.js index efebefb1b..31b020092 100644 --- a/lib/agent/triggers/connection/index.js +++ b/lib/agent/triggers/connection/index.js @@ -11,8 +11,13 @@ var emitter, interval_checker; var get_current_status = function(cb) { - is_online({ retries: 0 }) - .then(cb('connected')) + is_online({ + timeout: 1000, + retries: 0 + }) + .then(function() { + cb('connected'); + }) .catch(function() { network.get_connection_status(function(new_status) { cb(new_status); @@ -38,6 +43,7 @@ var check_status = function() { exports.start = function(opts, cb) { check_status(); hooks.on('network_state_changed', check_status); + hooks.on('disconnect', network.reset_active_access_point); // Connection Heartbeat // todo @lemavri Dinamically change interval from // 15-60 seconds if status remains. Reset otherwise @@ -50,6 +56,7 @@ exports.start = function(opts, cb) { exports.stop = function(cb) { hooks.remove('network_state_changed', check_status); + hooks.remove('disconnect'); clearInterval(interval_checker); if (emitter) { emitter.removeAllListeners(); diff --git a/lib/conf/tasks/index.js b/lib/conf/tasks/index.js index 4e8e574aa..00c1afafa 100755 --- a/lib/conf/tasks/index.js +++ b/lib/conf/tasks/index.js @@ -103,7 +103,7 @@ exports.post_install = function(values, cb) { if (err) return cb(err); var finished = function() { - log('Sweet! Please run `prey config gui` to finish installation.'); + log('Sweet! Please run `prey config panel` or `prey config gui` to link your device.'); return cb && cb(); } // After the installation success create prey user watcher (on mac's) diff --git a/lib/exceptions.js b/lib/exceptions.js index 8a03e2c24..6c4b5e9aa 100644 --- a/lib/exceptions.js +++ b/lib/exceptions.js @@ -1,7 +1,8 @@ var client = require('needle'), host = 'http://exceptions.preyproject.com'; -var opts = { +var opts = { + json: true, timeout: 4500 };