mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-01 08:40:11 +02:00
deploy: upload to VirusTotal using index-v1.json or index-v1.jar
* A mirror of the repo will have only index-v1.jar. * A buildserver with separate signing might have only index-v1.json
This commit is contained in:
parent
869cc114a3
commit
33b097a3aa
@ -31,6 +31,7 @@ import shutil
|
|||||||
|
|
||||||
from . import _
|
from . import _
|
||||||
from . import common
|
from . import common
|
||||||
|
from . import index
|
||||||
from .exception import FDroidException
|
from .exception import FDroidException
|
||||||
|
|
||||||
config = None
|
config = None
|
||||||
@ -478,9 +479,14 @@ def upload_to_virustotal(repo_section, vt_apikey):
|
|||||||
if repo_section == 'repo':
|
if repo_section == 'repo':
|
||||||
if not os.path.exists('virustotal'):
|
if not os.path.exists('virustotal'):
|
||||||
os.mkdir('virustotal')
|
os.mkdir('virustotal')
|
||||||
|
|
||||||
|
if os.path.exists(os.path.join(repo_section, 'index-v1.json')):
|
||||||
with open(os.path.join(repo_section, 'index-v1.json')) as fp:
|
with open(os.path.join(repo_section, 'index-v1.json')) as fp:
|
||||||
index = json.load(fp)
|
data = json.load(fp)
|
||||||
for packageName, packages in index['packages'].items():
|
else:
|
||||||
|
data, _ignored, _ignored = index.get_index_from_jar(os.path.join(repo_section, 'index-v1.jar'))
|
||||||
|
|
||||||
|
for packageName, packages in data['packages'].items():
|
||||||
for package in packages:
|
for package in packages:
|
||||||
outputfilename = os.path.join('virustotal',
|
outputfilename = os.path.join('virustotal',
|
||||||
packageName + '_' + str(package.get('versionCode'))
|
packageName + '_' + str(package.get('versionCode'))
|
||||||
|
Loading…
Reference in New Issue
Block a user