Skip to content

Instantly share code, notes, and snippets.

@wfjsw
Last active August 31, 2023 07:56
Show Gist options
  • Save wfjsw/5c18ceaaa6938b8f603d067e82664909 to your computer and use it in GitHub Desktop.
Save wfjsw/5c18ceaaa6938b8f603d067e82664909 to your computer and use it in GitHub Desktop.
const askhyZESMiTa = "aMq0Vk2QThOJ1qsK";
const asirwND73kx2 = "bENVgtN9llqTCWPS";
const ackQjV8pRLFF = "dKyBVluERbCaupYE";
const aciaallf8z0Q = "fZsaKttlA5A8GX7A";
const dskhXKbQZi19 = "hKVw3rIJQJlHirdh";
const dsizKZaAJQLb = "xH8I8jYDZY33QzJJ";
const dckvUcTa9vft = "oz2zCOI3ow8YN1gJ";
const dciZ7hxfi8SC = "ph4oq7nooy3NnkRE";
const aes_local_key = 'emhlbnFpcGFsbWtleQ==';
const aes_local_iv = 'emhlbnFpcGFsbWl2';
var BASE64 = {
encrypt: function (text) {
var b = new Base64();
return b.encode(text)
},
decrypt: function (text) {
var b = new Base64();
return b.decode(text)
}
};
var DES = {
encrypt: function (text, key, iv) {
var secretkey = (CryptoJS.MD5(key).toString()).substr(0, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(24, 8);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.DES.encrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString()
},
decrypt: function (text, key, iv) {
var secretkey = (CryptoJS.MD5(key).toString()).substr(0, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(24, 8);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.DES.decrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString(CryptoJS.enc.Utf8)
}
};
var AES = {
encrypt: function (text, key, iv) {
var secretkey = (CryptoJS.MD5(key).toString()).substr(16, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(0, 16);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.AES.encrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString()
},
decrypt: function (text, key, iv) {
var secretkey = (CryptoJS.MD5(key).toString()).substr(16, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(0, 16);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.AES.decrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString(CryptoJS.enc.Utf8)
}
};
var localStorageUtil = {
save: function (name, value) {
var text = JSON.stringify(value);
text = BASE64.encrypt(text);
text = AES.encrypt(text, aes_local_key, aes_local_iv);
try {
localStorage.setItem(name, text)
} catch (oException) {
if (oException.name === 'QuotaExceededError') {
console.log('Local limit exceeded');
localStorage.clear();
localStorage.setItem(name, text)
}
}
},
check: function (name) {
return localStorage.getItem(name)
},
getValue: function (name) {
var text = localStorage.getItem(name);
var result = null;
if (text) {
text = AES.decrypt(text, aes_local_key, aes_local_iv);
text = BASE64.decrypt(text);
result = JSON.parse(text)
}
return result
},
remove: function (name) {
localStorage.removeItem(name)
}
};
function gHXWDFQIQgkKkVCY(key, period) {
if (typeof period === 'undefined') {
period = 0
}
var d = DES.encrypt(key);
d = BASE64.encrypt(key);
var data = localStorageUtil.getValue(key);
if (data) {
const time = data.time;
const current = new Date().getTime();
if (new Date().getHours() >= 0 && new Date().getHours() < 5 && period > 1) {
period = 1
}
if (current - (period * 60 * 60 * 1000) > time) {
data = null
}
if (new Date().getHours() >= 5 && new Date(time).getDate() !== new Date().getDate() && period === 24) {
data = null
}
}
return data
}
function osvnuOOjUj(obj) {
var newObject = {};
Object.keys(obj).sort().map(function (key) {
newObject[key] = obj[key]
});
return newObject
}
function dSp17P6wE1CFXC6D(data) {
data = BASE64.decrypt(data);
data = DES.decrypt(data, dskhXKbQZi19, dsizKZaAJQLb);
data = AES.decrypt(data, askhyZESMiTa, asirwND73kx2);
data = BASE64.decrypt(data);
return data
}
var p3cnrDIfVp = (function () {
function osvnuOOjUj(obj) {
var newObject = {};
Object.keys(obj).sort().map(function (key) {
newObject[key] = obj[key]
});
return newObject
}
return function (mAfre3O9d, oPKQj9) {
var a3JB = '94db838b2ef213aaf72dac81f2073805';
var cN0OK = 'WEB';
var toTJ9XN = new Date().getTime();
var pqq15DU = {
appId: a3JB,
method: mAfre3O9d,
timestamp: toTJ9XN,
clienttype: cN0OK,
object: oPKQj9,
secret: hex_md5(a3JB + mAfre3O9d + toTJ9XN + cN0OK + JSON.stringify(osvnuOOjUj(oPKQj9)))
};
pqq15DU = BASE64.encrypt(JSON.stringify(pqq15DU));
pqq15DU = DES.encrypt(pqq15DU, dckvUcTa9vft, dciZ7hxfi8SC);
return pqq15DU
}
})();
function srXY9Y1XQRaq7GPCj(mAfre3O9d, oywGO2usiQ, c9lW53jNA, prR3ENZ) {
const kHL5 = hex_md5(mAfre3O9d + JSON.stringify(oywGO2usiQ));
const dQgJN = gHXWDFQIQgkKkVCY(kHL5, prR3ENZ);
if (!dQgJN) {
var pqq15DU = p3cnrDIfVp(mAfre3O9d, oywGO2usiQ);
$.ajax({
url: 'api/historyapi.php',
data: {
hmebd5PRa: pqq15DU
},
type: "post",
success: function (dQgJN) {
dQgJN = dSp17P6wE1CFXC6D(dQgJN);
oPKQj9 = JSON.parse(dQgJN);
if (oPKQj9.success) {
if (prR3ENZ > 0) {
oPKQj9.result.time = new Date().getTime();
localStorageUtil.save(kHL5, oPKQj9.result)
}
c9lW53jNA(oPKQj9.result)
} else {
console.log(oPKQj9.errcode, oPKQj9.errmsg)
}
}
})
} else {
c9lW53jNA(dQgJN)
}
}
function endebug(off, code) {
if (!off) {
!function(e) {
function n(e) {
function n() {
return u
}
function o() {
window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized ? t("on") : (a = "off",
console.log(d),
console.clear(),
t(a))
}
function t(e) {
u !== e && (u = e,
"function" == typeof c.onchange && c.onchange(e))
}
function r() {
l || (l = !0,
window.removeEventListener("resize", o),
clearInterval(f))
}
"function" == typeof e && (e = {
onchange: e
});
var i = (e = e || {}).delay || 500
, c = {};
c.onchange = e.onchange;
var a, d = new Image;
d.__defineGetter__("id", function() {
a = "on"
});
var u = "unknown";
c.getStatus = n;
var f = setInterval(o, i);
window.addEventListener("resize", o);
var l;
return c.free = r,
c
}
var o = o || {};
o.create = n,
"function" == typeof define ? (define.amd || define.cmd) && define(function() {
return o
}) : "undefined" != typeof module && module.exports ? module.exports = o : window.jdetects = o
}(),
jdetects.create(function(e) {
var a = 0;
var n = setInterval(function() {
if ("on" == e) {
setTimeout(function() {
if (a == 0) {
a = 1;
setTimeout(code)
}
}, 200)
}
}, 100)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment