Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 11 additions & 8 deletions emu/emu_downloads_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@
from emu.utils import download
from emu.docker_config import DockerConfig

ANDROID_REPOSITORY = os.environ.get("ANDROID_REPOSITORY", "https://dl.google.com").rstrip("/")

SYSIMG_REPOS = [
"https://dl.google.com/android/repository/sys-img/android/sys-img2-5.xml",
"https://dl.google.com/android/repository/sys-img/google_apis/sys-img2-5.xml",
"https://dl.google.com/android/repository/sys-img/google_apis_playstore/sys-img2-5.xml",
"https://dl.google.com/android/repository/sys-img/google_atd/sys-img2-5.xml",
"https://dl.google.com/android/repository/sys-img/android-tv/sys-img2-5.xml",
"%s/android/repository/sys-img/android/sys-img2-5.xml" % ANDROID_REPOSITORY,
"%s/android/repository/sys-img/google_apis/sys-img2-5.xml" % ANDROID_REPOSITORY,
"%s/android/repository/sys-img/google_apis_playstore/sys-img2-5.xml" % ANDROID_REPOSITORY,
"%s/android/repository/sys-img/google_atd/sys-img2-5.xml" % ANDROID_REPOSITORY,
"%s/android/repository/sys-img/android-tv/sys-img2-5.xml" % ANDROID_REPOSITORY,
]

EMU_REPOS = ["https://dl.google.com/android/repository/repository2-1.xml"]
EMU_REPOS = ["%s/android/repository/repository2-1.xml" % ANDROID_REPOSITORY]

CHANNEL_MAPPING = {
"channel-0": "stable",
Expand Down Expand Up @@ -193,7 +195,8 @@ def __init__(self, pkg, licenses):
# the <tag> element is labelled — for 16KB variants the path
# sort is e.g. google_apis_ps16k, served from .../google_apis/.
url_dir = sort_base or self.tag
self.url = "https://dl.google.com/android/repository/sys-img/%s/%s" % (
self.url = "%s/android/repository/sys-img/%s/%s" % (
ANDROID_REPOSITORY,
url_dir,
self.zip,
)
Expand Down Expand Up @@ -252,7 +255,7 @@ def __init__(self, pkg, licenses):
for archive in archives:
url = archive.find(".//url").text
hostos = archive.find("host-os").text
self.urls[hostos] = "https://dl.google.com/android/repository/%s" % url
self.urls[hostos] = "%s/android/repository/%s" % (ANDROID_REPOSITORY, url)

def download_name(self):
return "emulator-{}.zip".format(self.version)
Expand Down
4 changes: 3 additions & 1 deletion emu/platform_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import zipfile
from pathlib import Path

from emu.utils import download

ANDROID_REPOSITORY = os.environ.get("ANDROID_REPOSITORY", "https://dl.google.com").rstrip("/")

class PlatformTools(object):
"""The platform tools zip file. It will be downloaded on demand."""

# Platform tools, needed to get adb.
PLATFORM_TOOLS_URL = (
"https://dl.google.com/android/repository/platform-tools_r29.0.5-linux.zip"
'%s/android/repository/platform-tools_r29.0.5-linux.zip' % ANDROID_REPOSITORY
)
PLATFORM_TOOLS_ZIP = "platform-tools-latest-linux.zip"

Expand Down
Loading