2403 Commits

Author SHA1 Message Date
Dominik Schürmann
f6b3c4bbe2 Migrate AntiFeaturesListingView to AndroidX 2020-07-14 14:10:22 +02:00
Dominik Schürmann
f089b9df08 Use correct uses-library tag in androidTest 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
0034e1faff Replace old InstrumentationRegistry.getTargetContext()
with ApplicationProvider.getApplicationContext()
2020-07-14 14:10:22 +02:00
Dominik Schürmann
0ed4fb8e60 Update bouncycastle to 1.65 2020-07-14 14:10:22 +02:00
Dominik Schürmann
06b839d14f Fix test and androidTest dependencies 2020-07-14 14:10:21 +02:00
Dominik Schürmann
1fde5bd355 Remove androidx.legacy dependency 2020-07-14 14:10:21 +02:00
Dominik Schürmann
930f7e2c13 Remove obsolete useProguard flag 2020-07-14 14:10:21 +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
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
d67db78997 Fix AndroidManifest for androidTest 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
352b6fc7c1 add NonNull annotations to override method 2020-07-14 14:10:21 +02:00
Marcus Hoffmann
59ad42a73b add magic prefrence xml to cancel preferences page offset
Taken from here:
https://stackoverflow.com/a/53969021
2020-07-14 14:10:21 +02:00
Marcus Hoffmann
38374e1d32 update androidX libraries to latest versions
This needs another AGP and gradle update as
com.google.android.material:material:1.1.0 created compile errors
otherwise.
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
Marcus Hoffmann
e2a75f69ee androidX migrations preparations
We need compileSdk 28 and the required AGP and gradle versions, as well
as updating to compatible support library revisions.

minSdk and targetSdk needs to move to build.gradle from manifest.
buildToolsVersion isn't used anymore.
2020-07-14 14:10:21 +02:00
Dominik Schürmann
78a69e7703 Make acra report email configurable via gradle 2020-07-02 09:47:58 +02:00
Hans-Christoph Steiner
0a9e58cb2a
version code to 1010000
[skip ci]
2020-06-25 22:49:00 +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
Hosted Weblate
e66fdeb8ef
Update translation files
Updated by "Squash Git commits" hook in Weblate.

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/
2020-06-25 17:15:25 +02:00
Hans-Christoph Steiner
864453bb5d
autoVerify="false" on all IntentFilters for HTTP/HTTPS #2004
The autoVerify function seems to require that the app only declare domain
names in the IntentFilters that are set up with the "site association"
files.  For F-Droid to support the verified app link, it would have to stop
matching play.google.com, amazon.com, etc.  This autoVerify function also
triggers DNS lookups at the system level, which might not be forwarded over
Tor, in certain scenarios.  So this just disables the whole feature.

https://developer.android.com/training/app-links/verify-site-associations
2020-06-25 13:31:22 +02:00
Hans-Christoph Steiner
757476dc9b
use canonical download URL: https://f-droid.org/F-Droid.apk
fdroid-website@6be403585352126b04e5c72623ef5852cceb2502
fdroid-website!536
2020-06-25 13:31:20 +02: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
adf62a5b1f
fix format strings 2020-06-25 13:11:37 +02:00
Hans-Christoph Steiner
993611e90f
remove Android string quoting 2020-06-25 13:05:32 +02:00
Hans-Christoph Steiner
3b14604589
Merge remote-tracking branch 'weblate/master' into weblate
* weblate/master:
  Translated using Weblate: Hebrew (he) by Yaron Shahrabani <sh.yaron@gmail.com>
  Update translation files
  Update translation files
  Update translation files
  Update translation files
  Update translation files
  Update translation files
  Update translation files
  Translated using Weblate: Portuguese (Portugal) (pt-PT) by Manuela Silva <mmsrs@sky.com>
  Translated using Weblate: Ukrainian (uk) by ihor_ck <igor_ck@outlook.com>
  Update translation files
  Update translation files
  Translated using Weblate: Marathi (mr) by Prachi Joshi <josprachi@yahoo.com>
  Translated using Weblate: Romanian (ro) by Licaon Kter <licaon.kter@protonmail.com>
  Translated using Weblate: Serbian (sr) by Саша Петровић <salepetronije@gmail.com>
  Update translation files
  Update translation files
  Update translation files
  Update translation files

 Conflicts:
	app/src/main/res/values-fa/strings.xml
	app/src/main/res/values-hr/strings.xml
	app/src/main/res/values-ta/strings.xml
	app/src/main/res/values-uk/strings.xml
2020-06-25 13:03:53 +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
c9178d1a08 switch donate layout grid from 3 to 2 columns to handle longer URLs 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
Hosted Weblate
82e07f59d9
Update translation files
Updated by "Squash Git commits" hook in Weblate.

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/
2020-06-25 08:54:04 +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
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
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
527917393e Merge branch 'do-not-crop-featureimage' into 'master'
Do not crop feature image

Closes #1798

See merge request fdroid/fdroidclient!874
2020-05-18 18:28:34 +00: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