Commit graph

1076 commits

Author SHA1 Message Date
Hans-Christoph Steiner
109eb928e8 aapt 26.0.0 is required to properly parse permissions and label
#236

closes #395
aapt 26.0.0 outputs the permissions correctly

closes #306
aapt 26.0.0 now outputs:  application-label:'K-9 Mail'
2017-12-28 23:07:26 +01:00
mimi89999
90c7dd29df
gradle file: use flavour specific versionCode/versionName, fall back to parsing line by line 2017-12-23 17:12:54 +01:00
mimi89999
918bd15c45
Revert: gradle file: use flavour specific versionCode/versionName, fall back to parsing line by line 2017-12-23 12:57:34 +01:00
Hans-Christoph Steiner
781e3c785f always hide PIL.PngImagePlugin's "STREAM" debug messages
Otherwise, enabling verbose messages gives tons of these messages:
DEBUG: STREAM b'IHDR' 16 13
DEBUG: STREAM b'IDAT' 41 32768
2017-12-20 23:46:37 +01:00
Hans-Christoph Steiner
61aac0503a Merge branch 'fixFlavor' into 'master'
Regex only for flavor blocks: flavor { ... }

See merge request fdroid/fdroidserver!407
2017-12-14 16:56:01 +01:00
tobiasKaminsky
03f301470e
regex only for flavor blocks: flavor { ... } and nothing else 2017-12-11 14:29:32 +01:00
Hans-Christoph Steiner
6228162cbd handle jarsigner/apksigner output cleanly for rational logging
These were both spamming the output with lots of confusing messages, even
when --verbose was not used.  Jarsigner especially has confusing messages,
since it has warnings that do not pertain to APK signatures at all, like
the ones about timestamps and missing Certificate Authority.

closes #405
2017-12-07 17:32:14 +01:00
Hans-Christoph Steiner
a2978a5526 common: aapt 24.0.0 (v0.2-2964546) is now required
Without a recent aapt, the <uses-permission-sdk-23> tag will not be found.
2017-12-06 12:30:47 +01:00
Torsten Grote
2bb1445cd6 Merge branch 'nightly-fixes' into 'master'
more `fdroid nightly` polishing

See merge request fdroid/fdroidserver!399
2017-12-05 17:42:57 +00:00
Hans-Christoph Steiner
c33a71a945 fix hg pull, was stupid mistake in 7bba20c662
fdroid/fdroidserver!396
2017-12-05 16:55:58 +01:00
Hans-Christoph Steiner
2983c35361 shutil.move() in apk_strip_signature() to work across filesystems
os.rename() only works if source and destination are on the same file
system, shutil.move() works across file systems.

OSError: [Errno 18] Invalid cross-device link: '/builds/eighthave/fdroidclient/app/build/outputs/apk/app-debug.apk' -> '/tmp/tmp966vh75f/tmp.apk'
2017-12-04 22:52:41 +01:00
Hans-Christoph Steiner
1c3a4479ab add common.sign_apk() for nighly as test for using in publish
Since the MD5 migration was quite a bit of work, it makes sense to start
on moving away from SHA1 as much as possible while it is easy to do. SHA256
will only work in APK signatures on android-18 (4.3) or newer.  So if an
APK has a minSdkVersion of 18 or newer, then sign with SHA256.

https://issuetracker.google.com/issues/36956587
https://android-review.googlesource.com/c/platform/libcore/+/44491
2017-12-04 22:52:41 +01:00
Hans-Christoph Steiner
7bba20c662 block all SSH connections for VCS, for usabililty and security
If we allow SSH, then we'd have to manage known_hosts.

All VCS and submodule URLs should use HTTPS.  SSH URLs have security vulns:
https://blogs.msdn.microsoft.com/devops/2017/08/15/git-vulnerability-with-submodules/
https://www.theregister.co.uk/2017/08/13/ssh_flaw_in_git_mercurial_svn/
CVE-2017-1000117

I did a manual scan of the setup on jenkins.debian.net to see if I could
find any suspicious URLs.  Looks good so far.  This is what I used:

find . -type f -print0 |xargs -0 grep -Eo 'ssh[:+][svn/]+...................'
find . -type f -print0 |xargs -0 grep -Eo 'ssh://-[^ "]+'

Also, some ssh://_ URLs in submodules might still work, because of the URL
rewriting in fdbfb4d1.  But https://-oProxyCommand=pwnme does not really do
anything, unlike ssh://-oProxyCommand=pwnme
2017-12-04 17:49:59 +01:00
Marcus Hoffmann
db0a97e8e7 checkupdates: don't fail when we can't init submodules
Later revisions might have removed the submodules so we want to keep
going when there are no submodules present.
We still abort when there is an error initializing submodules.

