1042 Commits

Author SHA1 Message Date
Marcus Hoffmann
f32ed1eaed
don't crash when launching an app that isn't installed
This fixes the following crash:

* Install an app form F-Droid
* go to home screen
* uninstall app
* quickly switch to F-Droid the button will still show 'run' for a few
seconds
* launch the app you just uninstalled
2018-03-20 18:21:24 +01:00
hotlittlewhitedog
e272badf8e fix-detail-icon
modified:   app/src/main/java/org/fdroid/fdroid/views/AppDetailsRecyclerViewAdapter.java
2018-03-10 22:10:54 +01:00
Torsten Grote
50056317df
Prevent crash on screen rotation when showing panic app selector 2018-03-08 19:00:04 -03:00
Hans-Christoph Steiner
a74c68afd4 Merge branch 'ui' into 'master'
slight changes to the user interface

fdroid/fdroidclient!646
2018-03-07 23:58:24 +01:00
Hans-Christoph Steiner
215db81802 use warning suggestions for .addAll() method and null guard 2018-03-07 22:51:39 +01:00
Hans-Christoph Steiner
5547f12527 actually fix crashes from update notifications on < android-11
8600ce8d8a56398a4eb731f0cccb848c4e18d2eb didn't get all the affected places.

#1306
2018-03-07 22:51:39 +01:00
Hans-Christoph Steiner
978f4a2928 ignore potential filesystem corruption
As nice as it would be to help the users, F-Droid is not well positioned to
help the user with this problem.  The Android OS itself should do it. Plus
this issue has been open a long time, without much work on it, and the
existing solution is causing crashes.

#855
!440
!581

Utils.getBinaryHash() is used in a lot of places in the code, so its not
easy to handle this specific issue.  Here's one example:

org.fdroid.fdroid.Utils$PotentialFilesystemCorruptionException: java.io.IOException: read failed: EIO (I/O error)
	at org.fdroid.fdroid.Utils.getBinaryHash(Utils.java:426)
	at org.fdroid.fdroid.AppUpdateStatusService.findApkMatchingHash(AppUpdateStatusService.java:159)
	at org.fdroid.fdroid.AppUpdateStatusService.processDownloadedApk(AppUpdateStatusService.java:110)
	at org.fdroid.fdroid.AppUpdateStatusService.onHandleIntent(AppUpdateStatusService.java:65)
	at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.os.HandlerThread.run(HandlerThread.java:60)
2018-03-07 22:51:39 +01:00
Hans-Christoph Steiner
b9144cc95d fix pedantic warnings in Provisioner.java to make null warnings clear
The NullPointerException fixed by the previous commit had a warning to that
effect.  This fixes almost all the warnings to make the warnings clearer:

* unused method
* unused result of File.delete()
* can have reduced visibility
* single char static "" strings can be '' chars
2018-03-07 22:51:39 +01:00
dkanada
b4620bd0b6 fix right padding on version list 2018-03-07 12:02:22 -07:00
Hans-Christoph Steiner
dffac4e797 fix boot crash when Provisioner can't find ExternalFilesDir
closes #1332
!630
2018-03-07 16:46:18 +01:00
Hans-Christoph Steiner
6055874d9d do not crash if file vanishes during getBinaryHash()
APKs can be deleted at any time, either by being uninstalled or deleted
from the cache.
2018-03-07 16:46:17 +01:00
Hans-Christoph Steiner
6ad3604a0e Merge branch 'afWarningQrCodeScan' into 'master'
* jif-afWarningQrCodeScan:
  do not include english string in translations
  Correct check style errors
  Add style for the poor QR code scanning autofocus capability warning
  Add 'poor QR code scanning capability' translations
  Call to the camera autofocus checker in the view
  Add camera characteristics checker

fdroid/fdroidclient!649
closes #260
2018-03-06 16:35:28 +01:00
jif
3bf167e85f Correct check style errors 2018-03-01 20:52:13 +01:00
jif
6d1fc68ff1 Call to the camera autofocus checker in the view 2018-03-01 18:40:30 +01:00
jif
b419b78c94 Add camera characteristics checker
Those classes consist of 1 abstract class, which provide a factory for
2 classes each of which implements different behaviors according to
the Android API version.
2018-03-01 18:35:45 +01:00
dkanada
1facc7d07c rename version layout 2018-02-27 22:40:19 -07:00
dkanada
216695285a fix int overflow 2018-02-27 22:38:54 -07:00
Hans-Christoph Steiner
1cd2e62505 Merge branch '1300-alert-dialog-background' into 'master'
Fix background of AlertDialogs for DialogPreferences

Closes #1300

See merge request fdroid/fdroidclient!634
2018-02-23 14:38:13 +00:00
Marcus Hoffmann
10e2bf2a7c
add liberapay field and donation option
This add the liberapayID index field to the local db and then displays a
donation badge for apps that provide this.
2018-02-15 19:58:12 +01:00
Hans-Christoph Steiner
5c2e9305a8 only force index update when the locale actually changes
This was forcing an index update on any config change, even just a simple
screen rotation.  Now it actually checks whether its needed.

closes #1325
2018-02-13 21:26:49 +01:00
Hans-Christoph Steiner
30b00156db javadoc cleanup 2018-02-13 21:26:49 +01:00
Hans-Christoph Steiner
833d3f40fd CleanCacheService: reduce logcat noise, check if file exists before rm 2018-02-13 21:26:49 +01:00
Hans-Christoph Steiner
8a0abdd841 AppDetails2 run style formatter and fix line length issues 2018-02-13 20:34:02 +01:00
Hans-Christoph Steiner
532d1dfc72 make sure cached file exists before trying to scan it
Files in the cache can be deleted at any time, without warning.  F-Droid's
CleanCacheService can do it, the user can do it in Settings --> Apps, etc.
So when working with files from the cache, the methods need to be extra
defensive, checking that the file that they were given still exists.

closes #1305
2018-02-13 20:34:02 +01:00
Hans-Christoph Steiner
8600ce8d8a prevent crashes from update notifications on < android-11
closes #1306

* https://stackoverflow.com/questions/3112008/android-java-lang-illegalargumentexception-contentintent-required-error-cause
* https://stackoverflow.com/questions/20032249/is-setcontentintentpendingintent-required-in-notificationcompat-builder
2018-02-13 20:34:02 +01:00
Hans-Christoph Steiner
f32b26d5c3 Merge branch 'add-sorting-redo' into 'master'
Add sorting redo

fdroidclient!637
2018-02-13 17:28:54 +01:00
Hans-Christoph Steiner
782cf9917f FDroidApp.isAppThemeLight() to avoid opaque, super long test lines 2018-02-13 17:22:00 +01:00
Hans-Christoph Steiner
c031939379 run Android Studio code formatter e.g. Ctrl-Alt-L 2018-02-13 17:15:29 +01:00
hotlittlewhitedog
93885371cc add-sorting-redo-c3
modified:   app/src/main/java/org/fdroid/fdroid/views/apps/AppListActivity.java
	modified:   app/src/main/res/layout/activity_app_list.xml
2018-02-12 18:59:27 +01:00
hotlittlewhitedog
e72348b2d9 add-sorting-redo-c2
modified:   app/src/main/java/org/fdroid/fdroid/views/apps/AppListActivity.java
	modified:   app/src/main/res/layout/activity_app_list.xml
2018-02-12 18:32:15 +01:00
Hans-Christoph Steiner
0f98e1e125 ACRA: add more fields to crash reports, but no user identifying info
extended info on things we already have:
* PRODUCT is another name for BRAND/PHONE_MODEL
* TOTAL_MEM_SIZE can be derived from hardware name
* DISPLAY is also available by looking up the hardware
* STACK_TRACE_HASH should make automated sorting easier

new info:
* PACKAGE_NAME is only new info if the user is using a whitelabel app
* AVAILABLE_MEM_SIZE can be used to track users, but only when provided at
  high resolution, e.g. once per second or higher.  Most users only send a
  single crash report.  High frequency reporters send under 100, which is
  still orders of magnatude below what is needed to track users.
2018-02-08 23:41:31 +01:00
Hans-Christoph Steiner
b11cc6ab28 checkstyle fixes: LineLength 2018-02-06 00:17:43 +01:00
hotlittlewhitedog
b79c6a9780 add-sorting-redo
modified:   app/src/main/java/org/fdroid/fdroid/views/apps/AppListActivity.java
	modified:   app/src/main/res/layout/activity_app_list.xml
	modified:   app/src/main/res/values/strings.xml
	app/src/main/res/drawable-hdpi/ic_az_black.png
	app/src/main/res/drawable-hdpi/ic_last_updated_black.png
	app/src/main/res/drawable-mdpi/ic_az_black.png
	app/src/main/res/drawable-mdpi/ic_last_updated_black.png
	app/src/main/res/drawable-xhdpi/ic_az_black.png
	app/src/main/res/drawable-xhdpi/ic_last_updated_black.png
	app/src/main/res/drawable-xxhdpi/ic_az_black.png
	app/src/main/res/drawable-xxhdpi/ic_last_updated_black.png
	app/src/main/res/drawable-xxxhdpi/ic_az_black.png
	app/src/main/res/drawable-xxxhdpi/ic_last_updated_black.png
