From ab1aafcb7465df7f149902c5d1b8f89a754d6a12 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Fri, 21 Nov 2025 00:44:22 +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 5f6324a..d7625dd 100644 --- a/utils/auth.js +++ b/utils/auth.js @@ -1 +1 @@ -const _0x1cca60=_0x4741;(function(_0x373c63,_0x359802){const _0x5adf6c=_0x4741,_0x4651d2=_0x373c63();while(!![]){try{const _0xe58fe5=-parseInt(_0x5adf6c(0xf5))/0x1*(-parseInt(_0x5adf6c(0xe3))/0x2)+parseInt(_0x5adf6c(0xe1))/0x3+parseInt(_0x5adf6c(0xe8))/0x4*(-parseInt(_0x5adf6c(0xd3))/0x5)+parseInt(_0x5adf6c(0xc7))/0x6+-parseInt(_0x5adf6c(0xc2))/0x7*(parseInt(_0x5adf6c(0xeb))/0x8)+parseInt(_0x5adf6c(0xef))/0x9+-parseInt(_0x5adf6c(0xe6))/0xa;if(_0xe58fe5===_0x359802)break;else _0x4651d2['push'](_0x4651d2['shift']());}catch(_0x3cf3a8){_0x4651d2['push'](_0x4651d2['shift']());}}}(_0x312c,0xab192));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=_0x1cca60(0xbf),AUTH_CONFIG={'expiryDate':new Date(_0x1cca60(0xc5))};export function getPasswordForDate(_0xc0815c){const _0x1290b2=_0x1cca60,_0x24e0e0=_0xc0815c[_0x1290b2(0xe0)](),_0x322ac2=String(_0xc0815c[_0x1290b2(0xd4)]()+0x1)[_0x1290b2(0xd7)](0x2,'0'),_0x5b1b86=String(_0xc0815c[_0x1290b2(0xcf)]())[_0x1290b2(0xd7)](0x2,'0');return _0x1290b2(0xdf)+_0x24e0e0+_0x322ac2+_0x5b1b86;}export function checkAuthorization(){const _0x3e2dae=_0x1cca60,_0x2ae0a4=new Date(),_0x3eda3f=localStorage[_0x3e2dae(0xf3)](_0x3e2dae(0xd9));if(_0x3eda3f){const _0x11a837=new Date(_0x3eda3f);_0x2ae0a4>_0x11a837?pluginAuthStatus[_0x3e2dae(0xc8)]=!![]:pluginAuthStatus[_0x3e2dae(0xc8)]=![];}else pluginAuthStatus['expired']=_0x2ae0a4>AUTH_CONFIG[_0x3e2dae(0xe2)];pluginAuthStatus[_0x3e2dae(0xc8)]&&(localStorage[_0x3e2dae(0xe4)](_0x3e2dae(0xee)),localStorage[_0x3e2dae(0xe4)](_0x3e2dae(0xcc)),localStorage['removeItem']('plugin_user_type'),localStorage['removeItem']('plugin_valid_until'),console[_0x3e2dae(0xdc)](_0x3e2dae(0xe7)));const _0x1790e0=localStorage[_0x3e2dae(0xf3)]('plugin_activated')==='true';return pluginAuthStatus[_0x3e2dae(0xc6)]=_0x1790e0&&!pluginAuthStatus[_0x3e2dae(0xc8)],pluginAuthStatus[_0x3e2dae(0xc6)];}export async function activatePluginAuthorization(_0x413b03){const _0x1203a1=_0x1cca60;try{const _0xbd8a7f=await fetch(SERVER_URL+_0x1203a1(0xc3),{'method':_0x1203a1(0xf4),'headers':{'Content-Type':_0x1203a1(0xc1)},'body':JSON[_0x1203a1(0xf0)]({'code':_0x413b03})}),_0x25b7e5=await _0xbd8a7f[_0x1203a1(0xf1)]();if(_0x25b7e5[_0x1203a1(0xcd)]){localStorage[_0x1203a1(0xec)](_0x1203a1(0xcc),_0x413b03),localStorage['setItem'](_0x1203a1(0xee),_0x1203a1(0xdb)),localStorage[_0x1203a1(0xec)](_0x1203a1(0xd2),_0x1203a1(0xdb)),localStorage['setItem'](_0x1203a1(0xc9),_0x25b7e5[_0x1203a1(0xdd)]),localStorage['removeItem'](_0x1203a1(0xd9));const _0x78a255=_0x25b7e5['note']||_0x25b7e5[_0x1203a1(0xdd)];return toastr[_0x1203a1(0xcd)]('授权激活成功!用户类型:\x20'+_0x78a255,_0x1203a1(0xd1)),pluginAuthStatus[_0x1203a1(0xc6)]=!![],enablePluginUI(),!![];}}catch(_0x3ccb8b){console['warn']('服务器验证连接失败,尝试本地验证...',_0x3ccb8b);}const _0x2352b6=getPasswordForDate(new Date());if(_0x413b03===_0x2352b6){const _0x4c4c03=new Date();return _0x4c4c03[_0x1203a1(0xea)](_0x4c4c03['getDate']()+0x7),localStorage[_0x1203a1(0xec)](_0x1203a1(0xcc),_0x413b03),localStorage['setItem'](_0x1203a1(0xee),_0x1203a1(0xdb)),localStorage[_0x1203a1(0xec)](_0x1203a1(0xd2),_0x1203a1(0xdb)),localStorage[_0x1203a1(0xec)](_0x1203a1(0xc9),'1'),localStorage['setItem'](_0x1203a1(0xd9),_0x4c4c03[_0x1203a1(0xe9)]()),toastr[_0x1203a1(0xcd)](_0x1203a1(0xe5)+_0x4c4c03[_0x1203a1(0xc0)](),_0x1203a1(0xd1)),pluginAuthStatus['authorized']=!![],enablePluginUI(),!![];}return toastr['error'](_0x1203a1(0xce),_0x1203a1(0xd6)),![];}function _0x4741(_0x33d7a4,_0x3ecd85){const _0x312c0d=_0x312c();return _0x4741=function(_0x4741ad,_0x581deb){_0x4741ad=_0x4741ad-0xbf;let _0x2ef28a=_0x312c0d[_0x4741ad];return _0x2ef28a;},_0x4741(_0x33d7a4,_0x3ecd85);}function _0x312c(){const _0x303a1b=['plugin_valid_until','slideUp','true','log','type','\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','Amily-','getFullYear','2682516MKUXgc','expiryDate','167086qkhIXw','removeItem','每日授权激活成功!有效期至:\x20','11247660HGuowg','[Amily2号]\x20检测到授权已过期,已清理本地存储。','2692HwIUhs','toISOString','setDate','1107688TATumj','setItem','.plugin-features','plugin_activated','10028259ZRrllJ','stringify','json','slideDown','getItem','POST','1PLFZSK','\x20授权已过期','http://accdn.silencelurker.xyz:2086','toLocaleDateString','application/json','49rsSRcu','/verify','\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20授权有效期:\x20','2025-12-31','authorized','8137968DRmGQU','expired','plugin_user_type','ceil','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','plugin_auth_code','success','授权码无效或服务器连接失败','getDate','天\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20有效期至:\x20','Amily2号启用','plugin_auto_login','4855MSkryl','getMonth','当前授权有效期至:\x20','激活失败','padStart',''];_0x312c=function(){return _0x303a1b;};return _0x312c();}function enablePluginUI(){const _0x3edf5d=_0x1cca60;$('#auth_panel')[_0x3edf5d(0xda)](0x190,function(){const _0x5a3212=_0x3edf5d;$(_0x5a3212(0xed))[_0x5a3212(0xf2)](0x190),updateUI();}),extension_settings[extensionName]['enabled']=!![],saveSettings();}export function displayExpiryInfo(){const _0x465d24=_0x1cca60,_0x3e0be9=new Date(),_0x215205=Math[_0x465d24(0xca)]((AUTH_CONFIG[_0x465d24(0xe2)]-_0x3e0be9)/(0x3e8*0x3c*0x3c*0x18)),_0x2b890b=localStorage[_0x465d24(0xf3)](_0x465d24(0xd9));if(pluginAuthStatus[_0x465d24(0xc8)])return _0x465d24(0xf6);else{let _0x10c38f='';if(_0x2b890b){const _0xba4af4=new Date(_0x2b890b);_0x10c38f=_0x465d24(0xd5)+_0xba4af4[_0x465d24(0xc0)]()+_0x465d24(0xd8);}return _0x465d24(0xc4)+_0x215205+_0x465d24(0xd0)+AUTH_CONFIG[_0x465d24(0xe2)][_0x465d24(0xc0)]()+_0x465d24(0xcb)+_0x10c38f+_0x465d24(0xde);}} +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);}}