chiark / gitweb /
fdroidserver.git
7 years agosimplify Android Observatory config
Hans-Christoph Steiner [Mon, 10 Apr 2017 18:14:18 +0000 (20:14 +0200)]
simplify Android Observatory config

This just keeps the config key name simple and direct.

7 years agofix mistake: lists use .append() not .add()
Hans-Christoph Steiner [Mon, 10 Apr 2017 18:02:54 +0000 (20:02 +0200)]
fix mistake: lists use .append() not .add()

This was a mistake in 5ad3486741cee7d76d251cc27a49e1b4fa7310b9

7 years agobtlog: fix bug with first run, the etag variable needs to exist
Hans-Christoph Steiner [Thu, 6 Apr 2017 21:36:31 +0000 (23:36 +0200)]
btlog: fix bug with first run, the etag variable needs to exist

7 years agoMerge branch 'morebintrans' into 'master'
Torsten Grote [Wed, 5 Apr 2017 12:45:40 +0000 (12:45 +0000)]
Merge branch 'morebintrans' into 'master'

`fdroid btlog` for anyone to setup a binary transparency log for any repo

See merge request !243

7 years agoMerge branch 'miscfixes' into 'master'
Torsten Grote [Tue, 4 Apr 2017 21:28:08 +0000 (21:28 +0000)]
Merge branch 'miscfixes' into 'master'

misc fixes

Closes #268

See merge request !245

7 years agobtlog: test with `fdroid update` without requiring ssh access
Hans-Christoph Steiner [Mon, 3 Apr 2017 21:16:39 +0000 (23:16 +0200)]
btlog: test with `fdroid update` without requiring ssh access

Yay git!  Just use a filesystem git remote instead of ssh.

7 years agobtlog: if git remote is specified, push commits to that remote
Hans-Christoph Steiner [Mon, 3 Apr 2017 18:31:25 +0000 (20:31 +0200)]
btlog: if git remote is specified, push commits to that remote

This makes fdroid automatically push the new binary transparency commits if
there is a git_remote specified in either config.py or from a CLI arg.

7 years agoallow index.TestCase to work when run using any path
Hans-Christoph Steiner [Mon, 3 Apr 2017 17:19:37 +0000 (19:19 +0200)]
allow index.TestCase to work when run using any path

7 years agomove make_binary_transparency_log to btlog
Hans-Christoph Steiner [Mon, 3 Apr 2017 14:02:07 +0000 (16:02 +0200)]
move make_binary_transparency_log to btlog

This keeps the code more organized, and reduces the number of things that
are loaded for every command via common.

7 years agoremove setting git name/email for binary transparency logs
Hans-Christoph Steiner [Sun, 2 Apr 2017 21:07:05 +0000 (23:07 +0200)]
remove setting git name/email for binary transparency logs

The machine running the steps should include the git config, so that it is
specific to that machines.

7 years agosupport pretty output in JSON and for binary transparency logs
Hans-Christoph Steiner [Sun, 2 Apr 2017 19:58:34 +0000 (21:58 +0200)]
support pretty output in JSON and for binary transparency logs

This makes make_index_v1() support `fdroid update --pretty`, then also uses
pretty output for the binary transparency logs, so that the git history has
nice, readable diffs between commits.

7 years ago`fdroid btlog` external binary transparency logger
Hans-Christoph Steiner [Mon, 27 Mar 2017 19:52:15 +0000 (21:52 +0200)]
`fdroid btlog` external binary transparency logger

This complements the binary transparency logging that happens on the
server side !226.  Anyone can set up an efficient tracker of any
F-Droid repo which stores all index files that it sees.  It uses HEAD
requests and ETag checking to be as efficient as possible, so that
this can be automatically run at a frequent pace.

7 years agomove make_binary_transparency_log to common for easy reuse
Hans-Christoph Steiner [Mon, 27 Mar 2017 07:58:09 +0000 (09:58 +0200)]
move make_binary_transparency_log to common for easy reuse

7 years agoencode filenames as bytes to handle all locale setups
Hans-Christoph Steiner [Mon, 3 Apr 2017 18:24:00 +0000 (20:24 +0200)]
encode filenames as bytes to handle all locale setups

This was failing on environments that did not have any LANG or LC_* locale
variables set.  This is a valid setup, and is common in headless setups, so
it needs to be handled.

