Deploy Windows gateway as persistent scheduled task and verify public ADB

This commit is contained in:
tongtong committed 2026-11-12 13:32:50 +08:00
1 parent c38f067bea
commit 3fb894c1a1
9 files changed
+193 -13

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
$ErrorActionPreference = 'Stop'
$root = [System.IO.Path]::GetFullPath((Join-Path $env:LOCALAPPDATA 'AndroidDeviceStreaming/agent'))
New-Item -ItemType Directory -Path $root -Force | Out-Null
$sid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value
$grant = '*' + $sid + ':(OI)(CI)F'
icacls $root /inheritance:r /grant:r $grant '*S-1-5-18:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F'
if ($LASTEXITCODE -ne 0) { throw 'Cannot protect deployment directory ACL' }
Write-Output "Prepared private deployment directory: $root"