1192 Commits
Author SHA1 Message Date
Hans-Christoph Steiner 4a1bde02d5 tests/test_common.py: move to formatting with black
The oldest test cases are still really whack formatting, so they are not
included.
2026-10-27 07:52:42 +00:00
Hans-Christoph Steiner e6e4b85ea2 download_repo_index_v2 cleans up its tmp files
download_using_mirrors() downloads to temp files and returns the path, but
nothing was ever cleaning those temp files up.  On an active server, like
verification, this can fill /tmp/ with many gigs of index-v2.json files.
2026-10-27 07:52:42 +00:00
Hans-Christoph Steiner e050f775fe use clear dir names for tmp download dirs
/tmp has been filling up on verification, and it took me a little while to
track down the source.  The tmp dirs were called /tmp/tmp98345sf.  This
will replace the "tmp" prefix with something meaningful.
2026-10-27 07:52:42 +00:00
Hans-Christoph Steiner fe00abe2dc test_install_ndk: fix typo 2026-10-27 07:52:42 +00:00
thefuture 4c109b643a fix black issue 2026-10-24 15:06:56 +03:00
thefuture c2df702663 use pgsty/silo image a fork of minio 2026-10-24 15:02:55 +03:00
thefuture 4a3e99e29a black fix suggestion 2026-10-24 14:45:56 +03:00
thefuture 86fdabb4f0 add net test containers 2026-10-24 14:40:15 +03:00
Hans-Christoph Steiner 5bfcc371ae make_source_tarball: better .git exclusion and no .hg 2026-10-22 22:59:46 +02:00
Hans-Christoph Steiner 6bfcf06099 make_source_tarball: add tests and fix issues 2026-10-22 22:59:46 +02:00
Unknown 69d497ba55 common: guard SOURCE_DATE_EPOCH against None return value
When get_source_date_epoch(get_build_dir(app)) returns None (e.g. when
the app source directory has not been initialized or is missing git/scm
metadata), assigning env['SOURCE_DATE_EPOCH'] = None causes a TypeError
since environment variable values must be strings.

Ensure SOURCE_DATE_EPOCH is only set when a timestamp is returned, and
delete any stale SOURCE_DATE_EPOCH key otherwise.

Closes #1329
2026-10-19 12:38:09 +00:00
Patrick Gaskin 092e68dee7 fix fastlane metadata in a subdir losing its images and changelogs
insert_localized_app_metadata checks a build's subdir based on the path
suffix, but this only works for the base locale dir (with the summary,
descriptiion, etc), not the images/changelogs subdir, which are silently
ignored.

Triple-T metadata does not have this issue since copy_triple_t_store_metadata
finds the base metadata dir, then goes from there.

Searching for the fastlane dir from the end of the path instead of using
a fixed offset fixes this.
2026-09-11 12:59:32 +00:00
Hans-Christoph Steiner 61c6290a7a signindex: fix test_signindex case which was not running
* `if common.find_apksigner({}) is None:` was always false.
* test case never generated files for archive/
* use --nosign to only sign jars with signindex
2026-09-11 10:30:02 +00:00
Hans-Christoph Steiner bd56812fed signindex: complete conversion to common.get_config()
5b997e4037
2026-09-11 10:30:02 +00:00
Hans-Christoph Steiner d03ee2b138 hide icon warnings in integration tests 2026-09-11 10:30:02 +00:00
Hans-Christoph Steiner f9b5bbd66f index: ensure all indexes have the same timestamp
The current method messed up on timezones in some cases. Also fixes:
DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and
scheduled for removal in a future version. Use timezone-aware objects to
represent datetimes in UTC:
datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
2026-09-11 10:30:02 +00:00
Hans-Christoph Steiner b8fbf79a9d add test of production index.(css/html/png) setup 2026-09-11 09:59:48 +00:00
Hans-Christoph Steiner 86d643e861 zlib-ng's non-determinism breaks implanting APK sigs #1354
Python 3.14 defaults to building with zlib-ng, so this is a workaround
until signature copying is fixed.

This also fixes !1848 tests on macOS:
https://gitlab.com/fdroid/fdroidserver/-/jobs/15472305534
FileNotFoundError: [Errno 2] No such file or directory: '/etc/os-release'
2026-09-10 16:21:27 +00:00
Michael Pöhn ebcf5636e7 🪙 add support for taler template based donations 2026-08-27 16:00:16 +02:00
Michael Pöhn d7f52c4580 🧋 add array support for doante link metadata.
With this change the `Donate` metadata field can also be an array of
links, not just one single link. e.g.:

```
Donate:
  - "https://f-droid.org/donate"
  - "https://donate.example.com/fdroid"
```

For backwards compatibility the old solo string format is also
supported. e.g.:

