950 Commits

Author SHA1 Message Date
Peter Serwylo
25897df85b Update the badge on the bottom nav when dismissing 'ready to install' apps 2017-09-27 23:31:20 +10:00
Peter Serwylo
1d4f4ce01d Correctly handle swiping to dismiss items in updates tab.
Items which can be updated (but have not yet been downloaded or queued for download)
will act as if the user selected "Ignore this update" from the app details view.

Items which represent app statuses (e.g. downloading, downloaded ready to install,
installed ready to run) will have the status removed. If required, we will also
forget that they are ready to install, so they wont be there next time.
2017-09-27 23:31:20 +10:00
Peter Serwylo
32c17e5f72 Initial framework to allow for dismissing apps in updates tab. 2017-09-27 23:31:20 +10:00
Peter Serwylo
13e2eddb6a Static import of inner class to improve readability 2017-09-27 23:31:17 +10:00
Peter Serwylo
2bd70fc6b5 Fixed query for known vulns.
Used to work, then the default join from `fdroid_app` to `fdroid_apk`
was removed for performance reasons. This adds the join back, but requires
queries to explicitly opt in to the join if they require it. The specific
query for known vulns is not a performance problem, because sqlite is able
to narrow the result set quite substantially before requiring a join onto the
fdroid_apk table anyway (e.g. by using the "installed app" table).
2017-09-27 15:37:09 +10:00
Peter Serwylo
382ee652b8 STILL-UNTESTED: Fix for upgrading app to newer, non vuln version.
Prior to this it was just trying to uninstall the app instead.
2017-09-27 15:03:03 +10:00
Peter Serwylo
63cf0742b7 Fixes after rebasing. 2017-09-27 15:03:03 +10:00
Peter Serwylo
0551b0d1fc Allow user to ignore messages about vulnerable apps 2017-09-27 15:03:03 +10:00
Peter Serwylo
5f64985b34 Added 'ignore vuln' preference for apps 2017-09-27 15:03:03 +10:00
Peter Serwylo
4e544e61fb UNTESTED: Prompt the user to update an app with a known vulnerability.
Untested because there are no apps in current repos which exhibit this
behaviour which have newer versions. Right now I'm testing with com.waze
from testy.at.or.at which only has the one version.

I'm also unsure of how important this is seeing as most the time it will
prompt people to update anyway.
2017-09-27 15:03:03 +10:00
Peter Serwylo
7424220c02 Add apps with known vulnerabilities to updates tab.
Currently only supports "Uninstall", but will soon also support "Upgrade
to a newer version".
2017-09-27 15:03:03 +10:00
Peter Serwylo
9b20142fd9 Extract getInstalledApk() from AppDetails2 to App 2017-09-27 15:03:02 +10:00
Peter Serwylo
073cb199fc Move comment to correct field. 2017-09-27 15:03:02 +10:00
Peter Serwylo
504854547b Add query to get installed apps with known vuln + tests.
Note that I don't think the query will work correctly across multiple repos,
because it is currently only querying the app with the "preferred
metadata".
2017-09-27 15:03:02 +10:00
Peter Serwylo
1fc8828122 Save per-apk anti features to join table + tests.
Also use a newer version of testy.at.or.at index for the index-v1 test,
because it includes apks with "KnownVuln" anti features whereas the
older version did not.
2017-09-27 15:03:02 +10:00
Peter Serwylo
caa1ead689 Added anti-feature table + join onto apk.
Not used yet, but will be used soon for known vulnerability anti
features.
2017-09-27 15:03:01 +10:00
Peter Serwylo
91a03be6f4 Allow any path when adding fdroidrepo(s):// intents.
When explicitly given an fdroidrepo(s) intent, it seems silly to restrict it based on
a path of /fdroid/repo, because it is plainly obvious it is an F-Droid repo.
Manifest and NewRepoConfig both had to be amended to allow this behaviour.

Fixes #1171.
2017-09-25 15:43:32 +10:00
Christine Emrich
bd796136f7 Set sane colors for night and dark themes 2017-09-25 09:48:08 +10:00
Hans-Christoph Steiner
9cc66e035a show Toast if InstalledAppProviderService encounters EIO errors
A notification would be better, but a Toast is better than nothing.
2017-09-12 21:44:48 +02:00
Peter Serwylo
dacebceff6 Ignore errors that are likely due to filesystem corruption.
There is a specific POSIX error "EIO" which seems to be the "general
purpose we don't know what went wrong but its probably bad" exception.
Our investigations in #855 resulted in the conclusion that it is likely
due to some sort of filesystem corruption or something like that.

