1511 Commits

Author SHA1 Message Date
Isira Seneviratne
2fa3ff166b Replace access time and last updated PNGs with a vector drawable. 2020-10-23 16:10:05 +05:30
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
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
021d5cc1ff
EXTRA_CANONICAL_URL instance must always be a String 2020-10-21 11:52:19 +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
fe45b33851
use case-insensitive file extension comparison for Apk.isApk()
foo.APK is valid and installable, though not recommended.  Without this,
foo.APK would be copied to /sdcard/Downloads, which seems wrong
2020-10-21 11:30:51 +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
Marcus Hoffmann
3406edefcd
tests for locale selection 2020-10-20 23:17:25 +02:00
Jonas Kalderstam
87d4779c2d Fixed translations preferring secondary locale over english
In the case where a non-standard region has been set for the primary
system language, the secondary locale will be used for localized
strings when available instead of the expected primary language.

For example, set system locales to [en-SE, ja-JP], that is English
with region Sweden, and Japanese with region Japan, most apps will
display English descriptions but those which have a Japanese
translation will display that instead.

This commit adds a fallback case for when the primary locale has not
matched any translations, but it's language part does.
2020-10-20 17:40:56 +00:00
Hans-Christoph Steiner
10a586100e Merge branch 'kunpw-master-patch-10611' into 'master'
Measure http download progress by size of complete file in resumed downloads

See merge request fdroid/fdroidclient!923
2020-09-29 14:51:19 +00:00
Isira Seneviratne
dbbedc7ab1 Create and use notification channels on Android Oreo and higher. 2020-09-22 06:41:41 +05:30
Isira Seneviratne
f4409bad02 Add Android 11 to ANDROID_VERSION_NAMES. 2020-08-26 14:52:46 +05:30
kunpw
1c6ab58a30 Measure http download progress by size of complete file in resumed downloads 2020-08-25 15:12:56 +00:00
Hans-Christoph Steiner
a8f1a58f2d Merge branch 'Use_ConnectivityManagerCompat' into 'master'
Use ConnectivityManagerCompat.isActiveNetworkMetered().

See merge request fdroid/fdroidclient!915
2020-08-25 11:35:30 +00:00
Hans-Christoph Steiner
48c520e343 Merge branch 'Use_ConfigurationCompat' into 'master'
Use ConfigurationCompat.getLocales().

See merge request fdroid/fdroidclient!916
2020-08-25 11:29:28 +00:00
Hans-Christoph Steiner
e0cb3f8afc
App.isLocalized() marks whether relevant translations are available
!886
2020-07-22 19:46:54 +02:00
Glenn Carremans
2021f43761
Changed isLocalized logic
`isLocalized` will be true when App will contain 1 or more valid locales for this device
2020-07-22 19:43:03 +02:00
Isira Seneviratne
a44829d33f Use ConfigurationCompat.getLocales(). 2020-07-22 11:10:32 +05:30
Isira Seneviratne
7b8c12bc78 Use ConnectivityManagerCompat.isActiveNetworkMetered(). 2020-07-22 08:48:12 +05:30
Hans-Christoph Steiner
1ee0d7568b Merge branch 'bottom-nav-colors' into 'master'
make bottom nav color configurable

See merge request fdroid/fdroidclient!906
2020-07-15 08:17:16 +00:00
Dominik Schürmann
319b615da0 Remove unused imports, fix line lengths 2020-07-14 14:10:22 +02:00
Dominik Schürmann
f6b3c4bbe2 Migrate AntiFeaturesListingView to AndroidX 2020-07-14 14:10:22 +02:00
Dominik Schürmann
14996c1eca Fix errors reported by lint 2020-07-14 14:10:22 +02:00
Dominik Schürmann
78e81fb781 Use androidx.preference artifact
- use PreferenceFragmentCompat
- this requires androidx Fragments
- explicit declaration of androidx widgets in preferences.xml
  no longer required
2020-07-14 14:10:21 +02:00
Marcus Hoffmann
352b6fc7c1 add NonNull annotations to override method 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
Dominik Schürmann
f9e4506f2d make bottom nav color configurable 2020-07-13 13:36:50 +02:00
Dominik Schürmann
78a69e7703 Make acra report email configurable via gradle 2020-07-02 09:47:58 +02:00
Hans-Christoph Steiner
69ced9d114 Merge branch 'antifeature-icons' into 'master'
Anti-Feature icons

Closes #2014

