1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-19 19:40:17 +02:00
Commit Graph

2071 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
57c3ba413c log Android SDK/NDK component versions on buildserver
ad2b9b99c2 put this in the wrong place, it
was running it on the buildserver host rather than in the buildserver VM
itself, where the builds actually run.

refs #148
2017-02-13 20:08:45 +01:00
Hans-Christoph Steiner
0cf08de347 build: fix fdroidserverid in build log post on wiki
The carriage return in the fdroidserverid file messes up the wiki format.
This was forgotten in 69d39bb301
2017-02-13 20:08:45 +01:00
Hans-Christoph Steiner
69d39bb301 build: include fdroidserverid in build log post on wiki 2017-01-20 12:12:20 +01:00
Hans-Christoph Steiner
78a3e35ef7 break out categories.txt generation to standalone method
This is to clean up the code for the introduction of a new index format.
This also makes it so that only repo/categories.txt is generated, and not
archive/categories.txt.

Currently, the only thing that I can find that reads categories.txt is the
wordpress plugin, e.g. wp-fdroid.  And it only reads repo/categories.txt
not archive/categories.txt.
2017-01-20 10:47:35 +01:00
Hans-Christoph Steiner
d54ad41938 fix bad caching of non-APK files in the repo
Silly mistake in 07ce948809
2017-01-20 10:47:35 +01:00
Hans-Christoph Steiner
8147f92355 Merge branch 'fdroid-publish-ota-zip' into 'master'
`fdroid publish` now includes OTA ZIPs and related source

