From 01d1869d592ff25b642dc7f56ae5ab11f9b08dc6 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 21 Feb 2022 22:41:18 +0100 Subject: [PATCH 1/3] nightly: fix "deploy key URL" that is printed to log output GitLab now uses the "/-/" form as the canonical. --- fdroidserver/nightly.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdroidserver/nightly.py b/fdroidserver/nightly.py index 79a2f404..ce363cf9 100644 --- a/fdroidserver/nightly.py +++ b/fdroidserver/nightly.py @@ -206,7 +206,7 @@ def main(): clone_url = os.getenv('CI_PROJECT_URL') + NIGHTLY repo_base = clone_url + '/raw/master/fdroid' servergitmirror = 'git@' + urlparse(clone_url).netloc + ':' + repo_git_base - deploy_key_url = clone_url + '/settings/repository' + deploy_key_url = clone_url + '/-/settings/repository#js-deploy-keys-settings' git_user_name = os.getenv('GITLAB_USER_NAME') git_user_email = os.getenv('GITLAB_USER_EMAIL') elif 'TRAVIS_REPO_SLUG' in os.environ: From d1fd58681e1f9edd4f05777b60a36a07c5167457 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 21 Feb 2022 22:40:22 +0100 Subject: [PATCH 2/3] nightly: stop stripping APKs before signing, apksigner does it * https://gitlab.com/fdroid/fdroidserver/-/merge_requests/1033#note_742563869 * https://github.com/wardvl/f-droid-nightly-action/issues/3 --- fdroidserver/nightly.py | 1 - tests/common.TestCase | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/fdroidserver/nightly.py b/fdroidserver/nightly.py index ce363cf9..b2ca69f2 100644 --- a/fdroidserver/nightly.py +++ b/fdroidserver/nightly.py @@ -349,7 +349,6 @@ Last updated: {date}'''.format(repo_git_base=repo_git_base, 'Resigning {apkfilename} with provided debug.keystore' ).format(apkfilename=os.path.basename(apkfilename)) ) - common.apk_strip_v1_signatures(apkfilename, strip_manifest=True) common.sign_apk(apkfilename, destapk, KEY_ALIAS) if options.verbose: diff --git a/tests/common.TestCase b/tests/common.TestCase index 37f50219..dcdaa20a 100755 --- a/tests/common.TestCase +++ b/tests/common.TestCase @@ -870,6 +870,46 @@ class CommonTest(unittest.TestCase): self.assertFalse(os.path.isfile(unsigned)) self.assertTrue(fdroidserver.common.verify_apk_signature(signed)) + def test_resign_apk(self): + """When using apksigner, it should resign signed APKs""" + config = fdroidserver.common.read_config(fdroidserver.common.options) + if 'apksigner' not in config: + self.skipTest('SKIPPING test_resign_apk, apksigner not installed!') + + config['keyalias'] = 'sova' + config['keystorepass'] = 'r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' + config['keypass'] = 'r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' + config['keystore'] = os.path.join(self.basedir, 'keystore.jks') + fdroidserver.common.config = config + fdroidserver.signindex.config = config + + testdir = tempfile.mkdtemp( + prefix=inspect.currentframe().f_code.co_name, dir=self.tmpdir + ) + os.chdir(testdir) + os.mkdir('unsigned') + os.mkdir('repo') + + for apk in ( + 'org.bitbucket.tickytacky.mirrormirror_4.apk', + 'v2.only.sig_2.apk', + 'SystemWebView-repack.apk', + ): + original = os.path.join(self.basedir, apk) + unsigned = os.path.join('unsigned', apk) + resign = os.path.join('repo', apk) + shutil.copy(original, unsigned) + fdroidserver.common.sign_apk(unsigned, resign, config['keyalias']) + self.assertTrue( + fdroidserver.common.verify_apk_signature(resign), apk + " verifies" + ) + self.assertTrue(os.path.isfile(resign)) + self.assertFalse(os.path.isfile(unsigned)) + self.assertNotEqual( + fdroidserver.common.get_first_signer_certificate(original), + fdroidserver.common.get_first_signer_certificate(resign) + ) + def test_get_apk_id(self): config = dict() fdroidserver.common.fill_config_defaults(config) From e38f7dad68aac51a507a459a3e5fda32429ba3fc Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 22 Feb 2022 22:16:20 +0100 Subject: [PATCH 3/3] locale: fix corrupt python formats --- locale/bo/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/es/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/fr/LC_MESSAGES/fdroidserver.po | 4 ++-- locale/hu/LC_MESSAGES/fdroidserver.po | 4 ++-- locale/it/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/ko/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/nb_NO/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/pt/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/pt_BR/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/pt_PT/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/ro/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/sq/LC_MESSAGES/fdroidserver.po | 8 ++++---- locale/zh_Hant/LC_MESSAGES/fdroidserver.po | 8 ++++---- 13 files changed, 48 insertions(+), 48 deletions(-) diff --git a/locale/bo/LC_MESSAGES/fdroidserver.po b/locale/bo/LC_MESSAGES/fdroidserver.po index b994f072..74720eb1 100644 --- a/locale/bo/LC_MESSAGES/fdroidserver.po +++ b/locale/bo/LC_MESSAGES/fdroidserver.po @@ -1025,14 +1025,14 @@ msgid "Include the source tarballs in the mirror" msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "ཁུངས་ལྡན་མིན་པའི་རྒྱབ་ལྗོངས་ཡིག་ཆའི་ནང་།%s 1:%d 2" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "ངོས་འཛིན་མི་ཐུབ་པའི་རྒྱབ་ལྗོངས་ཡིག་ཆའི་སྒྲིག་བཀོད། : {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/es/LC_MESSAGES/fdroidserver.po b/locale/es/LC_MESSAGES/fdroidserver.po index 3b46c730..13533014 100644 --- a/locale/es/LC_MESSAGES/fdroidserver.po +++ b/locale/es/LC_MESSAGES/fdroidserver.po @@ -1034,14 +1034,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Incluir en el espejo los archivos tarball de código fuente" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Metadatos no válidos en %s:%d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Formato de metadatos desconocido: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/fr/LC_MESSAGES/fdroidserver.po b/locale/fr/LC_MESSAGES/fdroidserver.po index c8c49394..d42851a0 100644 --- a/locale/fr/LC_MESSAGES/fdroidserver.po +++ b/locale/fr/LC_MESSAGES/fdroidserver.po @@ -1053,9 +1053,9 @@ msgid "Include the source tarballs in the mirror" msgstr "Inclure au miroir les tarballs de source" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Métadonnées non valides dans %s:%d" +msgstr "" #: ../fdroidserver/metadata.py #, fuzzy, python-brace-format diff --git a/locale/hu/LC_MESSAGES/fdroidserver.po b/locale/hu/LC_MESSAGES/fdroidserver.po index 3eb151c7..aeb8d2f5 100644 --- a/locale/hu/LC_MESSAGES/fdroidserver.po +++ b/locale/hu/LC_MESSAGES/fdroidserver.po @@ -1027,9 +1027,9 @@ msgid "Include the source tarballs in the mirror" msgstr "A forráscsomagok belevétele a tükörbe" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Érvénytelen metaadatok itt: %s:%d" +msgstr "" #: ../fdroidserver/metadata.py #, python-brace-format diff --git a/locale/it/LC_MESSAGES/fdroidserver.po b/locale/it/LC_MESSAGES/fdroidserver.po index 75ac7844..ddc99107 100644 --- a/locale/it/LC_MESSAGES/fdroidserver.po +++ b/locale/it/LC_MESSAGES/fdroidserver.po @@ -1035,14 +1035,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Includere i tarball dei sorgenti nel mirror" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Metadati non validi in %s:%d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Formato dei metadati sconosciuto: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/ko/LC_MESSAGES/fdroidserver.po b/locale/ko/LC_MESSAGES/fdroidserver.po index 44ef8306..c9db0b6b 100644 --- a/locale/ko/LC_MESSAGES/fdroidserver.po +++ b/locale/ko/LC_MESSAGES/fdroidserver.po @@ -1013,14 +1013,14 @@ msgid "Include the source tarballs in the mirror" msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "%s:%d에서 잘못된 메타데이터" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "알 수 없는 메타데이터 형식: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/nb_NO/LC_MESSAGES/fdroidserver.po b/locale/nb_NO/LC_MESSAGES/fdroidserver.po index 559bbbee..06aab5e8 100644 --- a/locale/nb_NO/LC_MESSAGES/fdroidserver.po +++ b/locale/nb_NO/LC_MESSAGES/fdroidserver.po @@ -1055,14 +1055,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Inkluder kildetjæreballene i avspeilingen" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Ugyldig metadata i %s:%d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Ukjent metadataformat: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/pt/LC_MESSAGES/fdroidserver.po b/locale/pt/LC_MESSAGES/fdroidserver.po index 55601b47..56b05b7d 100644 --- a/locale/pt/LC_MESSAGES/fdroidserver.po +++ b/locale/pt/LC_MESSAGES/fdroidserver.po @@ -1028,14 +1028,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Incluir os tarballs de fontes no espelho" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Metadados inválidos em %s:%d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Formato de metadados desconhecido: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/pt_BR/LC_MESSAGES/fdroidserver.po b/locale/pt_BR/LC_MESSAGES/fdroidserver.po index 2c6de286..290026fa 100644 --- a/locale/pt_BR/LC_MESSAGES/fdroidserver.po +++ b/locale/pt_BR/LC_MESSAGES/fdroidserver.po @@ -1033,14 +1033,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Inclui os tarballs fonte no espelho" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Metadados inválidos em %s: %d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Formato de metadados desconhecido: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/pt_PT/LC_MESSAGES/fdroidserver.po b/locale/pt_PT/LC_MESSAGES/fdroidserver.po index 5c5369b6..2abe8404 100644 --- a/locale/pt_PT/LC_MESSAGES/fdroidserver.po +++ b/locale/pt_PT/LC_MESSAGES/fdroidserver.po @@ -1030,14 +1030,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Incluir os tarballs de fontes no espelho" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Metadados inválidos em %s:%d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Formato de metadados desconhecido: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/ro/LC_MESSAGES/fdroidserver.po b/locale/ro/LC_MESSAGES/fdroidserver.po index 265d0c06..59b17550 100644 --- a/locale/ro/LC_MESSAGES/fdroidserver.po +++ b/locale/ro/LC_MESSAGES/fdroidserver.po @@ -1031,14 +1031,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Includeți tarball-urile sursă în oglindă" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Metadate nevalabile în %s:%d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Format de metadate necunoscut: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/sq/LC_MESSAGES/fdroidserver.po b/locale/sq/LC_MESSAGES/fdroidserver.po index 3a08464d..2fa20a16 100644 --- a/locale/sq/LC_MESSAGES/fdroidserver.po +++ b/locale/sq/LC_MESSAGES/fdroidserver.po @@ -1104,14 +1104,14 @@ msgid "Include the source tarballs in the mirror" msgstr "Përfshi te pasqyra paketa tarball" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "Tejtëdhëna të pavlefshme te %s:%d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "Format i panjohur tejtëdhënash: {path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules" diff --git a/locale/zh_Hant/LC_MESSAGES/fdroidserver.po b/locale/zh_Hant/LC_MESSAGES/fdroidserver.po index a683ac24..84f6c898 100644 --- a/locale/zh_Hant/LC_MESSAGES/fdroidserver.po +++ b/locale/zh_Hant/LC_MESSAGES/fdroidserver.po @@ -1043,14 +1043,14 @@ msgid "Include the source tarballs in the mirror" msgstr "在鏡像中加入軟體的源代碼包。" #: ../fdroidserver/metadata.py -#, fuzzy, python-format +#, python-format msgid "Including metadata from %s@%s" -msgstr "%s 中有無效的中介資料 : %d" +msgstr "" #: ../fdroidserver/metadata.py -#, fuzzy, python-brace-format +#, python-brace-format msgid "Including metadata from {path}" -msgstr "未知的中介資料格式t:{path}" +msgstr "" #: ../fdroidserver/common.py msgid "Initialising submodules"