Hannes Gamper

84 papers A* 2A 7B 1C 5Misc 23Journal 29Unranked 17
YearRankTypeTitle / Venue / Authors
2025 A conf
ICME
Yuanchao Li, Azalea Gui, Dimitra Emmanouilidou, Hannes Gamper
2025 A* conf
AAAI
Soham Deshmukh, Shuo Han, Hazim T. Bukhari, Benjamin Elizalde, Hannes Gamper, Rita Singh, Bhiksha Raj
2025 Misc conf
ICASSP
Benjamin Stahl, Hannes Gamper
2025 J jnl
CoRR
Benjamin Stahl, Hannes Gamper
2025 J jnl
CoRR
Parthasaarathy Sudarsanam, Sebastian Braun, Hannes Gamper
2025 Misc conf
ICASSP
Shivam Mehta, Nebojsa Jojic, Hannes Gamper
2025 J jnl
CoRR
Shivam Mehta, Nebojsa Jojic, Hannes Gamper
2025 conf
EUSIPCO
Ali Vosoughi, Dimitra Emmanouilidou, Hannes Gamper
2025 J jnl
CoRR
Xilin Jiang, Hannes Gamper, Sebastian Braun
2025 J jnl
CoRR
Margarita Geleta, Hong Sodoma, Hannes Gamper
2024 Misc conf
ICASSP
Azalea Gui, Hannes Gamper, Sebastian Braun, Dimitra Emmanouilidou
2024 J jnl
IEEE Robotics Autom. Lett.
Hannes Gamper, Laura Rodrigo Pérez, Andreas Müller, Alejandro Díaz Rosales, Mario Di Castro
2024 J jnl
CoRR
Soham Deshmukh, Shuo Han, Hazim T. Bukhari, Benjamin Elizalde, Hannes Gamper, Rita Singh, Bhiksha Raj
2024 conf
ECCV Workshops (19)
Ruihan Yang, Hannes Gamper, Sebastian Braun
2024 conf
IWAENC
Eloi Moliner, Sebastian Braun, Hannes Gamper
2024 J jnl
CoRR
Eloi Moliner, Sebastian Braun, Hannes Gamper
2024 J jnl
Sci. Robotics
Hannes Gamper, Andreas Müller, Mario Di Castro
2024 conf
IWAENC
Sebastian Braun, Hannes Gamper
2024 A conf
INTERSPEECH
Soham Deshmukh, Dareen Alharthi, Benjamin Elizalde, Hannes Gamper, Mahmoud Al Ismail, Rita Singh, Bhiksha Raj, Huaming Wang
2024 J jnl
CoRR
Soham Deshmukh, Dareen Alharthi, Benjamin Elizalde, Hannes Gamper, Mahmoud Al Ismail, Rita Singh, Bhiksha Raj, Huaming Wang
2024 J jnl
CoRR
Yuanchao Li, Azalea Gui, Dimitra Emmanouilidou, Hannes Gamper
2023 J jnl
CoRR
Ruihan Yang, Hannes Gamper, Sebastian Braun
2023 J jnl
CoRR
Ross Cutler, Ando Saabas, Tanel Pärnamaa, Marju Purin, Evgenii Indenbom, Nicolae-Catalin Ristea, Jegor Guzvin, Hannes Gamper, Sebastian Braun, Robert Aichner
2023 J jnl
CoRR
Harishchandra Dubey, Ashkan Aazami, Vishak Gopal, Babak Naderi, Sebastian Braun, Ross Cutler, Alex Ju, Mehdi Zohourian, Min Tang, Hannes Gamper, Mehrsa Golestaneh, Robert Aichner
2023 conf
BCI
Hakim Si-Mohammed, Christian Holz, Andrew D. Wilson, Hannes Gamper, Adrian K. C. Lee, Dimitra Emmanouilidou, Edward Cutrell, Ivan Tashev
2023 A* conf
CHI
Jeremy Hyrkas, Andrew D. Wilson, John C. Tang, Hannes Gamper, Hong Sodoma, Lev Tankelevitch, Kori Inkpen, Shreya Chappidi, Brennan Jones
2023 Misc conf
ICASSP
Haleh Akrami, Hannes Gamper
2022 C conf
ISRR
Hannes Gamper, David Forkel, Alejandro Díaz Rosales, Jorge Playán Garai, Carlos Veiga Almagro, Luca Rosario Buonocore, Eloise Matheson, Mario Di Castro
2022 Misc conf
ICASSP
Sebastian Braun, Hannes Gamper
2022 Misc conf
ICASSP
Ross Cutler, Ando Saabas, Tanel Pärnamaa, Marju Purin, Hannes Gamper, Sebastian Braun, Karsten Sørensen, Robert Aichner
2022 J jnl
CoRR
Ross Cutler, Ando Saabas, Tanel Pärnamaa, Marju Purin, Hannes Gamper, Sebastian Braun, Karsten Sørensen, Robert Aichner
2022 J jnl
CoRR
Harishchandra Dubey, Vishak Gopal, Ross Cutler, Ashkan Aazami, Sergiy Matusevych, Sebastian Braun, Sefik Emre Eskimez, Manthan Thakker, Takuya Yoshioka, Hannes Gamper, Robert Aichner
2022 Misc conf
ICASSP
Harishchandra Dubey, Vishak Gopal, Ross Cutler, Ashkan Aazami, Sergiy Matusevych, Sebastian Braun, Sefik Emre Eskimez, Manthan Thakker, Takuya Yoshioka, Hannes Gamper, Robert Aichner
2022 conf
BCI
Justin Kilmarx, Hannes Gamper, Dimitra Emmanouilidou, David Johnston, Ed Cutrell, Andrew D. Wilson, Ivan Tashev
2022 J jnl
Robotics
Hannes Gamper, Adrien Luthi, Hubert Gattringer, Andreas Mueller, Mario Di Castro
2022 A conf
INTERSPEECH
Abu Zaher Md Faridee, Hannes Gamper
2022 J jnl
CoRR
Abu Zaher Md Faridee, Hannes Gamper
2022 J jnl
CoRR
Haleh Akrami, Hannes Gamper
2022 conf
EUSIPCO
Shoken Kaneko, Hannes Gamper
2021 conf
NER
Kuan-Jung Chiang, Dimitra Emmanouilidou, Hannes Gamper, David Johnston, Mihai Jalobeanu, Edward Cutrell, Andrew D. Wilson, Winko W. An, Ivan Tashev
2021 C conf
MMSP
Shoken Kaneko, Hannes Gamper
2021 Misc conf
ICASSP
Winko W. An, Barbara G. Shinn-Cunningham, Hannes Gamper, Dimitra Emmanouilidou, David Johnston, Mihai Jalobeanu, Edward Cutrell, Andrew D. Wilson, Kuan-Jung Chiang, Ivan Tashev
2021 C conf
ICINCO
Hannes Gamper, Hubert Gattringer, Andreas Müller, Mario Di Castro
2021 J jnl
CoRR
Sebastian Braun, Hannes Gamper
2021 Misc conf
ICASSP
Kusha Sridhar, Ross Cutler, Ando Saabas, Tanel Pärnamaa, Markus Loide, Hannes Gamper, Sebastian Braun, Robert Aichner, Sriram Srinivasan
2021 Misc conf
ICASSP
Chandan K. A. Reddy, Harishchandra Dubey, Vishak Gopal, Ross Cutler, Sebastian Braun, Hannes Gamper, Robert Aichner, Sriram Srinivasan
2021 A conf
Interspeech
Ross Cutler, Ando Saabas, Tanel Pärnamaa, Markus Loide, Sten Sootla, Marju Purin, Hannes Gamper, Sebastian Braun, Karsten Sørensen, Robert Aichner, Sriram Srinivasan
2021 A conf
Interspeech
Chandan K. A. Reddy, Harishchandra Dubey, Kazuhito Koishida, Arun Asokan Nair, Vishak Gopal, Ross Cutler, Sebastian Braun, Hannes Gamper, Robert Aichner, Sriram Srinivasan
2021 J jnl
CoRR
Chandan K. A. Reddy, Harishchandra Dubey, Kazuhito Koishida, Arun Asokan Nair, Vishak Gopal, Ross Cutler, Sebastian Braun, Hannes Gamper, Robert Aichner, Sriram Srinivasan
2021 Misc conf
ICASSP
Sebastian Braun, Hannes Gamper, Chandan K. A. Reddy, Ivan Tashev
2021 J jnl
CoRR
Sebastian Braun, Hannes Gamper, Chandan K. A. Reddy, Ivan Tashev
2020 C conf
MMSP
Hannes Gamper
2020 conf
BCI
Winko W. An, Hakim Si-Mohammed, Nicholas Huang, Hannes Gamper, Adrian K. C. Lee, Christian Holz, David Johnston, Mihai Jalobeanu, Dimitra Emmanouilidou, Edward Cutrell, Andrew D. Wilson, Ivan Tashev
2020 Misc conf
ICASSP
Ziqi Fan, Vibhav Vineet, Hannes Gamper, Nikunj Raghuvanshi
2020 J jnl
CoRR
Kusha Sridhar, Ross Cutler, Ando Saabas, Tanel Pärnamaa, Hannes Gamper, Sebastian Braun, Robert Aichner, Sriram Srinivasan
2020 Misc conf
ICASSP
Hannes Gamper, Dimitra Emmanouilidou, Sebastian Braun, Ivan J. Tashev
2020 conf
CHI Extended Abstracts
Joong Hoon Lee, Hannes Gamper, Ivan Tashev, Steven Dong, Siyuan Ma, Jacquelin Remaley, James D. Holbery, Sang Ho Yoon
2019 Misc conf
ICASSP
Helena Peic Tukuljac, Ville Pulkki, Hannes Gamper, Keith W. Godin, Ivan J. Tashev, Nikunj Raghuvanshi
2019 Misc conf
ICASSP
Andrea F. Genovese, Hannes Gamper, Ville Pulkki, Nikunj Raghuvanshi, Ivan J. Tashev
2019 J jnl
CoRR
Ziqi Fan, Vibhav Vineet, Hannes Gamper, Nikunj Raghuvanshi
2019 Misc conf
ICASSP
Christoph Hold, Hannes Gamper, Ville Pulkki, Nikunj Raghuvanshi, Ivan J. Tashev
2019 conf
WASPAA
Hannes Gamper, Chandan K. A. Reddy, Ross Cutler, Ivan J. Tashev, Johannes Gehrke
2019 Misc conf
ICASSP
Anderson R. Avila, Hannes Gamper, Chandan K. A. Reddy, Ross Cutler, Ivan Tashev, Johannes Gehrke
2019 J jnl
CoRR
Anderson R. Avila, Hannes Gamper, Chandan K. A. Reddy, Ross Cutler, Ivan Tashev, Johannes Gehrke
2019 J jnl
CoRR
Hannes Gamper, Dimitra Emmanouilidou, Sebastian Braun, Ivan J. Tashev
2018 conf
IWAENC
Hannes Gamper, Ivan J. Tashev
2018 C conf
ACC
Florian Reiterer, Hannes Gamper, Sandra Thaller, Patrick Schrangl, Helmut Kokal, Luigi del Re
2018 Misc conf
ICASSP
Etienne Thuillier, Hannes Gamper, Ivan J. Tashev
2017 conf
HSCMA
Hannes Gamper
2017 conf
WASPAA
Archontis Politis, Hannes Gamper
2017 Misc conf
ICASSP
Hannes Gamper, David Johnston, Ivan J. Tashev
2016 Misc conf
ICASSP
Archontis Politis, Mark R. P. Thomas, Hannes Gamper, Ivan J. Tashev
2016 Misc conf
ICASSP
Mark R. P. Thomas, Hannes Gamper, Ivan J. Tashev
2016 A conf
INTERSPEECH
Dayana Ribas, Emmanuel Vincent, John H. L. Hansen, Emma Jokinen, Mirco Ravanelli, Hannes Gamper, Fred Richardson
2016 A conf
INTERSPEECH
Hannes Gamper, Mark R. P. Thomas, Lyle Corbin, Ivan Tashev
2016 conf
IWAENC
Hannes Gamper, Lyle Corbin, David Johnston, Ivan J. Tashev
2015 conf
WASPAA
Hannes Gamper, Mark R. P. Thomas, Ivan J. Tashev
2015 J jnl
IEEE Signal Process. Mag.
Vesa Välimäki, Andreas Franck, Jussi Rämö, Hannes Gamper, Lauri Savioja
2015 Misc conf
ICASSP
Mark R. P. Thomas, Hannes Gamper, Ivan J. Tashev
2015 Misc conf
ICASSP
Hannes Gamper, Mark R. P. Thomas, Ivan J. Tashev
2013 J jnl
ACM Trans. Appl. Percept.
Hannes Gamper, Christina Dicke, Mark Billinghurst, Kai Puolamäki
2012 conf
IWAENC
Hannes Gamper, Sakari Tervo, Tapio Lokki
2011 J jnl
Virtual Real.
Antti Ajanki, Mark Billinghurst, Hannes Gamper, Toni Järvenpää, Melih Kandemir, Samuel Kaski, Markus Koskela, Mikko Kurimo, Jorma Laaksonen, Kai Puolamäki, Teemu Ruokolainen, Timo Tossavainen
2011 B conf
IDA
He Zhang, Eimontas Augilius, Timo Honkela, Jorma Laaksonen, Hannes Gamper, Henok Alene
redb/extractors/apk_extractors/apk_manifest.py
← Index redb/extractors/apk_extractors/apk_manifest.py python
import inspect
import json
from datetime import datetime, timezone
from typing import Any

