Commit graph

1076 commits

Author SHA1 Message Date
Hans-Christoph Steiner
989159ef09 require build-tools that fully supports apksigner 2020-10-22 09:53:51 +02:00
Hans-Christoph Steiner
8fd7dcd425 always use androguard version of common.get_apk_id() first
This removes the need for common.use_androguard()
2020-10-22 09:51:12 +02:00
Hans-Christoph Steiner
27b90a13bf remove aapt version of common.is_apk_and_debuggable() 2020-10-22 09:51:12 +02:00
Hans-Christoph Steiner
b5cd850abe apksigner search should use MINIMUM_APKSIGNER_BUILD_TOOLS_VERSION 2020-10-22 09:51:12 +02:00
Marcus Hoffmann
03b1adbe2b don't include .idsig files into the index
.idsig files contain an apksig v4 (https://source.android.com/security/apksigning/v4)
new versions of apksigner make this signature by default and it ends up
in /repo. Without this patch it would be included into the index as a
file to be downloaded by users. F-Droid Client crashes when it
encounters such an apk entry.

It's fine to have these signature files in the repo though, maybe
fdroidclient can make use of them at some point in the future (they are
intended to support streaming app installations).
2020-10-16 22:50:29 +02:00
Michael Pöhn
e63eb7cd2f Merge branch '2.0-deprecations' into 'master'
2.0 deprecations in `fdroid update`

See merge request fdroid/fdroidserver!813
2020-10-14 13:14:49 +00:00
Izzy
261a5cca44
add framagit.org to known git repo locations 2020-10-13 17:07:37 +02:00
Hans-Christoph Steiner
ae3c9c0552 change make_current_version_link to default to False
This is semi-broken and barely used, it should be off by default for 2.0.
2020-10-08 08:10:36 +02:00
Hans-Christoph Steiner
7adba093e4 Merge branch 'keytool_smartcardoptions' into 'master'
fix keytool not working with default smartcardoptions

See merge request fdroid/fdroidserver!812
2020-10-07 16:53:49 +00:00
Marcus Hoffmann
0d5fde334d fix keytool not working with default smartcardoptions
This broke in 74af61f255.
Keytool has still a different opinion from both apksigner and jarsigner
about the providerName argument. apksigner doesn't support it at all,
jarsigner ignores it but keytool fails without it. :-/

So we add it back to the default argument list but filter it out before
calling apksigner.
2020-10-07 16:12:21 +02:00
Hans-Christoph Steiner
5e1377c77a standardize on "Application ID" in UI text 2020-10-01 23:01:55 +02:00
akwizgran
896ffed703 Use jarsigner to verify reproducible APKs 2020-09-29 12:18:56 +00:00
Hans-Christoph Steiner
8c1cf724e1 init: force keystore to PKCS12 format
Java 8 supports PKCS12, Java 9+ uses PKCS12 by default, which should have
a .p12 file extension.  `fdroid init` has always just added .jks which is
the old default format.

* https://docs.oracle.com/en/java/javase/12/tools/keytool.html#GUID-5990A2E4-78E3-47B7-AE75-6D1826259549__GUID-A8B9E662-C1C2-4A0E-9307-A8464F0E95D4
* https://openjdk.java.net/jeps/229
2020-09-23 16:40:37 +02:00
Hans-Christoph Steiner
08f724651e remove "force_build_tools" config option, closes #738
The `force_build_tools` config option was added a long time ago to
brute force the _build-tools_ version by trying to replace the value
in `build.gradle` files. This is never something that should be used
in production, since the app's build metadata should specify this kind
of thing. And now that we're moving towards _androguard_ for
everything except fdroid build and fdroid publish, _build-tools_ will
no longer even be used in the other commands.
2020-09-16 16:30:49 +02:00
Marcus Hoffmann
7de601a5b5 fallback to minsdk when targetsdk isn't set
Androguard already has a function always returning an int here, so let's
use that.

Also put in a guard against minsdk not being set.
2020-09-14 14:12:18 +02:00
Marcus Hoffmann
7eb32feaa5 skip new signing test when we can't find apksigner
Also add some error handling to the find_apksigner() method.
2020-09-10 18:59:39 +02:00
Marcus Hoffmann
dfecdcc1bd set minimum apksigner version to 26.0.2 2020-09-10 13:20:01 +02:00
Marcus Hoffmann
145ba9db54 fix apksigner smartcardoptions
apksigner documents the options as --ks-provider-class and --ks-provider-arg
those seem to be accepted but fail when actually making a signature with
weird internal exceptions. The new options actually work.
From: https://geoffreymetais.github.io/code/key-signing/#scripting
2020-09-09 22:51:08 +02:00
Marcus Hoffmann
74af61f255 remove providerName from default smartcardoptions
apksigner doesn't recognize the SunPKCS11-OpenSC set via providerName
Neither jarsigner nor apksigner need this to work.
2020-09-09 22:50:58 +02:00
Marcus Hoffmann
768a91370c publish: use apksigner for signing apks with targetSDK>=30
This makes apksigner a hard requirement of the signing procedure.
We'll first try to find a globally installed version from PATH and if
that's not available fall back to using a version from build-tools.

Future TODO: always sign with apksigner, blocked on signature transplant
support for apksigv2/v3

Closes fdroid/fdroidserver#634
Closes fdroid/fdroidserver#827
2020-09-09 18:09:28 +02:00
Marcus Hoffmann
d5311fff09 vcs: don't fail when git remote set-head fails
There's valid use-cases for setups where set-head --auto fails. This
happens when building an app from a gitlab CI checkout where no remote
tracking branches are setup.

This isn't really a fatal error. When a remote HEAD exists we'll
continue setting it and if none exists and something requires this being
set up later on (either a build script or fdroid checkupdates) then
we'll fail later on with "origin/HEAD not being known to git".
By not failing early we allow the majority of use-cases that don't need
a remote HEAD to continue with just a warning.

The setup in which this can be reproduced is as follows:
(This is roughly what gitlab runner does when setting up a git checkout
for CI)
- mkdir test && cd test
- git init
- git remote add https://gitlab.com/Bubu/fdroidclassic.git
- git fetch --all
- git checkout db0d2a9a5d1d89101a344169013ac5d518185f31
- mkdir nested_repo && cd nested_repo
- git clone .. .
- git remote set-head origin --auto
  > error: Cannot determine remote HEAD
2020-08-25 21:32:29 +02:00
Marcus Hoffmann
78491a0a5b add used extlibs to scanignore path
fixes fdroid/fdroidserver#795
2020-08-25 21:32:29 +02:00
Michael Pöhn
fac033314a fix a comment and a warning 2020-08-20 20:40:15 +02:00
Michael Pöhn
f5a5fffb10 purge accepted_formats from config 2020-08-20 20:40:15 +02:00
Michael Pöhn
4dc503ed28 remove txt form accepted format list 2020-08-20 20:40:15 +02:00
Marcus Hoffmann
ba28b44ae7 common: use androguard to figure out minSDK version
Closes: #816
2020-08-19 19:49:39 +02:00
Marcus Hoffmann
a8e9653b96 update: make --create-key work with a HSM 2020-08-14 17:27:58 +02:00
Marcus Hoffmann
004d13a48a make publish and update work with a smartcard HSM
Followup to fdroid/fdroidserver!779.

We need to add smartcardoptions to every call to keytool and jarsigner
as well as handle when keypass not being required and not allowed for
pkcs11 keystores.
2020-08-14 17:27:58 +02:00
Marcus Hoffmann
066978cbcf publish: use common signing method
This is currently still jarsigner based but will at least use sha256
when possible
2020-08-14 15:07:04 +02:00
Hans-Christoph Steiner
f779ce276a 'keypass' is not required in config if using a HSM 2020-08-07 15:30:33 +02:00
Hans-Christoph Steiner
d213c8b37c update: validate smartcardoptions when using a HSM for the keystore 2020-08-07 15:30:33 +02:00
Hans-Christoph Steiner
5fce16c847
remove unused, confusing arg to common.getsrclib() 2020-06-24 22:40:27 +02:00
Hans-Christoph Steiner
d0f426e076
replace $$srclib$$ with an absolute path
closes #725
2020-06-24 22:40:26 +02:00
Hans-Christoph Steiner
1e6f99988a fix typo when looking for build.gradle.kts 2020-06-24 21:43:58 +02:00
Marcus
f84818c15e scanner: add a simple scan for blacklisted classes after build step
add com.android.billing to blacklist, see
https://gitlab.com/fdroid/fdroiddata/-/issues/2070#note_360611289
2020-06-15 18:03:19 +00:00
Hans-Christoph Steiner
410901d3bd Merge branch 'yamllint' into 'master'
yamllint

See merge request fdroid/fdroidserver!721
2020-05-14 12:36:19 +00:00
Hans-Christoph Steiner
ba854ab24a support Cordova's gradle file
https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html
2020-05-14 11:55:09 +02:00
Michael Pöhn
b076e8cba7 add srclib spec parser 2020-04-25 17:22:48 +02:00
Michael Pöhn
975538a7a7 make yamllint optional 2020-04-24 15:47:47 +02:00
Michael Pöhn
4e69ff582f run yamllint when parsing failed and also on fdroid lint runs 2020-04-24 15:47:31 +02:00
Michael Pöhn
2c86d38028 srclib: no spaces in dict key 2020-04-16 11:31:59 +02:00
Izzy
46a464a74b
get_app_from_url: add codeberg.org as git url 2020-04-15 09:13:08 +02:00
Hans-Christoph Steiner
ab2291475b import: mv reusable functions to common.py to avoid import_proxy.py
import is a strict keyword in Python, so it is not possible to import a
module called 'import', even with things like:

* import fdroidserver.import
* from fdroidserver import import
2020-03-11 13:41:13 +01:00
fuwa
2d63ab66f5 libvirt: various fixes related to the makebuildserver and fdroid build commands 2020-03-09 15:06:19 +00:00
Hans-Christoph Steiner
bf6004b08e
rsync status JSON as first and last steps of command runs 2020-02-19 14:50:35 +01:00
Hans-Christoph Steiner
d16478b10b
update: write status in JSON repo file, using new internal API 2020-02-18 23:45:48 +01:00
Hans-Christoph Steiner
5459a461db
common.get_head_commit_id() to get string commit ID from HEAD 2020-02-18 23:16:53 +01:00
Hans-Christoph Steiner
fafaa8f81f
standardize on path.endswith() for file extension checks
Its already widely used, this just removes the exceptions.  It is also more
Pythonic
2020-02-18 23:16:51 +01:00
Hans-Christoph Steiner
271b74af7d fix remove_signing_keys() for Kotlin gradles files (*.gradle.kts) 2020-02-13 22:32:51 +01:00
Hans-Christoph Steiner
68b793e308 support kotlin "*.gradle.kts" files in more places
closes #613
2020-02-13 22:32:51 +01:00