This also adds a new pass of the test suite without the locale env vars set
so that this situation is also tests on gitlab-ci, not only gpjenkins.

The error this caused was:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 6-18: ordinal not in range(128)

7 years agoignore cache on key name change, instead of crashing
Hans-Christoph Steiner [Mon, 3 Apr 2017 14:52:17 +0000 (16:52 +0200)]
ignore cache on key name change, instead of crashing

In 6c2cf2ccdd7130a034e50f9bea481351d475a272, the names of some essential
data bits changed.  If those names are not in the tmp/apkcache, then
`fdroid update` shouldn't crash but instead just ignore that cache entry.
tmp/apkcache should be deleted since the metadata version was bumped, but
I guess that does not always happen.

7 years agomake sure indexes are sorted to minimize diffs between copies
Hans-Christoph Steiner [Mon, 3 Apr 2017 09:29:21 +0000 (11:29 +0200)]
make sure indexes are sorted to minimize diffs between copies

With the binary transparency log stored in git, it makes that more readable
and as small as possible if the index files are fully sorted.  That will
reduce the differences between two copies of an index file to a bare
minimum.

If in the future we implement some kind of binary diff transfer, this will
also help there.

7 years agometadata: don't crash if metadata includes blank Categories list
Hans-Christoph Steiner [Thu, 23 Mar 2017 22:13:37 +0000 (23:13 +0100)]
metadata: don't crash if metadata includes blank Categories list

If someone includes just 'Categories:', it shouldn't crash.

7 years agobuildserver: allow gradle to install new components
Hans-Christoph Steiner [Wed, 22 Mar 2017 09:59:44 +0000 (10:59 +0100)]
buildserver: allow gradle to install new components

Google is making gradle automatically download Android SDK components that
are needed by the build, but not already present.  We need to support that
since it would be a lot of work to fight it.  Plus, since each build starts
from the fresh snapshot, it should not be such a big deal to let each
build install stuff during the process.

closes #268

7 years agoMerge branch 'invalid-apk-fix' into 'master'
Hans-Christoph Steiner [Mon, 3 Apr 2017 17:38:51 +0000 (17:38 +0000)]
Merge branch 'invalid-apk-fix' into 'master'

Fix bug when scanning invalid APKs and add a test for it

See merge request !246

7 years agoFix bug when scanning invalid APKs and add a test for it
Torsten Grote [Mon, 3 Apr 2017 16:07:49 +0000 (13:07 -0300)]
Fix bug when scanning invalid APKs and add a test for it

7 years agoMerge branch 'index-parsing' into 'master'
Hans-Christoph Steiner [Mon, 3 Apr 2017 16:04:35 +0000 (16:04 +0000)]
Merge branch 'index-parsing' into 'master'

Download and return repository index

See merge request !240

7 years agoMerge branch 'local-install' into 'master'
Hans-Christoph Steiner [Mon, 3 Apr 2017 14:45:45 +0000 (14:45 +0000)]
Merge branch 'local-install' into 'master'

Fix installs with pip --user

See merge request !244

7 years agoFix installs with pip --user
Torsten Grote [Mon, 3 Apr 2017 12:55:20 +0000 (09:55 -0300)]
Fix installs with pip --user

7 years agoReduce code duplication
Torsten Grote [Mon, 3 Apr 2017 12:23:06 +0000 (09:23 -0300)]
Reduce code duplication

by re-using methods for extracting and verifying certificate

7 years agoAdd method for downloading (and verifying) a repository index
Torsten Grote [Wed, 29 Mar 2017 21:33:09 +0000 (18:33 -0300)]
Add method for downloading (and verifying) a repository index

This includes some test cases to test the new code.

7 years agoMerge branch '265-fdroid-init-generates-double-entries-in-config-py' into 'master'
Hans-Christoph Steiner [Mon, 3 Apr 2017 10:13:20 +0000 (10:13 +0000)]
Merge branch '265-fdroid-init-generates-double-entries-in-config-py' into 'master'

avoid duplicate value assignments in config files

Closes #265

See merge request !241

7 years agoavoid duplicate value assignments when updating config files
Michael Pöhn [Sun, 2 Apr 2017 10:08:01 +0000 (12:08 +0200)]
avoid duplicate value assignments when updating config files

7 years agoMerge branch 'move-index-methods' into 'master'
Hans-Christoph Steiner [Fri, 31 Mar 2017 17:42:22 +0000 (17:42 +0000)]
Merge branch 'move-index-methods' into 'master'

