Commit Graph

92 Commits

Author SHA1 Message Date
Torsten Grote
fa65084e60 [db] make repo certs non-null and remove repos without cert
historically, repos were added to the DB without much information and could stay in a broken state until manually removed. If a repo is updating, it should have a cert. So only repos that never did a single index update don't have a cert. Nowadays, this can not happen anymore as we get the repo and its cert before adding it to the DB. So whenever we update a repo, we know its certificate and fingerprint. Thus, this includes a DB migration removing all broken repos and making the certificate for repos in the DB non-null.
2024-05-22 09:58:05 +00:00
Hans-Christoph Steiner
e5f54ab712 documented the edge case and the 100% correct sort order 2024-05-08 10:20:29 +02:00
Torsten Grote
51eadcc1b2 [db] sort versions with same version code by native code (CPU arch) as well
Some repos (like SimpleX Chat) publish several versions with the same version code only different in native code. Previously, the sorting of those versions was non-deterministic, now we at least make them deterministic by sorting by native code as well in lexicographic ascending order, so arm64 is shown before armeabi-v7a.
2024-05-08 08:02:37 +00:00
Torsten Grote
4c366403fa [db] Maintain legacy repo priority ordering when migrating 2024-04-30 10:54:55 -03:00
Torsten Grote
ef4e72e6d4 [db] handle broken repos without certificate
On versions before 1.18.0, adding a repo would add it as "empty" to the DB without a certificate right away and if there was an issue with it (e.g. typo in URL), it would stay in the DB until manually removed.
Our migration code did not consider such repos.
2024-04-05 21:32:16 +00:00
Torsten Grote
6ffb3fe7e3 Update dependencies 2024-03-05 14:43:28 +00:00
Torsten Grote
52e5509878 Fix lint errors after compileSdk upgrade to 34 2024-03-05 14:43:28 +00:00
Torsten Grote
35affc09db Upgrade to Gradle 8 and SDK 34
This commit tries to limit the changes required to what is needed to make the project compile again. This includes the Kotlin and Room update.
2024-03-05 14:43:28 +00:00
Torsten Grote
3c2ebe6f49 Don't crash on non-hierarchical URIs in RepoUriGetter 2024-02-27 10:39:24 -03:00
Torsten Grote
dec7c4d260 [db] return error when trying to add archive repo 2024-02-20 09:42:42 -03:00
Torsten Grote
e47ef72f75 [db] add archive repo adding to RepoAdder 2024-02-20 09:42:41 -03:00
Torsten Grote
0b292f3383 [db] Add convenience method for setting preferred repo via RepoManager 2024-02-20 09:42:40 -03:00
Torsten Grote
108105596d [db] allow re-ordering repo list and thus priorities 2024-02-20 09:42:40 -03:00
Torsten Grote
51a4bcec58 [db] don't allow initial repos from fixtures to provide weight
The client was already auto-incrementing their weight anyway. But it leaked our internal weight handling into the library consumer which can cause issues like when me are making changes to how we handles repo weights as we are doing now.
2024-02-20 09:42:40 -03:00
Torsten Grote
b993da8db8 [db] New repos now get lower weight than older ones
so they do not override the information from older repos anymore. This is especially an issue for the official repo which historically had the lowest priority while it should have the highest.
2024-02-20 09:42:39 -03:00
Torsten Grote
d9ea1e154b [db] Migrate repo weights and test migration 2024-02-20 09:42:39 -03:00
Torsten Grote
4a01b02fa6 [db] Add DB query for getting repos an app is in 2024-02-20 09:42:39 -03:00
Torsten Grote
b28d2ecd5b [app] Only request updates and suggested versions from preferred repositories
Before, we would install compatible updates from any repository
2024-02-20 09:42:39 -03:00
Torsten Grote
ead8bd1262 [db] Only consider preferred versions for updates and suggested version 2024-02-20 09:42:39 -03:00
Torsten Grote
12af2fa32b [db] reset the preferred repo when it gets disabled or deleted 2024-02-20 09:42:38 -03:00
Torsten Grote
5c27f7033e [db] Move InstantTaskExecutorRule into base DbTest class
so all tests can use LiveData helper methods such as getOrFail() without worrying about that rule
2024-02-20 09:42:38 -03:00
Torsten Grote
704234c9df [db] allow setting a preferred repo per app 2024-02-20 09:42:38 -03:00
Torsten Grote
c894e48675 [db] last minute change to fdroid.link format
The new one is simpler and basically wrap the real URL by just prepending https://fdroid.link/#
2024-02-13 09:47:51 -03:00
Torsten Grote
359145eaef [app] fix debug logging for libraries 2024-02-13 12:26:03 +00:00
Matthew Bogner
cf595783b0 Added a dns class that caches dns lookups 2024-02-01 11:57:31 +00:00
Torsten Grote
10d6e5b244 [db] remove trailing whitespace from fingerprint
Thanks @iNPUTmice for reporting!
2023-12-12 10:06:45 -03:00
Torsten Grote
b1a0403960 [db] Add URL as mirror if repo was added with unofficial mirror 2023-11-22 12:04:17 +00:00
Torsten Grote
6ac7f652ad [db] verify fingerprint of known repositories
if the user tries to add a repository at a known address with a different fingerprint than what we have on file, we'll refuse to add the repo
2023-10-20 09:26:17 -03:00
Torsten Grote
e61886c6b6 Upgrade the libraries we can still upgrade
without going to gradle 8, Java 17 and compileSdk 34
2023-10-20 09:26:17 -03:00
Torsten Grote
10ef3ab055 [db] remove deprecated insertEmptyRepo() method 2023-10-20 09:26:15 -03:00
Torsten Grote
62aa00b5b4 [db] add support for adding repos on content:// and file:// URIs
This complicates the code for this niche use-case, but is wanted by F-Droid to support communities with bad or no internet connectivity.
2023-10-20 09:26:15 -03:00
Torsten Grote
7d64492d92 [db] support adding repos protected with basic auth 2023-10-18 11:39:38 +00:00
Torsten Grote
51d43f9004 [db] update repo cache right after new repo got added
so we can use the new repo right away without waiting for DB to inform us about change. This is important if we want to show list of apps of a repo right after adding it.
2023-10-18 11:39:38 +00:00
Torsten Grote
a5ec22fa6c [db] add queries for getting app list items by repo 2023-10-18 11:39:38 +00:00
Torsten Grote
66b6c955a8 [db] add https:// scheme if it is missing from given repo URI 2023-10-18 11:39:38 +00:00
Torsten Grote
7c0c9c2cae [db] add support for detecting swap repos
Note that those are not really meant to be added to the DB as they are ephemeral by nature.
2023-10-18 11:39:38 +00:00
Torsten Grote
f068d920bd Add RepoManagerAddAllIntegrationTest which adds all known (stable) repos
See: https://forum.f-droid.org/t/known-repositories/721
2023-10-18 11:39:38 +00:00
Torsten Grote
03a5b697bb [db] Handle fdroidrepos:// Uris as well 2023-10-18 11:39:38 +00:00
Torsten Grote
7b52db331c [db] Catch NotFoundException in RepoAdder 2023-10-18 11:39:38 +00:00
Torsten Grote
40c71e4b06 [db] Reject invalid URIs when adding repos 2023-10-18 11:39:38 +00:00
Torsten Grote
6abf3e3a8f [db] Add execution delay in attempt to fix flaky RepoAdder test 2023-10-18 11:39:38 +00:00
Torsten Grote
35481a8011 Initial support for fdroid.link URIs 2023-10-18 11:39:38 +00:00
Aayush Gupta
17faf8d3ef Mark apps with target SDK lower than 23 as incompatiable
* Reason: https://developer.android.com/about/versions/14/behavior-changes-all#minimum-target-api-level

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2023-10-13 23:58:05 +05:30
Torsten Grote
7c9083fea1 Add test for compat flag in AppOverviewItems 2023-10-10 11:08:10 -03:00
Torsten Grote
30ad12cc57 Fix missing flag in RepoV2StreamReceiver 2023-10-10 11:05:24 -03:00
sim
b1f73e8cb7 Do not list incompatible app
Fix #41
2023-10-10 13:50:34 +00:00
Torsten Grote
93979a5dc7 [db] don't return default archive repos for getRepository() query based on certificate 2023-08-23 11:57:47 +02:00
Torsten Grote
1e54751142 [db] handle SerializationException when parsing index for RepoAdder 2023-08-23 10:53:44 +02:00
Torsten Grote
26b2c7b2fd Upgrade test dependencies and fix instrumentation test issue 2023-08-23 10:30:21 +02:00
Torsten Grote
f3e8a0a45b [db] Add plumping for fetching and adding a new repo 2023-08-21 10:52:34 +02:00