Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[windows] implement Android SDK and tools checksum validaation
  • Loading branch information
ilia-shipitsin committed Sep 21, 2023
commit 9196fe7aea4228b22e5a1b82aa3f8f20a241142b
10 changes: 9 additions & 1 deletion images/win/scripts/Installers/Install-AndroidSDK.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
################################################################################
## File: Install-AndroidSDK.ps1
## Desc: Install and update Android SDK and tools
## Supply chain security: checksum validation
################################################################################

# get packages to install from the toolset
$androidToolset = (Get-ToolsetContent).android
# Newer version(s) require Java 11 by default
# See https://github.com/actions/runner-images/issues/6960
$cmdlineToolsUrl = "https://dl.google.com/android/repository/commandlinetools-win-9123335_latest.zip"
$cmdlineToolsUrl = $androidToolset.commandline_tools_url
$cmdlineToolsArchPath = Start-DownloadWithRetry -Url $cmdlineToolsUrl -Name "cmdline-tools.zip"

#region Supply chain security
$localFileHash = (Get-FileHash -Path $cmdlineToolsArchPath -Algorithm SHA256).Hash

Use-ChecksumComparison -LocalFileHash $localFileHash -DistributorFileHash $androidToolset.hash
#endregion

$sdkInstallRoot = "C:\Program Files (x86)\Android\android-sdk"
$sdkRoot = "C:\Android\android-sdk"
Extract-7Zip -Path $cmdlineToolsArchPath -DestinationPath "${sdkInstallRoot}\cmdline-tools"
Expand Down
1 change: 1 addition & 0 deletions images/win/toolsets/toolset-2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"versions": [ "8", "11", "17" ]
},
"android": {
"commandline_tools_url": "https://dl.google.com/android/repository/commandlinetools-win-9123335_latest.zip",
"platform_min_version": "19",
"build_tools_min_version": "19.1.0",
"extra_list": [
Expand Down
2 changes: 2 additions & 0 deletions images/win/toolsets/toolset-2022.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
"versions": [ "8", "11", "17" ]
},
"android": {
"commandline_tools_url": "https://dl.google.com/android/repository/commandlinetools-win-9123335_latest.zip",
"hash": "8A90E6A3DEB2FA13229B2E335EFD07687DCC8A55A3C544DA9F40B41404993E7D",
"platform_min_version": "27",
"build_tools_min_version": "27.0.0",
"extra_list": [
Expand Down