Commit Graph

263 Commits

Author SHA1 Message Date
Torsten Grote
fb5b169e54 [app] Add support for IPFS CID downloading
This uses IndexFile objects instead of String file names everywhere. The general advantage of that is that we can now pass the hash and the file size to the downloader. For index v2 the hash can then get validated while downloading.
2022-12-01 17:43:13 +01:00
Torsten Grote
f52433730b [app] Fix formatting of timestamps (e.g. lastUpdated) and remove unused Utils methods 2022-12-01 17:43:13 +01:00
Torsten Grote
f6909f4399 [app] Fix downloading from content:// Uris (flash drive repos) 2022-12-01 17:43:13 +01:00
Torsten Grote
6c007e92b3 [app] Remove unused code 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
acafbbaa65 [app] Make AppDetailsActivity use new DB
AppIconsTest is now part of org.fdroid.database.AppTest
2022-12-01 09:27:57 +01:00
Torsten Grote
477436af68 [app] Don't show unknown (other) anti-features by default 2022-11-25 13:37:36 +01:00
Torsten Grote
3f88fdb8cb [app] Remove Provisioner as it isn't used/needed anymore 2022-11-25 12:24:33 +01:00
Hans-Christoph Steiner
8cf836a8b3 IndexV1UpdaterTest is now in the database lib.
libs/database/src/dbTest/java/org/fdroid/index/v1/IndexV1UpdaterTest.kt
2022-11-25 10:20:54 +01:00
Hans-Christoph Steiner
835f7485f0 LocaleSelectionTest is now in org.fdroid.database.BestLocaleTest 2022-11-24 22:44:15 +01:00
Torsten Grote
062c870f23 Move (Http)Downloader into download library 2022-02-16 09:43:18 -03:00
Hans-Christoph Steiner
1d002c9f08 replace Utils.hashBytes with DigestUtils.md5Hex 2022-01-26 19:24:34 +01:00
Hans-Christoph Steiner
50f1b110a2 implement Hasher.isFileMatchingHash() using commons-codec 2022-01-26 19:24:33 +01:00
Hans-Christoph Steiner
8a573a7b59 vendor commons-codec to implement getFileHexDigest and more
Android includes a crippled version of commons-codec 1.3, which it will
silently use instead of any version included in an app.  So we are forced
to vendor it.

This comes from the tag "commons-codec-1.16-rc1":
https://github.com/apache/commons-codec/tree/commons-codec-1.16-rc1/src/main/java/org/apache/commons/codec

For more on this:
* https://github.com/ExCiteS/apache-commons-codec-shaded
* https://gitlab.com/fdroid/fdroidclient/-/merge_requests/1089#note_822501322
2022-01-26 19:24:29 +01:00
Hans-Christoph Steiner
172751ea98 rename Utils.getBinaryHash() to Utils.getFileHexDigest()
Since this method works on any file, not just APKs or binaries...
2022-01-26 19:24:26 +01:00
Hans-Christoph Steiner
262aaf0c4e add tests for Anti-Features filters in SQL
This test reproduces the crash in #2326 before it was fixed in !1076

!1067
2022-01-19 20:43:19 +01:00
Sylvia van Os
5f922444ae Allow choosing which antifeatures to show 2021-10-14 09:25:25 +00:00
Hans-Christoph Steiner
29a1869818 create PublicSourceDirProvider to share installed APK files as streams 2021-07-06 23:24:51 +02:00
proletarius101
42c0fe7430 Migrate the image loader to Glide 2021-07-01 15:57:06 +00:00
Hans-Christoph Steiner
cf94cfb543 run Android Studio's Ctrl-Alt-O Organize Imports on all .java files 2021-04-13 10:23:59 +02:00
proletarius101
755588202f feat: rebase app themes to material themes 2021-04-12 16:36:17 +00: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
2975d4c09f always use fingerprint hashes in lowercase
* Utils.getBinaryHash() converts it to lowercase()
* Utils.getPackageSig() outputs lowercase
* fdroidserver outputs lowercase for all hash entries
2021-02-23 13:28:32 +01:00
Hans-Christoph Steiner
018e3221a7 prevent search terms triggering SQL injection vulns 2021-02-23 13:28:32 +01:00
Hans-Christoph Steiner
611974ecbf @Ignore test that covers when 1000 apps are installed on the device 2021-02-19 09:27:16 +01:00
Hans-Christoph Steiner
857bc5c29e tests: run shutdown() on tested ContentProviders to reduce memory usage
Hopefully?
2021-02-18 22:16:38 +01:00
Hans-Christoph Steiner
22cffbb0d8 prefer complete, localized apps in the category overview cards
To further the goal of providing a fully localized experience based on the
user's Language Settings, this applies similar logic as the Latest Tab to
the apps that are featured for each category.
2021-02-09 17:57:40 +01:00
Hans-Christoph Steiner
a81140be47 run Android Studio default code formatter with Ctrl-Alt-L 2021-02-09 17:51:19 +01:00
Angus Gratton
3cb6cc747b Add Repo.getFileUrl() method to get file URL in a standard way 2021-02-09 09:01:12 +11:00
Angus Gratton
5187b88a08 RepoUrlsTest: Add new tests for correct repo URL formatting 2021-02-09 08:03:55 +11:00
Hans-Christoph Steiner
5c7be1e852 move all App.setLocalized() tests into LocaleSelectionTest class 2021-02-08 09:51:04 +01:00
Hans-Christoph Steiner
57cee93647 trim leading/trailing whitespace from name/summary/video
This should make for predictable layouts, since fastlane entries are likely
to have a tailing newline, but entries in the metadata YAML will not.
2021-02-08 09:51:04 +01:00
Hans-Christoph Steiner
e35335d59c totally overhaul choosing locales from app metadata based on LocaleList
This makes the selection logic heed the list of preferred locales from the
user Settings.

