How to use apkid - 5 common examples

To help you get started, we’ve selected a few apkid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MobSF / Mobile-Security-Framework-MobSF / MalwareAnalyzer / views / apkid.py View on Github external
def apkid_analysis(app_dir, apk_file, apk_name):
    """APKID Analysis of DEX files."""
    if not settings.APKID_ENABLED:
        return {}
    try:
        import apkid
    except ImportError:
        logger.error('APKiD - Could not import APKiD')
        return {}
    if not os.path.exists(apk_file):
        logger.error('APKiD - APK not found')
        return {}

    apkid_ver = apkid.__version__
    from apkid.apkid import Scanner, Options
    from apkid.output import OutputFormatter
    from apkid.rules import RulesManager

    logger.info('Running APKiD %s', apkid_ver)
    options = Options(
        timeout=45,
        verbose=False,
        entry_max_scan_size=100 * 1024 * 1024,
        recursive=True,
    )
    output = OutputFormatter(
        json_output=True,
        output_dir=None,
        rules_manager=RulesManager(),
    )
github MobSF / Mobile-Security-Framework-MobSF / MalwareAnalyzer / views / apkid.py View on Github external
try:
        import apkid
    except ImportError:
        logger.error('APKiD - Could not import APKiD')
        return {}
    if not os.path.exists(apk_file):
        logger.error('APKiD - APK not found')
        return {}

    apkid_ver = apkid.__version__
    from apkid.apkid import Scanner, Options
    from apkid.output import OutputFormatter
    from apkid.rules import RulesManager

    logger.info('Running APKiD %s', apkid_ver)
    options = Options(
        timeout=45,
        verbose=False,
        entry_max_scan_size=100 * 1024 * 1024,
        recursive=True,
    )
    output = OutputFormatter(
        json_output=True,
        output_dir=None,
        rules_manager=RulesManager(),
    )
    rules = options.rules_manager.load()
    scanner = Scanner(rules, options)
    res = scanner.scan_file(apk_file)
    try:
        findings = output._build_json_output(res)['files']
    except AttributeError:
github MobSF / Mobile-Security-Framework-MobSF / MalwareAnalyzer / views / apkid.py View on Github external
from apkid.rules import RulesManager

    logger.info('Running APKiD %s', apkid_ver)
    options = Options(
        timeout=45,
        verbose=False,
        entry_max_scan_size=100 * 1024 * 1024,
        recursive=True,
    )
    output = OutputFormatter(
        json_output=True,
        output_dir=None,
        rules_manager=RulesManager(),
    )
    rules = options.rules_manager.load()
    scanner = Scanner(rules, options)
    res = scanner.scan_file(apk_file)
    try:
        findings = output._build_json_output(res)['files']
    except AttributeError:
        # apkid >= 2.0.3
        findings = output.build_json_output(res)['files']
    sanitized = {}
    for item in findings:
        filename = item['filename']
        sanitized[filename] = item['matches']
    return sanitized
github MobSF / Mobile-Security-Framework-MobSF / MalwareAnalyzer / views / apkid.py View on Github external
logger.error('APKiD - APK not found')
        return {}

    apkid_ver = apkid.__version__
    from apkid.apkid import Scanner, Options
    from apkid.output import OutputFormatter
    from apkid.rules import RulesManager

    logger.info('Running APKiD %s', apkid_ver)
    options = Options(
        timeout=45,
        verbose=False,
        entry_max_scan_size=100 * 1024 * 1024,
        recursive=True,
    )
    output = OutputFormatter(
        json_output=True,
        output_dir=None,
        rules_manager=RulesManager(),
    )
    rules = options.rules_manager.load()
    scanner = Scanner(rules, options)
    res = scanner.scan_file(apk_file)
    try:
        findings = output._build_json_output(res)['files']
    except AttributeError:
        # apkid >= 2.0.3
        findings = output.build_json_output(res)['files']
    sanitized = {}
    for item in findings:
        filename = item['filename']
        sanitized[filename] = item['matches']
github MobSF / Mobile-Security-Framework-MobSF / MalwareAnalyzer / views / apkid.py View on Github external
apkid_ver = apkid.__version__
    from apkid.apkid import Scanner, Options
    from apkid.output import OutputFormatter
    from apkid.rules import RulesManager

    logger.info('Running APKiD %s', apkid_ver)
    options = Options(
        timeout=45,
        verbose=False,
        entry_max_scan_size=100 * 1024 * 1024,
        recursive=True,
    )
    output = OutputFormatter(
        json_output=True,
        output_dir=None,
        rules_manager=RulesManager(),
    )
    rules = options.rules_manager.load()
    scanner = Scanner(rules, options)
    res = scanner.scan_file(apk_file)
    try:
        findings = output._build_json_output(res)['files']
    except AttributeError:
        # apkid >= 2.0.3
        findings = output.build_json_output(res)['files']
    sanitized = {}
    for item in findings:
        filename = item['filename']
        sanitized[filename] = item['matches']
    return sanitized

apkid

Android Package Identifier

GPL-3.0
Latest version published 9 months ago

Package Health Score

74 / 100
Full package analysis