See merge request fdroid/fdroidclient!834
2020-06-25 20:39:00 +00:00
Michael Pöhn
a4c3df6c24 Anti-Feature icons 2020-06-25 20:39:00 +00:00
Hans-Christoph Steiner
dfca502ac4
use https://f-droid.org/packages/ instead of https://f-droid.org/app
This avoids a redirect.  Both are supported in the IntentFilters.
2020-06-25 13:31:17 +02:00
Hans-Christoph Steiner
5c0ffea1ef fix checkstyle from !817 !818 2020-06-25 10:31:46 +02:00
Hans-Christoph Steiner
770d80340b run Ctrl-Alt-L code formatter on DBHelper 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
Hans-Christoph Steiner
35d2047536 only show donate icons for free software, otherwise show plain URLs
fdroidserver!754
fdroid-website !557
2020-06-25 10:31:44 +02:00
Marcus Hoffmann
4a5bee3e84 use icon from pm, when there's none from the metadata
This was already done for list views because of the panic uninstall list
but we can easily apply the same logic to the tile view and app detail
view as well.
2020-06-24 16:57:28 +02:00
Marcus Hoffmann
56c05933a2 ignore xml icons
They will never work, they should not be set by fdroidserver but we can
be defensive about not returning them to any views here.
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
941d8a0b8b rename app.icon to app.iconFromApk
This makes it clearer what this is actually referring to.
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
Marcus Hoffmann
4ac2f93238 put archive repo before main
Otherwise when both are enabled the metadata from the archive gets
priority over repo which is not really what we want.
It also breaks a lot of icons, featuregraphics and screenshots.

Fixes fdroid/fdroidclient#1771
Fixes fdroid/fdroidclient#1772
Fixes fdroid/fdroidclient#1686

We also update the default repo priorities for existing installs if we
find the default repos in the original order.

The query is pretty annoying to write in java, here is the raw sql form.

UPDATE fdroid_repo
SET priority = ( SELECT SUM(priority)
            FROM fdroid_repo
            WHERE address IN ('https://f-droid.org/repo', 'https://f-droid.org/archive')
          ) - priority
WHERE address IN ('https://f-droid.org/repo', 'https://f-droid.org/archive') AND
'TRUE' IN (
    SELECT
    CASE
        WHEN a.priority = b.priority-1 THEN 'TRUE'
        ELSE 'FALSE'
    END
    FROM fdroid_repo as a
    INNER JOIN fdroid_repo as b ON
    a.address = "https://f-droid.org/repo" and b.address = "https://f-droid.org/archive"
)
2020-06-24 16:34:43 +02:00
Marcus Hoffmann
82bca90009 UpdateService: fix update scheduling condition
This was blocking updates being scheduled when either data or wifi
updates were disabled. We only want to completely disable the update
service when both are disbaled though.

Ref: #1623
2020-06-15 20:39:56 +02:00
Hans-Christoph Steiner
4031df22f4 Merge branch 'fix_uninstall_crash' into 'master'
fixes a crash that can be triggered when uninstalling with privext

See merge request fdroid/fdroidclient!888
2020-06-10 20:59:16 +00:00
Marcus Hoffmann
3a2ab0baa6 fixes a crash that can be triggered when uninstalling with privext
Fixes the following crash:

05-19 22:39:55.535  1037 24513 W WindowManager: Attempted to add application window with unknown token Token{2f841 null}.  Aborting.
05-19 22:39:55.536 10844 10844 D AndroidRuntime: Shutting down VM
05-19 22:39:55.540 10844 10844 E AndroidRuntime: FATAL EXCEPTION: main
05-19 22:39:55.540 10844 10844 E AndroidRuntime: Process: org.fdroid.fdroid.debug, PID: 10844
05-19 22:39:55.540 10844 10844 E AndroidRuntime: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@d8ae31 is not valid; is your activity running?
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.view.ViewRootImpl.setView(ViewRootImpl.java:891)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:372)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:128)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.app.Dialog.show(Dialog.java:454)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at org.fdroid.fdroid.views.AppDetailsActivity$7.onReceive(AppDetailsActivity.java:607)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:311)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:47)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:120)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:108)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:166)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7529)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

The !isFinishing check was already in the installReceiver part, but
somehow missing in uninstallReceiver. There's also a reference to this
here: http://blackriver.to/2012/08/android-annoying-exception-unable-to-add-window-is-your-activity-running/

I don't understand this crash, especially as the dialouge still gets
shown after adding this check (possibly the parent activity is finishing
and then immediately restarting?). But this sems to realibly fix it.

This was happening when I installed an app, used a new settings entry to
unregister privext as a device owner (by calling it via binder/aidl) and
then trying to uninstall the app I just installed again, whithout
closing f-droid inbetween.
2020-05-19 23:43:25 +02:00
Marcus Hoffmann
a965deb51e clean up db when deleting a repository
Previously everything from a repo staying inside the db when removing it
without disabling it first, the problem manifests when the repo is
readded later (or a mirror), as it would get a new id but all apk
entries still point to the original repoid.

So we now first disable a repo (which just calls
RepoProvider.Helper.purgeApps) before deleting it from the db.

closes Bubu/fdroidclassic#29
2020-05-18 23:36:54 +02:00