4635 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
b9334e4507 Merge weblate 2017-07-03 19:02:04 +00:00
Peter Serwylo
827235b6d7 Merge branch 'merge-weblate' into 'master'
Merge weblate

See merge request !553
2017-07-02 22:20:29 +00:00
Hans-Christoph Steiner
66d3a50564 Merge weblate 2017-07-02 22:20:23 +00:00
Hans-Christoph Steiner
5de66eae15 Merge branch 'fix-1028--update-ui-when-db-changes' into 'master'
Don't show apps/categories after disabling repo.

Closes #1028

See merge request !551
2017-06-30 14:17:12 +00:00
Peter Serwylo
b658c0b44e Don't show apps/categories after disabling repo.
This was setup to work correctly, but for two problems:

 * The `cursor.close()` in `CategoriesViewBinder` stops the cursor from
   being requeried when required.

 * The `AppProvider` was not notifying correctly after deleting apps
   belonging to a repo.

Fixes #1028.
2017-06-29 17:33:52 +10:00
Hans-Christoph Steiner
61ab88f8ea Merge branch 'acra-fixes' into 'master'
ACRA fixes

Closes #1074

See merge request !544
2017-06-26 10:13:54 +00:00
Hans-Christoph Steiner
2fbb102f62 Merge branch 'add-ml-locale' into 'master'
Add Malayalam (ml) to language list

Closes #1077

See merge request !545
2017-06-26 07:34:37 +00:00
Shanavas
1b75a4fd3a Add Malayalam (ml) to language list 2017-06-23 23:19:57 +00:00
Peter Serwylo
b1ac0ff351 Prevent crash on categories screen when rotating.
The docs say that initLoader tries to reuse existing cursors.
The error message was "IllegalStateException: attempt to re-open an
already-closed object: SQLiteQuery: ...".
2017-06-23 17:06:45 +10:00
Peter Serwylo
79ede18259 Fix crash due to unknown suggested version.
There may be a bigger problem around suggested versions being null at
all, but that is getting looked at in a different feature set (i.e.
multi signature support) and will come in time. This fixes the immediate
problem some people were having and sending crash reports for in 0.104.

STACK_TRACE=java.lang.NullPointerException: Attempt to read from field 'java.lang.String org.fdroid.fdroid.data.Apk.versionName' on a null object reference
	at org.fdroid.fdroid.views.AppDetailsRecyclerViewAdapter$HeaderViewHolder.bindModel(AppDetailsRecyclerViewAdapter.java:425)
	at org.fdroid.fdroid.views.AppDetailsRecyclerViewAdapter.onBindViewHolder(AppDetailsRecyclerViewAdapter.java:244)
	at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6310)
	at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6343)
	...

Introduced in 97fd3f0.
2017-06-23 16:14:09 +10:00
Hans-Christoph Steiner
41d7e830d3 Merge branch 'new-ui/uninstall-fixes' into 'master'
System app uninstall prevention, fixes crash.

See merge request !478
2017-06-22 12:21:42 +00:00
Chirayu Desai
7ac3ff293e Don't allow uninstalling system apps.
* F-Droid cannnot uninstall system apps, only their updates,
  but even with the privileged extension, that can get complicated.
* Let's just not allow uninstalling system apps, the phone's settings
  app can happily disable/re-enable system apps, and also uninstalls
  their updates on disabling.
2017-06-22 15:04:23 +05:30
Peter Serwylo
a67393f65f Merge branch 'remove-update-time' into 'master'
Remove update time

