1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-06-03 06:10:10 +02:00
Commit Graph

3564 Commits

Author SHA1 Message Date
linsui
2331bcfe15 all @ in srclib tag 2023-12-19 15:49:17 +08:00
Hans-Christoph Steiner
2d5770985f gitlab-ci: silence irrelevant bandit error
This SSH connection is only ever to the Vagrant VM on the same machine.

>> Issue: [B507:ssh_no_host_key_verification] Paramiko call with policy set to automatically trust the unknown host key.
   Severity: High   Confidence: Medium
   CWE: CWE-295 (https://cwe.mitre.org/data/definitions/295.html)
   More Info: https://bandit.readthedocs.io/en/1.7.6/plugins/b507_ssh_no_host_key_verification.html
   Location: ./fdroidserver/build.py:104:8
103	        sshs = paramiko.SSHClient()
104	        sshs.set_missing_host_key_policy(paramiko.AutoAddPolicy())
105	        sshs.connect(sshinfo['hostname'], username=sshinfo['user'],
2023-12-15 08:40:27 +01:00
Hans-Christoph Steiner
e2949cbd61 port to looseversion 2023-12-08 10:48:01 +01:00
Hans-Christoph Steiner
ad9cabdab9 add looseversion license information to vendored file 2023-12-08 10:42:29 +01:00
Hans-Christoph Steiner
a1a88d39cf download looseversion to vendor
e1a5a176a9/src/looseversion/__init__.py
2023-12-08 10:42:27 +01:00
Andrew Gunnerson
679ba6f552
Add support for Python 3.12
Python 3.12 completely removed the builtin `distutils` module. This
commit replaces its use with the `packaging` package, which is an
external dependency, but maintained by the Python developers.

Signed-off-by: Andrew Gunnerson <accounts+gitlab@chiller3.com>
2023-12-07 18:15:05 -05:00
Hans-Christoph Steiner
4536b130df index: add datatype checking to mirrors: and config/mirrors.yml 2023-12-07 17:25:15 +01:00
Hans-Christoph Steiner
6d541e3ef6
establish config/mirrors.yml as a way to set up mirrors
The mirrors: entry in config.yml is great for quick access and shorter
mirror lists.  Now that we are adding a lot more metadata to the mirrors,
including potentially the full text of the privacy policy, having this
in its own file should make these cases easier to manage.
2023-12-07 14:38:26 +01:00
Axel López
825f969652 Support Uri.create() syntax for maven repositories 2023-12-07 01:30:59 +00:00
linsui
2081a9f2d2 lint: remove check_bulletes_lists 2023-12-06 23:35:55 +08:00
linsui
e2e7782ef3 add --force to git deinit 2023-11-25 22:11:19 +08:00
Gregor Düster
b5424d40f1 [checkupdates] Remove UpdateCheckMode "RepoTrunk"
It's unclear whether this still works and we're not planning to maintain
it.
2023-11-21 07:18:17 +00:00
Gregor Düster
81fdba452a [checkupdates] Remove --gplay option
It's unclear whether this still works and we're not planning to maintain
it.
2023-11-21 07:18:17 +00:00
Hans-Christoph Steiner
3e9f27612e Revert "Clone without blobs to save space" !1382
This seems to make git ignore the _fsck skipList_ files.

This reverts commit 24ea1f6852.

closes #1177
fdroid-bootstrap-buildserver!34
!1408
2023-11-20 10:07:05 +01:00
linsui
f99f430e9e deinit git submodule 2023-11-14 01:06:49 +08:00
sim
24ea1f6852 Clone without blobs to save space 2023-11-09 12:13:29 +00:00
Gregor Düster
81fea25509
[docs] Remove unnecessary use of Union 2023-10-26 09:17:43 +02:00
Gregor Düster
02b855da5e
[docs] Start utilising intersphinx 2023-10-22 21:27:08 +02:00
Gregor Düster
f238470855
[docs] Put type annotations in type hints instead of docstring 2023-10-22 21:01:27 +02:00
Gregor Düster
5503a05ef6
[checkupdates] Add more docstrings 2023-10-22 19:19:56 +02:00
cvzi
af1c5d4e5d Fix typo in build.py
encoutered -> encountered
2023-10-10 12:14:20 +00:00
Jochen Sprickerhof
49c415424d
Ignore encoding errors in logs
Found while compiling io.privatestorage.privatestoragemobile_9:

Traceback (most recent call last):
  File "/home/fdroid/fdroidserver/fdroidserver/build.py", line 1053, in main
    if trybuild(app, build, build_dir, output_dir, log_dir,
  File "/home/fdroid/fdroidserver/fdroidserver/build.py", line 813, in trybuild
    build_server(app, build, vcs, build_dir, output_dir, log_dir, force)
  File "/home/fdroid/fdroidserver/fdroidserver/build.py", line 253, in build_server
    logging.debug("buildserver > " + str(line, 'utf-8').rstrip())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfa in position 8: invalid start byte
2023-09-27 17:41:26 +02:00
Jochen Sprickerhof
521ff4fe17 Add default locale for generated categories
The client expects at least a name to be set.

Regression of 2c566cf6.
2023-09-21 14:14:06 +00:00
Licaon_Kter
4d0117d54c fix lint 2023-09-21 13:16:49 +00:00
Licaon_Kter
4a9b69a720 Lint 'main' too 2023-09-21 13:16:49 +00:00
Hans-Christoph Steiner
3757add164 test_sdk_exists to be based on apksigner, that's the requirement
Before, lots of pieces of the Android SDK were required for fdroidserver to
operate, like aapt, zipalign, etc.  Now, apksigner is the only requirement.

%"support APK Signature v2+"
!889
2023-09-17 23:31:07 +02:00
Hans-Christoph Steiner
48559ecec5 category with no apps should be ignored, even if defined in config
https://gitlab.com/fdroid/fdroidclient/-/issues/2619#note_1421280589

The test needed to change because the test index files contained category
definitions that were not ever used in the "copy tests/repo, generate java/gpg
keys, update, and gpgsign" test in tests/run-tests.
2023-09-08 10:45:53 +02:00
Hans-Christoph Steiner
2c566cf68f update: add all categories in metadata files to repo definitions
!1366 makes it so categories are now defined by the repo. Categories can be
defined in the config so that lint has a list of categories to enforce. This
also provides a place for localization and icons for the categories. The old
way of defining categories was just listing them in app metadata files. This
restores that way of functioning when using index-v2.

closes #1137
2023-09-08 10:45:51 +02:00
Hans-Christoph Steiner
64b8ee772c throw useful error if a config YAML file is not a dict 2023-09-08 10:42:27 +02:00
Hans-Christoph Steiner
00aa595f37 deploy: give useful error if rsync is not installed 2023-09-08 10:42:27 +02:00
linsui
8188bb6bfa metadata: set mapping indentation to 2 2023-09-08 08:18:27 +00:00
Hans-Christoph Steiner
9df8caca07 log error if config file name is not known
The case of Anti-Features keys and filenames is quite confusing.  I was
confused to find out that config/antiFeatures.yml is correct, while
config/antifeatures.yml is nothing.  This throws an error message to make
that clear.
2023-07-25 14:31:09 +00:00
Hans-Christoph Steiner
4e28fad55a use constants for names used in the config dict
Hopefully this helps with the Anti-Features case confusion:
* antifeatures
* antiFeatures
* AntiFeatures
2023-07-25 14:31:09 +00:00
Hans-Christoph Steiner
190a95ab17 use consistent name for releaseChannels config file 2023-07-25 14:31:09 +00:00
Licaon_Kter
a756ce0b1a Import - add more template content 2023-07-12 13:45:10 +00:00
Hans-Christoph Steiner
132e953c8c update: use proper name for PIL image filter ANTIALIAS -> LANCZOS
ANTIALIAS was made an alias of LANCZOS in 2.7.0:
https://pillow.readthedocs.io/en/stable/releasenotes/2.7.0.html#antialias-renamed-to-lanczos

The ANTIALIAS alias was removed in Pillow 10.0.0:
https://pillow.readthedocs.io/en/stable/deprecations.html
2023-07-03 17:44:47 +02:00
Hans-Christoph Steiner
bc58959315 purge remnants of repo/categories.txt, which is long unused 2023-06-02 13:26:03 +02:00
Hans-Christoph Steiner
1c3a87e002 lint: get Categories from config 2023-06-02 13:26:03 +02:00
FC Stegerman
9ac7dfe452 update: fix regression for ArchivePolicy: 0
* https://gitlab.com/fdroid/fdroidserver/-/merge_requests/920#note_1413338920
* https://gitlab.com/fdroid/fdroidserver/-/merge_requests/920#note_1413344025
2023-06-01 20:31:24 +02:00
Jochen Sprickerhof
2ee3cccb60 Don't modify app dict when generating v2 antifeatures
Regression of: 061ca38a
Closes: #1103
2023-06-01 17:53:34 +00:00
Licaon_Kter
2a60f6c195 scanner - tgz is gzip 2023-06-01 07:43:42 +00:00
Gregor Düster
31791b44f3
fixup! metadata: Make ArchivePolicy an interger internally 2023-05-30 23:05:59 +02:00
Gregor Düster
337974cbed
metadata: Make ArchivePolicy an interger internally 2023-05-30 23:02:34 +02:00
Hans-Christoph Steiner
fac7ceffe3 metadata: remove non-values from Builds: entries 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
689786eea4 metadata: refactor _builds_to_yaml to use dicts and _format functions
_builds_to_yaml does not use any features of the metadata.Build class, so
it can operate on plain dicts as well.  It also does not need to output
Build instances because those are converted to plain dicts when writing out
to YAML.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
b055559df7 metadata: remove STRING/INT conversion on output
The type conversion should all happen in post_parse_yaml_metadata whenever
possible.  Also, when `if` blocks end in `return`, it is clearer if no
`elif` or `else` is used.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
1bc9b41a2b metadata: YAML 1.2 handles gradle: off now, "off" isn't a boolean
Before switching to YAML 1.2, there needed to be special handling of values
that YAML parsed as booleans.
2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
d3521d7374 metadata: case-insensitive sort for AntiFeatures Categories 2023-05-29 16:50:28 +00:00
Hans-Christoph Steiner
2aa0403208 metadata: handle SHA-256 values that parse as decimal ints
https://gitlab.com/fdroid/fdroidserver/-/merge_requests/1350#note_1370665635
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
642e444cfa metadata: _normalize_type_list for TYPE_LIST quirks and errors
This should reduce surprises when dealing with filenames in things like
`rm:`.  So any float/int/bool value can be used directly, without quoting.

* A plain str/int/float value is interpreted as a list of one string.
* Dictionaries as values throws error.
* A set is treated like a list.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
4711b632b8 metadata: _normalize_type_int to handle exceptions 2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
9f606d0fbb metadata: auto-convert YAML special float values: .nan .inf -.inf
Even for people who know what the special floats not-a-number, infinity,
and negative infinity, they don't necessarily know the YAML 1.2 syntax for
these.  I didn't.  And I've spent some quality time fighting things with
those values.  They are also easy to reliably convert to string values.
2023-05-25 16:53:02 +02:00
Hans-Christoph Steiner
8374842faa metadata: normalize TYPE_BOOL to YAML 1.2 booleans
This makes the internal representation always be a boolean, and that also
means that YAML 1.2 booleans will be written out, e.g. rewritemeta.
2023-05-25 16:53:02 +02:00
linsui
982ecb45ab Fix Chinese example in doc string 2023-05-25 13:06:45 +00:00
Gregor Düster
fde880d780
scanner: Print all short options before long options
This is the default throughout the code base.
2023-05-25 12:33:39 +02:00
Hans-Christoph Steiner
f68b77a933 use pathlib's read_text() to avoid confusin intended blocks 2023-05-23 12:06:21 +02:00
Hans-Christoph Steiner
895e0553a0 error if a YAML Anti-Feature conflicts with a localized file
https://gitlab.com/fdroid/fdroidserver/-/issues/683#note_1383597734
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
b0c05842d8 metadata: RequiresRoot is boolean, according to docs
"Set this optional field to ‘True’ if the application requires root
privileges to be usable."
https://f-droid.org/docs/Build_Metadata_Reference/#RequiresRoot
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
0393e46af9 metadata: handle TYPE_STRINGMAP when writing out YAML 2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
e8ab84b583 metadata: simplify _app_to_yaml()
There are some redundant checks and odd construct:
* cm.update({a: b}) --> cm[a] = b
* getattr(app, field) --> app.get(field)
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
2cb12f9594 metadata: break out write_yaml to standalone function and add unit tests 2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
784bebfee9 metadata: keep manually added NoSourceSince in AntiFeatures
If the metadata file contains NoSourceSince:, it is added to the collection
of Anti-Features.  When rewriting the .yml file, NoSourceSince should only
be written into the AntiFeatures: collection if there are manual changes,
e.g. the user had provided translations.
2023-05-23 10:47:03 +02:00
Hans-Christoph Steiner
061ca38afd define "string map" type for new Anti-Features explanations
closes #683
2023-05-23 10:47:03 +02:00
Georg krause
9af2efda2e feat(scanner): Allow non-zero-exit code if problems were found 2023-05-23 09:54:24 +02:00
Jochen Sprickerhof
2488cb5710 scanner: replace global dict by dataclass 2023-05-12 17:58:04 +00:00
Jochen Sprickerhof
5723a1dafe
Create repo/icons without failure
Fixes fdroid lint CI.
2023-05-12 09:12:28 +02:00
Hans-Christoph Steiner
024d309262 index: rename app var to app_dict, its not an App instance
Throughout the code, variables named "app" are instances of the App class.
In this case, this is related, but it is a dict not an App instance, since
it is being prepared for including in the index-v1.json.
2023-05-11 10:37:45 +02:00
Hans-Christoph Steiner
bb99986630 metadata: fix crash if .fdroid.yml but its not a git repo 2023-05-11 10:37:45 +02:00
Hans-Christoph Steiner
c2bc52dd85 use constant for default locale 2023-05-11 10:37:45 +02:00
Hans-Christoph Steiner
d5a1439457 lint: Anti-Features validator uses names from config 2023-05-11 10:29:04 +02:00
Hans-Christoph Steiner
b04c7ff539 load_localized_config() returns a dict in a stable order
I renamed the variables while I was at it, to make it clearer.
2023-05-10 13:17:40 +02:00
Hans-Christoph Steiner
74a23284e1 common: load_localized_config() should make repo/ if not present
For 1,000,000 checks, this adds:
* ~4 seconds of runtime on a server with very slow disks.
* ~0.7 seconds of runtime on my laptop with a fast SSD.
2023-05-10 09:21:14 +02:00
Hans-Christoph Steiner
49362b5fd1 move load_locale() and file_entry() to be accessible by all modules
* load_locale -> common.load_localized_config() since common handles config
* file_entry -> metadata.file_entry() since metadata handles data format
2023-05-10 09:21:14 +02:00
Hans-Christoph Steiner
f9864dc3a2 rewritemeta: split into remove_blank_flags_from_builds()
This takes this key bit of functionality, splits it out as its own
function, and adds some unit tests.
2023-05-10 09:21:14 +02:00
Hans-Christoph Steiner
8ccc89ad4e index: fix requestsdict check order of operations
If requestsdict is None, the old logic would still check
requestsdict["uninstall"]) and crash there.
2023-05-10 09:21:14 +02:00
Hans-Christoph Steiner
f7830a41f1 deploy: ensure mirrors and binary transparency always create 'master'
If there was a global default on a machine that was something other than
'master', these things would crash with:

Traceback (most recent call last):
  File "/home/hans/code/fdroid/server/fdroid", line 22, in <module>
    fdroidserver.__main__.main()
  File "/home/hans/code/fdroid/server/fdroidserver/__main__.py", line 230, in main
    raise e
  File "/home/hans/code/fdroid/server/fdroidserver/__main__.py", line 211, in main
    mod.main()
  File "/home/hans/code/fdroid/server/fdroidserver/deploy.py", line 833, in main
    push_binary_transparency(BINARY_TRANSPARENCY_DIR,
  File "/home/hans/code/fdroid/server/fdroidserver/deploy.py", line 705, in push_binary_transparency
    local.pull('master')
  File "/usr/lib/python3/dist-packages/git/remote.py", line 1045, in pull
    res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/git/remote.py", line 848, in _get_fetch_info_from_stderr
    proc.wait(stderr=stderr_text)
  File "/usr/lib/python3/dist-packages/git/cmd.py", line 604, in wait
    raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git pull -v -- local master
  stderr: 'fatal: couldn't find remote ref master'
2023-05-10 09:21:14 +02:00
Hans-Christoph Steiner
1e4e2489aa
add keep_when_not_allowed config/option 2023-05-05 09:49:32 +02:00
Jason A. Donenfeld
26472c22ce build: check AllowedAPKSigningKeys in reproducible build scenario
The builder should check the `AllowedAPKSigningKeys` at build time, so
that the CI can check if somebody gives a wrong value that doesn't match
a compared RB binary.  In the event it fails, it gives useful
information, and in the event it succeeds, it makes it clear that this
build has verification back to the developer's original key.

Also, add tests for this to the test suite.
2023-05-05 06:14:31 +00:00
Jason A. Donenfeld
8a0b7e5b1b lint: binary or Binaries requires AllowedAPKSigningKeys
Per fdroiddata!12911 the linter should error out if somebody uses `binary` or
`Binaries` without supplying an `AllowedAPKSigningKeys`.

There are two reasons for this:

- Security: this allows full verification that the binaries built match
  the developers, not just what happened to get uploaded onto github at
  some later point in time.

- Reliable updates: if the signing key changes, users won't be able to
  update, so this is something we should learn about when upstreams send
  in commits changing their signing key, rather than just leaving it to
  chance.
2023-05-05 06:14:31 +00:00
Hans-Christoph Steiner
f871df502d metadata: minor optimization: call fieldtype() once per loop
I profiled this with timeit and a dict with 1000000000 items, and this is
the time difference:

with_equals:		0.8466835720173549
with_is:		0.8536969239939936
with_old:		1.4458542719949037

I also compared using `==` and `is`, and `==` was slightly faster.
2023-05-02 13:53:53 +02:00
Hans-Christoph Steiner
9a9705a667 update test_read_metadata to use ruamel.yaml and YAML 1.2
I tried to get this to indent the .yaml files properly so yamllint defaults
work with tests/metadata/dump/*.yaml, but it didn't take for some reason:

    yaml.indent(mapping=4, sequence=4, offset=2)
2023-05-02 13:52:38 +02:00
Hans-Christoph Steiner
822439dff5 remove exception for ruamel.yaml on Debian/stretch
stretch is no more, and this code base specifies Python 3.9 as minimum.
2023-05-02 13:50:54 +02:00
Hans-Christoph Steiner
74dddfd9fb refactor App.get_last_build() to checkupdates
This function is only used in checkupdates, and removing it from the App
class moves the App class one step closer to being a plain dict, which is a
more Pythonic style.
2023-05-02 13:50:31 +02:00
Hans-Christoph Steiner
8300ed051b ruamel.yaml is now required and the packages are all new enough 2023-05-02 13:41:39 +02:00
Hans-Christoph Steiner
e794ccb38c work towards switching fdroidserver/metadata.py to black 2023-05-02 13:41:27 +02:00
Hans-Christoph Steiner
c6ad8505d4 some easier fixes for black code format 2023-05-02 13:37:07 +02:00
linsui
1a0a0a1839 add litecoin address native segwit format 2023-05-02 11:31:34 +00:00
Hans-Christoph Steiner
1bcd9a8489 metadata: handle empty files and dicts, and error out on non-dicts 2023-04-28 10:55:20 +02:00
Hans-Christoph Steiner
2b81a66b79 App.comments is no more since !772 2023-04-28 10:44:19 +02:00
Hans-Christoph Steiner
dbe21b2b94 metadata: transform all TYPE_STRING values w/ _normalize_type_string()
Before this, there were separate post-parse paths for app-fields versus
build-flags.  This makes all TYPE_STRING values always go through the same
post-parse code path.
2023-04-28 10:44:19 +02:00
Hans-Christoph Steiner
a8531a03a6 metadata: refactor into one function to do YAML post processing
It used to be that there had to be separate post processing steps depending
on whether it was parsing .txt or .yml.  The .txt format is long gone!

!772
2023-04-28 10:44:19 +02:00
Hans-Christoph Steiner
3869e1374b metadata: force TYPE_STRING fields to string in internal dict
* YAML 1.2's boolean is 'true' so this makes the conversion correct.
* rewritemeta would also have to be changed to support this.
2023-04-27 21:51:10 +02:00
Hans-Christoph Steiner
c0ae09e0df metadata: remove strange app arg construct from parse_yaml_metadata()
My guess is that this is some kind of vestige of the old code structure,
back when there was .txt and .yml formats.  This makes it a normal Python
function: input as arg, return value is the result.
2023-04-27 21:51:10 +02:00
Hans-Christoph Steiner
41972e6525 warn on all unrecognized build flags
No need to put the list of keys in a set beforehand, just report all build
flags that are invalid.
2023-04-27 21:51:10 +02:00
Hans-Christoph Steiner
32ea4ef19a
enable black on fdroidserver/asynchronousfilereader/__init__.py 2023-04-27 11:34:18 +02:00
Hans-Christoph Steiner
2273d8203b
enable black on fdroidserver/signatures.py 2023-04-27 11:34:16 +02:00
Hans-Christoph Steiner
77f9ac9fa8
enable black on fdroidserver/rewritemeta.py 2023-04-27 11:34:12 +02:00
Hans-Christoph Steiner
eb81af57bb
enable black on fdroidserver/init.py 2023-04-27 11:34:10 +02:00
Hans-Christoph Steiner
7c692a4532 index-v2 'mirrors' fully settable from config
This lets mirrors: in config.yml be the same list-of-dicts format as it is
in index-v2.  This also includes a data format conversion to maintain the
right format for the old, unchanging index v0 and v1 formats.

#928
#1107
2023-04-27 07:53:02 +00:00
Hans-Christoph Steiner
ad960c6ecd
remove last maven: quirks and make it always a string
It turns out that the maven: field was originally declared as a TYPE_STRING,
given that it was not given a different type in metadata.py's 	flagtypes.
The code was confused because it was given a default value of `False` rather
than `None` as the rest of the TYPE_STRING fields have.

This construct in build.py means maven: should always be a string:

        if '@' in build.maven:
            maven_dir = os.path.join(root_dir, build.maven.split('@', 1)[1])
        else:
            maven_dir = root_dir
2023-04-24 11:08:48 +02:00
Gregor Düster
d971f19e92
metadata: Remove code ensuring YAML 1.2 compatibility
This is no longer necessary b/c the current YAML parser, ruamel.yaml,
implements YAML 1.2 in contrast to the previous parser PyYAML.
2023-04-18 17:08:44 +02:00
Gregor Düster
cff57e1a53
metadata: Remove ununsed code 2023-04-18 17:08:43 +02:00
Jason Donenfeld
6a239cbde4 Add maven central staging repo to allowed list 2023-04-12 12:44:42 +00:00
Jochen Sprickerhof
f5cdeff507
Write status json upon fdroid update start (Closes: #1114) 2023-04-11 17:14:58 +02:00
Hans-Christoph Steiner
36d2a8f899
all ndk paths in config must be strings
The paths in the config must be strings because they are used in things
like env vars where they must be strings.  Plus lots of other places in the
code assumes they are strings.  This is the first step to defining the
border of where paths can be pathlib.Path() and where they must be strings.
2023-04-11 13:54:19 +02:00
Hans-Christoph Steiner
898624dcac
common.get_android_tools_versions() for modern NDK dir layout
NDK r10e is still in use, but is so old, it does not have the modern
sdkmanager package metadata.
2023-04-11 13:54:17 +02:00
Hans-Christoph Steiner
0dd5a7db64
remove NDK download handling in favor of fdroid/sdkmanager 2023-04-11 13:54:05 +02:00
Jochen Sprickerhof
889b8cb372 Don't copy per version anti features to all versions
make_v0() modified the apps data structure to copy an anti feature for a
specific version to all versions resulting in index-v1 and -v2 to
contain wrong anti feature annotations. This patch fixes this and adds a
test that the data structure is no longer modified.

The bug shadowed bugs in the AF implementation of -v1 and -v2 resulting
in not coping the version specific data. This is corrected as well.
This is also tested now.

For -v2 the AF dict is now sorted to make the result reproducible.

Finally The NoSourceSince AF was added as a per version and overall AF
in -v1 and is now only applied as an overall AF and the test is updated
accordingly.
2023-04-04 14:20:41 +00:00
Licaon_Kter
35133a9a8f Scanner - add newer sonatype maven repos 2023-04-04 11:00:13 +00:00
Jochen Sprickerhof
2a5b127773
vmtools: Properly initialize provider member 2023-03-21 14:00:58 +01:00
Hans-Christoph Steiner
9749b26baa pylint: Reenable C0201 consider-iterating-dictionary
* C0201: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary)
2023-03-20 16:33:16 +01:00
Hans-Christoph Steiner
1fbfae355a pylint: Reenable R1723 no-else-break
* R1723: Unnecessary "elif" after "break", remove the leading "el" from "elif" (no-else-break)
2023-03-20 16:33:16 +01:00
FestplattenSchnitzel
abc752314b pylint: Reenable E1101 no-member 2023-03-20 16:33:16 +01:00
linsui
88eac942ec checkupdates: skip when there is no match for version
... name regex in CheckUpdateData
2023-03-20 14:31:08 +00:00
Hans-Christoph Steiner
b92e280eab fix code format for new black rule 2023-03-20 14:47:48 +01:00
Hans-Christoph Steiner
e903952029 always use defusedxml.ElementTree, never xml.etree.ElementTree
defusedxml is now available and installed everywhere, including the
buildserver VM and the buildserver host.

This fixes bandit's error because it didn't understand the try: block
* https://gitlab.com/eighthave/fdroidserver/-/jobs/3965835264
* https://bandit.readthedocs.io/en/1.7.5/blacklists/blacklist_calls.html#b313-b320-xml
2023-03-20 14:44:13 +01:00
Hans-Christoph Steiner
4295d254f9 build: actually raise exception when ndk: entry is invalid
pylint said:
fdroidserver/common.py:4238:8: W0133: Exception statement has no effect (pointless-exception-statement)
2023-03-20 14:43:44 +01:00
FC Stegerman
a5978ad8b2 metadata.Build.ndk_path(): find long form ndk too 2023-03-20 13:39:47 +00:00
Hans-Christoph Steiner
e6ff596b4c update: handle messed up namespaces in AndroidManifest.xml 2023-03-20 13:24:59 +00:00
Hans-Christoph Steiner
f3e49f4bcb
download_repo_index_v2() for verified downloading of index-v2 2023-03-09 12:35:29 +01:00
Hans-Christoph Steiner
dd16076651
add verify_jar_signature() to verify entry.jar 2023-03-09 12:34:55 +01:00
Hans-Christoph Steiner
723873456d
versioned download_repo_index_v1() to be future proof 2023-03-09 12:34:52 +01:00
FestplattenSchnitzel
2dda9db1f1
Remove support for Buildozer 2023-03-09 12:03:57 +01:00
Hans-Christoph Steiner
98448e0481 purge all references to zipalign, that is delegated to other things
Things like apksigner and @obfusk's tools handle this now.
jarsigner is used in the test, since that's the most common use of
`common.find_sdk_tools_cmd()`.

closes #1100
2023-02-22 14:45:51 +01:00
Jochen Sprickerhof
bae94931b4 Fix openjdk detection on different architectures
The pattern in Debian is:

java-$VERSION-openjdk-$DEB_HOST_ARCH

The regex for $DEB_HOST_ARCH did not match arm64, armel and armhf. As it
can be any string just match anything.
2023-02-22 11:24:39 +00:00
Hans-Christoph Steiner
24df262f6b handle str and pathlib.Path in getvcs() 2023-02-21 11:20:15 +01:00
Jochen Sprickerhof
671d1eba4c
Fix compare of Path objects 2023-02-20 11:59:16 +01:00
Hans-Christoph Steiner
b8f59097f7 purge all vestiges of the unused fdroid stats, closes #839
* for f in locale/*/LC_MESSAGES/fdroidserver.po; do msgattrib --set-obsolete --no-wrap --ignore-file=locale/fdroidserver.pot -o $f $f; done
* sed -i 's, \.\./fdroidserver/stats\.py,,' locale/*/LC_MESSAGES/fdroidserver.po
2023-02-19 22:54:38 +01:00
Izzy
04dc297982 downgrade missing ipfs_cid WARNING to DEBUG 2023-02-19 18:49:24 +00:00
Jochen Sprickerhof
e243983ff8 Cleanup upon failing sign_apk (Closes: #1085) 2023-02-19 10:55:23 +01:00
Hans-Christoph Steiner
f468270aa8
support Java 20, which is already in Debian/unstable, closes #1070 2023-02-17 16:35:20 +01:00
Hans-Christoph Steiner
0c9f62a5fe signindex: add JSON check for entry.json
Ran this to generate/refresh the test index files:
`cd tests; ../fdroid update --nosign --pretty`

* converts config.py description to a single line, since the values are no
  longer stripped, so this give the same output.

closes #835
2023-02-17 14:34:53 +00:00
FC Stegerman
2e080c8170 make F-Droid-specific changes to apksigcopier.py 2023-02-17 13:08:23 +00:00
FC Stegerman
c68e1489bd import apksigcopier v1.1.1 2023-02-17 13:08:23 +00:00
Jochen Sprickerhof
0f151a3779 v2: move video to translated text (Closes: #1095)
It contains a link to the actual video and can be translated.
2023-02-16 21:42:09 +01:00
Jochen Sprickerhof
04230dc7c0
common: support PosixPath in log message 2023-02-16 15:17:14 +01:00
Jochen Sprickerhof
fef42dbc87
build: support PosixPath in log message (Closes: #1096) 2023-02-16 14:29:31 +01:00
linsui
58f167b7e5 Add build.binary 2023-02-16 20:16:52 +08:00
linsui
33def096f5 Add postbuild 2023-02-16 12:11:26 +00:00
Jochen Sprickerhof
ecfbdef60f
Fix pathlib usage
Regression from 4a581bdf.
2023-02-16 09:23:07 +01:00
Simon Brand
4a581bdfb6 Remove path workarounds for old python versions 2023-02-15 19:25:48 +00:00
Jochen Sprickerhof
4a6ccae71a
install_ndk: cleanup tempdir 2023-02-06 14:52:32 +01:00
Jochen Sprickerhof
a6700e65ed build: close ssh_channel upon timeout
The build can get stuck when running into the timeout and paramiko not
noticing it. This can be reproduced by setting a small build timeout for
an app. I tried setting set_keepalive() but it did not help. This
forcefully closes the ssh channel to the VM so the fdroid build will
continue. As we destroy the VM in the next step anyhow I think this is
fine.
2023-02-04 10:14:03 +00:00
Jochen Sprickerhof
5e08187567 build: Rename chan to ssh_channel 2023-02-04 10:14:03 +00:00
Hans-Christoph Steiner
b152916b49 fix pylint: C1803: 'local_metadata_files != []' can be simplified to 'local_metadata_files' as an empty list is falsey (use-implicit-booleaness-not-comparison) 2023-02-02 16:02:49 +01:00
Hans-Christoph Steiner
75bf953c80 fix pylint: C0104: Disallowed name "bar" (disallowed-name) 2023-02-02 16:02:49 +01:00
Hans-Christoph Steiner
176301d831 fix pylint W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple) 2023-02-02 15:49:20 +01:00
Hans-Christoph Steiner
156b3f91cc fix pylint W0404: Reimport 're' (imported line 21) (reimported) 2023-02-02 15:49:20 +01:00
fdroid-bot
e71afa1299 Android NDK None (None) 2023-02-02 13:35:29 +00:00
Jochen Sprickerhof
f8e3356365
Distroy VM when running into timeout (Closes: #1094)
halt results in an Traceback.
2023-02-02 10:03:34 +01:00