feat: Implement real data fetching for points chart and enhance UI with config editor and history viewer styles

This commit is contained in:
2026-01-02 18:12:19 +01:00
parent 57e98e6f03
commit 7a483fd139
8 changed files with 256 additions and 54 deletions

View File

@@ -44,6 +44,16 @@ export async function getUserAgent(isMobile: boolean): Promise<UserAgentResult>
const system = getSystemComponents(isMobile)
const app = await getAppComponents(isMobile)
// IMPROVED: Add random patch variation to Edge version for uniqueness
// e.g., 130.0.2849.68 → 130.0.2849.[68-75] random
const edgeVersionParts = app.edge_version.split('.')
if (edgeVersionParts.length === 4 && edgeVersionParts[3]) {
const basePatch = parseInt(edgeVersionParts[3], 10) || 0
const randomizedPatch = basePatch + Math.floor(Math.random() * 8) // +0 to +7 variation
edgeVersionParts[3] = String(randomizedPatch)
app.edge_version = edgeVersionParts.join('.')
}
const uaTemplate = isMobile ?
`Mozilla/5.0 (${system}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${app.chrome_reduced_version} Mobile Safari/537.36 EdgA/${app.edge_version}` :
`Mozilla/5.0 (${system}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${app.chrome_reduced_version} Safari/537.36 Edg/${app.edge_version}`
@@ -142,8 +152,11 @@ export async function getEdgeVersions(isMobile: boolean): Promise<EdgeVersionRes
export function getSystemComponents(mobile: boolean): string {
if (mobile) {
const androidVersion = 10 + Math.floor(Math.random() * 5)
return `Linux; Android ${androidVersion}; K`
// IMPROVED: Android 10-14 coverage (was 10-14, now with sub-versions)
const androidMajor = 10 + Math.floor(Math.random() * 5) // 10, 11, 12, 13, 14
const androidMinor = Math.floor(Math.random() * 3) // 0, 1, 2
const androidPatch = Math.floor(Math.random() * 10) // 0-9
return `Linux; Android ${androidMajor}.${androidMinor}.${androidPatch}; K`
}
return 'Windows NT 10.0; Win64; x64'

View File

@@ -406,7 +406,9 @@ export function getAntiDetectionScript(options: {
// LAYER 10: Hardware Concurrency & Device Memory
// ═══════════════════════════════════════════════════════════════════════════
const commonCores = [4, 6, 8, 12, 16];
// IMPROVED: Limit to common consumer CPUs (4-8 cores)
// 12-16 cores are rare and can flag datacenter/server detection
const commonCores = [4, 6, 8];
const realCores = navigator.hardwareConcurrency || 4;
const normalizedCores = commonCores.reduce((prev, curr) =>
Math.abs(curr - realCores) < Math.abs(prev - realCores) ? curr : prev

View File

@@ -1,10 +1,17 @@
export type BanStatus = { status: boolean; reason: string }
// IMPROVED: Expanded ban detection patterns for better early warning
const BAN_PATTERNS: Array<{ re: RegExp; reason: string }> = [
{ re: /suspend|suspended|suspension/i, reason: 'account suspended' },
{ re: /locked|lockout|serviceabuse|abuse/i, reason: 'locked or service abuse detected' },
{ re: /unusual.*activity|unusual activity/i, reason: 'unusual activity prompts' },
{ re: /verify.*identity|identity.*verification/i, reason: 'identity verification required' }
{ re: /verify.*identity|identity.*verification/i, reason: 'identity verification required' },
{ re: /captcha|recaptcha|hcaptcha/i, reason: 'CAPTCHA challenge detected (potential bot detection)' },
{ re: /blocked|block|restriction|restricted/i, reason: 'access restricted or blocked' },
{ re: /security.*code|verification.*code|two.*factor/i, reason: 'unexpected 2FA prompt (suspicious activity)' },
{ re: /rate.*limit|too.*many.*requests|slow.*down/i, reason: 'rate limiting detected' },
{ re: /temporarily.*unavailable|service.*unavailable/i, reason: 'service temporarily unavailable (may be IP ban)' },
{ re: /automated.*request|bot.*detected|automated.*access/i, reason: 'automated access detected' }
]
export function detectBanReason(input: unknown): BanStatus {