1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-06 19:10:12 +02:00
Commit Graph

2507 Commits

Author SHA1 Message Date
Michael Pöhn
db5ed26517 publish: avoid double removal of dev-supplied reference binary 2018-07-12 23:53:05 +02:00
Michael Pöhn
cdc2147de9 put .binary.apk files into sub-directory 2018-07-12 23:52:46 +02:00
Michael Pöhn
fab02a49dc Merge branch 'better_gradle_support' into 'master'
Better gradle support

Closes #98

See merge request fdroid/fdroidserver!527
2018-07-11 15:20:19 +00:00
Marcus Hoffmann
9889a98dea
build: improve gradle experience
This expands the gradle wrapper shell script used by the buildserver for
usage outside the buildserver environment. It also allows downloading
whitelisted versions of gradle if they are not yet deployed to the
buildserver by simply upsating the copy of fdroidserver (in contrast to
having to reprovision the whole buildserver).

We first move the buildserver/gradle shell script to the repo root
as gradlew-fdroid, as it's an fdroid specific gradle wrapper.
We also now sync it inside the build VM before each build.

We then add a list of whitelisted gradle distributions taken from the
makebuildserver script.

The script additionally now reads two env vars which tell it where to
expect installed versions of gradle and where it might store downloaded
gradle .zip files. Both of those are configurable from config.py. As the
first should normally just be a subdir of the second it's not exposed in
the example config.py but only used by the buildserver config.py.

Default config now uses this internal gradle wrapper but a path to a
custom wrapper or specific gradle distribution can still be set from
config.py.

Closes fdroid/fdroidserver#98
Ref: fdroid/fdroidserver#370
2018-07-11 11:49:46 +02:00
Hans-Christoph Steiner
b03c4a7353 NoSourceSince Anti-Feature should only be added to index
Before, it was being added to the metadata, so that rewritemeta would
output it.

fdroid/fdroidserver!529
#508
2018-07-10 23:32:07 +02:00
Izzy
5d8e1bde4f new AntiFeature: SourceGone (automatically set at NoSourceSince). closes #508 2018-07-10 12:36:49 +00:00
Marcus Hoffmann
a728582077
build: propagate --no-tarball option to buildserver
Closes #510
2018-07-09 14:48:59 +02:00
Michael Pöhn
5726432159 fix ignoring developer supplied reference apks for reproducible builds when publishing 2018-07-02 15:28:22 +02:00
Hans-Christoph Steiner
d20e8613fe build: only test for all Android SDK paths where it is needed
Now that androguard can be used, the android-sdk is no longer required for
most operations.
2018-06-25 10:52:12 +02:00
Hans-Christoph Steiner
c3b361c91b remove 'from distutils.util import strtobool' dependency
Most of distutils is being removed from the Python standard library, and
this is totally not needed here.
2018-06-25 10:52:12 +02:00
Michael Pöhn
12af173821 fix left out refactoring in build.py 2018-06-23 23:26:42 +02:00
Hans-Christoph Steiner
a736a37282 update: let it work without JDK, only JRE and apksigner 2018-06-19 15:40:48 +02:00
Hans-Christoph Steiner
8f2ee4bd1d run 'zipalign' using standard flags used by Gradle Android Plugin
Nice find by @equeim!  -p was added in build-tools-23.0.0

https://developer.android.com/studio/publish/app-signing#sign-manually

closes #288
2018-06-19 15:40:48 +02:00
Hans-Christoph Steiner
deccd013c9 nightly: --no-deploy option to skip rsyncing repo 2018-06-19 15:40:48 +02:00
Hans-Christoph Steiner
881074b2aa nightly: --keep-private-keys option to allow further processing
This makes it possible to run `fdroid server update` after `fdroid nightly`
has completed.  It also actually deletes all private key files.
2018-06-19 15:40:48 +02:00
Hans-Christoph Steiner
1d6c462605 Merge branch '495-publish-build-logs-with-rsync' into 'master'
publish build logs with rsync

See merge request fdroid/fdroidserver!515
2018-06-19 13:44:09 +00:00
Michael Pöhn
752f6a4ba2 applied review suggestions for deploying (build) logs 2018-06-19 15:18:13 +02:00
Michael Pöhn
a318a637a5 vmtools: use pythonic way to check for installed binaries 2018-06-19 14:47:03 +02:00
Michael Pöhn
ebe71472d3 use default logging style in vmtools 2018-06-19 14:37:18 +02:00
Michael Pöhn
88e64df3ef deploying build logs to server after each individual build run 2018-06-19 12:24:52 +02:00
Michael Pöhn
4c53c71fcf added helper function for uploading build logs with rsync 2018-06-19 12:24:52 +02:00
Marcus Hoffmann
3a6942ca77
scanner: whitelist www.jitpack.io
Only the non-www version was recognized so far.