Move index methods into dedicated modules

See merge request !239

7 years agoRe-use config and options from common module in index
Torsten Grote [Fri, 31 Mar 2017 13:50:15 +0000 (10:50 -0300)]
Re-use config and options from common module in index

7 years agoMove index related methods to new index module
Torsten Grote [Wed, 29 Mar 2017 16:10:04 +0000 (13:10 -0300)]
Move index related methods to new index module

7 years agoMove index signing methods into signindex.py
Torsten Grote [Wed, 29 Mar 2017 15:11:40 +0000 (12:11 -0300)]
Move index signing methods into signindex.py

7 years agoMerge branch 'patch-1' into 'master'
Hans-Christoph Steiner [Wed, 29 Mar 2017 14:56:37 +0000 (14:56 +0000)]
Merge branch 'patch-1' into 'master'

Update support repository.

See merge request !238

7 years agoUpdate support repository.
Jan Christian Grünhage [Wed, 29 Mar 2017 10:33:38 +0000 (10:33 +0000)]
Update support repository.

7 years agoMerge branch 'smaller-methods' into 'master'
Hans-Christoph Steiner [Mon, 27 Mar 2017 19:59:51 +0000 (19:59 +0000)]
Merge branch 'smaller-methods' into 'master'

Factor out code into smaller methods to be used by repomaker

See merge request !236

7 years agoMerge branch 'notabug' into 'master'
Hans-Christoph Steiner [Mon, 27 Mar 2017 19:55:44 +0000 (19:55 +0000)]
Merge branch 'notabug' into 'master'

import: add notabug.org, auto-detect gradle, add options for license and categories

See merge request !237

7 years agoMerge branch 'build_tools_log' into 'master'
Hans-Christoph Steiner [Mon, 27 Mar 2017 19:54:48 +0000 (19:54 +0000)]
Merge branch 'build_tools_log' into 'master'

post correct build tool versions to wiki

Closes #267

See merge request !235

7 years agoMerge branch 'sign-and-verify-update' into 'master'
Hans-Christoph Steiner [Mon, 27 Mar 2017 19:48:36 +0000 (19:48 +0000)]
Merge branch 'sign-and-verify-update' into 'master'

sign and verify update

See merge request !230

7 years agoimport: add option to specify license and categories, auto-detect build.gradle
Boris Kraut [Sun, 26 Mar 2017 17:00:03 +0000 (19:00 +0200)]
import: add option to specify license and categories, auto-detect build.gradle

7 years agoimport: add notabug.org
Boris Kraut [Sun, 26 Mar 2017 16:05:37 +0000 (18:05 +0200)]
import: add notabug.org

7 years agoReturn public key and fingerprint after generating repo signing key
Torsten Grote [Wed, 22 Mar 2017 18:44:35 +0000 (15:44 -0300)]
Return public key and fingerprint after generating repo signing key

7 years agoFactor out code from update.main() to individual functions
Torsten Grote [Wed, 22 Mar 2017 18:17:04 +0000 (15:17 -0300)]
Factor out code from update.main() to individual functions

7 years agomoved version android tools version log header to corresponding function
Michael Pöhn [Wed, 22 Mar 2017 13:56:26 +0000 (14:56 +0100)]
moved version android tools version log header to corresponding function

7 years agofix local var name overloading when iterating build flavours
Michael Pöhn [Wed, 22 Mar 2017 13:20:54 +0000 (14:20 +0100)]
fix local var name overloading when iterating build flavours

7 years agofix exception handling in dscanner and update.py
Michael Pöhn [Wed, 22 Mar 2017 13:07:54 +0000 (14:07 +0100)]
fix exception handling in dscanner and update.py

7 years agoMerge remote-tracking branch 'fdroid/master' into build_tools_log
Michael Pöhn [Wed, 22 Mar 2017 13:02:45 +0000 (14:02 +0100)]
Merge remote-tracking branch 'fdroid/master' into build_tools_log

7 years agofix exception handling in build.py
Michael Pöhn [Wed, 22 Mar 2017 13:01:32 +0000 (14:01 +0100)]
fix exception handling in build.py

7 years agoprefer apksigner if installed, jarsigner sucks
Hans-Christoph Steiner [Mon, 9 Jan 2017 16:35:58 +0000 (17:35 +0100)]
prefer apksigner if installed, jarsigner sucks

Google has their own utility for verifying APK signatures on a desktop
machine since Java's jarsigner is bad for the task.  For example, it
acts as if an unsigned APK validates.  And to check whether an APK is
unsigned using jarsigner is difficult.

apksigner also does the v2 signatures, so it will have to be used
eventually anyway.  It is already in Debian/stretch and can be
available in jessie-backports if need be.

https://android.googlesource.com/platform/tools/apksig
https://packages.debian.org/apksigner

7 years agoset_command_in_config() for finding CLI tools to run
Hans-Christoph Steiner [Mon, 9 Jan 2017 14:21:05 +0000 (15:21 +0100)]
set_command_in_config() for finding CLI tools to run

7 years agoverify: fdroidserverid and buildserverid are part of the sig
Hans-Christoph Steiner [Mon, 9 Jan 2017 14:10:54 +0000 (15:10 +0100)]
verify: fdroidserverid and buildserverid are part of the sig

There are two SHA1 git commit IDs that fdroidserver includes in the builds
it makes: fdroidserverid and buildserverid.  Originally, these were inserted
into AndroidManifest.xml, but that makes the build not reproducible. So
instead they are included as separate files in the APK's META-INF/ folder.
If those files exist in the signed APK, they will be part of the signature
and need to also be included in the unsigned APK for it to validate.

7 years agomake `fdroid verify` use common.verify_apks()
Hans-Christoph Steiner [Tue, 20 Dec 2016 13:09:45 +0000 (14:09 +0100)]
make `fdroid verify` use common.verify_apks()

This makes the jarsigner the ultimate and only judge of whether two APKs
match.  This is the best tool since APK signatures are jar signatures. This
should be eventually updated to use the official Android APK signing tool
called apksigner.

https://android.googlesource.com/platform/tools/apksig/

7 years agoverify: ensure only a single signature is in compared APK
Hans-Christoph Steiner [Mon, 19 Dec 2016 15:54:32 +0000 (16:54 +0100)]
verify: ensure only a single signature is in compared APK

The ZIP format allows multiple entries with the exact same filename, and on
top of that, it does not allow deleting or updating entries.  To make the
`fdroid verify` procedure failsafe, it needs to create a new temporary APK
that is made up on the contents of the "unsigned APK" and the signature
from the "signed APK".  Since it would be possible to give a signed APK as
in the unsigned one's position, `fdroid verify` was not able to update the
signature since it was just adding the new signature to the end of the ZIP
file.  When reading a ZIP, the first entry is used.

7 years agoMerge branch 'supportrepo' into 'master'
Hans-Christoph Steiner [Wed, 22 Mar 2017 09:28:26 +0000 (09:28 +0000)]
Merge branch 'supportrepo' into 'master'

makebs: update support repo to r46

See merge request !233

7 years agopost correct build tool versions to wiki
Michael Pöhn [Tue, 21 Mar 2017 22:51:15 +0000 (23:51 +0100)]
post correct build tool versions to wiki

7 years agomakebs: update support repo to r46
Boris Kraut [Tue, 21 Mar 2017 20:50:29 +0000 (21:50 +0100)]
makebs: update support repo to r46

7 years agoMerge branch 'ndk14' into 'master'
Hans-Christoph Steiner [Mon, 20 Mar 2017 09:38:58 +0000 (09:38 +0000)]
Merge branch 'ndk14' into 'master'

makebs: add ndk r14

See merge request !231

7 years agomakebs: add ndk r14
Boris Kraut [Sun, 19 Mar 2017 21:21:18 +0000 (22:21 +0100)]
makebs: add ndk r14

7 years agoMerge branch 'scan-single-apk' into 'master'
Hans-Christoph Steiner [Fri, 17 Mar 2017 14:47:30 +0000 (14:47 +0000)]
Merge branch 'scan-single-apk' into 'master'

Allow for scanning single APKs

See merge request !227

7 years agoFactor code for scanning a single APK out into its own method.
Torsten Grote [Wed, 15 Mar 2017 17:43:22 +0000 (14:43 -0300)]
Factor code for scanning a single APK out into its own method.

This allows projects using fdroidserver to scan individual APKs without
needing to re-scan all APKs present in a repository.

