Skip to content

Commit

Permalink
Updated with BLE keys
Browse files Browse the repository at this point in the history
  • Loading branch information
yoprogramo committed Jul 26, 2021
1 parent d6ea2fd commit 5b3ec00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
9 changes: 5 additions & 4 deletions lib/nomorepass.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ exports.getQrNomoreKeys = function (site, user, pass, type, extra, callback) {
// Protocol 2 reverse
// First we made grant then ping
// for nomorekeys phisical keys (soundkey or lightkey)
if (type!='SOUNDKEY' && type!='LIGHTKEY')
if (type!='SOUNDKEY' && type!='LIGHTKEY' && type!='BLEKEY')
return null;
if (site==null) {
// site is the id device of origin, if null use generic WEBDEVICE
Expand All @@ -248,9 +248,10 @@ exports.getQrNomoreKeys = function (site, user, pass, type, extra, callback) {
NoMorePass.ticket = data.ticket;
if (type=='SOUNDKEY'){
pass = pass.substr(0,14).padEnd(14," ");
} else {
pass=""+parseInt(pass)%65536;
}
} else
if (type=='LIGHTKEY'){
pass=""+parseInt(pass)%65536;
}
var ep = CryptoJS.AES.encrypt(pass, tk);
// Make the grant and return text
if (typeof extra == 'object') {
Expand Down
21 changes: 11 additions & 10 deletions www/js/nomorepass.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ var NomorePass = {
NomorePass.config = config;
}
if (!('getidUrl' in NomorePass.config))
NomorePass.config.getidUrl = "https://www.nomorepass.com/api/getid.php";
NomorePass.config.getidUrl = "https://nomorepass.com/api/getid.php";
if (!('checkUrl' in NomorePass.config))
NomorePass.config.checkUrl = "https://www.nomorepass.com/api/check.php";
NomorePass.config.checkUrl = "https://nomorepass.com/api/check.php";
if (!('authUrl' in NomorePass.config))
NomorePass.config.authUrl = "https://www.nomorepass.com/api/auth.php";
NomorePass.config.authUrl = "https://nomorepass.com/api/auth.php";
if (!('assocUrl' in NomorePass.config))
NomorePass.config.assocUrl = "https://www.nomorepass.com/api/assoc.php";
NomorePass.config.assocUrl = "https://nomorepass.com/api/assoc.php";
if (!('pingUrl' in NomorePass.config))
NomorePass.config.pingUrl = "https://www.nomorepass.com/api/ping.php";
NomorePass.config.pingUrl = "https://nomorepass.com/api/ping.php";
if (!('referenceUrl' in NomorePass.config))
NomorePass.config.referenceUrl = "https://www.nomorepass.com/api/reference.php";
NomorePass.config.referenceUrl = "https://nomorepass.com/api/reference.php";
if (!('grantUrl' in NomorePass.config))
NomorePass.config.grantUrl = "https://www.nomorepass.com/api/grant.php";
NomorePass.config.grantUrl = "https://nomorepass.com/api/grant.php";
if (!('apikey' in NomorePass.config))
NomorePass.config.apikey='FREEAPIKEY';
NomorePass.stopped = false;
Expand Down Expand Up @@ -179,7 +179,7 @@ var NomorePass = {
// Protocol 2 reverse
// First we made grant then ping
// for nomorekeys phisical keys (soundkey or lightkey)
if (type!='SOUNDKEY' && type!='LIGHTKEY')
if (type!='SOUNDKEY' && type!='LIGHTKEY' && type!='BLEKEY')
return null;
if (site==null) {
// site is the id device of origin, if null use generic WEBDEVICE
Expand All @@ -201,7 +201,8 @@ var NomorePass = {
NomorePass.ticket = data.ticket;
if (type=='SOUNDKEY'){
pass = pass.substr(0,14).padEnd(14," ");
} else {
} else
if (type=='LIGHTKEY') {
pass=""+parseInt(pass)%65536;
}
var ep = CryptoJS.AES.encrypt(pass, tk);
Expand Down Expand Up @@ -235,7 +236,7 @@ var NomorePass = {
console.log(response);
}
});
var text = 'nomorepass://SENDPASS'+tk+data.ticket+site;
var text = 'nomorepass://'+type+tk+data.ticket+site;
if (typeof callback == 'function') {
callback(text);
}
Expand Down

0 comments on commit 5b3ec00

Please sign in to comment.