fdroidserver.scanner module¶
- class fdroidserver.scanner.EtipSignatureDataController¶
Bases:
ExodusSignatureDataController
Methods
check_last_updated
()Check if the last_updated value is ok and raise an exception if expired or inaccessible.
verify_data
()Clean and validate self.data.
check_data_version
fetch
fetch_signatures_from_web
load
load_from_cache
load_from_defaults
set_data
write_to_cache
- class fdroidserver.scanner.ExitCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
IntEnum
- Attributes:
denominator
the denominator of a rational number in lowest terms
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
real
the real part of a complex number
Methods
as_integer_ratio
(/)Return integer ratio.
bit_count
(/)Number of ones in the binary representation of the absolute value of self.
bit_length
(/)Number of bits necessary to represent self in binary.
conjugate
Returns self, the complex conjugate of any int.
from_bytes
(/, bytes[, byteorder, signed])Return the integer represented by the given array of bytes.
to_bytes
(/[, length, byteorder, signed])Return an array of bytes representing an integer.
- NONFREE_CODE = 1¶
- class fdroidserver.scanner.ExodusSignatureDataController¶
Bases:
SignatureDataController
Methods
check_last_updated
()Check if the last_updated value is ok and raise an exception if expired or inaccessible.
verify_data
()Clean and validate self.data.
check_data_version
fetch
fetch_signatures_from_web
load
load_from_cache
load_from_defaults
set_data
write_to_cache
- fetch_signatures_from_web()¶
- class fdroidserver.scanner.MessageStore(infos: list = <factory>, warnings: list = <factory>, errors: list = <factory>)¶
Bases:
object
- class fdroidserver.scanner.SUSSDataController¶
Bases:
SignatureDataController
Methods
check_last_updated
()Check if the last_updated value is ok and raise an exception if expired or inaccessible.
verify_data
()Clean and validate self.data.
check_data_version
fetch
fetch_signatures_from_web
load
load_from_cache
load_from_defaults
set_data
write_to_cache
- load_from_defaults()¶
- class fdroidserver.scanner.ScannerTool¶
Bases:
object
Methods
add
compile_regexes
load
refresh
scanner_data_lookup
- add(new_controller: SignatureDataController)¶
- compile_regexes()¶
- load()¶
- refresh()¶
- scanner_data_lookup()¶
- class fdroidserver.scanner.SignatureDataController(name, filename, url)¶
Bases:
object
Methods
Check if the last_updated value is ok and raise an exception if expired or inaccessible.
Clean and validate self.data.
check_data_version
fetch
fetch_signatures_from_web
load
load_from_cache
load_from_defaults
set_data
write_to_cache
- check_data_version()¶
- check_last_updated()¶
Check if the last_updated value is ok and raise an exception if expired or inaccessible.
- Raises:
SignatureDataMalformedException – when timestamp value is inaccessible or not parse-able
SignatureDataOutdatedException – when timestamp is older then self.cache_duration
- fetch()¶
- fetch_signatures_from_web()¶
- load()¶
- load_from_cache()¶
- load_from_defaults()¶
- set_data(new_data)¶
- verify_data()¶
Clean and validate self.data.
Right now this function does just a basic key sanitation.
- write_to_cache()¶
- fdroidserver.scanner.get_embedded_classes(apkfile, depth=0)¶
Get the list of Java classes embedded into all DEX files.
- Returns:
set of Java classes names as string
- fdroidserver.scanner.get_gradle_compile_commands(build)¶
- fdroidserver.scanner.main()¶
- fdroidserver.scanner.scan_binary(apkfile)¶
Scan output of dexdump for known non-free classes.
- fdroidserver.scanner.scan_source(build_dir, build={'androidupdate': [], 'antcommands': [], 'antifeatures': {}, 'binary': None, 'build': '', 'buildjni': [], 'commit': None, 'disable': '', 'encoding': None, 'extlibs': [], 'forcevercode': False, 'forceversion': False, 'gradle': [], 'gradleprops': [], 'init': '', 'maven': None, 'ndk': None, 'novcheck': False, 'oldsdkloc': False, 'output': None, 'patch': [], 'postbuild': '', 'preassemble': [], 'prebuild': '', 'rm': [], 'scandelete': [], 'scanignore': [], 'srclibs': [], 'subdir': None, 'submodules': False, 'sudo': '', 'target': None, 'timeout': None}, json_per_build=None)¶
Scan the source code in the given directory (and all subdirectories).
- Returns:
- the number of fatal problems encountered.