2018-02-04 22:13:20 +01:00
Hans-Christoph Steiner
29658259fa force clean index update when underlying OS is upgraded
Things like permission support, locales, etc. can change when Android is
updated.  So the database should be rebuilt from scratch with a fresh
download of the indexes.

closes #780
2018-01-31 16:20:24 +01:00
Hans-Christoph Steiner
887c55247a force full index update when system locale changes
The database currently only stores the active language.  So if the
user changes the system language of the phone, then the language of
all the app descriptions will be out of sync until the next update.
This forces an update when the locale is changed.  This functionality
is also needed for events like OS upgrades.

closes #225
2018-01-31 16:20:24 +01:00
Hans-Christoph Steiner
6448491751 WifiStateChangeService: exit after trying for 2 minutes
It was tried until it got an IP address, but that will only happen if there
is a wifi device configured.  Since WifiStateChangeService is started when
F-Droid starts, WifiStateChangeService could run for days if someone never
connected to WiFi in that time.

WifiStateChangeService is also started by NETWORK_STATE_CHANGED_ACTION so
it should start each time there is a change to the WiFi connection.
2018-01-31 16:20:23 +01:00
Hans-Christoph Steiner
8a8ca2e6f7 WifiStateChangeService: use Intent static start method pattern
This is the standard pattern for starting IntentServices.  It also makes
it really easy to trace what is starting this Service.
2018-01-31 16:20:23 +01:00
Hans-Christoph Steiner
6d011c3895 use triedEmptyUpdate methods in Preferences throughout the codebase
We have these methods, they should be used!
2018-01-31 16:20:23 +01:00
Hans-Christoph Steiner
d8879dd425 make DBHelper follow the Java Singleton pattern
It was already behaving like a singleton, but the code was spread around in
other classes.  DBHelper does not use a private constructor though since
the tests prevent it.
2018-01-31 16:20:23 +01:00
Hans-Christoph Steiner
2fe7faed6e convert panic preferences to standard Preferences code style
Yes, this is an ugly and old style, but mixing styles only makes it worse.
Plus it breaks the tests in some cases, since it makes Preferences depend
on Resources.
2018-01-31 15:04:14 +01:00
Torsten Grote
a639edb59c
Style NoPanicApp icon depending on theme 2018-01-30 19:07:37 -02:00
Hans-Christoph Steiner
6260c11efc Merge branch 'static-inner-class' into 'master'
Make some inner classes static

See merge request fdroid/fdroidclient!633
2018-01-30 15:11:55 +00:00
Andrew Gaul
94c4374bf7 Make some inner classes static
This avoids an implicit this field and can help GC.  Found via
error-prone.
2018-01-28 16:28:56 -08:00
Torsten Grote
6067c15085
Implement App Hiding
This commit allows F-Droid to hide itself from the laucher.
It can be hidden either as response to a panic trigger
or as a manual action by long pressing the floating search button.
The latter needs to be explicitly enabled in the settings.

Once hidden, a semi-functional fake calculator app appears in the
launcher that can be used to bring F-Droid back by entering a
pre-defined PIN.
2018-01-27 16:42:59 -02:00
dkanada
b5e6db76a7 rename strings and preferences
!617
2018-01-26 19:24:55 +01:00
Hans-Christoph Steiner
6fe1fa581f Merge branch 'provisioning' into 'master'
file based provisioning + authentication support in add repo Intents

See merge request fdroid/fdroidclient!630
2018-01-26 18:24:21 +00:00
Michael Pöhn
c60c606dcf remove outdated comments; use File concatenation instead of separators 2018-01-26 17:56:06 +01:00
Hans-Christoph Steiner
1959657092 Merge branch 'issue-1295' into 'master'
Fixes the behaviour of cancel button

Closes #1295

See merge request fdroid/fdroidclient!628
2018-01-26 12:39:08 +00:00
Hans-Christoph Steiner
c61024e070 Merge branch 'add-padding-to-last-app-redo' into 'master'
Add padding to last app in Category

See merge request fdroid/fdroidclient!625
2018-01-26 13:30:26 +01:00
Hans-Christoph Steiner
720822e260 keep category count at original number: 20 2018-01-26 13:29:29 +01:00