Marcus Hoffmann
768a91370c
publish: use apksigner for signing apks with targetSDK>=30
...
This makes apksigner a hard requirement of the signing procedure.
We'll first try to find a globally installed version from PATH and if
that's not available fall back to using a version from build-tools.
Future TODO: always sign with apksigner, blocked on signature transplant
support for apksigv2/v3
Closes fdroid/fdroidserver#634
Closes fdroid/fdroidserver#827
2020-09-09 18:09:28 +02:00
Marcus Hoffmann
ba28b44ae7
common: use androguard to figure out minSDK version
...
Closes : #816
2020-08-19 19:49:39 +02:00
Hans-Christoph Steiner
d0f426e076
replace $$srclib$$ with an absolute path
...
closes #725
2020-06-24 22:40:26 +02:00
Hans-Christoph Steiner
95c3ab2454
skip yamllint test if yamllint is not installed
...
!721
2020-05-27 22:07:17 +02:00
Michael Pöhn
b076e8cba7
add srclib spec parser
2020-04-25 17:22:48 +02:00
Michael Pöhn
d24484a950
simple testcase for common.run_yamllint
2020-04-24 15:47:47 +02:00
Michael Pöhn
fa7885063b
scrlib: add test for getsrclib
2020-04-16 11:31:59 +02:00
Michael Pöhn
286220fe11
srclib: add test for getsrclibvcs
2020-04-16 11:31:59 +02:00
Hans-Christoph Steiner
ab2291475b
import: mv reusable functions to common.py to avoid import_proxy.py
...
import is a strict keyword in Python, so it is not possible to import a
module called 'import', even with things like:
* import fdroidserver.import
* from fdroidserver import import
2020-03-11 13:41:13 +01:00
Hans-Christoph Steiner
202291d66c
integration test for creating and deploying status JSON files
...
----------------------------
2020-02-19 14:50:37 +01:00
Hans-Christoph Steiner
271b74af7d
fix remove_signing_keys() for Kotlin gradles files (*.gradle.kts)
2020-02-13 22:32:51 +01:00
Hans-Christoph Steiner
83ffeb855f
prefer build.gradle with Android Plugin as source of package/version/code
...
These days, the location that overrides all the others is in the android{}
block of the build.gradle file that loads the com.android.application
plugin. So this should be the preferred place to read these values.
test files GPL licensed: https://github.com/Integreight/1Sheeld-Android-App
2020-02-13 22:32:51 +01:00
Hans-Christoph Steiner
bfe587979d
import: make it work most of the time with git repos
...
This includes real tests too.
2020-02-13 13:51:52 +01:00
Hans-Christoph Steiner
e76a0c9d6a
git_mirror_size_limit config option to set max git mirror size
...
GitHub and GitLab have some kinds of limits on how big a git repo can be,
this makes that option configurable. This also is very useful for tests.
2020-01-14 11:36:08 +01:00
Hans-Christoph Steiner
7d40e89341
checkupdates: split out vercode parsing into testable function
2019-12-03 23:51:48 +01:00
Jochen Sprickerhof
bbee2cf707
Add unit test for string_is_integer()
2019-12-03 21:49:44 +01:00
Hans-Christoph Steiner
0a8af2c55f
Merge branch 'fix-readline-in-srclibs' into 'master'
...
build: fix bad regexs when removing signingConfig from srclibs
See merge request fdroid/fdroidserver!686
2019-10-25 08:18:08 +00:00
Hans-Christoph Steiner
afaa24f2fd
build: fix bad regexs when removing signingConfig from srclibs
...
I went through the source of all apps in fdroiddata for examples, and found
some that use readLine() for things totally unrelated to signingConfigs.
https://gitlab.com/fdroid/fdroiddata/merge_requests/4775#note_234132902
2019-10-23 12:44:47 +02:00
Michael Pöhn
7fa3c34e5b
update tests for fixed log deployment+changelog
2019-10-15 15:19:18 +02:00
Michael Pöhn
d0368d0ad8
common add parse_androidmanifests_ignore test
2019-07-23 22:44:45 +02:00
Michael Pöhn
2c87b5e6f9
deploy build logs: no timestamps
2019-07-06 16:48:56 +02:00
Michael Pöhn
f30983368c
build: rsync buildlogs to <webroot>/repo
2019-07-06 16:48:56 +02:00
Hans-Christoph Steiner
a0f5ee661e
tests: common.test_sign_apk requires aapt to run
2019-07-03 09:07:36 +02:00
Hans-Christoph Steiner
57b9d1e316
tests: handle when apksigner considers MD5 signatures valid
2019-07-02 22:17:06 +02:00
Taco
457cf22361
Added newer ndks, gradles, latest sdk-license, and update java 1.8 version
2019-03-30 17:10:21 -04:00
Hans-Christoph Steiner
d96f5ff660
support APK Signature V2 when apksigner is installed
...
This was done with much help from @uniqx. This is the first level of
supporting APK Signatures v1, v2, and v3. This is enough to include
APKs with any combo of v1/v2/v3 signatures. For this to work at all,
apksigner and androguard 3.3.3+ must be installed.
closes #399
2019-02-01 09:17:56 +01:00
Hans-Christoph Steiner
57556aceee
remove redundant open() arg: encoding='utf8'
...
By default, open() returns a str:
https://docs.python.org/3/library/functions.html#open
By default, str is UTF-8:
https://docs.python.org/3/library/stdtypes.html#str
This used to matter on Python 2.x, but this code is 3.x only now.
2018-10-19 15:01:34 +02:00
Hans-Christoph Steiner
6b57cb6b7c
fix strict Application ID checks
...
* upper case letters are allowed at all positions
* there must be a "." separator
2018-09-24 17:07:27 +02:00
Hans-Christoph Steiner
11d46072ab
use androguard primitives to speed up finding debuggable flag
...
androguard parses the whole APK before handing the instance back, this uses
the primitives to just find the <application android:debuggable=""> value,
then stop parsing.
#557
2018-09-21 14:56:46 +02:00
Hans-Christoph Steiner
a3cecc16a3
use partial androguard binary XML parsing to speed up APK ID lookup
...
Normally, androguard parses the entire APK before it is possible to get any
values from it. This uses androguard primitives to only attempt to parse
the AndroidManifest.xml, then to quit as soon as it gets what it needs.
This greatly speeds up the parsing (1 minute vs 60 minutes).
fdroid/fdroidserver#557
2018-09-21 14:56:46 +02:00
Hans-Christoph Steiner
807bf3d26b
build: reuse common methods for getting metadata from APKs
...
This splits out the code that gets the list of native ABIs supported, then
uses the standard methods for the rest.
2018-09-18 10:55:51 +02:00
Hans-Christoph Steiner
487c4d02f3
handle package: line output from aapt v28
...
fdroid/fdroiddata!3484
fdroid/fdroiddata!3562
fdroid/fdroidserver!548
2018-09-18 10:55:51 +02:00
Hans-Christoph Steiner
9d12b1dc61
add strict, tested validation of Android/F-Droid package names
...
Android has stricter rules than Java for Package Names, but anything the
Python regex thinks is valid must be valid according to Java's rules too.
https://developer.android.com/studio/build/application-id
2018-09-07 14:17:39 +02:00
Hans-Christoph Steiner
5d161cc9fd
validate appid when reading metadata files
...
The metadata file must be named after the Application ID of the app it is
describing, and Android Application IDs must be valid Java Package Names.
2018-09-03 22:56:08 +02:00
Hans-Christoph Steiner
4d13a904f3
use defusedxml to avoid DoS attacks while loading XML
2018-08-29 17:44:54 +02:00
Hans-Christoph Steiner
4503e7a92a
replace unneeded eval() call and support negative versionCodes
2018-08-29 17:24:04 +02:00
Hans-Christoph Steiner
1b37b521c8
common: fix tests when running without any Android SDK installed
...
fdroid/fdroidserver!552
fdroid/fdroidserver#541
2018-08-07 14:51:42 +02:00
Michael Pöhn
5d5617bf40
fix: minor bugs in testcases for: common, metadata, update
2018-08-06 23:53:49 +02:00
Michael Pöhn
752f6a4ba2
applied review suggestions for deploying (build) logs
2018-06-19 15:18:13 +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
Michael Pöhn
429bc21da7
make common.TestCase run independant of cwd
2018-06-19 12:24:52 +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
91068d8e00
tests: rename unicode test file to fix "file name too long" errors
...
pristine-tar and mkdir barf on this file.
2018-05-25 17:27:58 +02:00
Michael Pöhn
6b1f242d25
added tests for common.calculate_math_string
2018-05-22 13:24:37 +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
e75bf70be6
signatures: future-proof fetching app ID info from APK
...
We're not using platformBuildVersionName and it might go away just like it
appeared: with no good reason or announcement.
2018-02-22 15:08:55 +01:00
Hans-Christoph Steiner
52b3436ff6
make is_apk_and_debuggable() default to using androguard before aapt
2018-02-22 15:08:53 +01:00