You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
42 KiB

5 years ago
/* fp@iotcat v2.0.1 */
;(function(e,r,a){"use strict";if(typeof window!=="undefined"&&typeof define==="function"&&define.amd){define(a)}else if(typeof module!=="undefined"&&module.exports){module.exports=a()}else if(r.exports){r.exports=a()}else{r[e]=a()}})("fp",this,function(){"use strict";var l=.8;var f=function(e,r){e=[e[0]>>>16,e[0]&65535,e[1]>>>16,e[1]&65535];r=[r[0]>>>16,r[0]&65535,r[1]>>>16,r[1]&65535];var a=[0,0,0,0];a[3]+=e[3]+r[3];a[2]+=a[3]>>>16;a[3]&=65535;a[2]+=e[2]+r[2];a[1]+=a[2]>>>16;a[2]&=65535;a[1]+=e[1]+r[1];a[0]+=a[1]>>>16;a[1]&=65535;a[0]+=e[0]+r[0];a[0]&=65535;return[a[0]<<16|a[1],a[2]<<16|a[3]]};var d=function(e,r){e=[e[0]>>>16,e[0]&65535,e[1]>>>16,e[1]&65535];r=[r[0]>>>16,r[0]&65535,r[1]>>>16,r[1]&65535];var a=[0,0,0,0];a[3]+=e[3]*r[3];a[2]+=a[3]>>>16;a[3]&=65535;a[2]+=e[2]*r[3];a[1]+=a[2]>>>16;a[2]&=65535;a[2]+=e[3]*r[2];a[1]+=a[2]>>>16;a[2]&=65535;a[1]+=e[1]*r[3];a[0]+=a[1]>>>16;a[1]&=65535;a[1]+=e[2]*r[2];a[0]+=a[1]>>>16;a[1]&=65535;a[1]+=e[3]*r[1];a[0]+=a[1]>>>16;a[1]&=65535;a[0]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0];a[0]&=65535;return[a[0]<<16|a[1],a[2]<<16|a[3]]};var g=function(e,r){r%=64;if(r===32){return[e[1],e[0]]}else if(r<32){return[e[0]<<r|e[1]>>>32-r,e[1]<<r|e[0]>>>32-r]}else{r-=32;return[e[1]<<r|e[0]>>>32-r,e[0]<<r|e[1]>>>32-r]}};var v=function(e,r){r%=64;if(r===0){return e}else if(r<32){return[e[0]<<r|e[1]>>>32-r,e[1]<<r]}else{return[e[1]<<r-32,0]}};var h=function(e,r){return[e[0]^r[0],e[1]^r[1]]};var m=function(e){e=h(e,[0,e[0]>>>1]);e=d(e,[4283543511,3981806797]);e=h(e,[0,e[0]>>>1]);e=d(e,[3301882366,444984403]);e=h(e,[0,e[0]>>>1]);return e};var s=function(e,r){e=e||"";r=r||0;var a=e.length%16;var t=e.length-a;var n=[0,r];var i=[0,r];var o=[0,0];var u=[0,0];var l=[2277735313,289559509];var s=[1291169091,658871167];for(var c=0;c<t;c=c+16){o=[e.charCodeAt(c+4)&255|(e.charCodeAt(c+5)&255)<<8|(e.charCodeAt(c+6)&255)<<16|(e.charCodeAt(c+7)&255)<<24,e.charCodeAt(c)&255|(e.charCodeAt(c+1)&255)<<8|(e.charCodeAt(c+2)&255)<<16|(e.charCodeAt(c+3)&255)<<24];u=[e.charCodeAt(c+12)&255|(e.charCodeAt(c+13)&255)<<8|(e.charCodeAt(c+14)&255)<<16|(e.charCodeAt(c+15)&255)<<24,e.charCodeAt(c+8)&255|(e.charCodeAt(c+9)&255)<<8|(e.charCodeAt(c+10)&255)<<16|(e.charCodeAt(c+11)&255)<<24];o=d(o,l);o=g(o,31);o=d(o,s);n=h(n,o);n=g(n,27);n=f(n,i);n=f(d(n,[0,5]),[0,1390208809]);u=d(u,s);u=g(u,33);u=d(u,l);i=h(i,u);i=g(i,31);i=f(i,n);i=f(d(i,[0,5]),[0,944331445])}o=[0,0];u=[0,0];switch(a){case 15:u=h(u,v([0,e.charCodeAt(c+14)],48));case 14:u=h(u,v([0,e.charCodeAt(c+13)],40));case 13:u=h(u,v([0,e.charCodeAt(c+12)],32));case 12:u=h(u,v([0,e.charCodeAt(c+11)],24));case 11:u=h(u,v([0,e.charCodeAt(c+10)],16));case 10:u=h(u,v([0,e.charCodeAt(c+9)],8));case 9:u=h(u,[0,e.charCodeAt(c+8)]);u=d(u,s);u=g(u,33);u=d(u,l);i=h(i,u);case 8:o=h(o,v([0,e.charCodeAt(c+7)],56));case 7:o=h(o,v([0,e.charCodeAt(c+6)],48));case 6:o=h(o,v([0,e.charCodeAt(c+5)],40));case 5:o=h(o,v([0,e.charCodeAt(c+4)],32));case 4:o=h(o,v([0,e.charCodeAt(c+3)],24));case 3:o=h(o,v([0,e.charCodeAt(c+2)],16));case 2:o=h(o,v([0,e.charCodeAt(c+1)],8));case 1:o=h(o,[0,e.charCodeAt(c)]);o=d(o,l);o=g(o,31);o=d(o,s);n=h(n,o)}n=h(n,[0,e.length]);i=h(i,[0,e.length]);n=f(n,i);i=f(i,n);n=m(n);i=m(i);n=f(n,i);i=f(i,n);return("00000000"+(n[0]>>>0).toString(16)).slice(-8)+("00000000"+(n[1]>>>0).toString(16)).slice(-8)+("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)};var e={preprocessor:null,audio:{timeout:1e3,excludeIOS11:true},fonts:{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",userDefinedFonts:[],extendedJsFonts:false},screen:{detectScreenOrientation:true},plugins:{sortPluginsFor:[/palemoon/i],excludeIE:false},extraComponents:[],excludes:{enumerateDevices:true,pixelRatio:true,doNotTrack:true,fontsFlash:true},NOT_AVAILABLE:"not available",ERROR:"error",EXCLUDED:"excluded"};var p=function(e,r){if(Array.prototype.forEach&&e.forEach===Array.prototype.forEach){e.forEach(r)}else if(e.length===+e.length){for(var a=0,t=e.length;a<t;a++){r(e[a],a,e)}}else{for(var n in e){if(e.hasOwnProperty(n)){r(e[n],n,e)}}}};var u=function(e
5 years ago
/* reconnecting-websocket@joewalnes v1.0.0 */
!function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof module&&module.exports?module.exports=b():a.ReconnectingWebSocket=b()}(this,function(){function a(b,c,d){function l(a,b){var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,!1,!1,b),c}var e={debug:!1,automaticOpen:!0,reconnectInterval:1e3,maxReconnectInterval:3e4,reconnectDecay:1.5,timeoutInterval:2e3};d||(d={});for(var f in e)this[f]="undefined"!=typeof d[f]?d[f]:e[f];this.url=b,this.reconnectAttempts=0,this.readyState=WebSocket.CONNECTING,this.protocol=null;var h,g=this,i=!1,j=!1,k=document.createElement("div");k.addEventListener("open",function(a){g.onopen(a)}),k.addEventListener("close",function(a){g.onclose(a)}),k.addEventListener("connecting",function(a){g.onconnecting(a)}),k.addEventListener("message",function(a){g.onmessage(a)}),k.addEventListener("error",function(a){g.onerror(a)}),this.addEventListener=k.addEventListener.bind(k),this.removeEventListener=k.removeEventListener.bind(k),this.dispatchEvent=k.dispatchEvent.bind(k),this.open=function(b){h=new WebSocket(g.url,c||[]),b||k.dispatchEvent(l("connecting")),(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","attempt-connect",g.url);var d=h,e=setTimeout(function(){(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","connection-timeout",g.url),j=!0,d.close(),j=!1},g.timeoutInterval);h.onopen=function(){clearTimeout(e),(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onopen",g.url),g.protocol=h.protocol,g.readyState=WebSocket.OPEN,g.reconnectAttempts=0;var d=l("open");d.isReconnect=b,b=!1,k.dispatchEvent(d)},h.onclose=function(c){if(clearTimeout(e),h=null,i)g.readyState=WebSocket.CLOSED,k.dispatchEvent(l("close"));else{g.readyState=WebSocket.CONNECTING;var d=l("connecting");d.code=c.code,d.reason=c.reason,d.wasClean=c.wasClean,k.dispatchEvent(d),b||j||((g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onclose",g.url),k.dispatchEvent(l("close")));var e=g.reconnectInterval*Math.pow(g.reconnectDecay,g.reconnectAttempts);setTimeout(function(){g.reconnectAttempts++,g.open(!0)},e>g.maxReconnectInterval?g.maxReconnectInterval:e)}},h.onmessage=function(b){(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onmessage",g.url,b.data);var c=l("message");c.data=b.data,k.dispatchEvent(c)},h.onerror=function(b){(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onerror",g.url,b),k.dispatchEvent(l("error"))}},1==this.automaticOpen&&this.open(!1),this.send=function(b){if(h)return(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","send",g.url,b),h.send(b);throw"INVALID_STATE_ERR : Pausing to reconnect websocket"},this.close=function(a,b){"undefined"==typeof a&&(a=1e3),i=!0,h&&h.close(a,b)},this.refresh=function(){h&&h.close()}}return a.prototype.onopen=function(){},a.prototype.onclose=function(){},a.prototype.onconnecting=function(){},a.prototype.onmessage=function(){},a.prototype.onerror=function(){},a.debugAll=!1,a.CONNECTING=WebSocket.CONNECTING,a.OPEN=WebSocket.OPEN,a.CLOSING=WebSocket.CLOSING,a.CLOSED=WebSocket.CLOSED,a});
/* page reload */
$('title').remove();
$('head').append('<title>' + page.title + '</title>');
$('[rel="icon"]').remove();
$('head').append('<link rel="icon" type="image/x-icon" href="' + page.icon + '">');
if(!$('[name="viewport"]').length) {
$('head').append('<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">');
}
if(!$('[name="keywords"]').length) {
$('head').append('<meta name="keywords" content="Ushio,iotcat,yimian">');
}
if(!$('[name="description"]').length) {
$('head').append('<meta name="description" content="小汐の页">');
}
/* out&in event amine */
function getHiddenProp() {
var prefixes = ['webkit', 'moz', 'ms', 'o'];
if ('hidden' in document) return 'hidden';
for (var i = 0; i < prefixes.length; i++) {
if ((prefixes[i] + 'Hidden') in document)
return prefixes[i] + 'Hidden';
}
return null;
}
function getVisibilityState() {
var prefixes = ['webkit', 'moz', 'ms', 'o'];
if ('visibilityState' in document) return 'visibilityState';
for (var i = 0; i < prefixes.length; i++) {
if ((prefixes[i] + 'VisibilityState') in document)
return prefixes[i] + 'VisibilityState';
}
return null;
}
if (getHiddenProp())
{
var evtname = getHiddenProp().replace(/[H|h]idden/, '') + 'visibilitychange';
document.addEventListener(evtname, function ()
{
if(document[getVisibilityState()] == "hidden") {
5 years ago
page.ws.close();
delete page.ws;
log_update();
var rand = Math.random() * 100;
if(rand < 30) document.title = '啊咧(⊙0⊙)';
else if(rand < 55) document.title = '快来戳我呀( ´∀`)σ';
else if(rand < 75) document.title = '躲起来(´・ω・`)';
else document.title = '哎呦,页面崩掉了吗(>﹏<)';
setTimeout("document.title = page.title", 2400);
clearInterval(page.TimerObj);
page.TimerObj = null;
}
if(document[getVisibilityState()] == "visible") {
document.title = page.title;
5 years ago
session_ini();
if(page.TimerObj == null) page.TimerObj = setInterval("page.Timer++", 1000);
}
}, false);
}
/* log */
function log_ini() {
5 years ago
if(page.params['fpKey'] == undefined || page.params['fpKey'].length < 20){
fp(fp_callback);
}else{
fp(page.params['fpKey'], fp_callback);
}
}
function fp_callback(myFp, key, acc, detail, createdTime, timeUsed, detailObj) {
page.fp = myFp;
5 years ago
page.fpKey = key;
5 years ago
session_ini();
$.post("https://log.yimian.xyz/iis.php",{
"fp":myFp,
5 years ago
"url": page.url,
"lang": detailObj.language,
"timezone": detailObj.timezone,
"platform": detailObj.platform,
"ram": detailObj.deviceMemory,
"screen": detailObj.screenResolution,
"userAgent": detailObj.userAgent,
"webgl": detailObj.webglVendorAndRenderer
}, function(res){
page.sid = JSON.parse(res).sid;
page.ip = JSON.parse(res).ip;
5 years ago
if(session.status) drawBrand();
else setTimeout(drawBrand, 1000);
5 years ago
updateHref();
});
}
function log_update() {
$.post('https://log.yimian.xyz/iis.php',{
"sid": page.sid,
"sessiontime": page.Timer
})
}
setTimeout("log_ini();", 800);
5 years ago
/* update the href in <a> with fp and from*/
function updateHref(){
5 years ago
if(page.url.indexOf('?fpKey=') != -1) window.history.replaceState(null, 'ushio', page.url.substr(0, page.url.indexOf('?fpKey=')));
if(page.url.indexOf('&fpKey=') != -1) window.history.replaceState(null, 'ushio', page.url.substr(0, page.url.indexOf('&fpKey=')));
5 years ago
var links = $(document).find("a");
for(var index in links) {
var _href = links.eq(index).attr("href");
5 years ago
var _id = (links.eq(index).attr("id"));
if(_id) _id = _id.substr(0, 5);
5 years ago
if(_href != null) {
5 years ago
if(_href.indexOf("?") == -1 && _id == "ushio") links.eq(index).attr("href",_href + "?fpKey=" + page.fp + ((page.host) ? ("&from=https://"+page.host) : ""));
else if(_id == "ushio") links.eq(index).attr("href",_href + "&fpKey=" + page.fp + ((page.host) ? ("&from=https://"+page.host) : ""));
5 years ago
}
}
};
5 years ago
/* connect to session server */
function session_ini(){
page.ws = new ReconnectingWebSocket("wss://session.yimian.xyz:21515?fp="+page.fp);
page.ws.maxReconnectInterval = 60;
page.ws.onopen = function(evt) {
if(session.status === false) console.log('Ushio - Session Connected!!');
session.status = true;
page.ws.send("get");
session.set = function(key, val){
page.session[key] = val;
page.session['LastOperateTime'] = (new Date()).valueOf();
page.ws.send('{"key":"'+key+'", "val": "'+val+'", "t":'+page.session.LastOperateTime+'}');
page.ws.send('get');
if(session.status) return true;
else return false;
}
session.get = function(key){
page.ws.send('get');
return page.session[key];
}
session.del = function(key){
delete page.session[key];
page.session['LastOperateTime'] = (new Date()).valueOf();
page.ws.send('{"del":"'+key+'"}');
page.ws.send('get');
if(session.status) return true;
else return false;
}
};
page.ws.onmessage = function(msg){
page.session = JSON.parse(msg.data);
}
page.ws.onerror = function(err){
console.log('Ushio - Session Error::'+JSON.stringify(err));
session.status = false;
}
page.ws.onclose = function(){
console.log('Ushio - Session Connection Lost!!');
session.status = false;
}
}
/* brand */
function drawBrand(){
console.log('\n' + ' %c Ushio v1.0.2 %c ' + page.ip + ' %c '+ ((session.status)?'Connected':'Unconnected') +' %c https://ushio.xyz \n', 'color: #FFFFCC; background: #030307; padding:5px 0;', 'color: #FF99FF; background: #030307; padding:5px 0;', 'color: '+((session.status)?'#91FF3A':'#FF2C33')+'; background: #030307; padding:5px 0;', 'background: #4682B4; padding:5px 0;');
}