mirror of
https://github.com/SilenceLurker/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 14:45:51 +00:00
1 line
7.6 KiB
JavaScript
1 line
7.6 KiB
JavaScript
const _0x530cc9=_0x3dbd;(function(_0x507895,_0x16c4c4){const _0x5a66be=_0x3dbd,_0x4708fe=_0x507895();while(!![]){try{const _0x3c6285=parseInt(_0x5a66be(0x12d))/0x1*(-parseInt(_0x5a66be(0x135))/0x2)+parseInt(_0x5a66be(0x13a))/0x3+parseInt(_0x5a66be(0x106))/0x4*(parseInt(_0x5a66be(0x11f))/0x5)+parseInt(_0x5a66be(0x100))/0x6*(parseInt(_0x5a66be(0x121))/0x7)+parseInt(_0x5a66be(0x131))/0x8*(-parseInt(_0x5a66be(0x105))/0x9)+parseInt(_0x5a66be(0x13c))/0xa*(-parseInt(_0x5a66be(0x10d))/0xb)+parseInt(_0x5a66be(0x118))/0xc;if(_0x3c6285===_0x16c4c4)break;else _0x4708fe['push'](_0x4708fe['shift']());}catch(_0x5f2ebd){_0x4708fe['push'](_0x4708fe['shift']());}}}(_0x26b5,0x39b51));import{extension_settings}from'/scripts/extensions.js';import{saveSettings,extensionName}from'./settings.js';import{updateUI}from'../ui/state.js';export const pluginAuthStatus={'authorized':![],'expired':![]};function _0x3dbd(_0x515e61,_0x17f2b3){const _0x26b58c=_0x26b5();return _0x3dbd=function(_0x3dbd65,_0x397591){_0x3dbd65=_0x3dbd65-0xfd;let _0x19d677=_0x26b58c[_0x3dbd65];return _0x19d677;},_0x3dbd(_0x515e61,_0x17f2b3);}function _0x26b5(){const _0x20bcaa=['plugin_valid_until','[Amily2号]\x20授权有效期检查:\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20当前时间:\x20','11YoCGbx','getFullYear','#auth_panel','天\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<small>有效期至:\x20','expired','charAt','\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20','<div\x20class=\x22auth-status\x20expired\x22><i\x20class=\x22fas\x20fa-exclamation-triangle\x22></i>\x20授权已过期</div>','plugin_activated','2025-12-31','expiryDate','5874780UdJkgv','ceil','授权激活成功!','join','\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22auth-status\x20valid\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<i\x20class=\x22fas\x20fa-lock-open\x22></i>\x20授权有效期:\x20','seed','getDate','55UMisnh','true','76118RRrpcl','-AMILY_','</small>','plugin_auto_login','log','Amily2号启用','授权已过期','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20授权有效期至:\x20','ABCDEFGHJKLMNPQRSTUVWXYZ23456789','success','authorized','[Amily2号]\x20密码有效期为:\x20','16831hFewMI','setItem','removeItem','getItem','12520SMRIPl','setDate','push','abs','8TxnJBL','plugin_auth_code','天内将自动登录。','toISOString','toLocaleDateString','397122IQcvOu','授权码无效','3666800FpflhM','.plugin-features','slideDown','charCodeAt','enabled','validityDays','186ORnkfq','</small>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20是否在有效期内:\x20','激活失败','getMonth','2007AoGMhp','21940fqiERz','error','slideUp','[Amily2号]\x20密码匹配:\x20','\x20对应第'];_0x26b5=function(){return _0x20bcaa;};return _0x26b5();}const PASSWORD_VALIDITY_DAYS=0x7,AUTH_CONFIG={'expiryDate':new Date(_0x530cc9(0x116)),'validityDays':PASSWORD_VALIDITY_DAYS};console[_0x530cc9(0x125)](_0x530cc9(0x12c)+PASSWORD_VALIDITY_DAYS+'天');function generateDynamicPassword(_0x186fb0=new Date()){const _0x4ca3eb=_0x530cc9,_0x52703f={'a':0x41c64e6d,'c':0x3039,'m':0x7fffffff};function _0x19f426(_0x23ee6e){const _0xf4f987=_0x3dbd;let _0x55de8a=0x0;for(let _0x2015a4=0x0;_0x2015a4<_0x23ee6e['length'];_0x2015a4++){_0x55de8a=(_0x55de8a<<0x5)-_0x55de8a+_0x23ee6e[_0xf4f987(0xfd)](_0x2015a4),_0x55de8a|=0x0;}return _0x55de8a>>>0x0;}const _0x408939=_0x186fb0[_0x4ca3eb(0x104)]()+0x1,_0x56662c=_0x186fb0[_0x4ca3eb(0x11e)](),_0x2ffe75=_0x186fb0[_0x4ca3eb(0x10e)](),_0xd90ad=_0x408939+'-'+_0x56662c+_0x4ca3eb(0x122)+_0x2ffe75,_0x3093da='SD'+_0x19f426(_0xd90ad),_0x10fd3d='V'+_0x19f426(_0x3093da);function _0x9f83b0(_0x48d15e){return function(){const _0xb7491=_0x3dbd;return _0x48d15e[_0xb7491(0x11d)]=(_0x48d15e['a']*_0x48d15e[_0xb7491(0x11d)]+_0x48d15e['c'])%_0x48d15e['m'],_0x48d15e[_0xb7491(0x11d)];};}const _0x547686=_0x19f426(_0x10fd3d)%_0x52703f['m'],_0x14444b=_0x9f83b0({..._0x52703f,'seed':_0x547686}),_0x1d8f0b=_0x4ca3eb(0x129),_0x506d35=[];for(let _0x9b885d=0x0;_0x9b885d<0x3;_0x9b885d++){let _0xf76108='';for(let _0x386496=0x0;_0x386496<0x4;_0x386496++){const _0x5dd9bd=Math[_0x4ca3eb(0x134)](_0x14444b());_0xf76108+=_0x1d8f0b[_0x4ca3eb(0x112)](_0x5dd9bd%_0x1d8f0b['length']);}_0x506d35[_0x4ca3eb(0x133)](_0xf76108);}return _0x506d35[_0x4ca3eb(0x11b)]('-');}export function getPasswordForDate(_0x2ea9dc=new Date()){return generateDynamicPassword(_0x2ea9dc);}export function checkAuthorization(){const _0x580f59=_0x530cc9,_0x560a46=new Date();pluginAuthStatus[_0x580f59(0x111)]=_0x560a46>AUTH_CONFIG[_0x580f59(0x117)];pluginAuthStatus[_0x580f59(0x111)]&&(localStorage[_0x580f59(0x12f)](_0x580f59(0x115)),localStorage['removeItem'](_0x580f59(0x136)),localStorage['removeItem']('plugin_valid_until'),console[_0x580f59(0x125)]('[Amily2号]\x20检测到授权过期,已清理本地存储。'));const _0x56e9f8=localStorage[_0x580f59(0x130)]('plugin_activated')===_0x580f59(0x120),_0x43b99a=localStorage['getItem'](_0x580f59(0x136)),_0x2b5ee2=localStorage[_0x580f59(0x130)](_0x580f59(0x10b));let _0x31a722=![];if(_0x2b5ee2){const _0x42585c=new Date(_0x2b5ee2);_0x31a722=_0x560a46<=_0x42585c,console['log'](_0x580f59(0x10c)+_0x560a46['toISOString']()+_0x580f59(0x128)+_0x42585c[_0x580f59(0x138)]()+_0x580f59(0x102)+_0x31a722);}let _0x544bf2=![];if(_0x43b99a){const _0x5246d8=new Date();for(let _0x22b57b=0x0;_0x22b57b<AUTH_CONFIG['validityDays'];_0x22b57b++){const _0x30c393=new Date();_0x30c393[_0x580f59(0x132)](_0x5246d8[_0x580f59(0x11e)]()-_0x22b57b);const _0x345601=getPasswordForDate(_0x30c393);if(_0x43b99a===_0x345601){_0x544bf2=!![],console[_0x580f59(0x125)](_0x580f59(0x109)+_0x43b99a+_0x580f59(0x10a)+(_0x22b57b+0x1)+'天前');break;}}}return pluginAuthStatus[_0x580f59(0x12b)]=_0x56e9f8&&!pluginAuthStatus[_0x580f59(0x111)]&&_0x544bf2&&_0x31a722,pluginAuthStatus[_0x580f59(0x12b)];}export async function activatePluginAuthorization(_0x34c691){const _0x3824a5=_0x530cc9;let _0x4c26c5=![];const _0x46362d=new Date();for(let _0x4b2b39=0x0;_0x4b2b39<AUTH_CONFIG[_0x3824a5(0xff)];_0x4b2b39++){const _0x20eebe=new Date();_0x20eebe['setDate'](_0x46362d[_0x3824a5(0x11e)]()-_0x4b2b39);const _0x39f6e6=getPasswordForDate(_0x20eebe);if(_0x34c691===_0x39f6e6){_0x4c26c5=!![];break;}}if(!_0x4c26c5)return toastr[_0x3824a5(0x107)](_0x3824a5(0x13b),'激活失败'),![];const _0x228bc2=new Date();if(_0x228bc2>AUTH_CONFIG[_0x3824a5(0x117)])return toastr[_0x3824a5(0x107)](_0x3824a5(0x127),_0x3824a5(0x103)),![];const _0x34b6e8=new Date();return _0x34b6e8[_0x3824a5(0x132)](_0x228bc2[_0x3824a5(0x11e)]()+AUTH_CONFIG[_0x3824a5(0xff)]),localStorage[_0x3824a5(0x12e)](_0x3824a5(0x10b),_0x34b6e8['toISOString']()),localStorage[_0x3824a5(0x12e)](_0x3824a5(0x136),_0x34c691),localStorage[_0x3824a5(0x12e)](_0x3824a5(0x115),'true'),localStorage['setItem'](_0x3824a5(0x124),'true'),toastr[_0x3824a5(0x12a)](_0x3824a5(0x11a)+AUTH_CONFIG[_0x3824a5(0xff)]+_0x3824a5(0x137),_0x3824a5(0x126)),pluginAuthStatus[_0x3824a5(0x12b)]=!![],$(_0x3824a5(0x10f))[_0x3824a5(0x108)](0x190,function(){const _0x580c69=_0x3824a5;$(_0x580c69(0x13d))[_0x580c69(0x13e)](0x190),updateUI();}),extension_settings[extensionName][_0x3824a5(0xfe)]=!![],saveSettings(),!![];}export function displayExpiryInfo(){const _0xdb2fc8=_0x530cc9,_0x34bd1f=new Date(),_0x297f71=Math[_0xdb2fc8(0x119)]((AUTH_CONFIG[_0xdb2fc8(0x117)]-_0x34bd1f)/(0x3e8*0x3c*0x3c*0x18)),_0x324d66=localStorage[_0xdb2fc8(0x130)]('plugin_valid_until');if(pluginAuthStatus['expired'])return _0xdb2fc8(0x114);else{let _0x44dff3='';if(_0x324d66){const _0x561f12=new Date(_0x324d66);_0x44dff3='<small>当前授权有效期至:\x20'+_0x561f12[_0xdb2fc8(0x139)]()+_0xdb2fc8(0x123);}return _0xdb2fc8(0x11c)+_0x297f71+_0xdb2fc8(0x110)+AUTH_CONFIG[_0xdb2fc8(0x117)]['toLocaleDateString']()+_0xdb2fc8(0x101)+_0x44dff3+_0xdb2fc8(0x113);}} |