Commit Graph

123 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
48a10cac17 whitespace fixes from spotless applying AOSP code format 2023-07-05 21:40:12 +02:00
Hans-Christoph Steiner
703a1c10a7 use READ_EXTERNAL_STORAGE perm since only reading is needed
READ_EXTERNAL_STORAGE was added in SDK 16, this code predates that, so it
still used WRITE_EXTERNAL_STORAGE.  The minSdkVersion is 23 now, so the
correct permission is preferred.  This code does not do any writing, only
reading.

#1440
2023-06-14 18:31:27 +00:00
Torsten Grote
2048d6f478 Add code style to repo and fix it 2023-06-09 17:24:58 +00:00
Torsten Grote
b755a295e5 [app] Run HttpDownloaderTest with higher timeouts 2023-06-06 11:47:33 -03:00
Elias Howell
37323e1dbb fix typos and spelling errors 2023-05-10 16:56:47 -04:00
Isira Seneviratne
ebcc122ea5 Pass empty arrays to toArray(). 2023-01-13 09:01:11 +00:00
Hans-Christoph Steiner
4a95a423f0 SwapRepoEmulatorTest: stop ignoring and use swap IP setup 2022-12-01 17:43:14 +01:00
Hans-Christoph Steiner
3fa5e98fc4 convert SwapRepoTest into initial UpdateServiceTest
Finally, there can be a test for running UpdateService, which is essential
and has some really hairy code in it.  At least swap has been removed from
there.  This is barebones still, but it now can be developed to test quite
a bit of what is still needed in UpdateService.
2022-12-01 17:43:14 +01:00
Hans-Christoph Steiner
d19c5028ac SwapService: split updateRepo out into testable static method 2022-12-01 17:43:14 +01:00
Torsten Grote
da165361c3 [app] Adapt SwapRepoEmulatorTest to new DB 2022-12-01 17:43:14 +01:00
Torsten Grote
cae10f11d9 Make index file name constants public and replace their string usages 2022-12-01 17:43:14 +01:00
Torsten Grote
6c007e92b3 [app] Remove unused code 2022-12-01 17:43:13 +01:00
Torsten Grote
65d0bdf738 [app] Fix ApkVerifierTest by removing index v0 XML parsing and adding permissions directly in the test 2022-12-01 17:43:13 +01:00
Torsten Grote
7a1d288792 [app] remove old ContentProviders from old database implementation 2022-12-01 17:43:13 +01:00
Torsten Grote
a783d3cb94 [app] kill old IndexUpdaters and related code as this is now in libraries via RepoUpdater 2022-12-01 09:27:58 +01:00
Torsten Grote
cf913ffefa [app] Fix or remove UI tests
Tests for v0 index have been removed with their assets.

AntiFeaturesTest is not needed anymore, because filtering doesn't happen in new DB

PanicResponderActivityTest can not be tested as easily anymore

MultiIndexUpdaterTests are now spread over various database tests

LocaleSelectionTest is now in org.fdroid.database.BestLocaleTest

Most tests org.fdroid.fdroid.data now have equivalents in the new database library
2022-12-01 09:27:57 +01:00
Torsten Grote
d61ecbfa08 [app] Adapt nearby/swap to new DB 2022-12-01 09:27:57 +01:00
Hans-Christoph Steiner
41724028ac LocalHTTPDManagerTest: fix broken logic now that test runner works 2022-05-18 13:06:23 +02:00
Torsten Grote
82b131ff71 Address first round of review comments 2022-02-16 09:43:19 -03:00
Torsten Grote
155257d901 Enable explicit API Mode for download library
and clean up the API a bit in the process
2022-02-16 09:43:19 -03:00
Torsten Grote
a43d5d8ef1 Add glide support to download library 2022-02-16 09:43:19 -03:00
Torsten Grote
d5ceb0b202 Add proxy support to download library 2022-02-16 09:43:18 -03:00
Torsten Grote
eb9837811c Let HttpPoster also use HttpManager (renamed from DownloadManager) 2022-02-16 09:43:18 -03:00
Torsten Grote
062c870f23 Move (Http)Downloader into download library 2022-02-16 09:43:18 -03:00
Torsten Grote
9ca7bebc88 Add mirror support in downloads library 2022-02-16 09:43:17 -03:00
Torsten Grote
3d479b29e5 Initial work on separate download library 2022-02-16 09:43:17 -03:00
Hans-Christoph Steiner
402cbcc3c2 implement combined EXTRA_STREAM/EXTRA_TEXT Intents for createChooser()
An app can create an `ACTION_SEND Intent` to share a file and/or text
to another app.  This `Intent` can provide an `InputStream` to get the
actual file via `EXTRA_STREAM`.  This `Intent` can also include
`EXTRA_TEXT` to describe what the shared file is.  Apps like K-9Mail,
Gmail, Signal, etc. correctly handle this case and include both the
file itself and the related text in the draft message.