Closes #498
2018-06-11 12:40:55 +02:00
Hans-Christoph Steiner
ff90c0246e fix PEP8 W605 invalid escape sequence
Python 3.7 will get a lot stricter with escape sequences.  They must be
valid.

* https://lintlyci.github.io/Flake8Rules/rules/W605.html
* https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
2018-05-29 13:51:47 +02:00
Hans-Christoph Steiner
e6d5260c3c fix PEP8: W504 line break after binary operator 2018-05-29 12:31:56 +02:00
Hans-Christoph Steiner
fb02073cab fix "local variable 'e' is assigned to but never used" 2018-05-25 12:32:34 +02:00
Hans-Christoph Steiner
5ff1b5ef37 verify: exit with error code if any APK fails to verify 2018-05-25 11:56:13 +02:00
Hans-Christoph Steiner
a3a0b8dcf0 verify: --reuse-remote-apk to reuse local APKs
For something like a verification server, this avoids having `fdroid verify`
redownload the remote APK from f-droid.org every time its run.  For normal
users, it should download a fresh copy each time to avoid false errors
based on confusion over anything that might have changed the local copy of
the remote APK.

This patch has been used on verification.f-droid.org for a while now. It is
the last thing keeping verification.f-droid.org from using fdroidserver
straight from stretch-backports.
2018-05-25 11:48:01 +02:00
Hans-Christoph Steiner
b0a5ec5c1a workaround crash in diffoscope when verifying APKs
On versions of diffoscope before 87, like the version included in Ubuntu
xenial LTS, it would crash saying:

ValueError: max_diff_block_lines (100) cannot be smaller than max_page_diff_block_lines (128)

https://bugs.debian.org/875451
2018-05-25 11:48:01 +02:00
Hans-Christoph Steiner
cef73e5794 remove unused variable, as reported by pyflakes 2018-05-25 10:32:01 +02:00
Torsten Grote
c6f3aed003
Fix reproducible builds
This commit fixes two bugs with reproducible builds:
* Files added by the buildserver to META-INF (fdroidserverid and buildserverid)
  were causing signature verification to always fail when --on-server was used.
  Since they are not needed anymore, they are no longer added to APKs.
* When showing a diff between both APK files, `jar xf` did not extract
  the full APK properly which was causing useless diffs.
  Instead of using jar, python's zipfile library is used instead.
2018-05-24 16:09:10 -03:00
Michael Pöhn
6b1f242d25 added tests for common.calculate_math_string 2018-05-22 13:24:37 +02:00
Michael Pöhn
24b20d7668 use simple ast+operator based calculator for evaluating Vercode Operation 2018-05-22 13:08:14 +02:00
Michael Pöhn
f8a7c23485 fixed typo vmtools.py 2018-05-21 15:29:13 +00:00
Marcus Hoffmann
f4bb76f3a4
lint: update spdx tags to v4.0.0 2018-05-16 22:36:39 +02:00
Hans-Christoph Steiner
43c61aecee fix pylint Unused argument 2018-05-14 15:25:33 +02:00
Hans-Christoph Steiner
040b8d8d5d prefer latest version of Java, its no longer necessary to prefer 7
closes #474
2018-05-04 21:38:06 +02:00
Hans-Christoph Steiner
7eb622930e update Java path searches to also match v10, v11, etc.
This is still pretty conversative, since its not easy to test on all those
platforms.

#474
2018-05-04 21:37:41 +02:00
Hans-Christoph Steiner
cf1ce46e5c init: make work with only androguard, no Android SDK 2018-05-04 15:11:25 +02:00
J-Jamet
d6f1de2649 Fix applicationIdSuffix / versionNameSuffix #455 2018-05-04 12:24:16 +02:00
Hans-Christoph Steiner
27a5cce832 implement common.get_apk_id() using androguard 2018-05-03 13:46:42 +02:00
Hans-Christoph Steiner
98a2f70e38 fix intermittent test failure
For some reason, the parser stopped working intermittently, even
though the format has been the same since aapt 23 or earlier.  Then
also, some of the test cases pointed to symlinks that were no longer
generated, and one test app now has a blank versionName.