Either way, it is annoying many people, so we need to prevent it or
ignore it, rather than prompting the user to submit a bug report.
After much investigation it was unable to be reproduced other than by
one of the original bug reporters. As such, this change ignores it.

Unfortunately Java `IOException`s don't have an API for getting the
errno of a POSIX IO error. Thus, this change results to parsing the
exception message instead :(

Fixes #855.
2017-09-12 21:35:08 +02:00
Peter Serwylo
71337a49b3 Added doc comment clarifying unsigned media 2017-09-12 16:51:44 +02:00
Peter Serwylo
3a3c170781 Fix CI failures (checkstyle/pmd) 2017-09-12 16:51:44 +02:00
Peter Serwylo
595f72d5b2 Calculate whether an app is an APK or not when updating repos.
This improves performance when we need to decide whether or not apps are
installed or not while scrolling through large lists.

Fixes #1143.

Also change Jackson tests to properly ignore App#isApk.
2017-09-12 16:51:44 +02:00
Peter Serwylo
ac1dce24d2 Don't assume all apps have a preferred signer, as media apps don't
Fixes #1156.
2017-09-12 16:38:33 +02:00
Peter Serwylo
620affa239 Remove unneeded join onto apk which was causing performance problems.
This join resulted in one row for each apk in the result set (before
doing a GROUP BY), instead of one row for each apk. That is a large
difference in number of rows and resulted in much more work for sqlite.
Turns out this join wasn't required.
2017-09-12 16:38:33 +02:00
Peter Serwylo
80259d00ba More precise (and correct) logging of slow queries in debug mode.
Some queries are deferred, and then forced to run by Android by invoking
`getCount()`. Under these circumstances, the measured speed of the query
execution is 1ms.

This adds speed logging around `getCount()` in case that is the first time
the query is run.
2017-09-12 16:38:33 +02:00
Hans-Christoph Steiner
5144aedec9 Merge branch 'issue-1115--no-versions-multisig' into 'master'
Be more helpful when no versions available due to mismatching signatures.

Closes #1115

See merge request !577
2017-09-05 10:10:14 +00:00
Peter Serwylo
ba96819e40 Prompt user to go to settings to help with incompatible versions 2017-09-05 17:02:04 +10:00
Peter Serwylo
dd93df9ef2 Show mismatching sig apks when incompatible versions enabled.
This is in the spirit of the setting, where users can see which apks are
available even though they are not installable.

Adds a message explaining why it is incompatible (i.e. because the
signature doesn't match the installed version).
2017-09-05 17:02:01 +10:00
Peter Serwylo
ef717437a9 Explain multi-sig problems to user in app details. 2017-09-05 16:33:22 +10:00
Peter Serwylo
68e0f16b7c Minor simplification to view binding for app details.
Instead of casting to more specific view holders, all to call the
similarly named/behaved "bindModel()" method, push this to a base class.
2017-09-05 16:33:22 +10:00
Peter Serwylo
fc2093a9a6 Merge branch 'animation-fixes' into 'master'
Animation fixes

See merge request !566
2017-09-05 02:18:30 +00:00
Hans-Christoph Steiner
75d13d60ae move swap webpage's F-Droid.apk link so it doesn't get cleaned up
This is because of the previous commit.
2017-09-04 22:20:55 +02:00
Hans-Christoph Steiner
6651117f90 fix cleaning of temp install APKs
When the filenaming was changed in 91eb408 !514 this was not updated. So
now it is keeping these files forever, which gets large fast.

closes #1149
2017-09-04 22:20:55 +02:00
Hans-Christoph Steiner
0730d3c676 set App.preferredSigner when using index v0 #1086
This was an oversight when we added this functionality, though there was
a related TODO.

41f85f3c9df934daba0ee0d60c4c01bb071fa6e7
2017-09-04 22:20:55 +02:00
Peter Serwylo
aa2d791531 Merge branch 'etag-fix' into 'master'
switch etag cache check to purely client-side

Closes #562

See merge request !574
2017-09-04 20:22:02 +00:00
Hans-Christoph Steiner
312bc9f503 Merge branch 'swap-crash-serving-fdroid' into 'master'
Fix crash when trying to swap.

See merge request !563
2017-09-04 20:08:53 +00:00
Hans-Christoph Steiner
2550329ab5 switch etag cache check to purely client-side
Instead of including the etag in the HTTP GET request and letting the
server set the Response Code depending on whether the etag machines, this
makes the client first issue a HEAD request, which is uses to get the etag
and the file size.  We need to do the HEAD beforehand anyway to get the
file size for resumable downloads, and this approach prevents the server
from using the etag as a form of tracking cookie:
http://lucb1e.com/rp/cookielesscookies/

closes #562
2017-09-04 20:56:12 +02:00
Hans-Christoph Steiner
2dbeb60666 Merge branch 'issue-995--installing-after-disabling-repo' into 'master'
Ensure apps are not kept in "Updates" when their repo is disabled.

Closes #995

See merge request !568
2017-09-01 14:00:00 +00:00
Christine Emrich
0d874a7ee8 Dismiss about dialog on touch outside #1082 2017-08-30 22:24:04 +02:00
Christine Emrich
f8c81a47d9 Apply selected theme to about dialog in settings #1083 2017-08-30 22:21:09 +02:00
ByteHamster
8bfecc89fb Animation fixes
- Icon transition is no longer jumping in first frame (caused by different padding)
- Icon is no longer cropped at start of transition (caused by missing changeImageTransform)
- Toolbar icons are no longer animated. Introduced in !561 by changing the icons programmatically
2017-08-29 16:07:13 +02:00
Hans-Christoph Steiner
a48a92385e Merge branch 'issue-1117--empty-state-search' into 'master'
Empty search results now shows message (as in 0.102.3)

Closes #1117

See merge request !567
2017-08-29 14:00:39 +00:00
Christine Emrich
e9cdc5e952 Remove highlight from snapped screenshot #1068 2017-08-27 17:24:53 +02:00
Peter Serwylo
f3c48f8d6b Ensure apps are not kept in "Updates" when their repo is disabled.
This caused problems when users then tried to action the pending
install, where it would no longer have enough information to install the
app. Although it may be technically possible to keep enough information
around in memory to make the app installable, but it is not worth the
effort. If a user intentionally disables a repo, we should no longer be
responsible for keeping information about its apps around.

Fixes #995.
2017-08-08 21:12:59 +10:00
Peter Serwylo
0f8bec59e1 Show message when no search results are found.
Fixes #1117.
2017-08-08 11:35:23 +10:00
Peter Serwylo
a3a0c0a15d More verbose logging
There are some ACRA reports with this IllegalStateException getting hit.
It used to be that it was only ever because we forgot to request the
correct fields from the database. However now I'm not sure that this is
the only source. Perhaps it is also possible in response to parcelling
apk instances, or maybe something else? Either way, this should provide
further info about whether the apk doesn't belong to a repo for some
reason.
2017-08-01 13:04:08 +10:00
Peter Serwylo
3b41287cf7 Remove unused methods.
There are two methods which allow callers to choose which fields to
return. These were originally added for performance, so you only ask for
what you need. However empirically the performance gain doesn't mean
anything, because it is dwarfed by the query that was just executed.
However, it does open the code up to bugs because we forget to ask for
the right fields. So now it just returns all fields when querying for
apks.
2017-08-01 13:02:36 +10:00
Peter Serwylo
618f83bb23 Formatting 2017-08-01 11:59:44 +10:00
Peter Serwylo
2d377453d9 Ensure swapping doesn't get confused by apks in different repos.
While investigating #1086 which was about swap being busted, I
discovered that we recently introduced a worse bug when working with
multi sig stuff. The swap process, when installing an app (or even when
listening for if a user started installing - before they even did
anything), would ask for an apk from any repo. This is wrong, because we
should only ask for the apks from the swap repo when presented with a
swap dialog.

By fixing this so that it asks for a specific apk, this may also
fix the issue in #1086, because that was about us not asking for enough
info from the database for each Apk which was returned. Now we just
return all columns, because the performance overhead should be minimal,
but it prevents this class of bugs, where we didn't fully populate
our value object. However, I'm not confident that it is fixed, because I
was unable to reproduce it due to the other crash fixed in this change.

Relevant crash:

```
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.fdroid.fdroid.data.Apk.getUrl()' on a null object reference
  at org.fdroid.fdroid.views.swap.SwapAppsView$AppListAdapter$ViewHolder.setApp(SwapAppsView.java:311)
  at org.fdroid.fdroid.views.swap.SwapAppsView$AppListAdapter.bindView(SwapAppsView.java:422)
  at org.fdroid.fdroid.views.swap.SwapAppsView$AppListAdapter.newView(SwapAppsView.java:414)
  at android.support.v4.widget.CursorAdapter.getView(CursorAdapter.java:269)
  at android.widget.AbsListView.obtainView(AbsListView.java:2349)
  at android.widget.ListView.makeAndAddView(ListView.java:1864)
  at android.widget.ListView.fillDown(ListView.java:698)
...
```
2017-08-01 11:59:41 +10:00