feat: Add a new cleaner page for managing and automatically cleaning error S2A accounts, supported by new backend services for logging, authentication, and client operations.

This commit is contained in:
2026-02-02 03:27:33 +08:00
parent d05c19a8d5
commit daf4c68e4f
10 changed files with 704 additions and 506 deletions

View File

@@ -0,0 +1,161 @@
package client
import (
"math/rand"
"github.com/bogdanfinn/tls-client/profiles"
)
// ============================================================
// 浏览器指纹配置文件
// 整合 tls-client 高成功率指纹
// ============================================================
// BrowserFingerprint 浏览器指纹完整配置
type BrowserFingerprint struct {
Browser string
Version string
Platform string
Mobile bool
TLSProfile profiles.ClientProfile
}
// ============================================================
// Firefox 指纹池 (100% 成功率)
// ============================================================
var firefoxFingerprints = []BrowserFingerprint{
// 最新版本
{Browser: "firefox", Version: "135", Platform: "Windows", TLSProfile: profiles.Firefox_135},
{Browser: "firefox", Version: "135", Platform: "macOS", TLSProfile: profiles.Firefox_135},
{Browser: "firefox", Version: "135", Platform: "Linux", TLSProfile: profiles.Firefox_135},
{Browser: "firefox", Version: "133", Platform: "Windows", TLSProfile: profiles.Firefox_133},
{Browser: "firefox", Version: "133", Platform: "macOS", TLSProfile: profiles.Firefox_133},
{Browser: "firefox", Version: "133", Platform: "Linux", TLSProfile: profiles.Firefox_133},
{Browser: "firefox", Version: "132", Platform: "Windows", TLSProfile: profiles.Firefox_132},
{Browser: "firefox", Version: "132", Platform: "macOS", TLSProfile: profiles.Firefox_132},
{Browser: "firefox", Version: "123", Platform: "Windows", TLSProfile: profiles.Firefox_123},
{Browser: "firefox", Version: "120", Platform: "Windows", TLSProfile: profiles.Firefox_120},
{Browser: "firefox", Version: "120", Platform: "macOS", TLSProfile: profiles.Firefox_120},
{Browser: "firefox", Version: "117", Platform: "Windows", TLSProfile: profiles.Firefox_117},
{Browser: "firefox", Version: "110", Platform: "Windows", TLSProfile: profiles.Firefox_110},
{Browser: "firefox", Version: "108", Platform: "Windows", TLSProfile: profiles.Firefox_108},
{Browser: "firefox", Version: "106", Platform: "Windows", TLSProfile: profiles.Firefox_106},
{Browser: "firefox", Version: "105", Platform: "Windows", TLSProfile: profiles.Firefox_105},
{Browser: "firefox", Version: "104", Platform: "Windows", TLSProfile: profiles.Firefox_104},
{Browser: "firefox", Version: "102", Platform: "Windows", TLSProfile: profiles.Firefox_102},
}
// ============================================================
// Safari 指纹池 (100% 成功率)
// ============================================================
var safariFingerprints = []BrowserFingerprint{
// macOS Safari
{Browser: "safari", Version: "16.0", Platform: "macOS", TLSProfile: profiles.Safari_16_0},
{Browser: "safari", Version: "15.6.1", Platform: "macOS", TLSProfile: profiles.Safari_15_6_1},
// iOS Safari
{Browser: "safari", Version: "18.5", Platform: "iOS", Mobile: true, TLSProfile: profiles.Safari_IOS_18_5},
{Browser: "safari", Version: "18.0", Platform: "iOS", Mobile: true, TLSProfile: profiles.Safari_IOS_18_0},
{Browser: "safari", Version: "17.0", Platform: "iOS", Mobile: true, TLSProfile: profiles.Safari_IOS_17_0},
{Browser: "safari", Version: "16.0", Platform: "iOS", Mobile: true, TLSProfile: profiles.Safari_IOS_16_0},
{Browser: "safari", Version: "15.6", Platform: "iOS", Mobile: true, TLSProfile: profiles.Safari_IOS_15_6},
{Browser: "safari", Version: "15.5", Platform: "iOS", Mobile: true, TLSProfile: profiles.Safari_IOS_15_5},
// iPadOS Safari
{Browser: "safari", Version: "15.6", Platform: "iPadOS", Mobile: true, TLSProfile: profiles.Safari_Ipad_15_6},
}
// ============================================================
// Opera 指纹池 (高成功率)
// ============================================================
var operaFingerprints = []BrowserFingerprint{
{Browser: "opera", Version: "91", Platform: "Windows", TLSProfile: profiles.Opera_91},
{Browser: "opera", Version: "90", Platform: "Windows", TLSProfile: profiles.Opera_90},
{Browser: "opera", Version: "89", Platform: "Windows", TLSProfile: profiles.Opera_89},
}
// ============================================================
// OkHttp 指纹池 (100% 成功率 - Android 原生)
// ============================================================
var okhttpFingerprints = []BrowserFingerprint{
{Browser: "okhttp", Version: "13", Platform: "Android", Mobile: true, TLSProfile: profiles.Okhttp4Android13},
{Browser: "okhttp", Version: "12", Platform: "Android", Mobile: true, TLSProfile: profiles.Okhttp4Android12},
{Browser: "okhttp", Version: "11", Platform: "Android", Mobile: true, TLSProfile: profiles.Okhttp4Android11},
{Browser: "okhttp", Version: "10", Platform: "Android", Mobile: true, TLSProfile: profiles.Okhttp4Android10},
{Browser: "okhttp", Version: "9", Platform: "Android", Mobile: true, TLSProfile: profiles.Okhttp4Android9},
{Browser: "okhttp", Version: "8", Platform: "Android", Mobile: true, TLSProfile: profiles.Okhttp4Android8},
{Browser: "okhttp", Version: "7", Platform: "Android", Mobile: true, TLSProfile: profiles.Okhttp4Android7},
}
// ============================================================
// Chrome 指纹池 (测试通过的版本)
// 注意: 新版 Chrome (120+) 在 tls-client 中被检测,只保留旧版本
// ============================================================
var chromeFingerprints = []BrowserFingerprint{
// 只保留测试通过的旧版本
{Browser: "chrome", Version: "112", Platform: "Windows", TLSProfile: profiles.Chrome_112},
{Browser: "chrome", Version: "111", Platform: "Windows", TLSProfile: profiles.Chrome_111},
}
// ============================================================
// 合并所有指纹
// ============================================================
var allFingerprints []BrowserFingerprint
func init() {
allFingerprints = make([]BrowserFingerprint, 0, 100)
// Firefox (高优先级,多份)
allFingerprints = append(allFingerprints, firefoxFingerprints...)
allFingerprints = append(allFingerprints, firefoxFingerprints...)
// Safari (高成功率)
allFingerprints = append(allFingerprints, safariFingerprints...)
// Opera
allFingerprints = append(allFingerprints, operaFingerprints...)
// OkHttp (Android)
allFingerprints = append(allFingerprints, okhttpFingerprints...)
// Chrome (低优先级)
allFingerprints = append(allFingerprints, chromeFingerprints...)
}
// GetRandomFingerprint 获取随机指纹
func GetRandomFingerprint() BrowserFingerprint {
return allFingerprints[rand.Intn(len(allFingerprints))]
}
// GetRandomDesktopFingerprint 获取随机桌面端指纹
func GetRandomDesktopFingerprint() BrowserFingerprint {
desktopFps := make([]BrowserFingerprint, 0)
for _, fp := range allFingerprints {
if !fp.Mobile {
desktopFps = append(desktopFps, fp)
}
}
if len(desktopFps) == 0 {
return allFingerprints[rand.Intn(len(allFingerprints))]
}
return desktopFps[rand.Intn(len(desktopFps))]
}
// GetTotalFingerprintCount 获取总指纹数量
func GetTotalFingerprintCount() int {
return len(allFingerprints)
}
// GetUniqueFingerprintCount 获取去重后的指纹数量
func GetUniqueFingerprintCount() int {
unique := make(map[string]bool)
for _, fp := range allFingerprints {
key := fp.Browser + fp.Version + fp.Platform
unique[key] = true
}
return len(unique)
}