Fixes fdroid/fdroidserver#231
2017-12-04 16:30:37 +01:00
Marcus Hoffmann
30b3f41a75 GitFetchFDroidPopen: don't change cwd per default
Fix for ca24aa4ca8.
For git clone we don't want to change cwd because clone actually
creates the repo dir.
2017-12-03 17:07:36 +01:00
Hans-Christoph Steiner
ca24aa4ca8 stop git clone from hanging at prompts
Forgot this in fdbfb4d1a2 !378

reviewed in person with @bubu @uniqx
2017-12-03 13:13:07 +01:00
Hans-Christoph Steiner
b8ed892ad9 build: hard exit on success to avoid hanging
Something is preventing `fdroid build --all` from exiting after a long
run.  @bubu, @uniqx and I think it is because of the use of
AsynchronousFileReader, somehow it's thread does not exit. So the
workaround for now is to just try a hard exit instead of waiting for
things to finish cleanly with `sys.exit(0)`.

https://jenkins.debian.net/job/reproducible_fdroid_build_apps/94/console
2017-12-02 13:48:47 +01:00
Hans-Christoph Steiner
dcbc78d238 Merge branch 'gradleFlavor' into 'master'
gradle file: use flavour specific versionCode/versionName, fall back to parsing line by line

See merge request fdroid/fdroidserver!389
2017-11-30 13:44:47 +01:00
tobiasKaminsky
33aee96ed9
added test case 2017-11-30 11:12:18 +01:00
Hans-Christoph Steiner
e2bbeb5083 common: document read_pkg_args() and read_app_args()
It took me a long time to figure out how `fdroid build --all` builds the
whole list of apps...
2017-11-29 21:06:02 +01:00
Hans-Christoph Steiner
d46d9574b4 update: use KnownApks dates to check system clock on offline machines
KnownApks provides a reliable source of a relatively recent date.
2017-11-29 21:06:02 +01:00
tobiasKaminsky
f8492f05a8
gradle file: use flavour specific versionCode/versionName, fall back to parsing line by line 2017-11-29 09:40:44 +01:00
Marcus Hoffmann
f9b853ab91 makebuildserver: add ndk r16 2017-11-26 17:17:55 +01:00
Hans-Christoph Steiner
a3815039d8 Merge branch 'no_rm' into 'master'
common: use python instead of calling out to 'rm'

See merge request fdroid/fdroidserver!381
2017-11-25 16:43:44 +00:00
Marcus Hoffmann
c790f43bf3 common: use python instead of calling out to 'rm'
Be platform agnostic by not calling other utilities.
2017-11-25 13:49:33 +01:00
Hans-Christoph Steiner
09828f4a73 never wait for SSH prompts when running git commands
We never allow git via SSH or password/key access, and right now, this
causes things to hang forever.  This sets things up to fail quickly
with invalid ssh connections.

BatchMode=yes - passphrase/password querying will be disabled.

StrictHostKeyChecking=yes - never automatically prompt, or add host keys to
the ~/.ssh/known_hosts file, and refuse to connect to hosts whose host key
has changed.
2017-11-23 23:31:38 +01:00
Hans-Christoph Steiner
fdbfb4d1a2 build: stop git from waiting forever at username/password prompts
If a git fetch/clone/submodule URL points to gitlab, github, bitbucket, etc
and that repo does not exist any more, those services will prompt the user
for a username/password so that the service can check if its a private
repo.  Private repos show up the same as non-existent repos.  This employs
two techniques for making sure that git never waits at those prompts.  It
instead should just fail immediately.  The buildserver has been hanging on
these prompts forever, until manually killed.  This change will apply to
updates both on the buildserver host, and the buildserver guest vm.

This uses the "insteadOf" git config option to rewrite URLs to always use
HTTPS and then include a fake username/password so that git will use those
in the prompts and fail immediately.  This trick has been in use on the
verification server for a long while and has been working well.  It has
also been used on jenkins.debian.net in the host.
https://f-droid.org/en/docs/Verification_Server/