closes #987
closes #1186
refs #1440 #1882 #1730
!886
2021-02-08 09:36:46 +01:00
Hans-Christoph Steiner
16095c8bfd remove unused imports 2020-10-22 11:52:06 +02:00
Hans-Christoph Steiner
c0344c1eed handle .obf.zip by unzipping the map file then installing it 2020-10-21 11:52:21 +02:00
Hans-Christoph Steiner
b316eab85d post-install Intent to tell OsmAnd to import "installed" OBF
OsmAnd will import map files from a file:// URL pointing to an OBF file,
but this currently only works for file:// and not the proper content://.
This uses a hack to disable the warning about file:// URIs but only for the
final stage of installing the .obf file.

Hopefully in the future, this can be changed to use a proper content:// URL
as I suggested to them in this merge request:
https://github.com/osmandapp/OsmAnd/pull/10043
2020-10-21 11:52:18 +02:00
Hans-Christoph Steiner
8cf267ea6c code formatting 2020-10-21 11:52:15 +02:00
Hans-Christoph Steiner
4bb158ef77 handle installing OTA files separately from generic .zip files
It is valid to include .zip files in a repo, but only OTA ZIP files
should be installed into the OTA dir.
2020-10-21 11:52:13 +02:00
Hans-Christoph Steiner
5a0092d42e use shared method for getting full installed path for media files 2020-10-21 11:52:08 +02:00
Hans-Christoph Steiner
0797d82d67 fix emulator test breakage from !873
Use Mockito to mock LocaleList rather than changing App.java.  The only
reliably working emulator tests on gitlab-ci are emulator-22. The change to
App.java in 3406edefcd broke there:

E/ACRA    ( 2231): Caused by: java.lang.NoClassDefFoundError: android.os.LocaleList
E/ACRA    ( 2231): 	at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
E/ACRA    ( 2231): 	at java.lang.Class.getDexCacheType(Class.java:479)
E/ACRA    ( 2231): 	at java.lang.reflect.ArtMethod.getDexCacheType(ArtMethod.java:191)
E/ACRA    ( 2231): 	at java.lang.reflect.ArtMethod.getReturnType(ArtMethod.java:145)
E/ACRA    ( 2231): 	at java.lang.reflect.Method.getReturnType(Method.java:184)
E/ACRA    ( 2231): 	at java.lang.Class.getDeclaredMethods(Class.java:771)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.util.ClassUtil.getClassMethods(ClassUtil.java:1172)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.AnnotatedMethodCollector._addMemberMethods(AnnotatedMethodCollector.java:117)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.AnnotatedMethodCollector.collect(AnnotatedMethodCollector.java:49)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.AnnotatedMethodCollector.collectMethods(AnnotatedMethodCollector.java:40)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.AnnotatedClass._methods(AnnotatedClass.java:382)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.AnnotatedClass.memberMethods(AnnotatedClass.java:322)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addMethods(POJOPropertiesCollector.java:555)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collectAll(POJOPropertiesCollector.java:323)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getPropertyMap(POJOPropertiesCollector.java:287)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getProperties(POJOPropertiesCollector.java:186)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.BasicBeanDescription._properties(BasicBeanDescription.java:164)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.introspect.BasicBeanDescription.findProperties(BasicBeanDescription.java:239)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._findCreatorsFromProperties(BasicDeserializerFactory.java:292)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._constructDefaultValueInstantiator(BasicDeserializerFactory.java:276)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findValueInstantiator(BasicDeserializerFactory.java:224)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:220)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:414)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:458)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.createContextual(ObjectArrayDeserializer.java:128)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:696)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:496)
E/ACRA    ( 2231): 	at com.fasterxml.jackson.databind.Objec
2020-10-21 11:30:48 +02:00
Hans-Christoph Steiner
33fb22eae1 LocaleSelectionTest: include test for TW/HK issue
closes #2087
2020-10-20 23:17:30 +02:00
Hans-Christoph Steiner
138b78572c LocaleSelectionTest: reuse variables to make test cases clear 2020-10-20 23:17:28 +02:00
Marcus Hoffmann
3406edefcd tests for locale selection 2020-10-20 23:17:25 +02:00
Hans-Christoph Steiner
e0cb3f8afc App.isLocalized() marks whether relevant translations are available
!886
2020-07-22 19:46:54 +02:00
Hans-Christoph Steiner
fcc1656595 remove unused imports to placate checkstyle 2020-07-15 15:02:27 +02:00
Dominik Schürmann
319b615da0 Remove unused imports, fix line lengths 2020-07-14 14:10:22 +02:00
Dominik Schürmann
8f81bf0cb9 Use androidx.test artifacts for tests not just androidTests
- this allows replacing deprecated RuntimeEnvironment.application
2020-07-14 14:10:21 +02:00