James Dowdall

13 papers A 1B 4C 1Journal 2Unranked 5
YearRankTypeTitle / Venue / Authors
2005 J jnl
Comput. Speech Lang.
Eric SanJuan, James Dowdall, Fidelia Ibekwe-Sanjuan, Fabio Rinaldi
2004 conf
RIAO
Myra Spiliopoulou, Roland M. Müller, Marko Brunzel, Fabio Rinaldi, Michael Hess, James Dowdall, William J. Black, Babis Theodoulidis, John McNaught, Luc Bernard, Gian Piero Zarri, Giorgos Orphanos, Maghi King, Andreas Persidis
2004 B conf
LREC
Kaarel Kaljurand, Fabio Rinaldi, James Dowdall, Michael Hess
2004 conf
New Directions in Question Answering
Fabio Rinaldi, Michael Hess, James Dowdall, Diego Mollá Aliod, Rolf Schwitter
2004 B conf
LREC
James Dowdall, Will Lowe, Jeremy Ellman, Fabio Rinaldi, Michael Hess
2003 conf
OTM
Fabio Rinaldi, Kaarel Kaljurand, James Dowdall, Michael Hess
2003 conf
IWP@ACL
Fabio Rinaldi, James Dowdall, Kaarel Kaljurand, Michael Hess, Diego Mollá Aliod
2003 J jnl
IEEE Intell. Syst.
Diego Mollá Aliod, Rolf Schwitter, Fabio Rinaldi, James Dowdall, Michael Hess
2003 B conf
KES
Fabio Rinaldi, James Dowdall, Michael Hess, Diego Mollá Aliod, Rolf Schwitter, Kaarel Kaljurand
2003 conf
ACL (Linguistic Annotation)
Fabio Rinaldi, James Dowdall, Michael Hess, Kaarel Kaljurand, Andreas Persidis
2002 C conf
CICLing
Fabio Rinaldi, Michael Hess, Diego Mollá Aliod, Rolf Schwitter, James Dowdall, Gerold Schneider, Rachel Fournier
2002 B conf
LREC
James Dowdall, Michael Hess, Neeme Kahusk, Kaarel Kaljurand, Mare Koit, Fabio Rinaldi, Kadri Vider
2002 A conf
ECAI
Fabio Rinaldi, James Dowdall, Michael Hess, Diego Mollá Aliod, Rolf Schwitter
redb/extractors/apk_extractor.py
← Index redb/extractors/apk_extractor.py python
import logging
import zipfile
from abc import ABCMeta, abstractmethod

from redb.extractors.extractor import Extractor

logger = logging.getLogger(__name__)


@abstractmethod
class APKExtractor(Extractor, metaclass=ABCMeta):

    def __init__(
        self,
        filepath,
        log,
        exporters=None,
        index_prefix=None,
        known_benign=False,
        known_malicious=False,
        apk=None,
    ):
        # Read binary data before calling super().__init__ so that the
        # binary property override is available during hash computation.
        with open(filepath, "rb") as f:
            self._binary_data = f.read()

        self.apk = apk if apk else self._generate_apk_object(filepath)

        super().__init__(
            filepath,
            log,
            exporters,
            index_prefix,
            known_benign=known_benign,
            known_malicious=known_malicious,
        )

    @property
    def binary(self):
        """Override to use already-read binary data."""
        return self._binary_data

    def _generate_apk_object(self, filepath):
        """Parse APK using androguard."""
        apk = None
        try:
            # Suppress verbose androguard loguru DEBUG/INFO output
            from loguru import logger as loguru_logger
            loguru_logger.disable("androguard")
            from androguard.core.apk import APK
            apk = APK(filepath)
            if not apk.is_valid_APK():
                logger.warning(
                    f"APK validation warning for {filepath}"
                )
                # Still return the object — partial parsing may still work
        except Exception as e:
            logger.error(
                f"Format error parsing APK {filepath}: {e}"
            )
        return apk

    def _is_valid_apk(self):
        """Check if the APK object was parsed successfully."""
        return self.apk is not None

    def _get_zip_file(self):
        """Get a zipfile.ZipFile handle for direct archive inspection."""
        try:
            return zipfile.ZipFile(self.filepath, 'r')
        except (zipfile.BadZipFile, Exception) as e:
            self.log.error(f"Failed to open APK as ZIP: {e}")
            return None

    def _list_files(self):
        """List all files in the APK archive."""
        if not self._is_valid_apk():
            return []
        try:
            return self.apk.get_files()
        except Exception as e:
            self.log.error(f"Error listing APK files: {e}")
            return []