From e3ad7b36e33d4a8a10ffc34d3b4205cd30eb1ec4 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Thu, 27 Nov 2025 21:38:33 +0800 Subject: [PATCH] Update auth.js --- utils/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/auth.js b/utils/auth.js index d7625dd..cb90c0d 100644 --- a/utils/auth.js +++ b/utils/auth.js @@ -1 +1 @@ -function _0x5943(_0x27efe6,_0x2b1f1f){const _0x488ccd=_0x488c();return _0x5943=function(_0x594375,_0x4f86c2){_0x594375=_0x594375-0x118;let _0x2779dd=_0x488ccd[_0x594375];return _0x2779dd;},_0x5943(_0x27efe6,_0x2b1f1f);}function _0x488c(){const _0x2d20da=['authorized','201ngwizO','','toISOString','padStart','授权码无效或服务器连接失败','http://accdn.silencelurker.xyz:2086','ceil','removeItem','#auth_panel','[Amily2号]\x20检测到授权已过期,已清理本地存储。','getDate','toLocaleDateString','3389600cJYYqr','\x20授权已过期','slideDown','\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20授权有效期:\x20','getItem','setItem','.plugin-features','每日授权激活成功!有效期至:\x20','plugin_activated','plugin_auto_login','error','服务器验证连接失败,尝试本地验证...','Amily2号启用','12052894geKlDl','getFullYear','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','激活失败','241908eoKmcK','67624XnSnEI','success','expiryDate','getMonth','plugin_user_type','天\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20有效期至:\x20','json','3582815XhMPxt','2025-12-31','type','stringify','Amily-','793400xoeXih','true','当前授权有效期至:\x20','plugin_valid_until','enabled','expired','warn','setDate','application/json','15540712FMwvFZ','plugin_auth_code','\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20'];_0x488c=function(){return _0x2d20da;};return _0x488c();}const _0x4de1b4=_0x5943;(function(_0x53ab51,_0x17120a){const _0x50342f=_0x5943,_0x2740dc=_0x53ab51();while(!![]){try{const _0x22b808=parseInt(_0x50342f(0x12c))/0x1+-parseInt(_0x50342f(0x145))/0x2+parseInt(_0x50342f(0x139))/0x3*(-parseInt(_0x50342f(0x120))/0x4)+-parseInt(_0x50342f(0x127))/0x5+parseInt(_0x50342f(0x11f))/0x6+parseInt(_0x50342f(0x11b))/0x7+parseInt(_0x50342f(0x135))/0x8;if(_0x22b808===_0x17120a)break;else _0x2740dc['push'](_0x2740dc['shift']());}catch(_0x5c6a26){_0x2740dc['push'](_0x2740dc['shift']());}}}(_0x488c,0xe8ee4));import{extension_settings}from'/scripts/extensions.js';import{saveSettings,extensionName}from'./settings.js';import{updateUI}from'../ui/state.js';export const pluginAuthStatus={'authorized':![],'expired':![]};const SERVER_URL=_0x4de1b4(0x13e),AUTH_CONFIG={'expiryDate':new Date(_0x4de1b4(0x128))};export function getPasswordForDate(_0x14c29d){const _0xa039e3=_0x4de1b4,_0x410c69=_0x14c29d[_0xa039e3(0x11c)](),_0x14b8f7=String(_0x14c29d[_0xa039e3(0x123)]()+0x1)[_0xa039e3(0x13c)](0x2,'0'),_0x3e019d=String(_0x14c29d[_0xa039e3(0x143)]())[_0xa039e3(0x13c)](0x2,'0');return _0xa039e3(0x12b)+_0x410c69+_0x14b8f7+_0x3e019d;}export function checkAuthorization(){const _0x58e269=_0x4de1b4,_0x110a46=new Date(),_0x2960ce=localStorage['getItem'](_0x58e269(0x12f));if(_0x2960ce){const _0x68cff9=new Date(_0x2960ce);_0x110a46>_0x68cff9?pluginAuthStatus[_0x58e269(0x131)]=!![]:pluginAuthStatus['expired']=![];}else pluginAuthStatus[_0x58e269(0x131)]=_0x110a46>AUTH_CONFIG[_0x58e269(0x122)];pluginAuthStatus[_0x58e269(0x131)]&&(localStorage[_0x58e269(0x140)](_0x58e269(0x14d)),localStorage[_0x58e269(0x140)](_0x58e269(0x136)),localStorage[_0x58e269(0x140)]('plugin_user_type'),localStorage[_0x58e269(0x140)](_0x58e269(0x12f)),console['log'](_0x58e269(0x142)));const _0x2ac23a=localStorage[_0x58e269(0x149)](_0x58e269(0x14d))===_0x58e269(0x12d);return pluginAuthStatus[_0x58e269(0x138)]=_0x2ac23a&&!pluginAuthStatus[_0x58e269(0x131)],pluginAuthStatus[_0x58e269(0x138)];}export async function activatePluginAuthorization(_0x4bebb3){const _0x27652b=_0x4de1b4;try{const _0x1caf49=await fetch(SERVER_URL+'/verify',{'method':'POST','headers':{'Content-Type':_0x27652b(0x134)},'body':JSON[_0x27652b(0x12a)]({'code':_0x4bebb3})}),_0x2a841d=await _0x1caf49[_0x27652b(0x126)]();if(_0x2a841d[_0x27652b(0x121)]){localStorage['setItem'](_0x27652b(0x136),_0x4bebb3),localStorage[_0x27652b(0x14a)]('plugin_activated',_0x27652b(0x12d)),localStorage['setItem'](_0x27652b(0x14e),'true'),localStorage['setItem'](_0x27652b(0x124),_0x2a841d[_0x27652b(0x129)]),localStorage[_0x27652b(0x140)](_0x27652b(0x12f));const _0x3df35d=_0x2a841d['note']||_0x2a841d[_0x27652b(0x129)];return toastr[_0x27652b(0x121)]('授权激活成功!用户类型:\x20'+_0x3df35d,_0x27652b(0x11a)),pluginAuthStatus[_0x27652b(0x138)]=!![],enablePluginUI(),!![];}}catch(_0x32088e){console[_0x27652b(0x132)](_0x27652b(0x119),_0x32088e);}const _0x27b709=getPasswordForDate(new Date());if(_0x4bebb3===_0x27b709){const _0x328a13=new Date();return _0x328a13[_0x27652b(0x133)](_0x328a13[_0x27652b(0x143)]()+0x7),localStorage[_0x27652b(0x14a)](_0x27652b(0x136),_0x4bebb3),localStorage['setItem'](_0x27652b(0x14d),_0x27652b(0x12d)),localStorage[_0x27652b(0x14a)](_0x27652b(0x14e),_0x27652b(0x12d)),localStorage[_0x27652b(0x14a)](_0x27652b(0x124),'1'),localStorage[_0x27652b(0x14a)](_0x27652b(0x12f),_0x328a13[_0x27652b(0x13b)]()),toastr['success'](_0x27652b(0x14c)+_0x328a13[_0x27652b(0x144)](),_0x27652b(0x11a)),pluginAuthStatus[_0x27652b(0x138)]=!![],enablePluginUI(),!![];}return toastr[_0x27652b(0x118)](_0x27652b(0x13d),_0x27652b(0x11e)),![];}function enablePluginUI(){const _0x52d670=_0x4de1b4;$(_0x52d670(0x141))['slideUp'](0x190,function(){const _0x4960ff=_0x52d670;$(_0x4960ff(0x14b))[_0x4960ff(0x147)](0x190),updateUI();}),extension_settings[extensionName][_0x52d670(0x130)]=!![],saveSettings();}export function displayExpiryInfo(){const _0x280be5=_0x4de1b4,_0x2c076c=new Date(),_0xf273e5=Math[_0x280be5(0x13f)]((AUTH_CONFIG[_0x280be5(0x122)]-_0x2c076c)/(0x3e8*0x3c*0x3c*0x18)),_0x36adfc=localStorage[_0x280be5(0x149)](_0x280be5(0x12f));if(pluginAuthStatus[_0x280be5(0x131)])return _0x280be5(0x146);else{let _0x406c1c='';if(_0x36adfc){const _0x7dcb49=new Date(_0x36adfc);_0x406c1c=_0x280be5(0x12e)+_0x7dcb49['toLocaleDateString']()+_0x280be5(0x13a);}return _0x280be5(0x148)+_0xf273e5+_0x280be5(0x125)+AUTH_CONFIG[_0x280be5(0x122)][_0x280be5(0x144)]()+_0x280be5(0x11d)+_0x406c1c+_0x280be5(0x137);}} +const _0x2fa4d3=_0x16f9;function _0x509b(){const _0x38a5f7=['22642704zvbZES','#auth_panel','getFullYear','getMonth','authorized','https://amilyservice.amily49.cc','removeItem','expired','expiryDate','\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','ceil','plugin_user_type','true','success','getDate','Amily-','556588jIHnAe','padStart','note','2093270VxyNNi','log','application/json','2338143JBHgir','slideDown','每日授权激活成功!有效期至:\x20','当前授权有效期至:\x20','.plugin-features','4092174ruUeaQ','enabled','getItem','stringify','服务器验证连接失败,尝试本地验证...','[Amily2号]\x20检测到授权已过期,已清理本地存储。','setItem','type','plugin_auth_code','8zdjtba','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','970960FUcxgD','warn','7931028WMdZcd','2025-12-31','激活失败','\x20授权已过期','setDate','toLocaleDateString','Amily2号启用','\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20授权有效期:\x20','授权码无效或服务器连接失败','toISOString','plugin_activated','plugin_valid_until'];_0x509b=function(){return _0x38a5f7;};return _0x509b();}function _0x16f9(_0x42fc5b,_0x143a9e){const _0x509b7c=_0x509b();return _0x16f9=function(_0x16f92a,_0x153cf8){_0x16f92a=_0x16f92a-0x139;let _0x56c34b=_0x509b7c[_0x16f92a];return _0x56c34b;},_0x16f9(_0x42fc5b,_0x143a9e);}(function(_0x3f27ea,_0x45cfe4){const _0x2c0955=_0x16f9,_0x1ccd9b=_0x3f27ea();while(!![]){try{const _0x4b8205=parseInt(_0x2c0955(0x14f))/0x1+-parseInt(_0x2c0955(0x165))/0x2+parseInt(_0x2c0955(0x155))/0x3+parseInt(_0x2c0955(0x163))/0x4*(parseInt(_0x2c0955(0x152))/0x5)+parseInt(_0x2c0955(0x15a))/0x6+parseInt(_0x2c0955(0x167))/0x7+-parseInt(_0x2c0955(0x13f))/0x8;if(_0x4b8205===_0x45cfe4)break;else _0x1ccd9b['push'](_0x1ccd9b['shift']());}catch(_0x383e8e){_0x1ccd9b['push'](_0x1ccd9b['shift']());}}}(_0x509b,0xa42ec));import{extension_settings}from'/scripts/extensions.js';import{saveSettings,extensionName}from'./settings.js';import{updateUI}from'../ui/state.js';export const pluginAuthStatus={'authorized':![],'expired':![]};const SERVER_URL=_0x2fa4d3(0x144),AUTH_CONFIG={'expiryDate':new Date(_0x2fa4d3(0x168))};export function getPasswordForDate(_0x66610e){const _0x1d96dd=_0x2fa4d3,_0x4b1efa=_0x66610e[_0x1d96dd(0x141)](),_0x11c4b8=String(_0x66610e[_0x1d96dd(0x142)]()+0x1)['padStart'](0x2,'0'),_0x43c29d=String(_0x66610e[_0x1d96dd(0x14d)]())[_0x1d96dd(0x150)](0x2,'0');return _0x1d96dd(0x14e)+_0x4b1efa+_0x11c4b8+_0x43c29d;}export function checkAuthorization(){const _0x437588=_0x2fa4d3,_0x14ea85=new Date(),_0x4deb2b=localStorage['getItem'](_0x437588(0x13e));if(_0x4deb2b){const _0x42cb14=new Date(_0x4deb2b);_0x14ea85>_0x42cb14?pluginAuthStatus[_0x437588(0x146)]=!![]:pluginAuthStatus[_0x437588(0x146)]=![];}else pluginAuthStatus['expired']=_0x14ea85>AUTH_CONFIG[_0x437588(0x147)];pluginAuthStatus[_0x437588(0x146)]&&(localStorage[_0x437588(0x145)]('plugin_activated'),localStorage[_0x437588(0x145)]('plugin_auth_code'),localStorage['removeItem'](_0x437588(0x14a)),localStorage[_0x437588(0x145)](_0x437588(0x13e)),console[_0x437588(0x153)](_0x437588(0x15f)));const _0x59f2b4=localStorage[_0x437588(0x15c)](_0x437588(0x13d))===_0x437588(0x14b);return pluginAuthStatus[_0x437588(0x143)]=_0x59f2b4&&!pluginAuthStatus[_0x437588(0x146)],pluginAuthStatus[_0x437588(0x143)];}export async function activatePluginAuthorization(_0x10d045){const _0x4cd4d1=_0x2fa4d3;try{const _0x1768ff=await fetch(SERVER_URL+'/verify',{'method':'POST','headers':{'Content-Type':_0x4cd4d1(0x154)},'body':JSON[_0x4cd4d1(0x15d)]({'code':_0x10d045})}),_0x474ae7=await _0x1768ff['json']();if(_0x474ae7[_0x4cd4d1(0x14c)]){localStorage[_0x4cd4d1(0x160)](_0x4cd4d1(0x162),_0x10d045),localStorage['setItem']('plugin_activated','true'),localStorage[_0x4cd4d1(0x160)]('plugin_auto_login',_0x4cd4d1(0x14b)),localStorage[_0x4cd4d1(0x160)](_0x4cd4d1(0x14a),_0x474ae7[_0x4cd4d1(0x161)]),localStorage[_0x4cd4d1(0x145)](_0x4cd4d1(0x13e));const _0x204084=_0x474ae7[_0x4cd4d1(0x151)]||_0x474ae7['type'];return toastr[_0x4cd4d1(0x14c)]('授权激活成功!用户:\x20'+_0x204084,_0x4cd4d1(0x139)),pluginAuthStatus['authorized']=!![],enablePluginUI(),!![];}}catch(_0x1579d8){console[_0x4cd4d1(0x166)](_0x4cd4d1(0x15e),_0x1579d8);}const _0x5edd70=getPasswordForDate(new Date());if(_0x10d045===_0x5edd70){const _0x3ecc17=new Date();return _0x3ecc17[_0x4cd4d1(0x16b)](_0x3ecc17[_0x4cd4d1(0x14d)]()+0x7),localStorage[_0x4cd4d1(0x160)]('plugin_auth_code',_0x10d045),localStorage[_0x4cd4d1(0x160)]('plugin_activated',_0x4cd4d1(0x14b)),localStorage[_0x4cd4d1(0x160)]('plugin_auto_login',_0x4cd4d1(0x14b)),localStorage[_0x4cd4d1(0x160)](_0x4cd4d1(0x14a),'1'),localStorage[_0x4cd4d1(0x160)](_0x4cd4d1(0x13e),_0x3ecc17[_0x4cd4d1(0x13c)]()),toastr['success'](_0x4cd4d1(0x157)+_0x3ecc17[_0x4cd4d1(0x16c)](),'Amily2号启用'),pluginAuthStatus[_0x4cd4d1(0x143)]=!![],enablePluginUI(),!![];}return toastr['error'](_0x4cd4d1(0x13b),_0x4cd4d1(0x169)),![];}function enablePluginUI(){const _0x47ab2f=_0x2fa4d3;$(_0x47ab2f(0x140))['slideUp'](0x190,function(){const _0x4661b0=_0x47ab2f;$(_0x4661b0(0x159))[_0x4661b0(0x156)](0x190),updateUI();}),extension_settings[extensionName][_0x47ab2f(0x15b)]=!![],saveSettings();}export function displayExpiryInfo(){const _0x2662bd=_0x2fa4d3,_0x53cae0=new Date(),_0x190589=Math[_0x2662bd(0x149)]((AUTH_CONFIG['expiryDate']-_0x53cae0)/(0x3e8*0x3c*0x3c*0x18)),_0x40883e=localStorage[_0x2662bd(0x15c)](_0x2662bd(0x13e));if(pluginAuthStatus[_0x2662bd(0x146)])return _0x2662bd(0x16a);else{let _0x54dc36='';if(_0x40883e){const _0x1014f2=new Date(_0x40883e);_0x54dc36=_0x2662bd(0x158)+_0x1014f2['toLocaleDateString']()+'';}return _0x2662bd(0x13a)+_0x190589+'天\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20有效期至:\x20'+AUTH_CONFIG[_0x2662bd(0x147)][_0x2662bd(0x16c)]()+_0x2662bd(0x164)+_0x54dc36+_0x2662bd(0x148);}}