It also includes GIT_TERMINAL_PROMPT, which also prevents the bad behavior,
which was added in git 2.3.
https://github.com/blog/1957-git-2-3-has-been-released
2017-11-23 23:31:37 +01:00
Hans-Christoph Steiner
8bf70338e4 make common.local_rsync() method for pre-configured local rsyncs 2017-11-22 11:40:16 +01:00
Hans-Christoph Steiner
ed80391bb5 common.get_examples_dir() to get path to fdroidserver examples 2017-11-22 11:40:16 +01:00
relan
cd8a86a2a2 build: raise VCS client version logging level
Debug logging is not saved in buildserver logs. Also move this line into
build.py's main() to avoid duplication: common.setup_vcs(app) may be
called from parse_metadata() too.
2017-11-02 08:52:02 +03:00
Hans-Christoph Steiner
ffc91e301a make _ always be the gettext function, nothing else
This avoids hard bugs where the _() function gets overidden by a str or
something else.
2017-10-25 23:01:25 +02:00
Hans-Christoph Steiner
dd6d4b2012 preserve metadata when copying APK signatures
Since this code was not setting the "create system" and "compress type",
Python uses it's defaults.  Those will be different than what the Android
tools produces if this is run on UNIX.  The Android tools uses the bare
bones "Windows" ZIP format, e.g. no permissions, etc.

For example:
https://verification.f-droid.org/eu.siacs.conversations_234.apk.diffoscope.html
2017-10-25 23:01:25 +02:00
Hans-Christoph Steiner
e0df6d2479 choose the most recent available version of Java
This came about testing on OSX, where there are often multiple versions of
the JDK installed.  This was choosing the oldest version.  It should
choose the most recent version.
2017-10-25 23:01:25 +02:00
Marcus Hoffmann
e307cdec59 common: check file existence before opening manifest
This fixes a problem when there is a broken symlink with the name
AndroidManifest.xml which will then lead to a crash when trying to open
it for trying to remove the debuggable flag.
2017-10-24 15:19:38 +02:00
Hans-Christoph Steiner
f227af817f standardize on "build-tools" as the name of that Android SDK component 2017-10-19 23:28:13 +02:00
Michael Pöhn
788c8f97fd better error message in publish when repo_key is not set 2017-10-17 22:10:39 +02:00
relan
0ab0b03648 common: print VCS client version
This may help to debug issues with too old VCS clients.
2017-10-06 09:41:24 +03:00
Marcus Hoffmann
50ba108093 fix bare except to satisfy newer pycodestyle 2017-10-04 19:23:53 +02:00
Michael Pöhn
75c5fa6355 added some docstrings and error messages 2017-09-26 14:11:09 +02:00
Michael Pöhn
6fc968f7cd choose best apk version vor index v0 2017-09-26 14:11:09 +02:00
Michael Pöhn
bca07f794f added functions for storing/loading signer fingerprints to stats 2017-09-26 14:11:09 +02:00
Michael Pöhn
ba3844e97e function for finding developer signature in metadata 2017-09-26 14:11:09 +02:00
Michael Pöhn
7c4b8bcac4 added parse release filename function 2017-09-26 14:11:09 +02:00
Michael Pöhn
08627d70a7 check file existance before trying to verify apks; use centext manager for zips when verifying apk 2017-09-26 14:11:09 +02:00
Michael Pöhn
efb0bf6ee5 add common functions for dealing with apk signatures 2017-09-26 14:11:09 +02:00
Michael Pöhn
c196f7dd7a common function for fetching sha256 signing-key fingerprint 2017-09-26 14:11:09 +02:00
Hans-Christoph Steiner
beb79d613d move lots of comments to function doc strings 2017-09-25 16:35:18 +02:00
Hans-Christoph Steiner
176f539647 allow spaces in filenames
This fixes all the bugs I could find that prevented fdroid from
handling files with spaces in them.  This is more important now that
fdroid supports random media files, and Repomaker
2017-09-19 20:13:36 +02:00
Hans-Christoph Steiner
5dcb48831f index: always use jarsigner for verifying JAR signatures
apksigner v0.7 (build-tools 26.0.1), Google made it require that the
AndroidManifest.xml was present in the archive before it verifies the
signature.  So this needs to stick with the jarsigner hack for JARs.
2017-09-19 20:13:36 +02:00
Hans-Christoph Steiner
1d4e3a254d create blank config.py using cross-platform technique
os.mknod() fails on OSX with:

Traceback (most recent call last):

  File "/Users/travis/build/fdroidtravis/fdroidserver/tests/../fdroid", line 154, in <module>
    main()
  File "/Users/travis/build/fdroidtravis/fdroidserver/tests/../fdroid", line 130, in main
    mod.main()
  File "/Users/travis/build/fdroidtravis/fdroidserver/fdroidserver/update.py", line 1768, in main
    common.write_to_config(config, 'repo_keyalias', config['repo_keyalias'])
  File "/Users/travis/build/fdroidtravis/fdroidserver/fdroidserver/common.py", line 2328, in write_to_config
    os.mknod(cfg)
PermissionError: [Errno 1] Operation not permitted
2017-09-19 20:13:36 +02:00