mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
fix timestamp check; remove dead code
This commit is contained in:
parent
c10633eac5
commit
c9b59b525d
2 changed files with 2 additions and 169 deletions
|
|
@ -24,12 +24,10 @@ import imghdr
|
|||
import shutil
|
||||
import logging
|
||||
import zipfile
|
||||
import requests
|
||||
import itertools
|
||||
import traceback
|
||||
import urllib.request
|
||||
from argparse import ArgumentParser
|
||||
from collections import namedtuple
|
||||
from copy import deepcopy
|
||||
from tempfile import TemporaryDirectory
|
||||
from pathlib import Path
|
||||
|
|
@ -115,23 +113,6 @@ def get_embedded_classes(apkfile, depth=0):
|
|||
return classes
|
||||
|
||||
|
||||
# taken from exodus_core
|
||||
def _exodus_compile_signatures(signatures):
|
||||
"""
|
||||
Compiles the regex associated to each signature, in order to speed up the trackers detection.
|
||||
|
||||
:return: A compiled list of signatures.
|
||||
"""
|
||||
compiled_tracker_signature = []
|
||||
try:
|
||||
compiled_tracker_signature = [
|
||||
re.compile(track.code_signature) for track in signatures
|
||||
]
|
||||
except TypeError:
|
||||
print("signatures is not iterable")
|
||||
return compiled_tracker_signature
|
||||
|
||||
|
||||
def _datetime_now():
|
||||
"""
|
||||
simple wrapper for datetime.now to allow mocking it for testing
|
||||
|
|
@ -347,27 +328,6 @@ def _get_tool():
|
|||
return scanner._SCANNER_TOOL
|
||||
|
||||
|
||||
# taken from exodus_core
|
||||
def load_exodus_trackers_signatures():
|
||||
"""
|
||||
Load trackers signatures from the official Exodus database.
|
||||
|
||||
:return: a dictionary containing signatures.
|
||||
"""
|
||||
signatures = []
|
||||
exodus_url = "https://reports.exodus-privacy.eu.org/api/trackers"
|
||||
r = requests.get(exodus_url, timeout=300)
|
||||
data = r.json()
|
||||
for e in data['trackers']:
|
||||
signatures.append(
|
||||
namedtuple('tracker', data['trackers'][e].keys())(
|
||||
*data['trackers'][e].values()
|
||||
)
|
||||
)
|
||||
logging.debug('{} trackers signatures loaded'.format(len(signatures)))
|
||||
return signatures, scanner._exodus_compile_signatures(signatures)
|
||||
|
||||
|
||||
def scan_binary(apkfile, extract_signatures=None):
|
||||
"""Scan output of dexdump for known non-free classes."""
|
||||
logging.info(_('Scanning APK with dexdump for known non-free classes.'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue