1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 17:00:12 +01:00

fix genkey key listing in fdroid init

FDroidPopen() does not have a way to send to stdin, so we will use the
password file for now.  In the long run, at least the keypass should always
be sent via stdin rather than via a file.  Ideally, storepass would be too,
but if they are different, then storepass is less important.
This commit is contained in:
Hans-Christoph Steiner 2014-04-01 17:37:37 -04:00
parent ed3bd25bb5
commit e53092cffa
3 changed files with 6 additions and 2 deletions

View File

@ -66,12 +66,13 @@ def genkey(keystore, repo_keyalias, password, keydname):
'-storepass:file', config['keystorepassfile'], '-storepass:file', config['keystorepassfile'],
'-keypass:file', config['keypassfile'], '-keypass:file', config['keypassfile'],
'-dname', keydname]) '-dname', keydname])
# TODO keypass should be sent via stdin
if p.returncode != 0: if p.returncode != 0:
raise BuildException("Failed to generate key", p.stdout) raise BuildException("Failed to generate key", p.stdout)
# now show the lovely key that was just generated # now show the lovely key that was just generated
p = FDroidPopen(['keytool', '-list', '-v', p = FDroidPopen(['keytool', '-list', '-v',
'-keystore', keystore, '-alias', repo_keyalias]) '-keystore', keystore, '-alias', repo_keyalias],
output = p.communicate(password)[0] '-storepass:file', config['keystorepassfile'])
logging.info(output.lstrip().strip() + '\n\n') logging.info(output.lstrip().strip() + '\n\n')

View File

@ -132,6 +132,7 @@ def main():
'-storepass:file', config['keystorepassfile'], '-storepass:file', config['keystorepassfile'],
'-keypass:file', config['keypassfile'], '-keypass:file', config['keypassfile'],
'-dname', config['keydname']]) '-dname', config['keydname']])
# TODO keypass should be sent via stdin
if p.returncode != 0: if p.returncode != 0:
raise BuildException("Failed to generate key") raise BuildException("Failed to generate key")
@ -141,6 +142,7 @@ def main():
'-keypass:file', config['keypassfile'], '-sigalg', '-keypass:file', config['keypassfile'], '-sigalg',
'MD5withRSA', '-digestalg', 'SHA1', 'MD5withRSA', '-digestalg', 'SHA1',
apkfile, keyalias]) apkfile, keyalias])
# TODO keypass should be sent via stdin
if p.returncode != 0: if p.returncode != 0:
raise BuildException("Failed to sign application") raise BuildException("Failed to sign application")

View File

@ -800,6 +800,7 @@ def make_index(apps, apks, repodir, archive, categories):
'-keypass:file', config['keypassfile'], '-keypass:file', config['keypassfile'],
'-digestalg', 'SHA1', '-sigalg', 'MD5withRSA', '-digestalg', 'SHA1', '-sigalg', 'MD5withRSA',
os.path.join(repodir, 'index.jar') , config['repo_keyalias']]) os.path.join(repodir, 'index.jar') , config['repo_keyalias']])
# TODO keypass should be sent via stdin
if p.returncode != 0: if p.returncode != 0:
logging.info("Failed to sign index") logging.info("Failed to sign index")
sys.exit(1) sys.exit(1)