fix: use numeric-only device IDs to avoid confusing characters

- agent.ps1: ID format changed from hostname-random to pc-XXXX (pure digits)
- agent.ps1: Device ID display reformatted for easier copy
- agent.exe: rebuilt with dev-XXXX numeric ID generation
This commit is contained in:
dongsheng123132
2026-03-25 15:46:07 +08:00
parent 76d7e85b50
commit ed7e9052d0
2 changed files with 6 additions and 7 deletions

View File

@@ -40,9 +40,8 @@ if ($confirm -ne "y" -and $confirm -ne "Y") {
Write-Host "" Write-Host ""
# ---- Generate Device ID ---- # ---- Generate Device ID ----
$hostname = $env:COMPUTERNAME.ToLower() $rand = Get-Random -Minimum 1000 -Maximum 9999
$rand = -join ((97..122) + (48..57) | Get-Random -Count 4 | ForEach-Object { [char]$_ }) $DEVICE_ID = "pc-$rand"
$DEVICE_ID = "$hostname-$rand"
# ---- Download Agent ---- # ---- Download Agent ----
Write-Host " [1/2] Downloading agent..." -ForegroundColor White Write-Host " [1/2] Downloading agent..." -ForegroundColor White
@@ -87,10 +86,10 @@ Write-Host " ==========================================" -ForegroundColor Green
Write-Host " Connected! Send this ID to support:" -ForegroundColor Green Write-Host " Connected! Send this ID to support:" -ForegroundColor Green
Write-Host " ==========================================" -ForegroundColor Green Write-Host " ==========================================" -ForegroundColor Green
Write-Host "" Write-Host ""
Write-Host " +------------------------------------------+" -ForegroundColor Cyan Write-Host ""
Write-Host " | Device ID: $DEVICE_ID" -ForegroundColor Cyan Write-Host " Device ID: $DEVICE_ID" -ForegroundColor Green
Write-Host " | Hostname: $env:COMPUTERNAME" -ForegroundColor Cyan Write-Host ""
Write-Host " +------------------------------------------+" -ForegroundColor Cyan Write-Host " Hostname: $env:COMPUTERNAME" -ForegroundColor DarkGray
Write-Host "" Write-Host ""
Write-Host " * Close this window to disconnect" -ForegroundColor DarkGray Write-Host " * Close this window to disconnect" -ForegroundColor DarkGray
Write-Host " * Auto-disconnect after $TIMEOUT_HOURS hours" -ForegroundColor DarkGray Write-Host " * Auto-disconnect after $TIMEOUT_HOURS hours" -ForegroundColor DarkGray

Binary file not shown.