4947 Commits

Author SHA1 Message Date
Viktar Vauchkevich
5a4ffa7cac Translated using Weblate (Belarusian)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
tenzin tselek
8e830ed102 Translated using Weblate (Tibetan)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
José Rodrigo Baires Quezada
745bd5bc38 Translated using Weblate (Spanish)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
zmni
972869f27d Translated using Weblate (Indonesian)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
naofum
9392878b02 Translated using Weblate (Japanese)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
Verdulo
555352e947 Translated using Weblate (Polish)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
Verdulo
f41104a306 Translated using Weblate (Esperanto)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
eghbalmohsen
bad714d60e Translated using Weblate (Persian)
Currently translated at 100.0% (372 of 372 strings)
2017-07-17 23:24:37 +02:00
Hans-Christoph Steiner
78f35db060 Merge branch 'issue-568--removing-apks' into 'master'
Issue 568  removing apks

Closes #568

See merge request !564
2017-07-17 21:24:03 +00:00
Peter Serwylo
1bd9a73dbc Cache results of category-id query.
Each app insert required asking the database for the ID of each
category an app is in. Given the categories don't change (ever)
but are only appended to, we can cache the results in a static
Java variable for increased performance.

This reduced the "repo persister" logic for me from 50 seconds
for main F-Droid and 100 seconds for Archive, down to 15 seconds
and 30 seconds respectively.
2017-07-17 14:34:34 +10:00
Peter Serwylo
e26748e0e0 Remove now-unneccesary "update" code from repo updater.
Now that we need only "insert" new apps rather than"
 * Identify if an app exists
 * If so, update
 * If not, insert

There is much less code required for all of this stuff.
2017-07-17 14:33:16 +10:00
Peter Serwylo
5bde27daa8 Only copy the apps/apks for the current repo to temp tables.
When preparing a temp database to write to, don't copy all apps/apks.
Instead, only copy those _not_ belonging to the repo we are updating.
In an ideal world, we'd not even need to copy them, but we need
their IDs to be in the temp database so that we don't accidentally
use the same auto-generated ID as the main database.

This also means that we can drop the check for "does this app exist,
and hence should we UPDATE it instead of INSERTing it?" and always
just insert it.

Then, when copying the temp table back to disk, first delete all
apps/apks _belonging to the repo being updated_. Then, copy back the
apks/apps we found in the repo. This again improves performance because
we no longer need to bopy back and forth data which we know
wont change (as evidenced by the fact it belongs to a differen trepo).

I don't think this was possible earlier before we did the work to
support repo priorities properly. That is because we had a single app
which was serviced by several repositories. Now, we have multiple
entries in the `fdroid_app` table, for each repo which supports
that app.
2017-07-17 14:27:43 +10:00
Peter Serwylo
8c3441939f Pass through the ID of the repo being updated to the temp tables.
This will allow for more intelligent and efficient copying of data back
and forth from temp to persistent tables.
2017-07-17 12:45:55 +10:00
Hans-Christoph Steiner
571e05398f gitlab-ci: use eighthave image while gitlab fixes things 2017-07-14 21:55:33 +02:00
Hans-Christoph Steiner
488b9b02f9 update Issue763MultiRepo test to work with valid signatures
The test files used in Issue763MultiRepo.java are signed using MD5, which
is now considered invalid.  So if that test is run on any recent Java, it
will fail with a signature error.  This updates the test files to be signed
with SHA1 instead.

* index.microg.jar is a new version fetched from https://microg.org
* index.antox.jar was resigned with the testy.at.or.at key, since antox
  website doesn't exist anymore.
2017-07-14 21:55:33 +02:00
Hans-Christoph Steiner
99f4ae9864 Merge branch 'issue-1105--preferred-signer-field' into 'master'
Force refresh of repos so that preferred signer is present.

Closes #1105

See merge request !562
2017-07-13 20:25:03 +00:00
Peter Serwylo
e62f695a48 Force refresh of repos so that preferred signer is present.
It is a bit harsh to do this, but the rationale is explained in #1105.

Fixes #1105.
db-version/73
2017-07-12 17:12:46 +10:00
Hans-Christoph Steiner
18057abdb1 Merge branch 'issue-1097--toolbar-button-shadow' into 'master'
Add drop shadow to toolbar items in AppDetails.

