Repository navigation
Expand file tree
/
Copy pathsetup_sdk.ps1
More file actions
32 lines (29 loc) · 1.54 KB
/
Copy pathsetup_sdk.ps1
File metadata and controls
32 lines (29 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$sdk = "C:\Users\Anonymous\Downloads\keymon project\KeyMon\android-sdk"
New-Item -ItemType Directory -Force -Path "$sdk\platforms", "$sdk\build-tools" | Out-Null
$androidJar = "$sdk\platforms\android-34\android.jar"
if (-not (Test-Path $androidJar)) {
Write-Host "Downloading Android 34 Platform (60 MB)..."
$platZip = "$sdk\platform-34.zip"
Invoke-WebRequest -Uri "https://dl.google.com/android/repository/platform-34-ext7_r02.zip" -OutFile $platZip
Write-Host "Extracting Platform 34..."
$tmpDir = "$sdk\platforms\_tmp"
Expand-Archive -Path $platZip -DestinationPath $tmpDir -Force
$innerDir = Get-ChildItem "$tmpDir" | Select-Object -First 1
Move-Item -Path $innerDir.FullName -Destination "$sdk\platforms\android-34" -Force
Remove-Item $tmpDir, $platZip -Recurse -Force
Write-Host "Platform 34 Installed!"
}
$aapt2 = "$sdk\build-tools\34.0.0\aapt2.exe"
if (-not (Test-Path $aapt2)) {
Write-Host "Downloading Build-Tools 34.0.0 (55 MB)..."
$btZip = "$sdk\build-tools.zip"
Invoke-WebRequest -Uri "https://dl.google.com/android/repository/build-tools_r34-windows.zip" -OutFile $btZip
Write-Host "Extracting Build-Tools 34.0.0..."
$tmpDir = "$sdk\build-tools\_tmp"
Expand-Archive -Path $btZip -DestinationPath $tmpDir -Force
$innerDir = Get-ChildItem "$tmpDir" | Select-Object -First 1
Move-Item -Path $innerDir.FullName -Destination "$sdk\build-tools\34.0.0" -Force
Remove-Item $tmpDir, $btZip -Recurse -Force
Write-Host "Build-Tools 34.0.0 Installed!"
}
Write-Host "Android SDK Setup Complete!"