```
Donate: "https://f-droid.org/donate"
```
2026-08-27 13:54:58 +00:00
ByteHamster 0ae5a4fcdc Fix symlink handling around triple-t/fastlane metadata 2026-08-23 10:13:02 +02:00
Hans-Christoph Steiner 32d0b3bf8f signindex: test exception when failing to sign v0/v1 2026-07-22 11:26:28 +02:00
Hans-Christoph Steiner 5b997e4037 signindex: convert to common.get_config()
717df09be0
2026-07-22 08:19:42 +02:00
Michael Pöhn 1ea8ca7685 🧺 make TmpCwd more fault tolerant
TmpCwd used to raise FileNotFound exception when the processes cwd is
pointing to a non-existent directory.  This change makes it so that
TmpCwd doesn't raise this exception anymore.
2026-07-21 10:44:38 +00:00
Michael Pöhn 530c885a66 🌴 update: add get_apks_without_allowed_signatures v1 sig scheme only test 2026-07-21 10:44:38 +00:00
Michael Pöhn 02da07b736 🐽 make scan_apk_androguard determine is_v1_signed_only 2026-07-21 10:44:38 +00:00
Michael Pöhn 671b728789 ✂️ add apkfile_is_v1_signed_only
Intially apk_is_v1_signed_only() was designed to expect APK file-paths
as parameter. In some cases we already have an androguard APK instance,
so those changes the signature of apk_is_v1_signed_only to take
androguard APK objects instead of file-paths. Additionally we introduce
apkfile_is_v1_signed_only for working with file-paths.
2026-07-21 10:44:38 +00:00
Michael Pöhn 28f979584d 🗼 use v2+ signed apk in TestUpdateWithAllowedApkSigningKeys 2026-07-21 10:44:38 +00:00
Michael Pöhn 8b70f83d50 🛣️ switch TestUpdateWithAllowedApkSigningKeys to pathlib 2026-07-21 10:44:38 +00:00
Michael Pöhn 938009d7cc 🪣 TestUpdateWithAllowedApkSigningKeys rm pointless metadata copies 2026-07-21 10:44:38 +00:00
Michael Pöhn b3e2f47ae4 🪚 simplify tmp dir setup in TestUpdateWithAllowedApkSigningKeys 2026-07-21 10:44:38 +00:00
Michael Pöhn eb04ef67af 🔨 test_update_with_AllowedAPKSigningKeys contains 2 tests -> split 2026-07-21 10:44:38 +00:00
Michael Pöhn 366aee7f45 👉 move test_update_with_AllowedAPKSigningKeys into separate TestCase 2026-07-21 10:44:38 +00:00
Michael Pöhn f61f06b413 🤏 separate test case for get_apks_without_allowed_signatures 2026-07-21 10:44:38 +00:00
Michael Pöhn b218b890b1 ⚔️ build: reject v1 only sigend reference Binaries 2026-07-21 10:44:38 +00:00
Michael Pöhn 836d32fe69 🚠 build: refactor binary download into testable sub function
This adds _download_and_check_reference_binary() to build.py and moves
some lines from the humongous main() function there. It also adds some
unit tests for that new fucntion.
2026-07-21 10:44:38 +00:00
Michael Pöhn 3a83ae9fd7 📇 publish: do not allow v1 signed Binaries 2026-07-21 10:44:38 +00:00
Michael Pöhn ac3405fb28 🧓 add common.apk_is_v1_signed_only
Add a helper function that determines whether an APK is exclusively
singed with v1 signatures.
2026-07-21 10:44:38 +00:00
Hans-Christoph Steiner 5c7bac295d publish: skip sig implant test on Fedora #1354
There is a complicated issue with the ZIP library that needs to be resolved
in Fedora before this can work.
2026-07-21 12:32:28 +02:00
Timothy Mario Redaelli 82e644fa17 common, publish: support v2/v3-only sigdirs in developer signature graft 2026-06-03 20:51:49 +00:00
Hans-Christoph Steiner 093752b06f use IntEnum for SCREEN_RESOLUTIONS
This is a Pythonic structure for gathering all these constant values that
are used in a manageable way.

Enums have SCREEN_RESOLUTIONS['ldpi'] but throw KeyErrors when the key is
there.
2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner 778b6527a0 fix "doesn't conform to UPPER_CASE naming style (invalid-name)" 2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner 8ab474ad3b update: "0" DPI only needed for extraction, not icon_dirs
The '0' value is not used to generate an icon_dir, e.g. repo/icons-0/, so
this additional "all" structure is not needed.

The 0 DPI value is the really old default when no DPI specified.
https://github.com/androguard/androguard/blob/dd458bead6165975c3ef0b1b78eaf2450e4889d9/androguard/core/apk/__init__.py#L681
2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner 9f101af294 update: fix ancient bug where not all icons get moved to archive 2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner f3e3605f64 update: stop using density values as strings, they're ints 2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner cc47f7cc0f update: add tests for extract_apk_icons() 2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner b2a7e8eae2 update: parse icons by fully resolving the resources
This was doing only quite simple resolution, which missed lots of
things starting in Android Gradle Plugin 4.2.
2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner 09947064ff add tests of fdroidserver.update.get_icon_dir() 2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner f668343b35 update: move icon density parse to standalone function for testing 2026-05-22 23:02:59 +00:00
Hans-Christoph Steiner 02139d196d remove obsolete test back when aapt dump badging was parsed
see !485
2026-05-22 23:02:59 +00:00