|
27 | 27 | from emu.utils import download |
28 | 28 | from emu.docker_config import DockerConfig |
29 | 29 |
|
| 30 | +ANDROID_REPOSITORY = os.environ.get("ANDROID_REPOSITORY", "https://dl.google.com/") |
| 31 | + |
30 | 32 | SYSIMG_REPOS = [ |
31 | | - "https://dl.google.com/android/repository/sys-img/android/sys-img2-1.xml", |
32 | | - "https://dl.google.com/android/repository/sys-img/google_apis/sys-img2-1.xml", |
33 | | - "https://dl.google.com/android/repository/sys-img/google_apis_playstore/sys-img2-1.xml", |
34 | | - "https://dl.google.com/android/repository/sys-img/google_atd/sys-img2-1.xml", |
35 | | - "https://dl.google.com/android/repository/sys-img/android-tv/sys-img2-1.xml", |
| 33 | + f"{ANDROID_REPOSITORY}/android/repository/sys-img/android/sys-img2-1.xml", |
| 34 | + f"{ANDROID_REPOSITORY}/android/repository/sys-img/google_apis/sys-img2-1.xml", |
| 35 | + f"{ANDROID_REPOSITORY}/android/repository/sys-img/google_apis_playstore/sys-img2-1.xml", |
| 36 | + f"{ANDROID_REPOSITORY}/android/repository/sys-img/google_atd/sys-img2-1.xml", |
| 37 | + f"{ANDROID_REPOSITORY}/android/repository/sys-img/android-tv/sys-img2-1.xml", |
36 | 38 | ] |
37 | 39 |
|
38 | | -EMU_REPOS = ["https://dl.google.com/android/repository/repository2-1.xml"] |
| 40 | +EMU_REPOS = [f"{ANDROID_REPOSITORY}/android/repository/repository2-1.xml"] |
39 | 41 |
|
40 | 42 | CHANNEL_MAPPING = { |
41 | 43 | "channel-0": "stable", |
@@ -161,10 +163,7 @@ def __init__(self, pkg, licenses): |
161 | 163 | url_element = pkg.find(".//url") |
162 | 164 | self.zip = url_element.text |
163 | 165 |
|
164 | | - self.url = "https://dl.google.com/android/repository/sys-img/%s/%s" % ( |
165 | | - self.tag, |
166 | | - self.zip, |
167 | | - ) |
| 166 | + self.url = f"{ANDROID_REPOSITORY}/android/repository/sys-img/%s/%s" % (self.tag, self.zip) |
168 | 167 |
|
169 | 168 | def short_tag(self): |
170 | 169 | return self.SHORT_TAG[self.tag] |
@@ -214,7 +213,7 @@ def __init__(self, pkg, licenses): |
214 | 213 | for archive in archives: |
215 | 214 | url = archive.find(".//url").text |
216 | 215 | hostos = archive.find("host-os").text |
217 | | - self.urls[hostos] = "https://dl.google.com/android/repository/%s" % url |
| 216 | + self.urls[hostos] = f"{ANDROID_REPOSITORY}/android/repository/{url}" |
218 | 217 |
|
219 | 218 | def download_name(self): |
220 | 219 | return "emulator-{}.zip".format(self.version) |
|
0 commit comments