mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Merge branch 'bug-fixes' into 'master'
status JSON and --scan-binary should not exit with error when apkanalyzer fails Closes #825 See merge request fdroid/fdroidserver!886
This commit is contained in:
commit
d5a3182ce9
3 changed files with 17 additions and 4 deletions
|
|
@ -1052,8 +1052,10 @@ def main():
|
|||
# Build applications...
|
||||
failed_builds = []
|
||||
build_succeeded = []
|
||||
build_succeeded_ids = []
|
||||
status_output['failedBuilds'] = failed_builds
|
||||
status_output['successfulBuilds'] = build_succeeded
|
||||
status_output['successfulBuildIds'] = build_succeeded_ids
|
||||
# Only build for 72 hours, then stop gracefully.
|
||||
endtime = time.time() + 72 * 60 * 60
|
||||
max_build_time_reached = False
|
||||
|
|
@ -1167,6 +1169,7 @@ def main():
|
|||
'successfully')
|
||||
|
||||
build_succeeded.append(app)
|
||||
build_succeeded_ids.append([app['id'], build.versionCode])
|
||||
wikilog = "Build succeeded"
|
||||
|
||||
except VCSException as vcse:
|
||||
|
|
|
|||
|
|
@ -103,12 +103,20 @@ def get_gradle_compile_commands(build):
|
|||
|
||||
|
||||
def scan_binary(apkfile):
|
||||
logging.info("Scanning APK for known non-free classes.")
|
||||
"""Scan output of apkanalyzer for known non-free classes
|
||||
|
||||
apkanalyzer produces useful output when it can run, but it does
|
||||
not support all recent JDK versions, and also some DEX versions,
|
||||
so this cannot count on it to always produce useful output or even
|
||||
to run without exiting with an error.
|
||||
|
||||
"""
|
||||
|
||||
logging.info(_('Scanning APK with apkanalyzer for known non-free classes.'))
|
||||
result = common.SdkToolsPopen(["apkanalyzer", "dex", "packages", "--defined-only", apkfile], output=False)
|
||||
problems = 0
|
||||
if result.returncode != 0:
|
||||
problems += 1
|
||||
logging.error(result.output)
|
||||
logging.warning(_('scanner not cleanly run apkanalyzer: %s') % result.output)
|
||||
problems = 0
|
||||
for suspect, regexp in CODE_SIGNATURES.items():
|
||||
matches = regexp.findall(result.output)
|
||||
if matches:
|
||||
|
|
|
|||
|
|
@ -569,6 +569,8 @@ def main():
|
|||
|
||||
for d in ('.m2', '.gradle/caches', '.gradle/wrapper', '.pip_download_cache'):
|
||||
fullpath = os.path.join(os.getenv('HOME'), d)
|
||||
os.system('date')
|
||||
print('rsyncing', fullpath, 'into VM')
|
||||
if os.path.isdir(fullpath):
|
||||
ssh_command = ' '.join(('ssh -i {0} -p {1}'.format(key, port),
|
||||
'-o StrictHostKeyChecking=no',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue