Commit graph

1215 commits

Author SHA1 Message Date
Felix C. Stegerman
202fd8b25a
vendor & use apksigcopier v0.4.0-12-g93d8e14 2021-04-14 21:06:20 +02:00
Felix C. Stegerman
67a0f3ae5b
use subclass hack for better ZIP cloning
See https://bugs.python.org/issue43547 for more info on the details.

thanks to @obfusk for the technique
2021-04-14 15:17:56 +02:00
Felix C. Stegerman
0a4995cd3b read_pkg_args(): allow appid_vercode.apk in addition to appid:vercode 2021-04-10 07:18:28 +00:00
Felix C. Stegerman
3e557a1a8a
check for invalid appids passed to commands 2021-04-08 10:31:33 +02:00
Benedikt Brückmann
8f0712e89b Add a mypy run to the pipeline 2021-04-02 08:57:56 +00:00
Hans-Christoph Steiner
b69b95103e add complete tests for finding apksigner; fix minor detection bug
find_apksigner() was preferring the oldest valid version rather than the
newest.
2021-03-23 21:01:53 +01:00
Hans-Christoph Steiner
8b393189c1 include /etc/issue.net in status JSON to identify the base system 2021-03-23 11:01:40 +01:00
Hans-Christoph Steiner
903a7396b1 switch to preferring apksigner, requiring for fdroid publish 2021-03-22 22:30:49 +01:00
Hans-Christoph Steiner
50f0534d87 publish: always use apksigner to sign APKs, closes #880 2021-03-22 18:16:34 +01:00
Jochen Sprickerhof
ea9f917ddc Support versionCode and versionName in brackets
Example: versionCode(29)
https://github.com/florisboard/florisboard/blob/v0.3.9/app/build.gradle.kts#L24
2021-03-19 13:58:02 +01:00
Hans-Christoph Steiner
649347dcd4 common: properly parse version from NDK's source.properties 2021-03-09 15:55:45 +01:00
Benedikt Brückmann
8d51566a70 * Change image name
* add fingerprint
2021-02-08 12:25:02 +01:00
Benedikt Brückmann
997f5d267b Properly add css 2021-02-08 12:25:02 +01:00
Hans-Christoph Steiner
31c29f2fb3 support official ANDROID_SDK_ROOT env var when running CLI tools
ANDROID_HOME is deprecated:
https://developer.android.com/studio/command-line/variables#android_sdk_root

!816 #547
2021-01-29 16:34:36 +01:00
Hans-Christoph Steiner
63be6f6347 standardize naming in strings and comments on all caps APK 2021-01-29 15:40:59 +01:00
Hans-Christoph Steiner
97d5933a05 change config.py to config.yml everywhere it is needed 2021-01-29 13:24:17 +01:00
Hans-Christoph Steiner
f527b17715 sync repo examples with defaults and comment out example repo settings
!359
2021-01-24 09:26:11 +01:00
Hans-Christoph Steiner
5ae2703477 init: no error if examples/ dir cannot be found; overhaul repo_icon
There are so many possible installation paths for Python modules, it has
been very hard to even find and test them all.  This adds a fallback option
if the examples dir cannot be found.  A repo can work without an icon or
the example config.py.

This removes the fake assumption that the icon can be a full path in the
config.py.  While the path was being properly passed through to the index
file, the file was never copied properly into place nor rsynced to the web
server.
2021-01-18 14:07:20 +01:00
Hans-Christoph Steiner
fff59e5197 only use AutoName: in checkupdates
AutoName: is only needed for the commit messages generated by checkupdates,
and it makes the logic for localized names confusing.

closes #654
refs #304
2021-01-14 20:36:09 +01:00
Hans-Christoph Steiner
0f6b638986 common.get_app_display_name() for finding app names 2021-01-14 20:34:15 +01:00
Hans-Christoph Steiner
d36f71e048 make config optional when using common.set_FDroidPopen_env()
common.set_FDroidPopen_env() is used to call git and other tools that
are not part of the Android SDK nor require Java, so the items that
are being set from the config are optional.  This lets plugins do
quite a bit without ever setting up a config.
2021-01-11 20:58:50 +01:00
Hans-Christoph Steiner
bf25b4ca03 eliminate app.builds everywhere, it should be app['Builds']
The .txt format was the last place where the lowercase "builds" was used,
this converts references everywhere to be "Builds".  This makes it possible
to load metadata YAML files with any YAML parser, then have it possible to
use fdroidserver methods on that data, like metadata.write_metadata().