See merge request !193
2017-01-12 13:03:51 +00:00
Hans-Christoph Steiner
948689281a ensure fdroiddata metadata file overrides .fdroid.yml in source
If the already parsed App instance from metadata/*.* has a field, then the
value coming from .fdroid.yml should not override it.
2017-01-11 22:42:41 +01:00
Hans-Christoph Steiner
bc27dee950 fdroid publish now includes OTA ZIPs and related source
This adds support for publishing ZIP files which were built with
`fdroid build`.  This is for "Over-The-Air" (OTA) update ZIP files for
flashing to ROMs.  The first example of this is the Privileged Extension,
which must be installed by flashing an OTA ZIP on Android > 5.0.

!181
https://gitlab.com/fdroid/privileged-extension/issues/9
https://gitlab.com/fdroid/privileged-extension/issues/10
https://gitlab.com/fdroid/fdroiddata/merge_requests/1804

Also, "if app.Binaries:" is the same as "if app.Binaries is not None:", but
is the standard Python style.
2017-01-09 11:32:52 +01:00
Daniel Martí
fcba707c86 Merge branch 'import' into 'master'
import: fix raw git-over-https urls

See merge request !196
2017-01-01 23:25:30 +00:00
Daniel Martí
926aafa58b Bump CI image, now with build-tools 25.0.2 2016-12-23 17:46:09 +01:00
Boris Kraut
e1dda886d7 import: fix raw git-over-https urls 2016-12-21 10:12:20 +01:00
Kevin C. Krinke
df27bae6a0 dscanner - Drozer based post-build dynamic vulnerability scanner command
* New command `dscanner`, enables one to scan signed APKs with Drozer
 * Drozer is a dynamic vulnerability scanner for Android
 * Drozer runs in a emulator or on-device, this new `dscanner` command...
  * starts a docker image with Drozer and the Android Emulator pre-installed,
  * loads the signed APK into the emulator
  * activates Drozer automated tests for the APK
  * gathers the report output and places it next to the original APK
 * The Drozer docker image can be:
  * cached locally for re-use (just don't run --clean*)
  * retrieved from dockerhub.com for more efficient runtime
  * or be built from scratch (in the new "./docker" directory)
 * New "Vulnerability Scanning" documentation section (run gendocs.sh)
2016-12-06 14:00:44 +01:00
Hans-Christoph Steiner
e37be9b063 fix fdroid build with non-git repos
HEAD is really only in git.  This was introduced in
a4e4310803
2016-12-05 20:19:56 +01:00
Hans-Christoph Steiner
ce3efe4168 remove support for XML app metadata, its broken
JSON and YAML are very closely related, so supporting both of them is
basically almost no extra work.  Both are also closely related to how
Python works with dicts and pickles. XML is a very different beast, and its
not popular for this kind of thing anyway, so just purge it.
2016-12-05 20:16:54 +01:00
Hans-Christoph Steiner
b91cdffe17 App.get_last_build() method to replace duplicated code
Look @mvdan, I added a method to the App class!
2016-12-05 20:16:54 +01:00
Hans-Christoph Steiner
3db2c9869c do proper checking of versionCode value
versionCode is defined as a Java Integer, so any value between -2147483648
(Integer.MIN_VALUE) and 2147483647 (Integer.MIN_VALUE) is valid, including
0.

https://developer.android.com/guide/topics/manifest/manifest-element.html#vcode
2016-12-05 20:16:54 +01:00
Hans-Christoph Steiner
98297278bd check all APKs for old versions of OpenSSL
This scans all APKs for old versions of OpenSSL libraries that are known to
be vulnerable to issues, or fully unsupported.

This really should be implemented as a per-APK AntiFeature, so that it can
apply to any version that is vulnerable.  Since AntiFeatures are currently
only per-App, this instead sets the AntiFeature only if the latest APK is
vulnerable.

Google also enforces this:
https://support.google.com/faqs/answer/6376725?hl=en

apk['antiFeatures'] has the first letter small, since all build fields
start with a lowercase letter.  app.AntiFeatures has the first
uppercase since all App fields are that way.
2016-12-05 20:16:54 +01:00
Hans-Christoph Steiner
95656e6c61 check aapt version to make sure its new enough #236
Since `fdroid update` parses the output of aapt, and since aapt's output
format changes in non-compatible ways, test to make sure that the version
of aapt is new enough to prevent mystery stacktraces.  This only prints a
warning since in many cases, the old version will work just fine.
2016-12-05 20:16:12 +01:00
est31
ddefec33cd Add ndk 13b 2016-11-25 21:18:37 +01:00
Hans-Christoph Steiner
28ea33b8d1 if building directly in git repo, use file path for remote
When a git repo has a .fdroid.yml file in it, and `fdroid build` is run
directly in that git repo, then this uses the file path as the remote for
the git repo in build/appid that is actually built.  That makes it possible
to run builds of commits that are only local, and makes things a whole lot
faster.
2016-11-16 23:28:03 +01:00
Hans-Christoph Steiner
a4e4310803 allow metadata to be embedded in source repos via .fdroid.yml
This allows a source repo to include a complete metadata file so that it
can be built directly in place using `fdroid build`.  If that app is then
included in fdroiddata, it will first load the source repo type and URL
from fdroiddata, then read .fdroid.yml if it exists, then include the rest
of the metadata as specified in fdroiddata, so that fdroiddata has
precedence over the metadata in the source code.

This lets `fdroid build` apps without having a whole fdroiddata setup, but
instead just directly in place in the source code.  This also lets devs
optionallu maintain the fdroid metadata as part of their app, rather than
in fdroiddata without loosing any control.  This should make it easier to
spread around the maintenance load.
2016-11-16 23:28:03 +01:00
Hans-Christoph Steiner
f8dca60a20 convert comments above functions to python docstrings
This is how to write per-function comments.
https://www.python.org/dev/peps/pep-0257/
2016-11-16 23:28:03 +01:00
Hans-Christoph Steiner
1f55a40caa properly parse build metadata list types like gradle=
Something like `gradle: yes` in YAML will be parsed as a boolean, since
'yes' is officially defined as a boolean true in YAML.  For metadata fields
that need to be lists, this needs to be converted.  Same goes for a single
string like `gradle: customFlavor`.
2016-11-16 23:28:03 +01:00
Hans-Christoph Steiner
3fb4cba178 include version, commit, and android tools versions in local log
This includes more info to help track down problems with reproducible
builds, like the specific version being built, and which exact versions of
the Android SDK and NDK were used.
2016-11-16 23:28:03 +01:00
Hans-Christoph Steiner
ad2b9b99c2 log versions of all installed Android SDK/NDK components
Any variation in the Android tools used to build an APK can cause the build
to be unreproducible.  To help troubleshoot these times, this posts the
installed versions of the Android SDK and NDK components to the lastbuild
log, for the long term record.

refs #148
2016-11-16 23:28:03 +01:00
Daniel Martí
82b1d7ad14 all: make newer pycodestyle happy
Apparently the "two empty lines" rule is now stricter.
2016-11-15 20:55:06 +00:00
Hans-Christoph Steiner
56d51fcd6b gpg-sign all valid files in the repo, including source tarballs
This makes sure there is a GPG signature on any file that is included in
the repo, including APKs, OBB, source tarballs, media files, OTA update
ZIPs, etc.  Having a GPG signature is more important on non-APK files since
they mostly do not have any signature mechanism of their own.

This also adds basic tests of adding non-APK/OBB files to a repo with
`fdroid update`.

closes #232
2016-11-07 14:53:01 +01:00
Hans-Christoph Steiner
84e09cd2a2 allow arbitrary build products, not only APKs
This makes it so that the final build product can be specified in output=
and it'll work no matter if its an APK or not.  This was developed around
the case of building the OTA update.zip for the Privileged Extension. It
should work for any build process in theory but it has not yet been tested.

https://gitlab.com/fdroid/privileged-extension/issues/9
2016-11-07 14:53:01 +01:00
Hans-Christoph Steiner
8ecff5bd61 get_release_filename() to handle any file type, not just APKs
In order to support non-APK files that are built by `fdroid build`, this
function that names the file releases needs to be generic.
2016-11-03 08:07:11 +01:00
Hans-Christoph Steiner
ab8d51012d use versionName unmodified as specified
The versionName is defined as a string or string resource that can be any
arbitrary data.  fdroid should not second guess the developer here, and
should just use the versionName unmodified.  For anything that needs to
compare different versions of apps, versionCode should always be used since
that's what Android uses.

https://developer.android.com/guide/topics/manifest/manifest-element.html#vname
2016-11-03 08:07:11 +01:00
Daniel Martí
7dde16dd11 Merge branch 'support-media-files' into 'master'
Support media files

This is the first step in supporting adding artibitrary files to fdroid repos, targeted add supporting media files and flashable _update.zip_ files like used to install the Privileged Extension.  This reuses the existing metadata fields to keep compatibilty with older versions, but that means that lots of names are confusingly named since they refer to aspects of an APK rather than a generic file.  We can address that later when we refactor the whole index metadata.

See merge request !177
2016-11-02 21:11:05 +00:00
Hans-Christoph Steiner
8e45d30020 reuse os.stat() result when checking for non-APK files
This should make things a bit more efficient when running on lots of files,
unless python was already caching the result...
2016-11-02 18:10:13 +01:00
Hans-Christoph Steiner
07ce948809 support adding arbitrary files to a repo
This adds the most basic level of support for including arbitrary files in
an F-Droid repository.  This is useful for things like including videos,
ebooks, update.zip files for ROM updates, and more.  The aim is to have
this as generic as possible to keep it flexible for unforeseen uses.

Code-wise, this is really just a first effort.  This area of code has not
been touched in a very long time, and the repo parsing is done in a giant
function that is not easy to break apart.  It should be broken up to more
cleanly support arbitrary files.

Also remove the TODO line, we've decided to keep the old permission
format for now, at least until there is a major overhaul of the index
data format.  And the issue tracker the proper place for TODOs.
2016-11-02 18:10:13 +01:00
Hans-Christoph Steiner
36a585c2fc create addElementIfInApk() function for clean up common operation
There are currently a couple different ways this is done in the code, this
commit changes all of them to be like addElementNonEmpty().
2016-11-02 18:10:13 +01:00
est31
af22f18296 Scanner: handle utf8 errors more gracefully
Fixes #226
2016-11-02 16:58:59 +01:00
Hans-Christoph Steiner
47d9fd330d remove unused 'apps' argument from update.scan_apks() 2016-11-02 16:11:52 +01:00
Hans-Christoph Steiner
5faef55d67 support all valid versionCode values, i.e. Java Integer values
versionCode can be any Java Integer value, from Integer.MAX_VALUE
(2147483648) to Integer.MIN_VALUE (-2147483647)
2016-11-02 16:11:46 +01:00
Daniel Martí
148f077ad8 Bump ci images and default build-tools 2016-10-23 17:04:58 +01:00
est31
91c5fb567a Add qt sdk support 2016-09-27 14:36:12 +02:00
Daniel Martí
bcd31401ac checkupdates: avoid crash with --auto and None CVC
Reproducible via `fdroid checkupdates --auto subreddit.android.appstore`
at fdroiddata HEAD (e76449ab).

WARNING: ...subreddit.android.appstore : Couldn't find package ID
CRITICAL: Unknown exception found!
Traceback (most recent call last):
  File "/home/mvdan/.bin/fdroid", line 147, in <module>
    main()
  File "/home/mvdan/.bin/fdroid", line 124, in main
    mod.main()
  File "/home/mvdan/git/fsr/fdroidserver/checkupdates.py", line 571, in main
    checkupdates_app(app)
  File "/home/mvdan/git/fsr/fdroidserver/checkupdates.py", line 469, in checkupdates_app
    if int(build.vercode) >= int(app.CurrentVersionCode):
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
2016-09-26 21:07:55 +01:00
Hans-Christoph Steiner
d522988d8c make metadata exceptions optional based on CLI flag
In many cases, there are times where metadata errors need to be ignored, or
at least not stop the command from running.  For example, there will
inevitably be new metadata fields added, in which case a packaged version
of fdroidserver will throw errors on each one.  This adds a standard -W
flag to customize the response: ignore, default, or error.

* by default, the errors are still errors
* `fdroid readmeta -W` will just print errors
* `fdroid readmeta -Wignore` will not even print errors

https://gitlab.com/fdroid/fdroidserver/issues/150
2016-09-12 12:55:48 +02:00
Daniel Martí
fd7a8c83c8 all: bump to build-tools 24.0.2
Update the docker image to include it there too.
2016-09-10 11:45:39 +02:00
Hans-Christoph Steiner
6126b55136 rename server request from "delete" to "uninstall"
This matches the Android API's current Intent action for this, rather than
the deprecated one:

https://gitlab.com/fdroid/fdroidclient/blob/v0.101-alpha5/app/src/main/java/org/fdroid/fdroid/installer/DefaultInstallerActivity.java#L147
https://developer.android.com/reference/android/content/Intent.html#ACTION_UNINSTALL_PACKAGE
https://developer.android.com/reference/android/content/Intent.html#ACTION_DELETE
2016-08-24 23:05:34 +02:00
Hans-Christoph Steiner
a6a8d34528 sanitize mirror URLs to prevent path segments from being removed
urllib.parse.urljoin() will strip off the last path segment before joining
if that last path segment does not end with /.  That's a "feature" to make
it easy to replace file names.  Here it was stripping off the essential
'fdroid' segment, making URLs like:

https://foo.com/repo

when they should be

https://foo.com/fdroid/repo
2016-08-24 23:05:34 +02:00
Hans-Christoph Steiner
85632ba00e set up install/delete lists for "push" commands from server
It is now possible for the server operator to specify lists of apps that
must be installed or deleted on the client (aka "push installs).  If
the user has opted in, or the device is already setup to respond to
these requests, then fdroidclient will automatically install/delete
the packageNames listed.  This is protected by the same signing key
as the app index metadata.

It generates single XML elements with the data set in the attributes. This
keeps the XML compact and easily extensible, e.g. for adding versionCode,
signingKey, etc as attributes:

    <install packageName="com.fsck.k9"/>
    <install packageName="at.bitfire.davdroid"/>
    <delete packageName="com.facebook.orca"/>

Copyright: 2016 Blue Jay Wireless
Signed-off-by: Hans-Christoph Steiner <hans@eds.org>

closes #177
2016-08-16 21:02:15 +02:00
Boris Kraut
815961acc5 Add ndk r11c 2016-08-14 00:59:31 +02:00
Hans-Christoph Steiner
abb4c5587f Merge branch 'java-home-lookup' into 'master'
Fix JDK lookup

Fix two cases when JDK path lookup could fail (found those issues on my Fedora 24 box).

See merge request !153
2016-08-09 15:44:06 +00:00
Hans-Christoph Steiner
911297272c Merge branch 'permission-parsing' into 'master'
Parse maxSdkVersion and -23 permission tags

Parse maxSdkVersion and uses-permission-sdk-23 tags and insert them into the index.

AndroidManifest:
```xml
    <uses-permission android:name="android.permission.READ_CALENDAR" />

    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />

    <uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" />
```

new index format:
```xml
<package>
            <version>1.0</version>
            <versioncode>1</versioncode>
            <apkname>maxmin.apk</apkname>
            <hash type="sha256">526eb6d643050c3fae42fb6c001c704006046db52e98998b21f7646ecae3dae5
            </hash>
            <sig>893fc1f22301c902d05c938b29d21648</sig>
            <size>8681</size>
            <sdkver>14</sdkver>
            <targetSdkVersion>24</targetSdkVersion>
            <added>2016-08-01</added>
            <permissions>READ_EXTERNAL_STORAGE,READ_CALENDAR,WRITE_EXTERNAL_STORAGE</permissions>
                <uses-permission name="android.permission.WRITE_EXTERNAL_STORAGE"
                    maxSdkVersion="18" />
                <uses-permission name="android.permission.READ_CALENDAR" />
                <uses-permission name="android.permission.READ_EXTERNAL_STORAGE" />
                <uses-permission-sdk-23 name="android.permission.ACCESS_FINE_LOCATION" />
</package>
```

old format:
```xml
<permissions>READ_CALENDAR,ACCESS_FINE_LOCATION,WRITE_EXTERNAL_STORAGE</permissions>
```

This generates both formats for backward compatibility with old clients.

Also increase version of index format.

This is a proposal for the issues discussed in https://gitlab.com/fdroid/fdroidclient/issues/704

@eighthave @mvdan 

See merge request !150
2016-08-09 15:33:19 +00:00
Dominik Schürmann
cb965dcb07 Parse maxSdkVersion and -23 permission tags
Parse maxSdkVersion and uses-permission-sdk-23
tags and insert them into the index, e.g.,
<package>
 <permissions>READ_EXTERNAL_STORAGE,READ_CALENDAR,WRITE_EXTERNAL_STORAGE</permissions>
  <uses-permission name="android.permission.WRITE_EXTERNAL_STORAGE"
   maxSdkVersion="18" />
  <uses-permission name="android.permission.READ_CALENDAR" />
  <uses-permission name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission-sdk-23 name="android.permission.ACCESS_FINE_LOCATION" />
</package>

Also increase version of index format
2016-08-09 10:14:57 +02:00
relan
162808a4cc Check javac existence when looking for JDK
Empty JDK directories can remain from previous JDK installations. For
example in RHEL/Fedora when RPM upgrades a package it can leave modified
files (usually configs) and, consequently, their directories. So we could
end up selecting a bad JDK path.
2016-08-08 07:25:26 +03:00
relan
07660fdb13 Fix JAVA_HOME environment variable handling
Append JAVA_HOME to pathlist as a string, not as a list of characters.
2016-08-03 08:21:46 +03:00
Daniel Martí
662aa2c938 all: switch to build-tools 24.0.1 as default 2016-08-02 11:12:01 +02:00
Daniel Martí
059d216aff Re-add NDK r12b, now fixed. 2016-08-02 11:10:31 +02:00
Ciaran Gultnieks
bf153ec247 Revert "all: add NDK r12b and set it as default"
This reverts commit 82d09560c6.

It doesn't work - the setup scripts are expecting a ".bin" file (which
is apparently a 7z archive), but what's actually got is a ".zip".

Conflicts:
	buildserver/provision-android-ndk
2016-08-01 12:38:52 +01:00
Ciaran Gultnieks
e99454868a Catch another case of invalid wiki page names 2016-08-01 12:25:22 +01:00
Daniel Martí
e46debe12e common: extra checks for NDK in local.props
The previous commit fixed it in local setups, this fixes it in broken
buildservers too and makes it more reliable.
2016-07-28 08:26:51 +02:00
Daniel Martí
dee3e85098 common: don't insert $ANDROID_NDK to local.props
See the comment.

Updates #171.
2016-07-25 13:07:46 +02:00
Hans-Christoph Steiner
9be1c75e58 Merge branch 'ndk-r12' into 'master'
NDK r12



See merge request !147
2016-07-18 14:50:51 +00:00
Daniel Martí
82d09560c6 all: add NDK r12b and set it as default 2016-07-13 16:45:05 +01:00
Daniel Martí
a0e4245443 build: error properly if an invalid ndk is used
Currently, if buildjni is not used but ndk is set to an invalid value,
the build would start but $ANDROID_NDK would be empty. This is happening
in VLC, which results in very confusing errors.

If a build uses a ndk= value that is not set up, such as r11/r12 which
we do not have yet, it should error with "NDK version could not be
found". It does with this change.
2016-07-13 16:32:52 +01:00
Ciaran Gultnieks
21404e8622 Merge branch 'use_date_from_apk_in_known_apks' into 'master'
Pass a date from APK to KnownApks.recordapk()

... if --use-date-from-apks option is used.

Essentially, it just expands influence of `--use-date-from-apks` option to `stats/known_apks.txt`.

See merge request !141
2016-07-13 11:43:33 +00:00
Hans-Christoph Steiner
2201df150f add SHA-256 hashes of each OBB file 2016-07-07 22:34:41 +02:00
Hans-Christoph Steiner
5074be224a support .obb files for Opaque Binary Blog APK Expansions
OBB files provide a mechanism to deliver large data blobs that do not need
to be part of the APK.  For example, a game's assets do not need to change
often, so they can be shipped as an OBB, then APK updates do not need to
include all those assets for each update.

https://developer.android.com/google/play/expansion-files.html
2016-07-07 22:34:41 +02:00
Ciaran Gultnieks
1da89dc1f1 Various changes to get makebuildserver to work with a 64 bit base box
Note that the apt packages are split into two halves, because it takes
too long (on 64 bit!) to install them all. The sensible fix would be
to simply up the timeout on the package installation section, but this
is completely broken in chef.
2016-07-01 12:00:38 +00:00
Hans-Christoph Steiner
d522bb7e17 handle APKs with filenames encoded with CP437
The ZIP format has no official encoding :-| so we have to do hacks.  The
zipfile devs couldn't even sort this out:
https://bugs.python.org/issue10614

closes #167
2016-06-27 20:30:32 +02:00
Hans-Christoph Steiner
1be263e870 FDroidPopen must have a locale to support UTF-8 filenames
`fdroid update` should be able to handle any valid filename (hopefully
aapt doesn't barf on them).  To handle that, the environment where the
shell commands are run in needs to have a UTF-8 locale set. If LANG is
not set, things default to ASCII and UTF-8 filenames fail.

This also renames test APK with lots of Unicode chars as a test case.

closes #167
2016-06-27 20:30:32 +02:00
Hans-Christoph Steiner
498489c570 load bash profile using --login when running builds on server
This will make `vagrant ssh` and `fdroid build --server` be the same env,
so troubleshooting should be easier.  !135  Here's what `man bash` says:

 When bash is invoked as an interactive login shell, or as a
 non-interactive shell with the --login option, it first reads and
 executes commands from the file /etc/profile, if that file
 exists.  After reading that file, it looks for ~/.bash_profile,
 ~/.bash_login, and ~/.profile, in that order, and reads and
 executes commands from the first one that exists and is readable.
 The --noprofile option may be used when the shell is started to
 inhibit this behavior. When a login shell exits, bash reads and
 executes commands from the file ~/.bash_logout, if it exists.
2016-06-27 14:00:49 +02:00
Hans-Christoph Steiner
d6c9a8466b properly close opened images
This stops these errors:

fdroid/fdroidserver/fdroidserver/update.py:744: ResourceWarning: unclosed
 file <_io.BufferedReader
 name='repo/icons-320/info.guardianproject.urzip.100.png'>

fdroid/fdroidserver/fdroidserver/update.py:721: DeprecationWarning: The
 'warn' function is deprecated, use 'warning' instead
2016-06-27 14:00:49 +02:00
Daniel Martí
1210dc7769 Merge branch 'api-24' into 'master'
Api 24, gradle versions

CC @krt @eighthave 

See merge request !140
2016-06-27 07:03:58 +00:00
Dominik Schürmann
51a6d1602f Make permission parsing more specific
Get name only and ignore maxSdkVersion

Fixes #188
2016-06-26 18:03:37 +02:00
Dmitriy Bogdanov
b7f28fa576 Pass default date to KnownApks.recordapk()
... if --use-date-from-apks option is used
2016-06-26 19:18:50 +04:00
Daniel Martí
b026874353 all: add and switch to build-tools v24 2016-06-24 17:06:16 +01:00
Hans-Christoph Steiner
c352605768 add force_build_tools config option
This replaces the current default behavior of always forcing the
build_tools version and allows the user to set build-tools forcing in
config.py.

closes #147
2016-06-21 10:29:56 +02:00
Hans-Christoph Steiner
400acdefab check whether metadata file is a duplicate before parsing it
By checking first, this prevents a stacktrace when the duplicate metadata
file is not valid.  For example, in the tests, the duplicate is just a zero
length file, which was causing a stacktrace.
2016-06-21 10:29:56 +02:00
Ciaran Gultnieks
d7e6e335f3 Fix buildserver, broken by e449d2f
Switching to a script /etc/profile.d to set up the environment is all
well and good, except that doesn't get run when you directly execute a
command directly via ssh, which means that the buildserver didn't work
at all (at least for anything that used gradle, or relied on the
environment variables.

This fix doesn't look very nice, but it works - it just forces the
appropriate script to run before build.py is executed on the server.

(Side note, I thought we had tests for this, how did it get past them?)
2016-06-18 12:15:16 +01:00
Markus Kilås
cf320f2e9a Adding support for DSA and ECDSA signatures. 2016-06-17 12:58:52 +02:00
Daniel Martí
3e88b7444d lint: only check unused exlibs if using all apps 2016-06-17 11:35:44 +01:00
Ciaran Gultnieks
720d40ac1c Merge branch 'use-android-update-sdk' into 'master'
switch SDK/NDK/gradle buildserver provisioning to shell scripts

This converts the SDK, NDK, and gradle chef recipes to vagrant provisioning shell scripts.   Those recipes were just shell scripts anyway, forced into that ugly ruby/chef syntax.  Hopefully this will make things easier to maintain since simple bash is easier for most devs than ruby/chef. Also, it might speed up the provisioning a little bit since the whole script is sent to the VM then executed, rather than sent line-by-line.  Additionally, the SDK components are now installed using `android update sdk` so we do not need to duplicate Google's crazy kludges with that stuff.

See merge request !132
2016-06-17 09:15:33 +00:00
Daniel Martí
882afebf76 common: always set android ndk env vars
Also, add the ndk to PATH at the beginning, in case any other ndks are
already in it.

Fixes #176.
2016-06-16 21:36:31 +01:00
Hans-Christoph Steiner
8e57f2737d invalidate apkcache if the metadata version is different
When the metadata changes, different things will be stored about each APK.
So invalidate the cached info parsed from APKs if the cache's metadata
version does not match the metadata version of the currently running tools.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
e449d2f583 buildserver: setup env vars using standard script
bash provides a standard file location for a script to be run when the
shell starts: /etc/profile.d/  This converts the scattered bits of code for
making ~/.bsenv into a single provisioning script to generate
/etc/profile.d/bsenv.sh, which gets automatically executed when bash starts
2016-06-15 15:26:35 +02:00
Hans-Christoph Steiner
1b7a8f85fc parse targetSdkVersion from APKs
The default targetSdkVersion is minSdkVersion, according to the docs:
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target

https://gitlab.com/fdroid/fdroidclient/issues/682
2016-06-14 11:43:07 +02:00
Hans-Christoph Steiner
032dbc3e8d official Android default minSdkVersion is 1 not 0
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#min
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
1feccf9eb8 rename 'sdkversion' var to 'minSdkVersion' to avoid confusion
'sdkversion' is confusing when there is also 'targetSdkVersion' and
'maxSdkVersion'.
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
0ae257db15 rename maxSdkVersion variables to match Android
Since this variable is already different than the XML name ('maxsdkver'),
this eliminates one more name for the same thing.
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
2b6d692f06 use UTF8 as default instead of ASCII for .java .gradle pom.xml
.java .gradle and XML files all can use any encoding.  Most code is ASCII,
but authors' names, etc. can easily be non-ASCII.  UTF-8 is by far the most
common file encoding.  While UTF-8 is the default encoding inside the code
in Python 3, it still has to deal with the real world, so the encoding
needs to be explicitly set when reading and writing files. So this switches
fdroidserver to expect UTF-8 instead of ASCII when parsing these files. For
now, this commit means that we only support UTF-8 encoded *.java, pom.xml
or *.gradle files.  Ideally, the code would detect the encoding and use the
actual one, but that's a lot more work, and its something that will not
happen often. We can cross that bridge when we come to it.

One approach, which is taken in the commit when possible, is to keep the
data as `bytes`, in which case the encoding doesn't matter.

This also fixes this crash when parsing gradle and maven files with
non-ASCII chars:

ERROR: test_adapt_gradle (__main__.BuildTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/fdroidserver-eighthave/tests/build.TestCase", line 59, in test_adapt_gradle
    fdroidserver.build.adapt_gradle(testsdir)
  File "/var/lib/jenkins/workspace/fdroidserver-eighthave/fdroidserver/build.py", line 445, in adapt_gradle
    path)
  File "/var/lib/jenkins/workspace/fdroidserver-eighthave/fdroidserver/common.py", line 188, in regsub_file
    text = f.read()
  File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9460: ordinal not in range(128)
2016-06-07 20:13:54 +02:00
Hans-Christoph Steiner
afd528731a read/write F-Droid files always as UTF-8
This makes UTF-8 the sole supported encoding for F-Droid's files. This is
mostly codifying the already existing practice for config.py and index.xml.
The other files where always just ASCII before.

* config.py
* metadata/*.txt
* known_apks.txt
* categories.txt
* latestapps.txt
* latestapps.dat
* index.xml

Note: this does not change the read/write encoding of stats files.  That is
still ASCII.
2016-06-07 14:10:04 +02:00
Hans-Christoph Steiner
444e8ad982 read/write Java .properties files in proper encoding
They are officially defined as always in ISO 8859-1:
https://docs.oracle.com/javase/6/docs/api/java/util/Properties.html
2016-06-07 13:37:32 +02:00
Ciaran Gultnieks
401649e036 Add extra debug logging for move to/from archive 2016-05-29 15:36:58 +01:00
Daniel Martí
3aeea6fc90 lint: Add check for missing and unused extlibs 2016-05-05 13:42:07 +01:00
Daniel Martí
0711ddb376 lint: make the check for format a regular check 2016-05-05 13:23:30 +01:00
Daniel Martí
0c6269bb67 lint: error on unused files
For now, this is just patch files.
2016-05-05 12:40:16 +01:00
Daniel Martí
5117562df4 lint: gradle does have target= support 2016-04-20 11:23:27 +01:00
Dmitriy Bogdanov
3f75c95e5f Add an encoding parameter to open apkcache created with Py2 2016-04-12 12:42:41 +04:00
Daniel Martí
ec9087d057 Add and switch to build-tools 23.0.3
Also bump to the CI image which contains it.
2016-04-05 10:49:30 +01:00
Daniel Martí
7dfc1c0449 common: never pass None to replace_config_vars
This fixes fdroid build com.umang.dashnotifier:18:

	ERROR: Could not build app com.umang.dashnotifier due to unknown error: Traceback (most recent call last):
	  File "/home/mvdan/git/fsr/fdroidserver/build.py", line 1121, in main
	    options.onserver, options.refresh):
	  File "/home/mvdan/git/fsr/fdroidserver/build.py", line 950, in trybuild
	    build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir, tmp_dir, force, onserver, refresh)
	  File "/home/mvdan/git/fsr/fdroidserver/build.py", line 480, in build_local
	    extlib_dir, onserver, refresh)
	  File "/home/mvdan/git/fsr/fdroidserver/common.py", line 1335, in prepare_source
	    srclibpaths.append(getsrclib(lib, srclib_dir, build, preponly=onserver, refresh=refresh))
	  File "/home/mvdan/git/fsr/fdroidserver/common.py", line 1258, in getsrclib
	    cmd = replace_config_vars(srclib["Prepare"], None)
	  File "/home/mvdan/git/fsr/fdroidserver/common.py", line 1822, in replace_config_vars
	    cmd = cmd.replace('$$NDK$$', build.ndk_path())
	AttributeError: 'NoneType' object has no attribute 'ndk_path'
2016-04-02 13:43:49 +01:00
Daniel Martí
e822627fd1 Fix build crash introduced in 3768d7a4
get_ndk_path was removed long ago when App and Build were introduced.
Now Build.ndk_path() should be used. Trying to use the object as a dict
resulted in a nasty crash:

	TypeError: 'Build' object is not subscriptable

This is probably a result from faulty rebasing and not enough test
coverage.
2016-03-30 22:54:37 +01:00
mimi89999
593a94ea7f Fix error in build.py 2016-03-27 21:36:16 +02:00
Daniel Martí
f46253a79f rewritemeta: fix after !62 breakage 2016-03-24 19:48:15 +00:00
Hans-Christoph Steiner
9cd6b444f8 standardize on .yml as the file extension for YAML
Though the YAML people recommend .yaml for the file extension, in Android
land it seems clear that .yml has won out:

* .travis.yml
* .gitlab-ci.yml
* .circle.yml
* Ansible main.yml
2016-03-23 17:16:28 +01:00
Hans-Christoph Steiner
19189b9b04 import app into fdroid directly from git clone
This adds a new method for `fdroid import` that will generate the fdroidserver
metadata based on a local git repo.  This new mode generates the metadata in
the new .fdroid.yaml format in the git repo itself.  It is intended as a quick
way to get starting building apps using the fdroidserver tools.
2016-03-23 17:16:28 +01:00
Hans-Christoph Steiner
994488ad47 rename metadata.write_metadata() to match metadata.parse_*_metadata()
This changes the function name to include the format of the metadata file,
and also changes the order of the args to match the parse_*_metadata()
functions.
2016-03-23 17:16:28 +01:00
Hans-Christoph Steiner
578218a8b0 build: set default config for .fdroid.* metadata
The default config for .fdroid.* metadata that is included in a git repo is
different than for the standard metadata/ layout because the expectations
are different.  In this case, the most common user will be the app
developer working on the latest update of the app on their own machine.
2016-03-23 17:16:28 +01:00
Hans-Christoph Steiner
3e6b263c8e do not require if config.py if using local metadata
Since you can have a .fdroid.* metadata file included directly in an
app's git repo, it seems annoying to force developers to also include
a blank config.py in order to run `fdroid build` from their git repo.

The next step after this is some kind of global config file for
setting paths and things that need to be customized that would apply
to all git repos, for example, to enable using a buildserver.

This also required moving all of the env setting for FDroidPopen into
a single place so that it is properly setup when using the local
metadata.
2016-03-23 17:16:27 +01:00
Hans-Christoph Steiner
3768d7a4d6 refactor env handling for FDroidPopen to support .fdroid.* metadata
The start up sequence of processes that are based on the .fdroid.* metadata
is a bit different, so this ensures that the environment variables get
properly initialized in all cases.

This also creates a single function where the environment is set.  Before
it was being set in multiple places across multiple files.
2016-03-23 17:16:27 +01:00
Hans-Christoph Steiner
9abb80b3b7 support .fdroid.* metadata file in source root of app being built
This allows app makers to include a .fdroid.(json|xml|yaml|txt) metadata
file in the root of the git repo of their app, then they can build it using
`fdroid build`.  This is useful for developers who want to maintain the
fdroid build recipe themselves, and run the fdroid build process for their
own builds.
2016-03-23 17:16:27 +01:00
Daniel Martí
23ef5b072a checkupdates: don't ignore repeated tags
If multiple tags point at the same commit, limiting the regex search to
one tag per line would only catch one tag. This broke org.wikipedia's
update check.
2016-03-16 18:15:08 +00:00
Hans-Christoph Steiner
4422dca528 fix py3 bug when running fdroid build with a buildserver
File "/var/lib/jenkins/workspace/fdroidserver-makebuildserver/fdroidserver/build.py", line 1119, in main
    options.onserver, options.refresh):
  File "/var/lib/jenkins/workspace/fdroidserver-makebuildserver/fdroidserver/build.py", line 954, in trybuild
    build_server(app, build, vcs, build_dir, output_dir, force)
  File "/var/lib/jenkins/workspace/fdroidserver-makebuildserver/fdroidserver/build.py", line 403, in build_server
    output += get
TypeError: Can't convert 'bytes' object to str implicitly

closes #164 https://gitlab.com/fdroid/fdroidserver/issues/164
2016-03-15 13:21:19 +01:00
Hans-Christoph Steiner
016fa78111 fix stab at a Cygwin port (aaaahh Windows!)
This gets `fdroid init` and `fdroid readmeta` working on Cygwin.
2016-03-15 11:30:27 +01:00
Ciaran Gultnieks
5d296f8c61 Fix python3 checkupdates crashes 2016-03-14 22:29:46 +00:00
Ciaran Gultnieks
6cecb69bf2 Fix another python3 build crash 2016-03-14 22:23:19 +00:00
Hans-Christoph Steiner
7039d16046 always parse versions as strings, not bytes
Fixes a couple errors like:
  File "./makebuildserver", line 30, in vagrant
    out += line
  TypeError: Can't convert 'bytes' object to str implicitly

If universal_newlines=False, the default, then Popen will return bytes if
the newlines in the data do not match the system's newlines.  Setting it to
true enables auto-conversion, and then guarantees that the data is always
str.

"If universal_newlines is True, the file objects stdin, stdout and stderr
are opened as text streams in universal newlines mode, as described above
in Frequently Used Arguments, otherwise they are opened as binary streams."
https://docs.python.org/3/library/subprocess.html#subprocess.Popen
2016-03-14 12:49:38 +01:00
Daniel Martí
f267a1d7c9 Merge branch 'py3' into 'master'
Python 3

I tried to keep commits separate, so if anything causes trouble, it can be reverted or changed easily.

* pre-commit hooks pass
* all tests pass
* My use of `build`, `checkupdates`, `lint`, `import`, `publish` and `update` work as usual
* 2to3 does not report anything useful anymore (only useless parentheses and list() encapsulation of iterators)
* rewritemeta works exactly as usual

CC @eighthave

See merge request !88
2016-03-11 23:51:56 +00:00
Daniel Martí
a023a235a2 metadata: always open metadata files in UTF-8
For some reason, Python uses whatever encoding the system is using via a
locale. Since CI uses an ascii locale, stuff breaks. I can't find a way
to make all of fdroidserver ignore the locale and just use UTF-8, so for
now force it where it's bothering CI.
2016-03-11 13:27:01 +00:00
Daniel Martí
23a950bd00 Fix issue related to creating fdroidvcs file 2016-03-11 13:27:01 +00:00
Daniel Martí
d98b4d1b83 metadata: slightly speed up post_metadata_parse
Iterating over all the fields and checking which are modified is slower
than just iterating over the modified ones.
2016-03-11 13:27:01 +00:00
Daniel Martí
7f6276889e metadata: Sorting builds twice is not necessary 2016-03-11 13:27:00 +00:00
Daniel Martí
d4f806d757 Undo utf-8 text wrap workaround
This was added to fix unicode support in Python2. No longer needed in
Python3.
2016-03-11 13:27:00 +00:00
Daniel Martí
031bb39961 import: switch to python3 urllib 2016-03-11 13:27:00 +00:00
Daniel Martí
4e28fa78fc Fix python headers in some source files
These were missing the python2 header, so they went under my radar when
doing the switch go python3.
2016-03-11 13:27:00 +00:00
Daniel Martí
a1703f1204 update: fix encoding issues with the xml index 2016-03-11 13:27:00 +00:00
Daniel Martí
24266d48e1 update: get output bytes, not str, from keytool 2016-03-11 13:27:00 +00:00
Daniel Martí
4cb5ff0247 common: Introduce FDroidPopenBytes
* We can now get the output bytes directly if desired
* FDroidPopen remains with str output
* Ouptut is now buffered efficiently with a BytesIO instead of
  concatenating strings
2016-03-11 13:27:00 +00:00
Daniel Martí
63f8718cf5 Replace iterkeys() with keys() 2016-03-10 16:43:37 +00:00
Daniel Martí
8b3c27cb47 update: replace encode('hex') with hexlify 2016-03-10 16:43:37 +00:00
Daniel Martí
b31e20ee8b publish: fix hashing of strings 2016-03-10 16:43:37 +00:00
Daniel Martí
a78341d8e5 init: fix writing into file 2016-03-10 16:43:37 +00:00
Daniel Martí
da258dad57 Replace md5 with hashlib.md5 2016-03-10 16:43:37 +00:00
Daniel Martí
dd8ad7a4fd common: fix str fetching from manifest xml 2016-03-10 16:43:37 +00:00
Daniel Martí
d39bf37ce8 Port urllib and HTMLParser imports to python3 2016-03-10 16:43:37 +00:00
Daniel Martí
fc21dbc667 Replace remaining file() usage 2016-03-10 16:43:37 +00:00
Daniel Martí
5026d4e08b FDroidPopen: return str again
In the future we might want to instead return bytes, but for now the
easiest for the port to python3 is to continue to return str.
2016-03-10 16:43:37 +00:00
Daniel Martí
b73cc8e0b3 Replace itervalues() with values() 2016-03-10 16:43:37 +00:00
Daniel Martí
ce18d1cc85 Port to python3's configparser 2016-03-10 16:43:37 +00:00
Daniel Martí
2493e705f2 lint: remove sets usage 2016-03-10 16:43:37 +00:00
Daniel Martí
ec301b8566 common: update base64 encoding of bytes 2016-03-10 16:43:37 +00:00
Daniel Martí
920ae4692f Port all imports to python3 2016-03-10 16:43:37 +00:00
Daniel Martí
11b8b1ca4f update: replace ord() with bytearray 2016-03-10 16:43:37 +00:00
Daniel Martí
ee9a296b64 Make pre-commit hook pass after python3 switch 2016-03-10 16:43:37 +00:00
Daniel Martí
099b45fcca Remove import workarounds for Python2 2016-03-10 16:43:37 +00:00
Daniel Martí
f1f5836a66 Remove code that worked around python2 unicode 2016-03-10 16:43:37 +00:00
Daniel Martí
e829b0f9e7 Get readmeta and rewritemeta running under python3 2016-03-10 16:43:37 +00:00
Daniel Martí
832b1224b9 Replace basestring with str 2016-03-10 16:43:37 +00:00
Daniel Martí
75419c1f04 Replace iteritems() with items() 2016-03-10 16:43:37 +00:00
Daniel Martí
6819c109fe Replace execfile with open+compile+exec 2016-03-10 16:43:37 +00:00
Daniel Martí
ca5ee87b16 Switch to io.StringIO 2016-03-10 16:43:37 +00:00
Daniel Martí
e3591cb7b8 Fix imports in Python 3
Since common and metadata import each other, we must import via
"fdroidserver.*".
2016-03-10 16:43:37 +00:00
Daniel Martí
99edd64372 Switch all headers to python3 2016-03-10 16:43:36 +00:00
Daniel Martí
2a73b74603 checkupdates: sort tags by date in one go
This greatly speeds up checkupdates when UCM:Tags is used on git
repositories, especially on ones with lots of tags. The old method ran a
command per tag. The new method runs a single command and doesn't
require any sorting.

Test runs show that `fdroid checkupdates org.adaway` is down from ~13s
to ~10s on my laptop.
2016-03-10 11:14:08 +00:00
Daniel Martí
261cbcd3ee build: don't remove wrapper dir gradle/
The point of removing these was to make sure that gradlew wasn't used,
and that our gradle was used instead. Removing the scripts already
accomplishes this.

Removing gradle/ should be harmless, but some apps like I2P re-use this
directory to also hold other stuff that is actually needed. So be safer
and don't remove it at all.
2016-03-08 23:50:14 +00:00
Daniel Martí
ace4834cf7 lint: Also warn about gitlab links missing /issues 2016-03-07 22:30:52 +00:00
Boris Kraut
f4ce1737d9 import: use .git suffix only for repo-url 2016-03-06 11:20:10 +01:00
Daniel Martí
920f11d047 lint: error on fdroid import disable line 2016-03-03 14:19:32 +00:00
Daniel Martí
bf32477433 Merge branch 'p1' into 'master'
Fix pubkey extraction on update

Replacement of !86.

Fix pubkey extraction in case of non-empty _JAVA_OPTIONS. Fixes #133.

I didn't actually run the test suite (it looks like there are some preparations to be done for that), but I checked the commands from `test_fdroid_popen_stderr_redirect` in ipython.

See merge request !103
2016-02-28 13:37:17 +00:00
Daniel Martí
e3f60e2b78 common: make jdk detection more strict
We weren't using ^ and $, so stuff like java-8-openjdk-i386 would match
both the Arch and the Debian regexes. A list with one regex per line in
the same format is also easier to read and maintain.

This might be why java8 isn't being detected properly on our Debian
stable buildserver.
2016-02-23 12:43:58 +00:00
Daniel Martí
3e124c8105 build: don't error on .fdroid* files in fdroiddata
This avoids the following incorrect error:

	fdroidserver.common.FDroidException: Only one local metadata file allowed! Found: .fdroid.keystorepass.txt .fdroid.keypass.txt
2016-02-23 12:03:26 +00:00
Daniel Martí
2e5c96dcfa Merge branch 'scanner-repos' into 'master'
Allow commonsware and gradle plugin repos

This is in a MR because I'm uneasy about adding a semi-random AWS url to the list. But seems like the commonsware guy only publishes jars there, which doesn't make any sense to me.

Any idea @eighthave?

See merge request !102
2016-02-20 07:29:12 +00:00
Dmitriy Bogdanov
0fdeade4d4 Add an option to use dates from APK 2016-02-18 16:41:43 +04:00
Dmitriy Bogdanov
a8b1472a43 Fix update crash in case of unset dates in APK 2016-02-18 16:40:51 +04:00
Dmitriy Bogdanov
7fc55a3847 Fix pubkey extraction on update
Fix pubkey extraction in case of non-empty _JAVA_OPTIONS
2016-02-17 22:22:57 +04:00
Ciaran Gultnieks
8135760554 Change can't update category name - closes #80 2016-02-17 14:38:44 +00:00
Daniel Martí
163044648c Allow commonsware and gradle plugin repos 2016-02-17 13:00:05 +00:00
Hans-Christoph Steiner
e0312897c7 make "Current Version Code" default to most recent APK
closes #36 https://gitlab.com/fdroid/fdroidserver/issues/36
2016-02-17 10:40:07 +01:00
Hans-Christoph Steiner
3967a0068b added 'mirrors' option to config for giving official mirror URLs
serverwebroot has long supported uploading to multiple servers, this bit of
metadata communicates those official mirrors to the client so that it can
automatically do something useful with that information.

closes #14 https://gitlab.com/fdroid/fdroidserver/issues/14
2016-02-17 10:40:07 +01:00
Hans-Christoph Steiner
a28ede2b67 PEP8 fix E225 missing whitespace around operator 2016-02-15 23:06:31 +01:00
Hans-Christoph Steiner
0bdbadabff init: check if examples/ exists in layout before using the path
There is definitely some odd stuff that happens in all these paths, so
let's just check that examples/ exists, and move on from there.
2016-02-15 23:06:31 +01:00
Daniel Martí
f06afe7884 Forgot to remove the output= debug prints 2016-02-15 13:49:12 +00:00
Daniel Martí
9800ed1a1a output= is now a glob path and can do gradle 2016-02-15 12:02:45 +00:00
Hans-Christoph Steiner
5780c14df2 fix PEP9 E713 test for membership should be 'not in' 2016-02-12 08:33:22 +01:00
Hans-Christoph Steiner
8489047bcf build: check that metadata is present before creating tmp dirs
Before, `fdroid build` would create some subdirs, then fail when it could
not read the metadata via metadata.read_metadata().  This checks before
whether there is any metadata available, and warns the user accordingly.
2016-02-12 08:33:22 +01:00
Hans-Christoph Steiner
751fd3fb0a common: do not crash if the java_paths are not what is expected
Many commands work without the JDK installed, and it is also possible that
someone is using only JDK 8 or 9.
2016-02-12 08:33:21 +01:00
Daniel Martí
7feeaad095 common: add regexp for arch oracle paths 2016-02-11 21:48:51 +00:00
Daniel Martí
28db5b82c2 common: fix JDK detection on latest arch 2016-02-11 21:34:44 +00:00
Hans-Christoph Steiner
69c81c3817 use jarsigner and keytool from same JDK as is being set in JAVA7_HOME
Using the same JDK throughout should prevent weird bugs where a setup might
use Java8's jarsigner and Java7's keytool.  This also allows the user to
set java_paths and have jarsigner and keytool used from that specified JDK.

This incorporates almost all of the patch that is in the Debian package
that forces fdroidserver to use the default JDK on that Debian release.

closes #93 https://gitlab.com/fdroid/fdroidserver/issues/93
2016-02-11 21:17:23 +01:00
Hans-Christoph Steiner
fdf17e809c automatically detect various installed JDKs and set JAVA[6-9]_HOME
This checks for which JDKs are installed in common locations, then sets the
JAVA[6-9]_HOME env vars needed by some build environments.
2016-02-11 21:17:23 +01:00
Julian Strobl
dd0b38a7e5 use tag if version name is unknown
If we don't find the version name neither in the AndroidManifest.xml nor
in the build.grade file, we fallback to the tag the user specified to
search for.

That way we have a better version name than 'Unknown'.
2016-02-11 19:50:16 +01:00
Daniel Martí
f586161361 lint: also check for trailing spaces in names
I was wrong - we don't check for trailing whitespaces on lines. That
would have to happen at parse time, not in the linter, so it would slow
things down and would become an error, not a warning. Not really worth
it.
2016-01-31 21:29:31 +00:00
Daniel Martí
8f36adfd7b Merge branch 'authorregex' into 'master'
lint: check whitespaces in "Author Name"



See merge request !94
2016-01-31 21:26:31 +00:00
Boris Kraut
5858ba5680 lint: check whitespaces in "Author Name" 2016-01-31 21:37:25 +01:00
Marvin W
6130e6eaf0 Support 'gpgkey' option as announced in sample config. 2016-01-27 15:51:03 +00:00
Ciaran Gultnieks
3629437b09 Tidy up/fix some vagrant issues
1. It is packaged in modern versions of distros, update docs accordingly
2. 1.1 is hopelessly outdated - support 1.4 onwards
3. Check the version properly, and write a better config (previously it
   wrote the 1.1 config for 1.1 and 1.3+
4. Ensure that the default share from later versions is not present when
   building, it's only required for provisioning.
2016-01-26 22:05:31 +00:00
Ciaran Gultnieks
f6b9e46246 Handle with invalid manifests better
In other words, don't blow up and kill a whole checkupdates run just
because one version of one package has some invalid xml.
2016-01-26 22:05:31 +00:00
Daniel Martí
1ff4f63de3 scanner: Allow clojars.org maven repository
See https://github.com/inorichi/tachiyomi/issues/46.
2016-01-24 18:13:45 +00:00
Daniel Martí
fff658ba19 stats: use a stable sort that doesn't randomize
Since we only sorted by count, ignoring the string, it meant that items
with the same count might be arranged in different manners. Hence the
`stats` behaviour was not predictable at all. Now it sorts first by
count, then by string.
2016-01-11 02:43:06 +01:00
Daniel Martí
68e2b46cb0 build: don't add extra clean tasks
It is a good idea in theory, especially for extra tasks specified by the
user. But in practice, tasks specified by developers often don't have a
clean counterpart. So this just breaks the build.
2016-01-11 02:05:43 +01:00
Daniel Martí
0cf2539c89 metadata: fix text wrapping on unicode characters
We were passing the utf-8 encoded string to textwrap, which took the
bytes as characters. Hence multi-byte unicode characters (in utf-8)
would count as multiple columns, which is clearly wrong.
2016-01-10 17:54:38 +01:00
Daniel Martí
e8eda55d9d metadata: Always use regex to verify values
Lists can be made into regexes very easily. Major code simplification.
Also no need to construct sets to avoid iterating over lists.
2016-01-04 13:44:00 +01:00
Daniel Martí
7ff833b948 Remove redundant AntiFeatures bool check 2016-01-04 13:26:48 +01:00
Dominik George
7f3434ea50
Add Author Name and Author Email fields. (Closes: #90) 2016-01-03 23:00:03 +01:00
Daniel Martí
622195bf16 lint: warn about spaces in summaries too 2015-12-31 11:21:47 +01:00
Daniel Martí
4482ba971d gradle: stop trying to patch outputFile
This often breaks since we're just removing a single line. Instead, use
a much more reliable way of finding output apks.
2015-12-31 09:47:14 +01:00
NeroBurner
1683df0cf8 handle Queue 2015-12-29 20:11:47 +01:00
NeroBurner
0e0767492e Octal numbers 0600 to 0o600 2015-12-29 20:10:04 +01:00
NeroBurner
5ca182a20d except named exception handling 2015-12-29 20:09:27 +01:00
NeroBurner
af38f151a2 Change print-function to have brackets 2015-12-29 20:06:46 +01:00
Daniel Martí
967472408b Add NonFreeAssets anti-feature 2015-12-29 12:39:48 +01:00
Daniel Martí
5b8d593275 gradle: Completely get rid of gradlepluginver
We can support multiple output dirs without having to detect/infer the
plugin version. Much simpler and more robust too.
2015-12-24 16:41:39 +01:00
Daniel Martí
138618937f gradle: Never add lintOptions workaround
This breaks on newer plugin versions. Instead of complicating this logic
even further to support them, upstream devs should instead use gradle
configs that actually work.

If their build fails because of lint, it's theirs to fix, not ours.
2015-12-24 16:40:36 +01:00
Daniel Martí
adff5615f5 Fix issues spotted by older pyflakes 2015-12-16 16:42:50 +01:00
Daniel Martí
013315bf10 Open metadata files in only one place
Also get rid of the useless get_default_app_info func.
2015-12-07 20:31:23 +01:00