Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
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
Prev Previous commit
Next Next commit
Lints.
  • Loading branch information
chinmaygarde committed Mar 17, 2024
commit 74440978ccc9bbf4fa941a5a803ebdec39b86df9
11 changes: 5 additions & 6 deletions testing/android/native_activity/native_activity_apk.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
import sys

import argparse
import errno
import os
import zipfile
import subprocess


def RunCommandChecked(command):
def run_command_checked(command):
try:
subprocess.check_output(command, stderr=subprocess.STDOUT, text=True)
except subprocess.CalledProcessError as cpe:
Expand Down Expand Up @@ -66,10 +65,10 @@ def main():
'-o',
unaligned_apk_path,
]
RunCommandChecked(aapt2_command)
run_command_checked(aapt2_command)

# Stuff the library in the APK which is just a regular ZIP file. Libraries are not compressed.
with zipfile.ZipFile(unaligned_apk_path, "a", compression=zipfile.ZIP_STORED) as zipf:
with zipfile.ZipFile(unaligned_apk_path, 'a', compression=zipfile.ZIP_STORED) as zipf:
zipf.write(args.library, 'lib/%s/%s' % (args.android_abi, library_file))

# Align the dylib to a page boundary.
Expand All @@ -81,14 +80,14 @@ def main():
unaligned_apk_path,
unsigned_apk_path,
]
RunCommandChecked(zipalign_command)
run_command_checked(zipalign_command)

# Sign the APK.
apksigner_command = [
args.apksigner_bin, 'sign', '--ks', args.keystore, '--ks-pass', 'pass:android', '--out',
apk_path, unsigned_apk_path
]
RunCommandChecked(apksigner_command)
run_command_checked(apksigner_command)

return 0

Expand Down
2 changes: 2 additions & 0 deletions tools/templater/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// FLUTTER_NOLINT: https://github.com/flutter/flutter/issues/105732

#include <filesystem>
#include <string>
#include <string_view>
Expand Down