from redb.extractors.enum import Tag
from redb.extractors.apk_extractor import APKExtractor
from redb.models.dataclasses import APKManifest, APKManifestComponent


class APKManifestExtractor(APKExtractor):

    def __init__(
        self, filepath, log, exporters=None, index_prefix=None,
        known_benign=False, known_malicious=False,
        apk=None,
    ):
        super().__init__(
            filepath, log, exporters, index_prefix,
            known_benign, known_malicious, apk,
        )
        self.manifest = None
        self.components = []
        self.log.debug(inspect.currentframe().f_code.co_name)

    def tag(self):
        return Tag.APK_MANIFEST.value

    def _is_component_exported(self, component_type, component_name):
        """Determine if a component is exported.

        Pre-API 31: exported is implicitly True if intent filters exist.
        API 31+: android:exported must be explicit; default is False.
        """
        try:
            exported_attr = None
            # Try to get the exported attribute directly from the XML
            axml = self.apk.get_android_manifest_xml()
            if axml is not None:
                for node in axml.getElementsByTagName(component_type):
                    name = node.getAttributeNS(
                        "http://schemas.android.com/apk/res/android", "name"
                    )
                    if name == component_name:
                        exported_attr = node.getAttributeNS(
                            "http://schemas.android.com/apk/res/android", "exported"
                        )
                        break
        except Exception:
            exported_attr = None

        if exported_attr == "true":
            return True
        if exported_attr == "false":
            return False

        # If not explicitly set, check for intent filters (pre-API 31 behavior)
        try:
            intent_filters = self.apk.get_intent_filters(component_type, component_name)
            if intent_filters:
                actions = intent_filters.get("action", [])
                if actions:
                    return True
        except Exception:
            pass

        return False

    def _get_intent_filters_for_component(self, component_type, component_name):
        """Get intent filters for a specific component."""
        actions = []
        categories = []
        try:
            intent_filters = self.apk.get_intent_filters(component_type, component_name)
            if intent_filters:
                actions = intent_filters.get("action", [])
                categories = intent_filters.get("category", [])
        except Exception:
            pass
        return actions, categories

    def _safe_extract(self, field_name, func, default=None):
        """Extract a single field, logging and returning default on failure."""
        try:
            return func()
        except Exception as e:
            self.log.warning(
                f"Error extracting APK manifest field '{field_name}' for "
                f"{self.hash.sha256}: {e}"
            )
            return default

    def extract(self):
        if not self._is_valid_apk():
            self.log.error(f"Invalid APK for {self.hash.sha256}")
            return None

        activities = self._safe_extract(
            "activities", lambda: list(self.apk.get_activities() or []), []
        )
        services = self._safe_extract(
            "services", lambda: list(self.apk.get_services() or []), []
        )
        receivers = self._safe_extract(
            "receivers", lambda: list(self.apk.get_receivers() or []), []
        )
        providers = self._safe_extract(
            "providers", lambda: list(self.apk.get_providers() or []), []
        )

        # Build component list with intent filter info
        self.components = []
        all_actions = set()
        all_categories = set()
        exported_components = []

        component_map = [
            ("activity", activities),
            ("service", services),
            ("receiver", receivers),
            ("provider", providers),
        ]

        for comp_type, comp_list in component_map:
            for comp_name in comp_list:
                try:
                    is_exported = self._is_component_exported(comp_type, comp_name)
                    actions, categories = self._get_intent_filters_for_component(
                        comp_type, comp_name
                    )
                    all_actions.update(actions)
                    all_categories.update(categories)
                    if is_exported:
                        exported_components.append(comp_name)

                    self.components.append(APKManifestComponent(
                        component_type=comp_type,
                        class_name=comp_name,
                        is_exported=is_exported,
                        intent_actions=list(actions),
                        intent_categories=list(categories),
                    ))
                except Exception as e:
                    self.log.warning(
                        f"Error processing component '{comp_name}' for "
                        f"{self.hash.sha256}: {e}"
                    )
                    # Still add the component with minimal info
                    self.components.append(APKManifestComponent(
                        component_type=comp_type,
                        class_name=comp_name,
                        is_exported=False,
                        intent_actions=[],
                        intent_categories=[],
                    ))

        # Uses-feature
        uses_features = []
        try:
            uses_features = list(self.apk.get_features() or [])
        except Exception:
            pass

        # Meta-data
        meta_data = None
        try:
            axml = self.apk.get_android_manifest_xml()
            if axml is not None:
                md = {}
                for node in axml.getElementsByTagName("meta-data"):
                    name = node.getAttributeNS(
                        "http://schemas.android.com/apk/res/android", "name"
                    )
                    value = node.getAttributeNS(
                        "http://schemas.android.com/apk/res/android", "value"
                    )
                    resource = node.getAttributeNS(
                        "http://schemas.android.com/apk/res/android", "resource"
                    )
                    if name:
                        md[name] = value or resource or ""
                if md:
                    meta_data = md
        except Exception:
            pass

        # Full manifest XML
        manifest_xml = None
        try:
            axml = self.apk.get_android_manifest_xml()
            if axml is not None:
                manifest_xml = axml.toxml()
        except Exception:
            try:
                manifest_xml = self.apk.get_android_manifest_axml().get_xml()
                if isinstance(manifest_xml, bytes):
                    manifest_xml = manifest_xml.decode("utf-8", errors="replace")
            except Exception:
                pass

        self.manifest = APKManifest(
            activity_count=len(activities),
            service_count=len(services),
            receiver_count=len(receivers),
            provider_count=len(providers),
            activities=activities,
            services=services,
            receivers=receivers,
            providers=providers,
            exported_components=exported_components,
            intent_filters_by_action=sorted(all_actions),
            intent_filters_by_category=sorted(all_categories),
            uses_features=uses_features,
            meta_data=meta_data,
            manifest_xml=manifest_xml,
        )
        return self.manifest

    def prepare_export_data(self, exporter_type: str) -> Any:
        if exporter_type == "ClickHouseExporter":
            if not self.manifest:
                return None

            current_time = datetime.now(timezone.utc)
            m = self.manifest

            # Components table (one row per component)
            components_data = []
            for comp in self.components:
                components_data.append([
                    self.sha256,
                    comp.component_type,
                    comp.class_name,
                    int(comp.is_exported),
                    comp.intent_actions,
                    comp.intent_categories,
                    current_time,
                ])

            # Manifest summary table (one row per APK)
            manifest_data = [[
                self.sha256,
                m.activity_count,
                m.service_count,
                m.receiver_count,
                m.provider_count,
                m.intent_filters_by_action,
                m.intent_filters_by_category,
                m.uses_features,
                m.manifest_xml,
                current_time,
            ]]

            return {
                'multi_table': True,
                'manifest': {
                    'table': 'redb_apk_manifest',
                    'data': manifest_data,
                    'column_names': [
                        'sha256',
                        'activity_count', 'service_count', 'receiver_count', 'provider_count',
                        'intent_filters_by_action', 'intent_filters_by_category',
                        'uses_features', 'manifest_xml', 'analysis_date',
                    ],
                    'column_type_names': [
                        'FixedString(64)',
                        'UInt16', 'UInt16', 'UInt16', 'UInt16',
                        'Array(String)', 'Array(String)',
                        'Array(String)', 'Nullable(String)',
                        "DateTime64(3, 'UTC')",
                    ],
                },
                'components': {
                    'table': 'redb_apk_components',
                    'data': components_data,
                    'column_names': [
                        'sha256', 'component_type', 'class_name', 'is_exported',
                        'intent_actions', 'intent_categories', 'analysis_date',
                    ],
                    'column_type_names': [
                        'FixedString(64)', 'LowCardinality(String)', 'String', 'UInt8',
                        'Array(String)', 'Array(String)',
                        "DateTime64(3, 'UTC')",
                    ],
                },
            }

    def get_clickhouse_table(self) -> str:
        return "redb_apk_manifest"