1495 Commits

Author SHA1 Message Date
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
Marcus
80693c48ff Merge branch 'fix_1845' into 'master'
do not disable update button because of antifeatures

Closes #1845

See merge request fdroid/fdroidclient!872
2020-05-18 18:00:40 +00:00
Isira Seneviratne
983593688c Remove unused API level checks. 2020-05-11 08:20:20 +00:00
Marcus Hoffmann
03600c347c do not disable update button because of antifeatures
This testing at the wrong point, namely in the app details where you are
already looking at the antifeatures which might be present.
In the list view there's an additional direct check with
isDisabledByAntiFeatures() anyway.

Fix fdroid/fdroidclient#1845
2020-02-25 15:47:33 +01:00
Dmitriy Bogdanov
b64b938f78
Fix inactive action buttons 2020-02-13 17:12:34 +04:00
Chirayu Desai
02b613a08e Handle API 29 split-permissions v3
* Re-do the logic completely, and make it much more clearer.
* Also, Read external storage implies access media location
  *ONLY* on apps not targetting API 29 or above, i.e <= 28
2020-02-02 20:15:18 +05:30
Dmitriy Bogdanov
827e2b2e04
Fix displaying default icon for apps without icons 2020-01-23 13:49:48 +04:00
Marcus Hoffmann
90d803dc7b include android 10 in versions display 2020-01-11 00:44:47 +01:00
Hans-Christoph Steiner
3f64fd4930
init suggestedVersionCode to Integer.MIN_VALUE
Java inits ints to 0.  Since it is valid to have a negative Version Code,
versionCodes are inited to Integer.MIN_VALUE;

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

closes #1063
2020-01-10 18:15:42 +01: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
cd635459ad
rename Cols.SuggestedApk to AutoInstallApk #1063 2020-01-10 18:15:36 +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