252 Commits

Author SHA1 Message Date
Nico Alt
315265fbb4 fix #91: Material Design
- use 'com.android.support:appcompat-v7:22.0.0' instead of version 20.0.0
- ActionBar color: "F-Droid Blue" (also option for "F-Droid Green")
- fix invisible swap button with Material Design
- remove "Light + dark action bar" theme (as of Action Bar is always blue/green)
2015-05-07 22:06:01 +02:00
Daniel Martí
01e6db5720 We don't need WRITE_EXTERNAL_STORAGE on api 19 or later
On api 19 or later, writing to your own private directory on the SD doesn't
require any extra dependencies. We only ever store icons, apks and index stuff
on the private repo, so we never read/write anywhere else on the SD.
2015-05-07 16:12:54 +02:00
Daniel Martí
1d225912f4 Remove a few unused variables 2015-05-04 00:14:40 +02:00
Daniel Martí
4a007698a6 Run dos2unix on all external source files 2015-05-04 00:08:36 +02:00
Daniel Martí
939efa5b17 Run "code cleanup" in Android Studio
This basically removes public, static and final from interfaces since it's
always that way.
2015-05-04 00:06:32 +02:00
Daniel Martí
0f36372d38 Fix to 26894fcb01d4: also bump the gradle dependency 2015-05-03 23:49:17 +02:00
Nico Alt
054ac8b3fa add missing import 2015-05-03 12:18:39 +02:00
Daniel Martí
45137f2f8e Also apply fixes to custom zxing code 2015-05-01 00:38:06 +02:00
Daniel Martí
e314c401e7 Fix possible NPE when using a TextView 2015-05-01 00:38:06 +02:00
Daniel Martí
bc98fd69b1 Apply a few android studio fixes 2015-05-01 00:38:06 +02:00
Daniel Martí
869662152a Fix regression in 9c6a652a02e
String.replaceAll(String, String) isn't in-place!
2015-05-01 00:16:18 +02:00
Daniel Martí
45ab80bb29 Make CommaSeparatedList.make() also take String[] 2015-04-30 20:51:19 +02:00
Daniel Martí
7b4cee35c7 Throw some more final keywords in 2015-04-30 20:42:30 +02:00
Peter Serwylo
1b114b6bae Merge branch 'fix-202' into 'master'
Fix issue #202 - crash due to sqlite parameter limit being hit.

*NOTE: Queuing here for merge after next stable.*

The queries which have the potential to cause crashes due to too many parameters in the `ApkProvider` are now encapsulated in `ApkProvider` and can only be accessed by safe helper methods, which alleviate the problem by breaking big requests down into many smaller requests.

This will probably have to be done for the `ApkProvider`, but leaving for now because the limit is twice as big.

See merge request !70
2015-04-28 21:35:46 +00:00
Peter Serwylo
833db3b5ce Merge branch 'fix-220' into 'master'
Cache files to SD card again (if preference set).

**NOTE: Queueing here to be merged after next stable**

A previous security fix meant we no longer stored apk files on the
SD card. However, this should still be a feature that people can opt
for if they want, without being insecure. As such the process is now:

 * First download: put in internal storage (to ensure it can't be
   modified before installing)

 * After download: also copy to SD card for caching.

 * On starting F-Droid:

    + Always delete internal storage apks.

    + Only delete other, cached apks if cache preference is false.

To make the code simpler and less prone to bugs, I had to consider
the fact that if people did not have an accessible SD card, then the
path to a cached apk and a "downloaded but transient" apk cannot be
the same. While possible, it means many checks to see if they are
the same, thorough permission management to prevent security issues,
and makes it harder to clear transient apks when F-Droid starts.