Closes #1097

See merge request !561
2017-07-10 14:19:26 +00:00
Peter Serwylo
2523134485 Add drop shadow to toolbar items in AppDetails.
This is so that feature images with white backgrounds to not completely
obscure the icons.

Fixes #1097.
2017-07-10 12:59:52 +10:00
Hans-Christoph Steiner
300677fb9c Bump to 1000000 1.0-alpha0 2017-07-08 00:10:59 +02:00
Hans-Christoph Steiner
57664eb086 stop using 'v' prefix for release tags 2017-07-08 00:10:45 +02:00
Hans-Christoph Steiner
7e7835c182 update CHANGELOG for 1.0-alpha0 2017-07-08 00:08:51 +02:00
Hans-Christoph Steiner
2b24c810fa Merge branch 'merge-weblate' into 'master'
Merge weblate

See merge request !560
2017-07-07 21:44:11 +00:00
Hans-Christoph Steiner
490b757113 Merge weblate 2017-07-07 21:44:09 +00:00
Hans-Christoph Steiner
86e8df852e Merge branch 'fix-index-v1-repo-commiting' into 'master'
Fix index-v1 repo commiting

Closes #1016

See merge request !559
2017-07-07 19:00:14 +00:00
Hans-Christoph Steiner
dcf395ad9a add test to update index.xml using index-v1.json 2017-07-07 18:06:49 +02:00
Hans-Christoph Steiner
6c247e3201 Jackson gives us {"repo": {"mirrors": ["foo", "bar"] as ArrayList
I was optimistic and guessed it was a String[], since that's what is needed.

Found by @cde while working on #35
2017-07-07 18:06:49 +02:00
Hans-Christoph Steiner
2a7fe78483 split IndexV1Updater's repo saving into working code
RepoUpdater.prepareRepoDetailsForSaving() was broken here because the Repo
properties were being set before calling it, and then the Repo instance was
passed to it for comparison.  So the comparison was always saying the value
was unchanged.  In IndexV1Updater, the flow doesn't need those checks.

This also fixes the bug where added repos never had their name/description/
icon/etc show up in ManageRepos and RepoDetails.

@cde found this bug working on mirror support, thanks!

related to #35
closes #1016
2017-07-07 18:06:49 +02:00
Hans-Christoph Steiner
0180e754fe remove needlessly scary sentence from otherwise friendly Updates screen
This is not really a useful way to tell the user that the index might be
out of date.  It just adds confusion and makes people think that F-Droid
isn't quite smart enough to know what's going on.
2017-07-07 18:05:53 +02:00
Hans-Christoph Steiner
a430c17950 Merge branch 'non-apk' into 'master'
Add support for non-apk files

Closes #1023

See merge request !541
2017-07-07 12:12:17 +00:00
Hans-Christoph Steiner
7dbf03c435 Apk.isMediaInstalled() needs to check using sanitized file names
The install process automatically sanitizes filenames to avoid exploits
that put attack code in the filename.  Media files are also installed using
this logic, so the installed check needs to use sanitized file names to be
accurate.
2017-07-07 17:09:14 +05:30
Hans-Christoph Steiner
c5a1b11315 allow spaces in file names
This will be more important as people work with media, since it is quite
common to use spaces in filenames generated by humans.  Media files will
not be built by fdroid, so most likely, they will have human-generated
names.
2017-07-07 12:10:52 +05:30
Hans-Christoph Steiner
06bcf75f9b put the faster check first in App.isInstalled()
A > is much faster than all the stuff that isMediaInstalled() has to do,
so put > first, so that if it is true, isMediaInstalled() is not executed.
2017-07-07 12:10:51 +05:30
Chirayu Desai
0d8b0c7fd4 Introduce FileInstaller, a way to handle media files from F-Droid
* This installer is invoked when for non-apk/media files, and
  copies them to an appropriate folder on the sdcard.
* We also introduce a FileInstallerActivity to ask for storage
  permissions at runtime, as needed by Android 6.0 and above,
  and handle the install/uninstall process.
* A toast is shown with the install path after installation.

TODO:
* Manage Installed Apps screen doesn't show media files.
2017-07-07 12:10:48 +05:30
Chirayu Desai
cbf3133e43 AppProvider: Use IS instead of = for suggestedApk calculation
* For non apk files, the signature column would be NULL always,
and in SQLite NULL = NULL is false, but NULL IS NULL is true.

See http://www.sqlite.org/lang_expr.html Operators
2017-07-07 11:41:02 +05:30
Hans-Christoph Steiner
339deb97d9 Merge branch 'issue-1093--reduce-ci-verbosity' into 'master'
Reduce verbosity of CI logging

See merge request !557
2017-07-06 22:19:56 +00:00
Hans-Christoph Steiner
8f680bc1aa Merge branch 'improve-updates-tab-stability' into 'master'
Refactor `AppListItemController` to improve updates tab stability

See merge request !549
2017-07-06 22:15:41 +00:00
Hans-Christoph Steiner
89001ac1f5 Merge branch 'fix-fdroid-notifying-itself' into 'master'
Don't try to notify the user for apks which are already installed.

See merge request !547
2017-07-06 09:51:38 +00:00
Peter Serwylo
2fc8060a5d Check file size first before checking hash to save cycles. 2017-07-06 14:09:17 +10:00
Peter Serwylo
2a40e082e6 Don't try to notify the user for apks which are already installed.
If an app is downloaded into our cache, but an app with the same hash is
already installed, don't bother notifying people about it.

Extracted the logic for finding the path to an apk on disk (given a
PackageInfo object) to also be used by AppUpdateStatusSerice.

Change logging so that if we discard a downloaded file we Log.i instead
of Utils.debugLog. This is so that when debugging a release build we can
see what is happening, because this specific problem was easier to debug
with release builds (rather than setting up a custom fdroid repo).
2017-07-06 13:56:01 +10:00
Peter Serwylo
acbf563724 Reduce verbosity of logging 2017-07-06 11:25:17 +10:00
Peter Serwylo
d37e25db21 Merge branch 'issue-1059--preferred-sig' into 'master'
Support for " preferred sig"

See merge request !552
2017-07-05 23:58:18 +00:00
Peter Serwylo
9acc5a2310 Make pre-multi-sig tests work again.
Before mult-signature support, the process of marking an app as
installed in the `InstalledAppProvider` didn't have any side effects
beyond its own table. Now, it is also responsible for calculating the
`suggestedVersionCode` of the associated app as well.

This means old tests around suggested versions no longer work. This is
because they would insert an App, and set the
`Cols.SUGGESTED_VERSION_CODE` using a `ContentValues`. This was then
overwritten by the `InstalledAppProvider` asking for the real
calculation for suggested versions. That is - it would check for
relevant apks and figure out which was best.

To make the old tests correct, they need:
 * To be able to "install" apps with the correct signature.
 * To insert the relevant apks into the database, not just depend on the
   presence  of an `app`.
2017-07-06 09:22:23 +10:00
Peter Serwylo
bf4b0d89a1 Ensure that the suggestedVersionCode is updated after [un]installing.
Previously, it was only done on repo update.

Now it is done whenever an app is installed or unisntalled. The query to
update the suggested version for each app is quite slow when run at the
end of a repo update. However in this change, we are limiting the query
to only update a single app, which means that performance should not be
a problem.
2017-07-06 09:22:23 +10:00
Peter Serwylo
677fd3a522 Use signature as well as version code in app details for suggested apk. 2017-07-06 09:22:23 +10:00
Peter Serwylo
41f85f3c9d Correctly check for 'suggestedApk' in app details.
Take into account the preferred/installed signature instead of just the
version code.
2017-07-06 09:22:23 +10:00
Peter Serwylo
caac895442 Add "preferredSigner" field to App.
At present, this is chosen from the first package in the index-v1
metadata.
db-version/72
2017-07-06 09:22:21 +10:00
Peter Serwylo
6b42b802b3 Tests for preferred multi sig choice.
When a single repo provides apks with multiple signatures, then we need
to be able to select the preferred one. This adds tests for this which
fail, because that feature has not yet been implemented.
2017-07-06 09:20:45 +10:00
Peter Serwylo
b7b8865325 Extract useful test functions into TestUtils
These will be used by a "preferred sig" test soon.
2017-07-06 09:20:45 +10:00
Hans-Christoph Steiner
ba84bbb9ea reduce massive verbosity of org.fdroid.fdroid.data.AppProviderTest 2017-07-05 17:42:18 +02:00