7 years agoMerge branch 'index-v1' into 'master'
Torsten Grote [Fri, 17 Mar 2017 13:34:31 +0000 (13:34 +0000)]
Merge branch 'index-v1' into 'master'

app index V1 - support graphics, localization, and more

See merge request !221

7 years agosignindex: support signing index-v1.jar
Hans-Christoph Steiner [Thu, 16 Mar 2017 17:51:43 +0000 (18:51 +0100)]
signindex: support signing index-v1.jar

This is a bit different than index.jar: instead of their being index.xml
and index_unsigned.jar, the presense of index-v1.json means that there is
unsigned data.  That file is then stuck into a jar and signed by the
signing process.  index-v1.json is never published to the repo.  It is
included in the binary transparency log, if that is enabled.

7 years agomove update.signjar() to common so it can also be used in signindex
Hans-Christoph Steiner [Wed, 15 Mar 2017 20:23:44 +0000 (21:23 +0100)]
move update.signjar() to common so it can also be used in signindex

7 years agowarn and ignore graphics files that have no matching app metadata
Hans-Christoph Steiner [Thu, 8 Dec 2016 18:28:31 +0000 (19:28 +0100)]
warn and ignore graphics files that have no matching app metadata

If there are graphics files that are in repo/ but there is no metadata for
the associated app, then do not include the graphics in the index. Issue a
warning about this.

7 years agocopy graphic assets from fdroiddata and app source into repo
Hans-Christoph Steiner [Tue, 6 Dec 2016 16:22:46 +0000 (17:22 +0100)]
copy graphic assets from fdroiddata and app source into repo

This looks for standard graphics assets in two standardized locations, one
in metadata/ subdirs and another in fastlane's standard dirs in the app's
source repo.  When it finds them, it copies them into the repo, where they
will then be included in the index for use by fdroidclient.  The images in
the metadata/ folder of fdroiddata take precendence over the files in the
app's source repo.

So like this for including graphics in fdroiddata:
  metadata/packageName/locale/filename.(png|jpg|jpeg)
for example:
  metadata/org.videolan.vlc/en-US/featureGraphic.png
or
  metadata/info.guardianproject.ripple/zh-CN/phoneScreenshots/screenshot1.png

Including graphics in fdroiddata would be optional. The prefered way to get
graphics into the repo would be for the files to be in the git repo in a
standard location.  This fastlane layout is currently supported:

https://github.com/fastlane/fastlane/blob/1.109.0/supply/README.md#images-and-screenshots

7 years agoensure that app.Categories is always a list of strings
Hans-Christoph Steiner [Tue, 6 Dec 2016 15:11:25 +0000 (16:11 +0100)]
ensure that app.Categories is always a list of strings

This just makes it easier for people writing build recipes.  Rewriting will
output a list of strings as well.

The test index.xml and categories.txt are updated to include the new number
categories, and the changed CurrentVersionCode to 2147483647 (MAX_VALUE)

7 years agoinclude graphics and screenshots from repo in V1 index
Hans-Christoph Steiner [Tue, 6 Dec 2016 12:32:34 +0000 (13:32 +0100)]
include graphics and screenshots from repo in V1 index

If the repo has store graphics and/or screenshots, then include those in
the metadata.  This follows the possible graphics for Google Play, and the
file naming scheme of the open source 'fastlane' tool for managing those
files.

https://github.com/fastlane/fastlane/blob/1.109.0/supply/README.md#images-and-screenshots
https://support.google.com/googleplay/android-developer/answer/1078870?
https://android-developers.blogspot.com/2011/10/android-market-featured-image.html

Signed-off-by: Hans-Christoph Steiner <hans@eds.org>
7 years agoinclude push install/uninstall requests in index-v1
Hans-Christoph Steiner [Mon, 5 Dec 2016 20:06:04 +0000 (21:06 +0100)]
include push install/uninstall requests in index-v1

Since the index-v1 is generated straight from the internal dict, this just
moves the generation earlier, and feeds it into the apps dict.

7 years agoconvert internal dict keys to match fdroidclient's Apk class
Hans-Christoph Steiner [Tue, 29 Nov 2016 12:40:21 +0000 (13:40 +0100)]
convert internal dict keys to match fdroidclient's Apk class

This syncs up the field names between the fdroiddata .yml files, the keys
used in the implementation in fdroidserver, the index data format, and the
final data structures in fdroidclient.  This makes it easier for devs to
follow, and makes the Jackson parsing library automatically handle
converting the data from the index file to Java instances.

