242 Commits

Author SHA1 Message Date
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 3406edefcd1807cc9352589ac86dbb725c3165b0 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
Dominik Schürmann
360e61118d Fix AppDetailsAdapterTest
by creating a context where styles are available
2020-07-14 14:10:21 +02:00
Dominik Schürmann
cefd706aeb Use robolectric:4.3
- remove constants annotation
- Most @Implementation methods in shadow classes are now protected instead of public.
  Tests should always prefer to call SDK methods directly on Android classes rather
  than on their shadows
2020-07-14 14:10:21 +02:00
Dominik Schürmann
c784274b98 Automated Robolectric migration as in http://robolectric.org/automated-migration/ 2020-07-14 14:10:21 +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
5c0ffea1ef fix checkstyle from !817 !818 2020-06-25 10:31:46 +02:00
Hans-Christoph Steiner
23bd3b81dd support new Liberapay: field, with migration support for LiberapayID:
Liberapay was originally included using a numeric ID, since they had not yet
finalized the public URLs.  Now it is a username.  So this logic prefers
the username in Liberapay: field, and uses the old LiberapayID: as a
fallback.  LiberapayID: will not override Liberapay: if it is already set.
This reuses the old database key since it is stored and processed as a
String anyway.
2020-06-25 10:31:46 +02:00
Hans-Christoph Steiner
1061929fb4 support OpenCollective as a donation option 2020-06-25 10:31:46 +02:00
Marcus Hoffmann
bc6e5e8433 add test for localized icon 2020-06-24 16:57:28 +02:00
Marcus Hoffmann
7b5d7f8fed fix tests after icon changes 2020-06-24 16:57:28 +02:00
Marcus Hoffmann
a500660a41 allow displaying localized icons
Move the logic of calculating the correct iconUrl from sql to java.

Fixes #1460.
2020-06-24 16:57:28 +02:00
Hans-Christoph Steiner
765f6b840f
rename App.upstreamVersionCode to suggestedVersionCode #1063 2020-01-10 18:15:40 +01:00
Hans-Christoph Steiner
10808e2fea
rename App.upstreamVersionName to suggestedVersionName #1063 2020-01-10 18:15:39 +01:00
Hans-Christoph Steiner
531494e571
rename App.suggestedVersionName to autoInstallVersionName #1063
# Conflicts:
#	app/src/test/java/org/fdroid/fdroid/updater/IndexV1UpdaterTest.java
2020-01-10 18:15:37 +01:00
Hans-Christoph Steiner
cc3d874dc4
rename App.suggestedVersionCode to autoInstallVersionCode #1063 2020-01-10 18:15:34 +01:00
Hans-Christoph Steiner
1c0957ce77
disable annoying or erronous PMD errors 2020-01-10 16:28:03 +01:00
Hans-Christoph Steiner
c987e6ad4c
use Collections' isEmpty() to test for emptiness
This should make the code intent clearer and more standard Java.
2020-01-10 16:28:01 +01:00
Hans-Christoph Steiner
c7f3910472
fix PMD "Field has the same name as a method" 2020-01-10 16:28:00 +01:00
Social Justice Wizard
390f0a8d96 Make tests support a variable number of default repos. 2020-01-02 19:34:36 +01:00
Hans-Christoph Steiner
d406a5d66c code formatting to please checkstyle 2019-06-12 14:48:50 +02:00
Hans-Christoph Steiner
bac0ae8f25 show all installed apps as possibilities for panic uninstall
F-Droid should be able to uninstall any app, in theory, not just the apps
that are listed in the index.

This lays some groundwork for moving swap's SelectAppsView to the standard
AppList elements used everywhere else.  It also does a little bit towards
getting rid of InstalledApp in favor of just reusing App.
2019-06-12 14:48:50 +02:00
Hans-Christoph Steiner
3b53af0657 panic: add destructive option to reset repos to defaults 2019-06-12 14:48:50 +02:00
Hans-Christoph Steiner
b400df3ac3 remove unused 'projection' argument from ApkProvider.findApkFromAnyRepo()
One small victory in the ever lasting battle against creeping complexity!
2019-06-12 14:48:50 +02:00
Hans-Christoph Steiner
7ca4ee6539 rename InstalledAppProvider method after what it returns: last update 2019-06-12 14:48:50 +02:00