From 09ad48cf4940badcfe6d7d6ac4ec1ce37ecf12e8 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Fri, 21 Nov 2025 00:24:17 +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 99085a9..5f6324a 100644 --- a/utils/auth.js +++ b/utils/auth.js @@ -1 +1 @@ -const _0x512633=_0x2c07;(function(_0x38de7f,_0x58e628){const _0x242fae=_0x2c07,_0x726b89=_0x38de7f();while(!![]){try{const _0x83b47d=-parseInt(_0x242fae(0x151))/0x1+parseInt(_0x242fae(0x130))/0x2*(parseInt(_0x242fae(0x153))/0x3)+-parseInt(_0x242fae(0x148))/0x4*(-parseInt(_0x242fae(0x13c))/0x5)+-parseInt(_0x242fae(0x12e))/0x6*(parseInt(_0x242fae(0x140))/0x7)+-parseInt(_0x242fae(0x14b))/0x8+parseInt(_0x242fae(0x141))/0x9+parseInt(_0x242fae(0x152))/0xa;if(_0x83b47d===_0x58e628)break;else _0x726b89['push'](_0x726b89['shift']());}catch(_0x19238c){_0x726b89['push'](_0x726b89['shift']());}}}(_0x31eb,0xbb13d));import{extension_settings}from'/scripts/extensions.js';function _0x31eb(){const _0x205107=['authorized','9824200mkdDpy','服务器验证连接失败,尝试本地验证...','setDate','当前授权有效期至:\x20','toLocaleDateString','POST','328661hYuqxU','12482190jSbKZQ','3806637cdKNyS','expiryDate','getDate','plugin_valid_until','每日授权激活成功!有效期至:\x20','ceil','getFullYear','log','','removeItem','enabled','stringify','26622lWPioR','plugin_activated','2NXXmmS','json','toISOString','expired','true','setItem','天\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20有效期至:\x20','授权码无效或服务器连接失败','application/json','plugin_auth_code','2025-12-31','getItem','25WoFFjZ','plugin_auto_login','success','http://accdn.silencelurker.xyz:2086','2296IuuMiR','1143882LldiPm','padStart','error','plugin_user_type','Amily-','激活失败','授权激活成功!用户类型:\x20','907276yfOcAB','slideUp'];_0x31eb=function(){return _0x205107;};return _0x31eb();}import{saveSettings,extensionName}from'./settings.js';import{updateUI}from'../ui/state.js';export const pluginAuthStatus={'authorized':![],'expired':![]};const SERVER_URL=_0x512633(0x13f),AUTH_CONFIG={'expiryDate':new Date(_0x512633(0x13a))};export function getPasswordForDate(_0x117972){const _0x52661f=_0x512633,_0x70bc0d=_0x117972[_0x52661f(0x159)](),_0x45b6a1=String(_0x117972['getMonth']()+0x1)[_0x52661f(0x142)](0x2,'0'),_0x2206ce=String(_0x117972[_0x52661f(0x155)]())[_0x52661f(0x142)](0x2,'0');return _0x52661f(0x145)+_0x70bc0d+_0x45b6a1+_0x2206ce;}function _0x2c07(_0x2c9f6e,_0x501a5a){const _0x31eb16=_0x31eb();return _0x2c07=function(_0x2c0711,_0x3bc7ad){_0x2c0711=_0x2c0711-0x12c;let _0x20bafe=_0x31eb16[_0x2c0711];return _0x20bafe;},_0x2c07(_0x2c9f6e,_0x501a5a);}export function checkAuthorization(){const _0x338a87=_0x512633,_0x6ea34f=new Date(),_0x218c05=localStorage['getItem']('plugin_valid_until');if(_0x218c05){const _0x4330a4=new Date(_0x218c05);_0x6ea34f>_0x4330a4?pluginAuthStatus[_0x338a87(0x133)]=!![]:pluginAuthStatus[_0x338a87(0x133)]=![];}else pluginAuthStatus['expired']=_0x6ea34f>AUTH_CONFIG[_0x338a87(0x154)];pluginAuthStatus[_0x338a87(0x133)]&&(localStorage[_0x338a87(0x15c)](_0x338a87(0x12f)),localStorage['removeItem'](_0x338a87(0x139)),localStorage[_0x338a87(0x15c)](_0x338a87(0x144)),localStorage[_0x338a87(0x15c)](_0x338a87(0x156)),console[_0x338a87(0x15a)]('[Amily2号]\x20检测到授权已过期,已清理本地存储。'));const _0x495903=localStorage[_0x338a87(0x13b)](_0x338a87(0x12f))===_0x338a87(0x134);return pluginAuthStatus[_0x338a87(0x14a)]=_0x495903&&!pluginAuthStatus[_0x338a87(0x133)],pluginAuthStatus[_0x338a87(0x14a)];}export async function activatePluginAuthorization(_0x529320){const _0x398aff=_0x512633;try{const _0x18b86b=await fetch(SERVER_URL+'/verify',{'method':_0x398aff(0x150),'headers':{'Content-Type':_0x398aff(0x138)},'body':JSON[_0x398aff(0x12d)]({'code':_0x529320})}),_0x39e943=await _0x18b86b[_0x398aff(0x131)]();if(_0x39e943['success'])return localStorage[_0x398aff(0x135)]('plugin_auth_code',_0x529320),localStorage['setItem'](_0x398aff(0x12f),_0x398aff(0x134)),localStorage[_0x398aff(0x135)](_0x398aff(0x13d),'true'),localStorage['setItem'](_0x398aff(0x144),_0x39e943['type']),localStorage[_0x398aff(0x15c)](_0x398aff(0x156)),toastr[_0x398aff(0x13e)](_0x398aff(0x147)+_0x39e943['type'],'Amily2号启用'),pluginAuthStatus['authorized']=!![],enablePluginUI(),!![];}catch(_0x169c8c){console['warn'](_0x398aff(0x14c),_0x169c8c);}const _0x43ffc9=getPasswordForDate(new Date());if(_0x529320===_0x43ffc9){const _0x92650e=new Date();return _0x92650e[_0x398aff(0x14d)](_0x92650e[_0x398aff(0x155)]()+0x7),localStorage[_0x398aff(0x135)](_0x398aff(0x139),_0x529320),localStorage['setItem'](_0x398aff(0x12f),_0x398aff(0x134)),localStorage['setItem'](_0x398aff(0x13d),_0x398aff(0x134)),localStorage[_0x398aff(0x135)]('plugin_user_type','1'),localStorage[_0x398aff(0x135)](_0x398aff(0x156),_0x92650e[_0x398aff(0x132)]()),toastr[_0x398aff(0x13e)](_0x398aff(0x157)+_0x92650e[_0x398aff(0x14f)](),'Amily2号启用'),pluginAuthStatus['authorized']=!![],enablePluginUI(),!![];}return toastr[_0x398aff(0x143)](_0x398aff(0x137),_0x398aff(0x146)),![];}function enablePluginUI(){const _0x524dfa=_0x512633;$('#auth_panel')[_0x524dfa(0x149)](0x190,function(){$('.plugin-features')['slideDown'](0x190),updateUI();}),extension_settings[extensionName][_0x524dfa(0x12c)]=!![],saveSettings();}export function displayExpiryInfo(){const _0x4551f3=_0x512633,_0x3541a5=new Date(),_0x589d2e=Math[_0x4551f3(0x158)]((AUTH_CONFIG['expiryDate']-_0x3541a5)/(0x3e8*0x3c*0x3c*0x18)),_0x2279a4=localStorage[_0x4551f3(0x13b)](_0x4551f3(0x156));if(pluginAuthStatus[_0x4551f3(0x133)])return'\x20授权已过期';else{let _0x5c3abd='';if(_0x2279a4){const _0x9ba980=new Date(_0x2279a4);_0x5c3abd=_0x4551f3(0x14e)+_0x9ba980[_0x4551f3(0x14f)]()+_0x4551f3(0x15b);}return'\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20授权有效期:\x20'+_0x589d2e+_0x4551f3(0x136)+AUTH_CONFIG[_0x4551f3(0x154)][_0x4551f3(0x14f)]()+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5c3abd+'\x0a\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20';}} +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);}}