This bumps the metadata version since the apkcache will have to be
discarded.

Here are the name changes:
* apkname --> apkName
* id --> packageName
* sha256 --> hash
* version --> versionName
* versioncode --> versionCode

tests/repo/index.xml was changed only to bump the metadata version
from 17 to 18.

7 years ago`fdroid update` uses datetime instances for timestamps
Hans-Christoph Steiner [Mon, 28 Nov 2016 20:10:58 +0000 (21:10 +0100)]
`fdroid update` uses datetime instances for timestamps

Using datetime instances as the internal format makes it much easier to
convert between the formats needed for index.xml and index-v1.  apkcache
still uses time tuples and known_apks.txt still uses the ISO date.

7 years agoadd index V1 format, a direct translation of internal dict
Hans-Christoph Steiner [Mon, 28 Nov 2016 20:09:07 +0000 (21:09 +0100)]
add index V1 format, a direct translation of internal dict

Python encode/decode libs work directly with dicts, so the internal dict
can just be passed directly to any of these libs (pyyaml, pyjson, msgpack,
simplejson, etc).  This still generates the exact same index.xml as before.

This converts the internal format for the repo timestamp to a datetime
instance, which can be easily converted to UNIX time in seconds for XML
and UNIX time in milliseconds for the new index formats.  UNIX time in
milliseconds is directly serialized into a java.util.Date instance by
Jackson.

7 years agobreak out jar signing into function so it can be reused
Hans-Christoph Steiner [Mon, 5 Dec 2016 18:19:02 +0000 (19:19 +0100)]
break out jar signing into function so it can be reused

The new index format will also need to use jar signing

7 years agoonly set 'No description available' in the old index format
Hans-Christoph Steiner [Fri, 25 Nov 2016 14:29:37 +0000 (15:29 +0100)]
only set 'No description available' in the old index format

The new index format aims to be a direct representation of the data, then
the clients/website will handle the rest.

7 years agoMerge branch 'buildserver-auto-install' into 'master'
Michael Pöhn [Fri, 17 Mar 2017 12:51:15 +0000 (12:51 +0000)]
Merge branch 'buildserver-auto-install' into 'master'

buildserver auto install

Closes #247

See merge request !229

7 years agoMerge branch 'metadata_output_vars' into 'master'
Hans-Christoph Steiner [Fri, 17 Mar 2017 11:37:18 +0000 (11:37 +0000)]
Merge branch 'metadata_output_vars' into 'master'

metadata output-lines now substitute $$VERSION$$/etc.

Closes #263

See merge request !228

7 years agoMerge branch 'binary-transparency' into 'master'
Hans-Christoph Steiner [Thu, 16 Mar 2017 19:57:56 +0000 (19:57 +0000)]
Merge branch 'binary-transparency' into 'master'

new repo-wide config option for a "Binary Transparency" log based on git

See merge request !226

7 years agoadd a simple test of the binary transparency log
Hans-Christoph Steiner [Thu, 16 Mar 2017 18:22:32 +0000 (19:22 +0100)]
add a simple test of the binary transparency log

This makes sure it gets generated with two commits: README and first log.

7 years agoupdate: include git config name/email in binary transparency log
Hans-Christoph Steiner [Thu, 16 Mar 2017 16:45:10 +0000 (17:45 +0100)]
update: include git config name/email in binary transparency log

7 years agobuildserver: support HTTPS Debian mirrors
Hans-Christoph Steiner [Thu, 16 Mar 2017 13:48:08 +0000 (14:48 +0100)]
buildserver: support HTTPS Debian mirrors

The ever troublesome gpjenkins box needs to use HTTPS mirrors.  Plus it
improves the security of the buildserver, since there have been CVEs that
HTTPS would protect against:
https://www.debian.org/security/2016/dsa-3733

7 years agobuildserver: allow gradle/sdkmanager to install into the new m2repository
Hans-Christoph Steiner [Thu, 16 Mar 2017 10:43:46 +0000 (11:43 +0100)]
buildserver: allow gradle/sdkmanager to install into the new m2repository

Google is pushing gradle towards downloading all the SDK components that it
needs, rather than having a preconfigured SDK installed.  The buildserver
strongly supports the old model, with added checksum checking even. We can
still support the old model by pre-configuring the SDK and locking it down
as root. This can then also support the new model by setting the file perms
so that new packages can be auto-installed, but they cannot overwrite any
packages that come pre-installed and pre-verified.

