# Скрипт подготовки native-модуля hev-socks5-tunnel
$ErrorActionPreference = "Stop"
$cppDir = Join-Path $PSScriptRoot "app\src\main\cpp"
$hevDir = Join-Path $cppDir "hev-socks5-tunnel"

Set-Location $cppDir

if (Test-Path (Join-Path $hevDir "src\hev-main.c")) {
    Write-Host "hev-socks5-tunnel уже установлен: $hevDir"
} else {
    Write-Host "Клонирование hev-socks5-tunnel..."
    git clone --recursive --depth 1 https://github.com/heiher/hev-socks5-tunnel.git
}

Write-Host "Исправление symlink-заголовков для Windows..."
& (Join-Path $PSScriptRoot "fix-symlinks.ps1")

Write-Host ""
Write-Host "Готово. Откройте проект в Android Studio и выполните:"
Write-Host "  Build -> Clean Project"
Write-Host "  Build -> Rebuild Project"
