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
12 changes: 4 additions & 8 deletions src/launchpad/utils/android/bundletool.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,6 @@ def build_apks(
with tempfile.TemporaryDirectory(prefix="bundletool-") as temp_dir:
temp_dir_path = Path(temp_dir)
temp_apks_path = temp_dir_path / "apks.apks"
device_spec_path = temp_dir_path / "device-spec.json"
with open(device_spec_path, "w", encoding="utf-8") as device_spec_file:
json.dump(device_spec.model_dump(by_alias=True), device_spec_file)

build_apks_command = [
"build-apks",
f"--bundle={bundle_path}",
Expand All @@ -182,10 +178,6 @@ def build_apks(

if universal_apk:
build_apks_command.append("--mode=universal")
else:
# Restrict bundletool to APKs matching the target device instead
# of generating every possible split before extract-apks filters them.
build_apks_command.append(f"--device-spec={device_spec_path}")

# Generate keystore and sign APKs if requested
if sign_apks:
Expand All @@ -203,6 +195,10 @@ def build_apks(

logger.debug("APKs will be signed with generated keystore")

device_spec_path = temp_dir_path / "device-spec.json"
with open(device_spec_path, "w", encoding="utf-8") as device_spec_file:
json.dump(device_spec.model_dump(by_alias=True), device_spec_file)

self._run_command(build_apks_command)

# Extract APKs for the specified device
Expand Down
45 changes: 0 additions & 45 deletions tests/unit/utils/android/test_bundletool.py

This file was deleted.

Loading