1438 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
4312deb4c8 Merge branch 'padding' into 'master'
Fix extra large padding after every five items on main page

See merge request fdroid/fdroidclient!850
2019-10-29 17:27:23 +00:00
dkanada
d538760ad1 fix extra large padding after every five items on main page 2019-10-29 04:02:37 +09:00
dkanada
6393923274 hide the seekbar value on all devices 2019-10-29 01:51:54 +09:00
Marcus
65463781d0 PrivilegedInstaller: fix a grammar mistake in error message 2019-10-15 11:43:08 +00:00
Hans-Christoph Steiner
ca5996c5b3 detect when USB OTG device is plugged in and show Nearby tab 2019-06-17 18:37:26 +02:00
Hans-Christoph Steiner
23b296a012 add Intent Extra to force Nearby tab to show, like the other tabs have 2019-06-17 18:37:00 +02:00
Hans-Christoph Steiner
525f99b056 implement mirror/repos on USB OTG via Storage Access Framework
* https://developer.android.com/training/articles/scoped-directory-access

One potential future direction, if this proves too limiting:
https://github.com/magnusja/libaums
2019-06-17 18:36:58 +02:00
Hans-Christoph Steiner
842db03d8a fold ".views.hiding" into ".panic", it is only use there 2019-06-17 11:28:52 +02:00
Hans-Christoph Steiner
32aad6b562 move ".net.bluetooth" into ".nearby" package 2019-06-17 11:18:07 +02:00
Hans-Christoph Steiner
15d349f863 move LocalHTTPD and WifiStateChangeService into ".nearby" package 2019-06-17 11:18:07 +02:00
Hans-Christoph Steiner
43c7574228 fold ".views.swap" package into ".nearby" class 2019-06-17 10:50:56 +02:00
Hans-Christoph Steiner
790b5ab27d rename 'localrepo' package to 'nearby' to cover the whole thing 2019-06-17 10:50:56 +02:00
Hans-Christoph Steiner
df3a09dd2b ensure SwapService is running first, after Location perm prompt 2019-06-14 11:25:41 +02:00
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
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
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
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
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
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
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
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
307abc5706 Merge branch 'finalize-1.6' into 'master'
Finalize 1.6

Closes #1556

See merge request fdroid/fdroidclient!813
2019-04-09 22:16:00 +00:00
mueller-ma
1c881baa9c Color swipe to refresh indicator 2019-04-09 21:26:32 +00:00
Hans-Christoph Steiner
d2fea72ed9 always update itself last
When auto-updates are enabled, the app should update itself last, to ensure
that all of the other apps are completely updated before this app is killed
as part of the update process.

closes #1556
2019-04-09 23:17:21 +02:00
Hans-Christoph Steiner
272a0e3f27 fix crash when there is no cache when DeleteCacheService runs
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:30)
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:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
2019-04-09 14:39:45 +02:00
Hans-Christoph Steiner
593ce5284c fix insane NPE
java.lang.NullPointerException: println needs a message
 at android.util.Log.println_native(Native Method)
 at android.util.Log.e(Log.java:232)
 at org.fdroid.fdroid.net.DownloaderService.handleIntent(DownloaderService.java:232)
 at org.fdroid.fdroid.net.DownloaderService.access$000(DownloaderService.java:88)
 at org.fdroid.fdroid.net.DownloaderService$ServiceHandler.handleMessage(DownloaderService.java:108)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:148)
 at android.os.HandlerThread.run(HandlerThread.java:61)
2019-04-09 14:39:45 +02:00
Hans-Christoph Steiner
66e909d606 standardize all Downloaders on 8k block sizes
This is needed since this affects the onProgress broadcasts, and sending
too many can peg the device's CPU.  1k was just too small.  ANd 8k works
fine for Bluetooth.

fdroid/fdroidclient#1590
2019-04-09 14:39:45 +02:00
Jonas L
94e441cc9c Improve adding repos from the clipboard
In some cases (e.g. when using Firefox Klar) and copying the URL
(of a link), then only the uri is set and not the text. This
prevented (before this commit) the autofill of the
add package source dialog in such cases.
2019-03-29 09:14:43 +00:00
Hans-Christoph Steiner
81139c40fa trigger WifiStateChangeService after user accepts location perms
Normally, WifiStateChangeService finds the SSID when F-Droid starts. But if
the user hasn't granted location permissions yet, then WifiStateChangeService
won't have been able to read the SSID yet.
2019-03-29 00:11:16 +01:00