diff --git a/fdroidserver/publish.py b/fdroidserver/publish.py index ac9a3f44..1369d177 100644 --- a/fdroidserver/publish.py +++ b/fdroidserver/publish.py @@ -280,7 +280,7 @@ def main(): signaturefile, signedfile, manifest = signingfiles with open(signaturefile, 'rb') as f: - devfp = common.signer_fingerprint_short(common.get_signature(f.read())) + devfp = common.signer_fingerprint_short(common.get_certificate(f.read())) devsigned = '{}_{}_{}.apk'.format(appid, vercode, devfp) devsignedtmp = os.path.join(tmp_dir, devsigned) shutil.copy(apkfile, devsignedtmp) diff --git a/tests/run-tests b/tests/run-tests index 63e3b71b..63cefb94 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -1104,6 +1104,35 @@ if have_git_2_3; then fi +#------------------------------------------------------------------------------# +echo_header 'test extracting and publishing with developer signature' + +REPOROOT=`create_test_dir` +cd $REPOROOT +fdroid_init_with_prebuilt_keystore +echo "accepted_formats = ['txt']" >> config.py +echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py +test -d metadata || mkdir metadata +cp $WORKSPACE/tests/metadata/com.politedroid.txt metadata/ +test -d repo || mkdir repo +test -d unsigned || mkdir unsigned +cp $WORKSPACE/tests/repo/com.politedroid_6.apk unsigned/ +$fdroid signatures unsigned/com.politedroid_6.apk +test -d metadata/com.politedroid/signatures/6 +test -f metadata/com.politedroid/signatures/6/MANIFEST.MF +test -f metadata/com.politedroid/signatures/6/RELEASE.RSA +test -f metadata/com.politedroid/signatures/6/RELEASE.SF +! test -f repo/com.politedroid_6.apk +$fdroid publish +test -f repo/com.politedroid_6.apk +if which jarsigner; then + jarsigner -verify repo/com.politedroid_6.apk +fi +if which apksigner; then + apksigner verify repo/com.politedroid_6.apk +fi + + #------------------------------------------------------------------------------# # remove this to prevent git conflicts and complaining