improve password entry for signing keys
Allow the user to set ANDROID_PW_FILE to the name of a file for
storing password keys. When the tools need additional passwords, they
will rewrite this file and invoke the user's editor for the new
passwords to be added. This allows passwords to be reused across
invocations of the signing tools, without making the user reenter them
every time.
Paranoid users can use a file stored in a ramdisk, or not use this
feature at all (the code will prompt for passwords in the ordinary way
when ANDROID_PW_FILE is not set).
diff --git a/tools/releasetools/sign_target_files_apks b/tools/releasetools/sign_target_files_apks
index 844182d..9f393c8 100755
--- a/tools/releasetools/sign_target_files_apks
+++ b/tools/releasetools/sign_target_files_apks
@@ -141,7 +141,7 @@
going to be signed with the same key."""
shared_user_apks = {}
- maxlen = 0
+ maxlen = len("(unknown key)")
for info in input_tf_zip.infolist():
if info.filename.endswith(".apk"):
@@ -172,7 +172,7 @@
for user, keys in errors:
print 'shared user id "%s":' % (user,)
for key, apps in keys.iteritems():
- print ' %-*s %s' % (maxlen, key, apps[0])
+ print ' %-*s %s' % (maxlen, key or "(unknown key)", apps[0])
for a in apps[1:]:
print (' ' * (maxlen+5)) + a
print