有效期至:\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';}}