Strange that this wasn't caught in the gitlab-ci runs.  !484

FAIL: test_get_api_id_aapt (__main__.CommonTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./common.TestCase", line 578, in testA_get_api_id_aapt
    self.assertEqual(versionName, vn)
AssertionError: '0.1' != "0.1' platformBuildVersionName='4.3.1-1425645"
- 0.1
+ 0.1' platformBuildVersionName='4.3.1-1425645
2018-05-03 13:46:42 +02:00
Hans-Christoph Steiner
cc1e10a37a delete .java.security after checking MD5 signatures
This file is written freshly each time before use, so it does not need
to be ekpt around.  It was the only file making the fdroiddata.git
repo dirty on the f-droid.org infrastructure.

This also adds stricter file permissions to avoid an attacker changing
those settings during operation.
2018-05-03 13:46:36 +02:00
Hans-Christoph Steiner
0e5ed1bb11 reusable method for checking if a value is a resId or not
I wrote this for the previous commit, but since aapt does not recognize
SDK Version values that are string resources, I made this do the same thing
2018-04-26 15:19:41 +02:00
Hans-Christoph Steiner
e17815e9f0 handle bad SDK Version values in APKs
Even though it is invalid to have *SdkVersion in AndroidManifest.xml set as
anything but an integer, sometimes people manage to get something in there.
`fdroid update` needs to be able to handle all that.

* https://developer.android.com/guide/topics/manifest/uses-sdk-element#min
* https://gitlab.com/souch/SMSbypass/blob/v0.9/app/src/main/AndroidManifest.xml#L29
* https://gitlab.com/souch/SMSbypass/blob/v0.9/app/src/main/res/values/strings.xml#L27

admin#65
2018-04-26 15:19:41 +02:00
Hans-Christoph Steiner
74c6555c71 index: ensure index.xml timestamp is in UTC, closes #481
use verbose but safe syntax so this works with all versions of sed, e.g. osx
2018-04-25 16:35:22 +02:00
Hans-Christoph Steiner
afe0c6a167 fix scan_apk_androguard when parsing versionName without a dot (e.g. 5)
fixes de35f1b05b:

Traceback (most recent call last):
  File "/home/hans/code/fdroid/server/fdroid", line 164, in <module>
    main()
  File "/home/hans/code/fdroid/server/fdroid", line 138, in main
    mod.main()
  File "/export/share/code/fdroid/server/fdroidserver/update.py", line 1932, in main
    apks, cachechanged = process_apks(apkcache, repodirs[0], knownapks, options.use_date_from_apk)
  File "/export/share/code/fdroid/server/fdroidserver/update.py", line 1459, in process_apks
    use_date_from_apk, ada, True)
  File "/export/share/code/fdroid/server/fdroidserver/update.py", line 1332, in process_apk
    apk = scan_apk(apkfile)
  File "/export/share/code/fdroid/server/fdroidserver/update.py", line 1051, in scan_apk
    scan_apk_androguard(apk, apk_file)
  File "/export/share/code/fdroid/server/fdroidserver/update.py", line 1220, in scan_apk_androguard
    res_id = arsc.get_id(apk['packageName'], res_id)[1]
TypeError: 'NoneType' object is not subscriptable

For example https://f-droid.org/archive/com.abitsinc.andr_5.apk:
$ aapt dump badging archive/com.abitsinc.andr_5.apk |head -1
package: name='com.abitsinc.andr' versionCode='5' versionName='5' platformBuildVersionName='2.3.3'
2018-04-18 12:32:28 +02:00
Hans-Christoph Steiner
de35f1b05b update: handle APKs with a blank versionName
Instead of just crashing, first try to use the versionName as written in the
build metadata, otherwise just let it be blank.  A blank versionName will
cause fdroidclient < 1.3 to crash.  Blank versionNames are not allowed in
the .txt metadata format, only .yml.

closes #477
closes #478
closes fdroidclient#1416
closes fdroidclient#1417
closes fdroidclient#1418
fdroiddata!3061
2018-04-17 12:36:49 +02:00
Hans-Christoph Steiner
9bf9159a77 update: use only 7 chars of SHA256 for non-APK version name
#460
2018-04-17 12:36:49 +02:00
Phoenix09
ea89b25fd7 fdroidserver/update.py: APK_LABEL_ICON_PAT icon pattern should not be greedy 2018-04-14 23:30:23 +01:00
Ciaran Gultnieks
bd00b87e4e Filter another invalid mediawiki page title character 2018-04-11 14:32:55 +01:00