The test files in tests/metadata/dump/*.yaml were manually edited by cutting
the builds: block and putting it the sort order for Builds: so the contents
should be unchanged.

```
sed -i \
 -e 's/app\.builds/app.get('Builds', \[\])/g' \
 -e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
 -e "s/app\.get(Builds, \[\]) =/app\['Builds'] =/g" \
 -e "s/app\.get(Builds, \[\])/app.get('Builds', \[\])/g" \
 -e "s/app\.get('Builds', \[\])\.append/app\['Builds'\].append/g" \
 -e "s/app\['builds'\]/app.get('Builds', [])/g" \
 */*.*
```
2020-12-15 08:55:05 +01:00
Hans-Christoph Steiner
fb628c2cb2 include modified and untracked files in status JSON
Ideally, an fdroid repo should be running from a clean git repo, so that
all changes are tracked in git.  This change is useful in seeing which
changes and/or files are not in git.  If there are modified files, the
dirty flag will be set, so this info can help debugging that.
2020-12-15 08:30:48 +01:00
Hans-Christoph Steiner
ac5ed93428 Merge branch 'purge-description-formatting' into 'master'
Purge description formatting

Closes #845 and #678

See merge request fdroid/fdroidserver!828
2020-12-09 18:28:08 +00:00
Jochen Sprickerhof
66d0e6b1f9 find_sdk_tools_cmd always raise exception if not found
test_sdk_exists() succeeds on an empty directory so it does not give any
new information. Contrary, test_sdk_exists() succeeds on an empty
directory, so find_sdk_tools_cmd() returned None even though the tools
where not found, before.
2020-12-09 17:37:02 +01:00
Hans-Christoph Steiner
c98b15e72a purge code that modifies the repo descriptions
YAML now provides nice ways of handling blocks of text, including removing
indents and newlines.  Remove the custom hack.
2020-12-08 09:37:49 +01:00
Hans-Christoph Steiner
2a265cbc0b Merge branch 'build_tools_tests' into 'master'
Build tools tests

See merge request fdroid/fdroidserver!834
2020-11-30 08:39:20 +00:00
Jochen Sprickerhof
25b1f3fe8c Ignore non version number entries in build_tools_path
LooseVersion('debian') stay a string and results in a type error.
2020-11-29 19:04:35 +01:00
Jochen Sprickerhof
4d78d79280 Revert "Ignore non version number entries in build_tools_path"
This reverts commit 5c36f84430.
2020-11-29 19:04:12 +01:00
Jochen Sprickerhof
ce10fcb759 Check if build_tools path exists before listdir 2020-11-29 10:06:39 +01:00
Hans-Christoph Steiner
1c7df94e76 purge unneeded 'build_tools' config option
Back when fdroidserver was built around aapt, that was needed to
guarantee that a compatible version of aapt was used. Now, aapt is
only optionally used for getting the APK ID, so this was just
complicating maintenance.
2020-11-29 10:06:39 +01:00
Hans-Christoph Steiner
1a736c2314 Merge branch 'versionCode_underscore' into 'master'
Support underscore (_) in versionCode

See merge request fdroid/fdroidserver!830
2020-11-27 10:30:44 +00:00
Jochen Sprickerhof
5c36f84430 Ignore non version number entries in build_tools_path 2020-11-26 23:31:20 +01:00
Jochen Sprickerhof
2cb0ff4578 Support underscore (_) in versionCode
Example:

https://github.com/ubergeek42/weechat-android/blob/v1.3.1/app/build.gradle.kts#L67
2020-11-26 21:03:51 +01:00
Hans-Christoph Steiner
d530733290 fix stacktrace crash when env vars are badly set in config.yml
This was trying to delete from a dict that was being iterated through.
Python doesn't like that!
2020-11-12 17:00:03 +01:00
Hans-Christoph Steiner
a9fdb5b401 init: switch to config.yml as the default format 2020-10-23 14:20:49 +02:00
Hans-Christoph Steiner
4bbbf35511 support both config.py and config.yml in common.write_to_config() 2020-10-23 14:18:55 +02:00
Hans-Christoph Steiner
2d115135f7 support env vars in config.yml: awsaccesskeyid: {env: AWS_KEY} 2020-10-23 14:18:55 +02:00
Hans-Christoph Steiner
d3d48dba5e add config.yml as default config file format
None of the config options in config.py require Python code.  YAML is a
common config data format, and it is also used for build metadata.  It is
also much safer to use since it can be pure data, without anything
executable in it.  This also reduces the attack surface of the fdroid
process by eliminating a guaranteed place to write to get code executed.
With config.py, any exploit that can get local write access can turn that
into execute access by writing to the config.py, then cleaning up after
itself once it has what it needs.  Switching to YAML removes that vector
entirely.

Also, this removes the config_file argument.  It is not used in either
fdroidserver or repomaker.  Also, it probably wouldn't work since so
much of the code assumes that the current working dir is the root of the
repo.
2020-10-23 14:18:55 +02:00
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