See merge request !71
2015-04-28 21:34:05 +00:00
Daniel Martí
7267736166 Bump to 0.88 2015-04-28 23:14:55 +02:00
Daniel Martí
3ab6bd84f9 Fix copy/paste error in 14ae586
This led to devices incorrectly flagging packages as non-compatible. With this
fix everything works as before.
2015-04-24 01:16:56 +02:00
Daniel Martí
fa5eac0b72 Bump to 0.87-test 2015-04-21 19:29:06 +02:00
Daniel Martí
e367265396 Some style/format fixes suggested by AS 2015-04-21 19:27:10 +02:00
Daniel Martí
14ae58690c Simplify compat.SupportedArchitectures 2015-04-21 19:27:03 +02:00
Daniel Martí
a3c78e4d02 "updated" bools in App and Apk are now unused 2015-04-21 19:09:30 +02:00
Daniel Martí
76a489c492 Don't hardcode tab indexes in multiple places 2015-04-21 19:09:14 +02:00
Daniel Martí
7945c0dead Rename ignored catched exceptions to "ignored" as per AS 2015-04-21 18:59:41 +02:00
Daniel Martí
ab8a180141 Optimize imports via Android Studio 2015-04-21 18:56:52 +02:00
Daniel Martí
b7b42b77e9 Remove fix-formats.sh - should be done in the translation system 2015-04-21 17:36:13 +02:00
Daniel Martí
ec4b2bf331 Slightly simplify declarations in Utils.java 2015-04-21 17:33:52 +02:00
Daniel Martí
b84e8ef7d6 Add some more final keywords 2015-04-21 17:24:19 +02:00
Daniel Martí
cf4a1a436f Run remove-empty-trans 2015-04-21 17:18:03 +02:00
Daniel Martí
4431d25793 Run fix-ellipsis 2015-04-21 17:17:23 +02:00
Daniel Martí
4a5bb059de Remove trailing empty line in file 2015-04-21 17:16:54 +02:00
F-Droid Translatebot
6a87a372fb Translation updates 2015-04-21 16:10:00 +01:00
Peter Serwylo
72ff2b8805 Cache files to SD card again (if preference set).
A previous security fix meant we no longer stored apk files on the
SD card. However, this should still be a feature that people can opt
for if they want, without being insecure. As such the process is now:

 * First download: put in internal storage (to ensure it can't be
   modified before installing)

 * After download: also copy to SD card for caching.

 * On starting F-Droid:

    + Always delete internal storage apks.

    + Only delete other, cached apks if cache preference is false.

To make the code simpler and less prone to bugs, I had to consider
the fact that if people did not have an accessible SD card, then the
path to a cached apk and a "downloaded but transient" apk cannot be
the same. While possible, it means many checks to see if they are
the same, thorough permission management to prevent security issues,
and makes it harder to clear transient apks when F-Droid starts.
2015-04-21 22:53:32 +10:00
Peter Serwylo
424839c793 Encapsulate functions which can produce invalid SQL.
Now the other content provider functions which can result in broken SQL
due to the number of arguments is private, and can only be accessed
from a public helper method which ensures that limit is never hit.
2015-04-21 22:27:58 +10:00
Peter Serwylo
898f331bfd Fix #202: Deleting more apks than sqlite can handle in one query.
The static delete helper function in ApkProvider now supports
recursively reducing the size of the list of apks to delete, until
it is under the threshold that sqlite can handle.
2015-04-21 18:38:03 +10:00
Peter Serwylo
cdb8100819 Fixes #231 - category translations were reverting to english.
There are two places where translations get populated. One of them (when
the fragment is initialized) translates the categories. The other place
(when the "installed app cache" background process completes) did not
translate the category names. They are now both translated.
2015-04-20 13:19:21 +10:00
Daniel Martí
928d3e8c9a Bump to 0.86-test 2015-04-18 00:06:13 +02:00
Daniel Martí
3ed414cf96 Don't use + in gradle deps to make the build reproducible
20.0.+ equals 20.0.0 since there wasn't a 20.0.1
2015-04-17 11:45:49 +02:00
Daniel Martí
a2e1ce0fe2 Simplify if (cond) return true; else return false; 2015-04-16 19:12:44 +02:00
Daniel Martí
8737f4a9fc Remove more unused imports 2015-04-16 19:08:17 +02:00
Daniel Martí
250749a3cd Remove unused variable left from the intent rewrite 2015-04-16 19:08:00 +02:00
Daniel Martí
39c2aeb19a updateEmptyRepos is now in views/fragments/AppListFragment 2015-04-16 19:04:14 +02:00
Daniel Martí
5e7146d19a Drop unnecessary elses after returns 2015-04-16 18:51:29 +02:00
Daniel Martí
e1a6e2386f Style all switches equally, without indentation 2015-04-16 18:41:39 +02:00
Daniel Martí
d6a8ef9e59 Compact very simple getters in a single line 2015-04-16 18:35:22 +02:00
Daniel Martí
33fd77e3b8 style fix: no spaces before post-increment 2015-04-16 18:25:13 +02:00
Daniel Martí
9c6a652a02 Avoid NPE when fetching the Wifi SSID
Fixes #220
2015-04-16 16:49:39 +02:00
Peter Serwylo
dccd0256d3 Reworded help string for cache apk preference.
There was some confusion about the "SD Card" portion of the string.
Sometimes it will not store on the SD card, e.g. if the SD card is
not mounted, or inaccessible to F-Droid.
2015-04-16 17:00:23 +10:00
Peter Serwylo
280a5e7279 Merge branch 'master' into 'master'
translation fixes for swap