fdroiddata!2096
closes #247

7 years agometadata output-lines now substitute $$VERSION$$/etc.
Michael Pöhn [Thu, 16 Mar 2017 08:23:28 +0000 (09:23 +0100)]
metadata output-lines now substitute $$VERSION$$/etc.

7 years agogenerate HTML diff from verify using diffoscope
Hans-Christoph Steiner [Wed, 14 Dec 2016 14:54:01 +0000 (15:54 +0100)]
generate HTML diff from verify using diffoscope

If diffoscope is installed, then use it to generate HTML diffs of all
verification builds.

7 years agonew repo-wide config option for a Binary Transparency Log
Hans-Christoph Steiner [Fri, 16 Dec 2016 11:19:07 +0000 (12:19 +0100)]
new repo-wide config option for a Binary Transparency Log

A Binary Transparency Log is a append only log of all binaries published by
a repo.  This is useful for people to find whether the binary they have
matches what F-Droid has published, and also makes it more difficult for
the published history to be changed without notice, or for a server to give
specific users custom malware binaries.

https://www.eff.org/deeplinks/2014/02/open-letter-to-tech-companies

7 years agoRemove whitespace from HTTP update check versions
Ciaran Gultnieks [Wed, 15 Mar 2017 08:58:08 +0000 (08:58 +0000)]
Remove whitespace from HTTP update check versions

7 years agoCatch update check failure and proceed, not bomb out
Ciaran Gultnieks [Wed, 15 Mar 2017 08:57:24 +0000 (08:57 +0000)]
Catch update check failure and proceed, not bomb out

7 years agoupdate: fix crash in debug logging message
Hans-Christoph Steiner [Wed, 15 Mar 2017 13:23:19 +0000 (14:23 +0100)]
update: fix crash in debug logging message

7 years agobuildserver: remove my silly mistake
Hans-Christoph Steiner [Tue, 14 Mar 2017 19:14:06 +0000 (20:14 +0100)]
buildserver: remove my silly mistake

Should have done this through a merge request... code review!

7 years agobuildserver: bump to android_m2repository r45
Hans-Christoph Steiner [Tue, 14 Mar 2017 19:04:50 +0000 (20:04 +0100)]
buildserver: bump to android_m2repository r45

7 years agoMerge branch 'constraintlayout-license-bullshit' into 'master'
Hans-Christoph Steiner [Tue, 14 Mar 2017 12:11:27 +0000 (12:11 +0000)]
Merge branch 'constraintlayout-license-bullshit' into 'master'

buildserver: support new ConstraintLayout license bullshit

See merge request !225

7 years agobuildserver: allow gradle to install newer build-tools versions
Hans-Christoph Steiner [Tue, 14 Mar 2017 11:39:03 +0000 (12:39 +0100)]
buildserver: allow gradle to install newer build-tools versions

gradle will now automatically download and install missing bits of the
Android SDK.  While we prefer to have the SDK packages fully verified, we
should allow this behavior on the buildserver to ensure that builds work
even when the buildserver can't be updated.  Since each build starts from a
clean snapshot, this auto-installed build-tools will only be used for the
single build, so it won't affect other apps.

7 years agobuildserver: support new ConstraintLayout license bullshit
Hans-Christoph Steiner [Mon, 13 Mar 2017 15:31:27 +0000 (16:31 +0100)]
buildserver: support new ConstraintLayout license bullshit

The new ConstraintLayout library in Android Support has some new custom way
of handling the license.  I suspect that they are going to use this new way
with all of the bits that gradle downloads.  We also have to support it for
apps that use it, including soon fdroidclient.

fdroiddata!2094
ci-images!1

7 years agoMerge branch 'popen-nonutf8' into 'master'
Ciaran Gultnieks [Mon, 13 Mar 2017 07:40:31 +0000 (07:40 +0000)]
Merge branch 'popen-nonutf8' into 'master'

common: don't assume build script output is utf-8

See merge request !224

7 years agocommon: don't assume build script output is utf-8
Daniel Martí [Sun, 12 Mar 2017 19:36:44 +0000 (19:36 +0000)]
common: don't assume build script output is utf-8

FDroidPopen is used for running many commands - from git to gradle to
custom commands via flags like build=. When any of these invoke calls to
custom build systems or upstream programs/scripts, it's not safe to
assume that the output will be utf8.