This is used in F-Droid to share apps.  The text is the
name/description of the app and the URL that points to the app's page
on f-droid.org.  The `EXTRA_STREAM` is the actual APK if available.
Having all together means that the user can choose to share a message
or the actual APK, depending on the receiving app.

Unfortunately, not all apps handle this well.  WhatsApp and Element
only attach the file and ignore the text.
https://github.com/vector-im/element-android/issues/3637
2021-07-06 23:24:51 +02:00
Hans-Christoph Steiner
29a1869818 create PublicSourceDirProvider to share installed APK files as streams 2021-07-06 23:24:51 +02:00
Hans-Christoph Steiner
8773d6205c rename BannerUpdatingRepos --> StatusBanner 2021-04-13 16:26:23 +02:00
Hans-Christoph Steiner
d1e80bb067 add FDroidMetricsWorker to gather data into JSON reports 2021-03-08 15:30:30 +00:00
Hans-Christoph Steiner
d3be7d692d add CleanCacheWorker Robolectric tests 2021-03-03 18:49:47 +01:00
Hans-Christoph Steiner
3afd269a9c enable all Espresso tests when run from Android Studio
This should not make them run in the .gitlab-ci.yml setup, since that is
set to ignore @LargeTest
2021-02-23 17:53:33 +01:00
Hans-Christoph Steiner
06dbd048af add WorkManagerTestRule to CleanCacheWorkerTest 2021-01-27 15:38:42 +01:00
Isira Seneviratne
ab8e7935b0 Add WorkManagerTestRule. 2021-01-21 06:18:23 +05:30
Isira Seneviratne
7c81b1ad15 Use WorkManager to clean the cache. 2021-01-21 06:17:28 +05:30
Isira Seneviratne
fb8922b252 Use ContextCompat.getSystemService(). 2020-11-06 16:27:11 +05:30
Hans-Christoph Steiner
c157c3f047 fix Espresso test broken by androidx id change
fdroid/fdroidclient!899
2020-10-21 11:52:26 +02:00
Hans-Christoph Steiner
3b2b9ae1df fix ApkVerifierTest when running on android-29+
fdroid/fdroidclient!856
2020-10-21 11:52:24 +02:00
Hans-Christoph Steiner
15a024b06e update javadocs 2020-10-21 11:52:22 +02:00
Dominik Schürmann
2701961175 Fix LocalizationTest by recognizing ds format 2020-07-14 17:57:07 +02:00
Dominik Schürmann
319b615da0 Remove unused imports, fix line lengths 2020-07-14 14:10:22 +02:00
Dominik Schürmann
0034e1faff Replace old InstrumentationRegistry.getTargetContext()
with ApplicationProvider.getApplicationContext()
2020-07-14 14:10:22 +02:00
Marcus Hoffmann
18592150c1 perform androidX migration through android studio
Project compiles and works fine after this.
2020-07-14 14:10:21 +02:00
Hans-Christoph Steiner
1c0957ce77 disable annoying or erronous PMD errors 2020-01-10 16:28:03 +01:00
Hans-Christoph Steiner
dca8023d7d ignore flaky swap webserver tests by default 2019-11-30 22:00:53 +01:00
Hans-Christoph Steiner
bfcc5c974e fix crash in Panic Settings
This got missed in ef90fd2dfd
fdroid/fdroidclient!829

for f in `find app/src/ -type f -name \*.xml|xargs grep --no-filename -F '<org.fdroid.fdroid' | awk '{ print $1}' |sort -u`; do test -e app/src/*/java/`echo $f | sed -e 's,<,,' -e 's,\.,/,g'`.java || echo FAIL $f; done
2019-07-06 00:12:28 +02:00
Hans-Christoph Steiner
69642d88f7 add placeholder SwapWorkflowActivity for basic flavor 2019-06-17 11:28:52 +02:00
Hans-Christoph Steiner
15d349f863 move LocalHTTPD and WifiStateChangeService into ".nearby" package 2019-06-17 11:18:07 +02:00
Hans-Christoph Steiner
43c7574228 fold ".views.swap" package into ".nearby" class 2019-06-17 10:50:56 +02:00
Hans-Christoph Steiner
790b5ab27d rename 'localrepo' package to 'nearby' to cover the whole thing 2019-06-17 10:50:56 +02:00