Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: build/android/gyp/finalize_apk.py

Issue 14843017: [Android] Support building standalone APK in component build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/developer_recommended_flags.gypi ('k') | build/common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/finalize_apk.py
diff --git a/build/android/gyp/finalize_apk.py b/build/android/gyp/finalize_apk.py
index bd7981a3357f30b3150c03f375798a0a7124be3c..0b1d2c258af670104a2b6da848b146e605435467 100755
--- a/build/android/gyp/finalize_apk.py
+++ b/build/android/gyp/finalize_apk.py
@@ -11,23 +11,22 @@ import optparse
import os
import shutil
import sys
+import tempfile
from util import build_utils
def SignApk(keystore_path, unsigned_path, signed_path):
- intermediate_path = unsigned_path + '.copy'
- shutil.copy(unsigned_path, intermediate_path)
+ shutil.copy(unsigned_path, signed_path)
sign_cmd = [
'jarsigner',
'-sigalg', 'MD5withRSA',
'-digestalg', 'SHA1',
'-keystore', keystore_path,
'-storepass', 'chromium',
- intermediate_path,
+ signed_path,
'chromiumdebugkey',
]
build_utils.CheckCallDie(sign_cmd)
- shutil.move(intermediate_path, signed_path)
def AlignApk(android_sdk_root, unaligned_path, final_path):
@@ -55,9 +54,10 @@ def main(argv):
options, _ = parser.parse_args()
- signed_apk_path = options.unsigned_apk_path + '.signed.apk'
- SignApk(options.keystore_path, options.unsigned_apk_path, signed_apk_path)
- AlignApk(options.android_sdk_root, signed_apk_path, options.final_apk_path)
+ with tempfile.NamedTemporaryFile() as intermediate_file:
+ signed_apk_path = intermediate_file.name
+ SignApk(options.keystore_path, options.unsigned_apk_path, signed_apk_path)
+ AlignApk(options.android_sdk_root, signed_apk_path, options.final_apk_path)
if options.stamp:
build_utils.Touch(options.stamp)
« no previous file with comments | « build/android/developer_recommended_flags.gypi ('k') | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698