Unfortunately, this currently leads to crashes and failed builds:

ERROR: Could not build app org.kiwix.kiwixmobile due to unknown error: Traceback (most recent call last):
  File "/home/vagrant/fdroidserver/fdroidserver/build.py", line 1155, in main
    options.onserver, options.refresh):
  File "/home/vagrant/fdroidserver/fdroidserver/build.py", line 951, in trybuild
    build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir, tmp_dir, force, onserver, refresh)
  File "/home/vagrant/fdroidserver/fdroidserver/build.py", line 648, in build_local
    p = FDroidPopen(['bash', '-x', '-c', cmd], cwd=root_dir)
  File "/home/vagrant/fdroidserver/fdroidserver/common.py", line 1786, in FDroidPopen
    result.output = result.output.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb7 in position 5397290: invalid start byte

One way to fix this would be to use one of the python libraries that
guess an encoding. But a much safer option is to tell the decode method
to ignore non-utf8 bytes, as opposed to crashing on them.

7 years agoMerge branch 'include-ota-zip-in-index-xml' into 'master'
Hans-Christoph Steiner [Fri, 10 Mar 2017 23:06:22 +0000 (23:06 +0000)]
Merge branch 'include-ota-zip-in-index-xml' into 'master'

fix OTA ZIP inclusion in index.xml

See merge request !223

7 years agofix source tarball filename for media files
Hans-Christoph Steiner [Fri, 10 Mar 2017 18:05:01 +0000 (19:05 +0100)]
fix source tarball filename for media files

bug from 07ce9488097c1361c1cc1a515773fb73199550bf

7 years agoinclude non-APKs that match metadata and fdroid-generated filenames
Hans-Christoph Steiner [Fri, 10 Mar 2017 17:28:22 +0000 (18:28 +0100)]
include non-APKs that match metadata and fdroid-generated filenames

Since it is now possible to build and include arbitrary files, like OTA
update ZIP files, the update procedure needs to look for non-APK files that
match the packageName_versionCode pattern of fdroid-generated files.

!193
admin#14
privileged-extension#9

7 years agoupdate: do not include fdroid-generated tarballs as "media" files
Hans-Christoph Steiner [Fri, 10 Mar 2017 16:40:19 +0000 (17:40 +0100)]
update: do not include fdroid-generated tarballs as "media" files

`fdroid build` will generate source tarballs, and now with support for
adding any file to a repo, we need to explicitly ignore the fdroid-
generated source tarballs.  If people want to include source tarballs in a
repo, they still can, as long as that source tarball doesn't use the
`fdroid build` tarball naming scheme.

7 years agoMerge branch 'gradle341' into 'master'
Hans-Christoph Steiner [Fri, 10 Mar 2017 15:23:41 +0000 (15:23 +0000)]
Merge branch 'gradle341' into 'master'

makebs: add gradle 3.4.1

See merge request !222

7 years agomakebs: add gradle 3.4.1
Boris Kraut [Fri, 10 Mar 2017 13:29:36 +0000 (14:29 +0100)]
makebs: add gradle 3.4.1

7 years agoMerge branch 'pre-indexv1-fixes' into 'master'
Hans-Christoph Steiner [Tue, 7 Mar 2017 10:39:41 +0000 (10:39 +0000)]
Merge branch 'pre-indexv1-fixes' into 'master'

pre index-v1 fixes

See merge request !220

7 years agouses-permission maxSdkVersion as int, and enforces int string in XML
Hans-Christoph Steiner [Tue, 29 Nov 2016 20:04:27 +0000 (21:04 +0100)]
uses-permission maxSdkVersion as int, and enforces int string in XML

This forces <uses-permission maxSdkVersion=""> to be an integer in the
internal dict, and forces it to have no decimal point in XML.  Having it as
an integer in the internal dict means data will pass directly through to
the fdroidclient Apk instance, where it is ultimately an integer.

7 years agonon-APK files will not have minSdkVersion, so don't force it
Hans-Christoph Steiner [Thu, 8 Dec 2016 18:30:38 +0000 (19:30 +0100)]
non-APK files will not have minSdkVersion, so don't force it

fdroidclient should handle no minSdkVersion fine, since it just parses the
text in <sdkver></sdkver> as an int, and uses a default value if there is
an Exception.