I just had a Spanish-speaker test out the swap, and these are the fixes related to their bug reports.

See merge request !68
2015-04-15 21:32:54 +00:00
Peter Serwylo
0dd31c287c Merge branch 'defaultValues' into 'master'
Change some "defaultValue"s

Key "theme": I also use the dark version of F-Droid but I think the most users would prefer the light version. This is also standard in the
most used apps on Android, I think, see GApps, Flym, K-9, Telegram, ...

Key "localRepoBonjour": I never used this function and I think it's better, if the user manually activates it when he wants to use it.

Key "localRepoHttps": I see no reason why it should not use https over http, it's better of security view, I think.

Key "cacheDownloaded": The most smartphones today have enough storage available to allow to enable this function. This would decrease the
traffic on both sides, as the user does not have to download a app and the F-Droid server does not have to send it multiple
times.

This is somehow related to #221, I think.

See merge request !67
2015-04-15 21:29:29 +00:00
Peter Serwylo
6568f9fcbc Fixed crash on slow device due to database being locked.
The error below was happening on my crappy slow phone, I suspect because
the database upgrade check was locking the database, while this was
scheduled and started running on a different thread. Given it is a very
low priority task (it notifies F-Droid if apps were installed by a method
other than F-Droid) it is now delayed by 10 seconds.

E  FATAL EXCEPTION: AsyncTask #1
E  java.lang.RuntimeException: An error occured while executing doInBackground()
E      at android.os.AsyncTask$3.done(AsyncTask.java:200)
E      at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
E      at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
E      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
E      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
E      at java.lang.Thread.run(Thread.java:1019)
E  Caused by: android.database.sqlite.SQLiteException: database is locked: BEGIN EXCLUSIVE;
E      at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
E      at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1763)
E      at android.database.sqlite.SQLiteDatabase.beginTransactionWithListener(SQLiteDatabase.java:527)
E      at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:481)
E      at org.fdroid.fdroid.data.FDroidProvider.applyBatch(FDroidProvider.java:58)
E      at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:217)
E      at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:95)
E      at android.content.ContentResolver.applyBatch(ContentResolver.java:639)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater.updateCache(InstalledAppCacheUpdater.java:98)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater.update(InstalledAppCacheUpdater.java:64)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater$Worker.doInBackground(InstalledAppCacheUpdater.java:163)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater$Worker.doInBackground(InstalledAppCacheUpdater.java:159)
E      at android.os.AsyncTask$2.call(AsyncTask.java:185)
E      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
E      ... 4 more
2015-04-16 07:24:58 +10:00