refactor: reintroduce license modules as no-op compatibility shims

This commit is contained in:
yanguo0905
2026-03-24 15:24:51 +08:00
parent a53d3bbbce
commit f6bc2471da
14 changed files with 55 additions and 202 deletions
+15 -39
View File
@@ -1,44 +1,20 @@
#!/usr/bin/env python3
import sys
import hashlib
import os
# -*- coding: utf-8 -*-
"""Compatibility auth shim.
# 混淆的授权检查
_x = "oipmuxel"
_y = hashlib.sha256(_x.encode()).hexdigest()
This project previously performed import-time authorization checks via
`import _auth_check`. The check is intentionally disabled now, but we keep
this module to avoid runtime/import errors for any legacy extension code that
still imports `_auth_check`.
"""
def check_license():
"""检查授权"""
try:
if not os.path.exists("license.key"):
return False
with open("license.key", "r") as f:
key = f.read().strip()
# 验证授权码格式
if "|" not in key or len(key.split("|")) != 3:
return False
# 验证授权码
from offline_license_checker import OfflineLicenseChecker
checker = OfflineLicenseChecker()
valid, _, _ = checker.verify_license()
return valid
except:
return False
from __future__ import annotations
def show_purchase_info():
"""显示购买信息"""
print("\n" + "="*60)
print("⚠️ 需要授权码才能运行")
print("="*60)
print("\n💰 购买授权请联系:")
print(" Telegram: https://t.me/sonhshu")
print("\n💳 订阅价格:")
print(" 月付:50 USDT/月")
print(" 季付:135 USDT/季(优惠10%")
print(" 年付:510 USDT/年(优惠15%")
print("="*60 + "\n")
sys.exit(1)
# 自动执行检查
if not check_license():
show_purchase_info()
def check_license() -> bool:
"""Legacy API: always returns True."""
return True
# Keep side effects empty on import.
AUTH_ENABLED = False