See merge request !542
2017-06-22 05:54:15 +00:00
Felix Ableitner
02fad57f0b Remove update time 2017-06-22 05:54:11 +00:00
Peter Serwylo
93d5fc171e Merge branch 'fix-relative-time-formatting' into 'master'
Fix formatting for "Updated x time ago" (fixes #1064)

Closes #1064

See merge request !540
2017-06-19 04:57:18 +00:00
Felix Ableitner
31473c4395 Fix formatting for "Updated x time ago" (fixes #1064) 2017-06-19 11:25:36 +09:00
Hans-Christoph Steiner
eabec87a4c Bump to 0.104 v0.104 2017-06-16 23:20:28 +02:00
Hans-Christoph Steiner
6eaf0360d8 update CHANGELOG for 0.104 2017-06-16 23:20:28 +02:00
Hans-Christoph Steiner
3d5d20e082 index-v1's suggestedVersionCode goes into client's upstreamVersionCode
closes #1052
refs #1063
2017-06-16 23:20:28 +02:00
Hans-Christoph Steiner
b4d22bb4ce Merge branch 'category-tweaks-further' into 'master'
Category colours and sorting.

Closes #1058

See merge request !539
2017-06-16 08:07:21 +00:00
Peter Serwylo
b28057a6ee Sort 'top x apps in category' in descending last updated order.
See #754. Doesn't fix it, because that requests the entire list to be
sorted, but this just sorts the category overview screen.
2017-06-16 11:53:03 +10:00
Peter Serwylo
963996b412 Use white or black text for category chip, depending on brighness of background 2017-06-16 11:01:37 +10:00
Peter Serwylo
444ba43ac0 Adjust category colours to match repomaker designs
Fixes #1058.
2017-06-16 10:47:36 +10:00
Peter Serwylo
3484d6f1dd Merge branch 'last-0.104-fixes' into 'master'
failsafe preference for index-v1.jar

See merge request !537
2017-06-15 23:57:42 +00:00
monolifed
f5810073ea Translated using Weblate (Turkish)
Currently translated at 100.0% (375 of 375 strings)
2017-06-16 00:20:36 +02:00
Hans-Christoph Steiner
bb47d1e41e better report failing plurals tests 2017-06-16 00:20:36 +02:00
Hans-Christoph Steiner
53a17e6146 add failsafe pref to disable using new index
If the client fails due to some bug in handling index-v1.jar, then it will
be totally stuck, even if index.jar would have worked.  This creates a new,
temporary "expert" preference to force the client only use the old XML
index file.  Worst comes to worst, we can tell people to enable this to
upgrade.

Once everything proves stable, we can remove this.
2017-06-16 00:20:36 +02:00
Hans-Christoph Steiner
ee1871f07e clean up English source strings
This started with the work of @kingu, it cleans up some of the language,
including:

* upgrade --> update
* application --> app
* internet --> Internet

closes !508
2017-06-16 00:20:36 +02:00
Hans-Christoph Steiner
7b737b7ba6 Merge branch 'merge-weblate' into 'master'
Merge weblate

See merge request !538
2017-06-15 22:02:26 +00:00
Hans-Christoph Steiner
ab66bfa78b Merge weblate 2017-06-15 22:02:25 +00:00
Hans-Christoph Steiner
e40ce864ce Merge branch 'installer-fallback-N' into 'master'
PrivExt API >= 24 uninstall fixes.

See merge request !486
2017-06-15 18:05:42 +00:00
Hans-Christoph Steiner
e6ba0de8b2 Merge branch 'multi-sig--install' into 'master'
Multi signature improvements for AppDetails + install workflow

See merge request !536
2017-06-15 17:56:55 +00:00
Hans-Christoph Steiner
d54788aafa Merge branch 'multi-sig-tests' into 'master'
Tests and slight improvements for multi-sig support when calculating suggested versions.

See merge request !534
2017-06-15 17:43:47 +00:00
Chirayu Desai
c095a85c3d Installer: Fallback to DefaultInstaller on API >= 24 for uninstall,
... when PackageInstaller is the installer (privext).

* In the case where the Privileged Extension is installed,
  but the installation happens through DefaultInstaller still
  due to something like a permission mismatch,
  that is set as the installer package name.
* We cannot install packages installed by that via the system methods,
  so fallback to DefualtInstaller for uninstalling as well when the
  app is installed by PackageInstaller
2017-06-15 01:15:31 +05:30
Chirayu Desai
204ac3cca9 PackageManagerCompat: Handle exceptions better
* Don't catch all exceptions, only what we expect.
* Also re-format comments as javadoc
2017-06-14 17:45:12 +05:30
Peter Serwylo
edf84c533d Added more explicit test for UpdateService and its can update notification 2017-06-13 12:52:17 +10:00
Peter Serwylo
5a292b8e77 Cleanup tests by extracting common code, and test canUpdate query. 2017-06-13 12:52:16 +10:00
Peter Serwylo
0409a7dcd6 Use provider helper methods instead of manually invoking.
The fact that Cursors are used with the apk provider is more of an
implementation detail (to some extent). It is a crappy, leaky
implementation right now, but still an implementation detail.
2017-06-13 12:52:16 +10:00
Peter Serwylo
28b7d69e60 Don't show versions with a different sig if installed.
This should probably be done on the database level, if purely for the
fact that we have a good set of unit tests for that. However it is still
quite clean to do so here.
2017-06-13 12:52:16 +10:00
Peter Serwylo
189b2277ba Refactor ApkProvider.getApkFromAnyRepo to getSuggestedApk(Apk).
This is really the intention of the method, given it used to accept
a version code and a package name. Now it optionally accepts a sig
also. If present, it will restrict the query to apks with that sig.

Also added to the multi-sig tests to ensure this method takes it into
consideration.
2017-06-13 12:52:16 +10:00
Peter Serwylo
b092d52403 Find better way to detach DB which doesn't pollute test output 2017-06-13 12:49:35 +10:00
Peter Serwylo
655a30c309 Use integer instead of boolean.
There is some magic conversions going on so that booleans get
converted into integers, but they are only on Android. Under
robolectric, it throws a class cast exception instead.
2017-06-13 12:49:35 +10:00
Peter Serwylo
f7d9be9cd5 Remove System.out.print's. Replace with Logs where appropriate.
Some were removed and left removed if they were run during tests,
because the tests are supposed to be automated and the noise they added
would not have helped diagnose a failure.

Also removed the dead code around "uses-feature" which will never
get implemented, especially as it is in the XML index.
2017-06-13 12:49:15 +10:00
Peter Serwylo
de149cf589 Remove subselect and use better index.
The main problem is that we were using an index on fdroid_apk.vercode,
when it should have been using an index on fdroid_apk.appId. There are
thousands of apks which would match based on vercode, but only two or
three which match based on appId. This improves performance of the
calculate-suggested-vercode query from 25,000ms to 100ms.
2017-06-13 09:05:37 +10:00
Peter Serwylo
bb96cdeff9 Refactor join between installed apps and packages. db-version/71 2017-06-13 09:05:37 +10:00
Peter Serwylo
b729f4dc84 Add slow query logging to updateSuggestedFrom* methods.
Produces the following output:

D  Explain:
D    SCAN TABLE fdroid_app
D    EXECUTE CORRELATED SCALAR SUBQUERY 0
D    SEARCH TABLE fdroid_apk USING INDEX apk_vercode
D    EXECUTE CORRELATED SCALAR SUBQUERY 1
D    SEARCH TABLE fdroid_app AS innerAppName USING INTEGER PRIMARY KEY (rowid=?)
D    EXECUTE CORRELATED SCALAR SUBQUERY 2
D    SEARCH TABLE fdroid_package AS pkg USING INTEGER PRIMARY KEY (rowid=?)
D    SEARCH TABLE fdroid_installedApp AS installed USING INDEX sqlite_autoindex_fdroid_installedApp_1 (appId=?)

There are two possibilities here, one is the number of correlated sub
queries (three seems a bit excessive). Alterantively, it could be the
fact that one of the inner queries is using a string index (appId=?)
instead of an integer primary key.
2017-06-13 09:05:31 +10:00
Peter Serwylo
d0444dafca Clarify comments in response to CR. 2017-06-12 14:22:07 +10:00
Peter Serwylo
82eb50c2fe Add test for multi-repo multi-sig apps 2017-06-12 14:22:05 +10:00
Peter Serwylo
aa472ba764 Drop the composite vercode + repo primary key from apk table
We expect repos to serve multiple apks with the same version code but
different signing certificates in the future.
db-version/70
2017-06-12 13:48:36 +10:00
Peter Serwylo
b95a330ccf Restrict suggested versions to those with the same sig as installed.
Only if there is actually a version installed.
2017-06-12 13:48:36 +10:00