File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11# ###############################################################################
22# # File: Install-AndroidSDK.ps1
33# # Desc: Install and update Android SDK and tools
4+ # # Supply chain security: checksum validation
45# ###############################################################################
56
67# get packages to install from the toolset
78$androidToolset = (Get-ToolsetContent ).android
89# Newer version(s) require Java 11 by default
910# See https://github.com/actions/runner-images/issues/6960
10- $cmdlineToolsUrl = " https://dl.google.com/android/repository/commandlinetools-win-9123335_latest.zip "
11+ $cmdlineToolsUrl = $androidToolset .commandline_tools_url
1112$cmdlineToolsArchPath = Start-DownloadWithRetry - Url $cmdlineToolsUrl - Name " cmdline-tools.zip"
13+
14+ # region Supply chain security
15+ $localFileHash = (Get-FileHash - Path $cmdlineToolsArchPath - Algorithm SHA256).Hash
16+
17+ Use-ChecksumComparison - LocalFileHash $localFileHash - DistributorFileHash $androidToolset.hash
18+ # endregion
19+
1220$sdkInstallRoot = " C:\Program Files (x86)\Android\android-sdk"
1321$sdkRoot = " C:\Android\android-sdk"
1422Extract- 7Zip - Path $cmdlineToolsArchPath - DestinationPath " ${sdkInstallRoot} \cmdline-tools"
Original file line number Diff line number Diff line change 148148 "versions" : [ " 8" , " 11" , " 17" ]
149149 },
150150 "android" : {
151+ "commandline_tools_url" : " https://dl.google.com/android/repository/commandlinetools-win-9123335_latest.zip" ,
152+ "hash" : " 8A90E6A3DEB2FA13229B2E335EFD07687DCC8A55A3C544DA9F40B41404993E7D" ,
151153 "platform_min_version" : " 19" ,
152154 "build_tools_min_version" : " 19.1.0" ,
153155 "extra_list" : [
Original file line number Diff line number Diff line change 132132 "versions" : [ " 8" , " 11" , " 17" ]
133133 },
134134 "android" : {
135+ "commandline_tools_url" : " https://dl.google.com/android/repository/commandlinetools-win-9123335_latest.zip" ,
136+ "hash" : " 8A90E6A3DEB2FA13229B2E335EFD07687DCC8A55A3C544DA9F40B41404993E7D" ,
135137 "platform_min_version" : " 27" ,
136138 "build_tools_min_version" : " 27.0.0" ,
137139 "extra_list" : [
You can’t perform that action at this time.
0 commit comments