2119 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
254bd6a4db allow hotspots to work for swapping, even if they don't have internet
It is possible to enable the Hotspot AP on a device, and disable mobile
data.  This setup will work fine for swapping, but the detection logic for
whether there is metered internet was blocking it.  So this adds a new
state to represent and handle this condition.
2019-06-13 21:17:31 +02:00
Hans-Christoph Steiner
679820c0b2 get the SSID info when hotspot is active 2019-06-13 21:17:31 +02:00
Hans-Christoph Steiner
9db9f32bf1 show hotspot-specific status messages when hotspot is active 2019-06-13 21:17:31 +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
89140d5334 InstalledAppProvider: use Android sematics for query methods
Throughout Android, a null projection means return the full record.  This
is well documented.

Also, null sortOrder means use default sort order.
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
515b5b08f0 set up Panic preference to choose apps to uninstall on trigger 2019-06-12 14:48:50 +02:00
Hans-Christoph Steiner
3812331166 stop crashing if the suggested version ends up being bogus
It is possible for repo operators to specify a bad CurrentVersionCode for
an app that is also in another repo, and cause confusion in the suggested
version calculation.  Or if one repo's index is very out of date.  This
adds a fallback for these cases, so at least it'll stop the crash and
attempt the user's requested install.
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
Michael Pöhn
5dd866d39e fix checkstyle 2019-06-12 12:04:15 +02:00
Michael Pöhn
067d39f72d preferences fragment: setup use tor preferences changed only once 2019-06-11 16:23:22 +02:00
Michael Pöhn
88f3a68f83 deduplicate error prone proxy settings code 2019-06-11 16:23:22 +02:00
Michael Pöhn
292950898e replace prone useTor preference mirror value from FDroidApp with direct preference calls 2019-06-11 16:23:22 +02:00
Yoginth
0851fea8eb
Fix Typos 2019-06-05 03:52:40 +00:00
Hans-Christoph Steiner
6d3a7d4537 move all QR Code related classes to .qr package 2019-05-24 15:47:48 +02:00
Hans-Christoph Steiner
23fc17ba5f purge confusing, unused duplicate string/icon assignment in bottom nav
fdroid/fdroidclient#1785
2019-05-24 15:47:48 +02:00
Hans-Christoph Steiner
c652718a4a fix lint: Repeated word "do" in message: possible typo [Typos] 2019-05-24 15:47:48 +02:00
Hans-Christoph Steiner
1b670df1fd
./tools/remove-unused-and-blank-translations.py 2019-05-24 15:38:36 +02:00
Hosted Weblate
36f29bc6a8 Translated using Weblate: Portuguese (pt) by ssantos <ssantos@web.de>
Currently translated at 100.0% (431 of 431 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt/

Translated using Weblate: Portuguese (pt) by ssantos <ssantos@web.de>

Currently translated at 100.0% (22 of 22 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt/

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/

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/

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/

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/

Translated using Weblate: Portuguese (pt) by ssantos <ssantos@web.de>

Currently translated at 100.0% (22 of 22 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt/

Translated using Weblate: Portuguese (pt) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt/

Translated using Weblate: Portuguese (pt) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt/

Translated using Weblate: Portuguese (pt) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt/

Translated using Weblate: Portuguese (pt) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt/

Added translation using Weblate: Portuguese (pt) by Rui Mendes <xz9@protonmail.com>
2019-05-24 15:36:13 +02:00
Hosted Weblate
2289a07483 Translated using Weblate: Icelandic (is) by Sveinn í Felli <sv1@fellsnet.is>
Currently translated at 100.0% (431 of 431 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/is/

Translated using Weblate: Icelandic (is) by Sveinn í Felli <sv1@fellsnet.is>

Currently translated at 100.0% (22 of 22 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/is/
2019-05-24 15:36:13 +02:00
Hosted Weblate
4258315286 Translated using Weblate: Hebrew (he) by Yaron Shahrabani <sh.yaron@gmail.com>
Currently translated at 100.0% (431 of 431 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/he/

Translated using Weblate: Hebrew (he) by Yaron Shahrabani <sh.yaron@gmail.com>

Currently translated at 100.0% (22 of 22 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/he/

Translated using Weblate: Hebrew (he) by Yaron Shahrabani <sh.yaron@gmail.com>

Currently translated at 100.0% (22 of 22 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/he/

Translated using Weblate: Hebrew (he) by Yaron Shahrabani <sh.yaron@gmail.com>

Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/he/
2019-05-24 15:36:13 +02:00
Hosted Weblate
c2070fb76f Translated using Weblate: German (de) by Hans-Christoph Steiner <hans@guardianproject.info>
Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/de/

Translated using Weblate: German (de) by ssantos <ssantos@web.de>

Currently translated at 100.0% (22 of 22 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/de/

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/

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/

Translated using Weblate: German (de) by C. Rüdinger <Mail-an-CR@web.de>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/de/

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/

Translated using Weblate: German (de) by C. Rüdinger <Mail-an-CR@web.de>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/de/

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/

Translated using Weblate: German (de) by ssantos <ssantos@web.de>

Currently translated at 100.0% (22 of 22 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/de/

Translated using Weblate: German (de) by CurlingTongs <o11577482@nwytg.net>

Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/de/

Translated using Weblate: German (de) by C. Rüdinger <Mail-an-CR@web.de>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/de/

Translated using Weblate: German (de) by Sören Strecke <soeren.strecke@live.de>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/de/

Translated using Weblate: German (de) by C. Rüdinger <Mail-an-CR@web.de>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/de/

Translated using Weblate: German (de) by ssantos <ssantos@web.de>

Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/de/
2019-05-24 15:36:13 +02:00
Hans-Christoph Steiner
fea778793c replace BluetoothSwap with BluetoothManager, using HandlerThread
This is the last of the SwapType stuff!

fdroid/fdroidclient#1723
fdroid/fdroidclient#1669
2019-05-24 13:35:56 +02:00
Hans-Christoph Steiner
effcf4bfa9 purge WifiSwap class in favor of Intents and Services 2019-05-24 13:35:56 +02:00
Hans-Christoph Steiner
79e7e78e7f create testable LocalHTTPDManager for controlling the webserver
The RxJava tricks were a nightmare...
2019-05-24 10:02:22 +02:00
Hans-Christoph Steiner
d91fbe7b0e rework swap startup putting SwapService first
SwapService is the thing that needs to be always running, and the last
thing killed.  So it should start first, and stop last.  So now, the user
clicking the button starts SwapService, which starts SwapWorkflowActivity.
This also eliminatings the "Loading" screen in favor of just showing the
StartSwapView with various inline progress indicators.
2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
39f23f6876 add required length limits to swap strings for the translators 2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
9dc9a23a41 fix all RtL lint errors in swap layouts 2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
f0158063fb show full error messages from UpdateService
The "cause" is the Exception that was caught and embedded into the
UpdateException, so it has more info on what happened.
2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
b5d94b7476 convert swap error "back" button to "Try again"
The Android back button provides a working back function, and the Swap
"close" button on the upper left already provides a reset function. So this
turns the "back" button to be a "try again" button which re-runs the
connection process.
2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
d5f2e26ea7 use one method everywhere for the "swap back" requests 2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
ea3b47f705 purge CacheSwapAppsService in favor of InstalledAppProvider
The most expensive part of this whole process is calculating the hash of the
whole APK.  InstalledAppProvider already caches that, and the rest is OK to
query.  If any particular part of the query is expensive, it could also be
moved to InstalledAppProviderService.
2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
9fc1ecd5a4
doh! only change translations in Weblate, or suffer merge conflicts! 2019-05-21 14:50:47 +02:00
Hans-Christoph Steiner
c5a6445239 fix bottom bar loading the wrong "Updates" string
closes #1785
2019-05-20 14:14:29 +02:00
Hans-Christoph Steiner
1cc14b3499 show progress spinner on Updates Tab if index is being updated
The "Congrats, your apps are up to date" message isn't quite right in this
context.

closes #1769
2019-05-20 14:14:29 +02:00
Hans-Christoph Steiner
dffc8e5925 make sure ImageLoader is inited before trying to use it
closes #1782
2019-05-20 14:14:29 +02:00
Hans-Christoph Steiner
86908ceeaa the calculated ETag should be compared to the stored ETag
Thanks to @amiraliakbari for tracking this down!

closes fdroid/fdroidclient#1737
2019-05-20 14:14:29 +02:00
Hocuri
dbfe267540
Show snackbars with undo buttons. 2019-05-13 17:55:09 +02:00
Hans-Christoph Steiner
1d359f82ce actually use index added/lastUpdated dates in UTC
The date/time written to index.xml and index-v1.json should always be in
UTC format.  These formats are often in the form of just a date, e.g.
2019-04-28.  Those are then converted to UNIX seconds, which includes the
time.  In the date only case, the time is assumed to be 00:00, which will
be different per time zone.

index-v1.json is better since it mostly uses Java-style UNIX time in millis
but the dates/times are parsed then stored in the local database in the old
format yyyy-MM-dd_HH:mm:ss which will result in different UNIX times when
the device is in different time zones.

fdroid/fdroidclient#1757
2019-05-10 16:30:23 +02:00
Hans-Christoph Steiner
c0c5721f6a Normalize Repo.lastUpdated values to contain the date and time
This also converts old Repo.lastUpdated values rather than just failing.
index.xml handling used to store the Repo "Last Updated" date used to store
the value as just an ISO date (2019-04-29), then the time was added.  So if
date/time parsing fails, this falls back to trying to parse just the date.
null is returned when parsing fails, and the Latest Tab shows nothing if
the Last Updated is null.

Some related tests were also tweaked.

Hopefully:
closes fdroid/fdroidclient#1757
2019-05-10 14:13:23 +02:00
Hans-Christoph Steiner
d62c0cf723 AppDetails: use inline OnClickListeners in Android style
no need to declare variables that are used in one place.  Also, reordered
related lines a bit for clarity.
2019-05-10 14:13:23 +02:00
Hans-Christoph Steiner
a71489a102 set max width on places where the translations get too long
closes #1678
2019-05-10 14:13:23 +02:00
ioTY
67af661640 Check whether fdroidPrivileged enabled 2019-05-10 14:13:23 +02:00
Hans-Christoph Steiner
af1040443e ignore Errors and Exceptions in background services
Throwable includes Errors and Exceptions.  Fixes stacktraces like these:

java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$3.done(AsyncTask.java:325)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
	at java.util.concurrent.FutureTask.run(FutureTask.java:242)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
	at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-oj.jar)
	at org.apache.commons.io.FileUtils.isSymlink(FileUtils.java:3107)
	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1616)
	at org.fdroid.fdroid.DeleteCacheService.onHandleWork(DeleteCacheService.java:32)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)
	at android.os.AsyncTask$2.call(AsyncTask.java:305)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	... 3 more
java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-oj.jar)
	at org.apache.commons.io.FileUtils.isSymlink(FileUtils.java:3107)
	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1616)
	at org.fdroid.fdroid.DeleteCacheService.onHandleWork(DeleteCacheService.java:32)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)
	at android.os.AsyncTask$2.call(AsyncTask.java:305)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
	at java.lang.Thread.run(Thread.java:761)
2019-05-10 14:13:23 +02:00
AmirAli Akbari
f76f9357d7 IndexV1Updater: Closing JarFile on end of use. Closes issue #1382. 2019-05-10 10:34:16 +00:00
Hans-Christoph Steiner
d7453d878d fix lint: Repeated word "do" in message: possible typo 2019-04-17 15:51:21 +02:00
Rafael Fontenelle
28b5744fe9 Translated using Weblate: Portuguese (Brazil) (pt-BR) by Rafael Fontenelle <rafaelff@gnome.org>
Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rafael Fontenelle <rafaelff@gnome.org>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-BR) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (20 of 20 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (428 of 428 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (428 of 428 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rafael Fontenelle <rafaelff@gnome.org>

Currently translated at 100.0% (428 of 428 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-BR) by Rafael Fontenelle <rafaelff@gnome.org>

Currently translated at 100.0% (20 of 20 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt_BR/
2019-04-10 00:58:54 +02:00
Hosted Weblate
95787b637e Translated using Weblate: Chinese (Traditional) (zh-rTW) by Jeff Huang <s8321414@gmail.com>
Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/zh_Hant/
2019-04-10 00:41:42 +02:00
Hosted Weblate
fe7d836f28 Translated using Weblate: French (fr) by Arnaud Jacquemin <arnaud.jacquemin+weblate@free.fr>
Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/fr/
2019-04-10 00:40:54 +02:00