Xiangling Ding

54 papers A 2B 2C 3Misc 1Journal 44Unranked 2
YearRankTypeTitle / Venue / Authors
2026 J jnl
ACM Trans. Multim. Comput. Commun. Appl.
Xiangling Ding, Jia Tang, Yunyi Li, Gaobo Yang, Yubo Lang
2026 J jnl
J. Inf. Secur. Appl.
Jizhou Yao, Xi Liu, Yulin Zhao, Yinqian Deng, Hong Guo, Xiangling Ding
2026 J jnl
IEEE Trans. Inf. Forensics Secur.
Dengyong Zhang, Miao Hu, Jiaxin Chen, Changsheng Chen, Jin Wang, Yun Song, Gaobo Yang, Xin Liao, Xiangling Ding
2026 J jnl
Multim. Tools Appl.
Ramadhani R. Iddy, Gaobo Yang, Dewang Wang, Xiangling Ding, Senzota K. Semakuwa
2025 J jnl
Multim. Syst.
Juan Cai, Min Long, Le-Bing Zhang, Quantao Yao, Xiangling Ding
2025 J jnl
Signal Process. Image Commun.
Jiale He, Qunbing Xia, Gaobo Yang, Xiangling Ding
2025 J jnl
Expert Syst. Appl.
Yunyi Li, Huijuan Wu, Xi Jiang, Xiangling Ding
2025 J jnl
Comput. Vis. Image Underst.
Shuai Liu, Jiyou Chen, Xiangling Ding, Gaobo Yang
2025 J jnl
ACM Trans. Multim. Comput. Commun. Appl.
Dengyong Zhang, Wenjie Zhu, Xin Liao, Feifan Qi, Gaobo Yang, Xiangling Ding
2025 J jnl
Expert Syst. Appl.
Xiangling Ding, Yuchen Nie
2025 J jnl
ACM Trans. Multim. Comput. Commun. Appl.
Dengyong Zhang, Runqi Lou, Jiaxin Chen, Xiangling Ding, Xin Liao, Gaobo Yang
2024 J jnl
J. Vis. Commun. Image Represent.
Dengyong Zhang, Zhenyu Lv, Feng Li, Xiangling Ding, Gaobo Yang
2024 J jnl
J. Inf. Secur. Appl.
Xiangling Ding, Yingqian Deng, Yulin Zhao, Wenyi Zhu
2024 J jnl
Multim. Syst.
Wenyi Zhu, Xiangling Ding, Zhang Chao, Yingqian Deng, Yulin Zhao
2024 conf
APSIPA
Dengyong Zhang, Runqi Lou, Jiaxin Chen, Xin Liao, Gaobo Yang, Xiangling Ding
2024 J jnl
IEEE Signal Process. Lett.
Xiangling Ding, Yulin Zhao, Qing Gu, Dengyong Zhang, Gaobo Yang
2024 J jnl
Sensors
Juan Cai, Qiangqiang Duan, Min Long, Le-Bing Zhang, Xiangling Ding
2024 J jnl
Artif. Intell. Rev.
Xiangling Ding, Yuchen Nie, Jizhou Yao, Jia Tang, Yubo Lang
2024 J jnl
Expert Syst. Appl.
Dewang Wang, Gaobo Yang, Jiyou Chen, Xiangling Ding
2024 J jnl
Expert Syst. Appl.
Dengyong Zhang, Ningjing Jiang, Feng Li, Jiaxin Chen, Xin Liao, Gaobo Yang, Xiangling Ding
2024 A conf
ICME
Yulin Zhao, Xiangling Ding
2024 J jnl
IEEE Internet Things J.
Xiangling Ding, Yulin Zhao, Le-Bing Zhang, Yunyi Li
2023 conf
CSCloud/EdgeCom
Yuchen Nie, Xiangling Ding, Wenyi Zhu, Yulin Zhao
2023 J jnl
J. Frankl. Inst.
Yunyi Li, Yiqiu Jiang, Hengmin Zhang, Jianxun Liu, Xiangling Ding, Guan Gui
2023 J jnl
Multim. Tools Appl.
Dengyong Zhang, Wenjie Zhu, Xiangling Ding, Gaobo Yang, Feng Li, Zelin Deng, Yun Song
2023 C conf
IH&MMSec
Dengyong Zhang, Pu Huang, Xiangling Ding, Feng Li, Gaobo Yang
2022 B conf
SECON
Xiangling Ding, Wenjie Zhu, Dengyong Zhang
2022 B conf
TrustCom
Qing Gu, Xiangling Ding, Dengyong Zhang, Ce Yang
2022 J jnl
Comput. Syst. Sci. Eng.
Can Xiao, Feng Li, Dengyong Zhang, Pu Huang, Xiangling Ding, Victor S. Sheng
2022 J jnl
CoRR
Yunyi Li, Yiqiu Jiang, Hengmin Zhang, Jianxun Liu, Xiangling Ding, Guan Gui
2022 J jnl
Comput. Vis. Image Underst.
Jiyou Chen, Gaobo Yang, Xiangling Ding, Zhiqing Guo, Shuai Wang
2022 Misc conf
ICASSP
Xiangling Ding, Pu Huang, Dengyong Zhang, Xianfeng Zhao
2021 A conf
ICME
Xiangling Ding, Yifeng Pan, Qing Gu, Jiyou Chen, Gaobo Yang, Yimao Xiong
2021 J jnl
IEEE Trans. Broadcast.
Yue Li, Gaobo Yang, Yun Song, Hanling Zhang, Xiangling Ding, Dengyong Zhang
2021 J jnl
Int. J. Digit. Crime Forensics
Xiangling Ding, Yanming Huang, Dengyong Zhang, Junlin Ouyang
2021 C conf
ISCAS
Xiangling Ding, Yifeng Pan, Kui Luo, Yanming Huang, Junlin Ouyang, Gaobo Yang
2020 J jnl
Wirel. Commun. Mob. Comput.
Dengyong Zhang, Shanshan Wang, Feng Li, Shang Tian, Jin Wang, Xiangling Ding, Rongrong Gong
2020 J jnl
Multim. Tools Appl.
Xiangling Ding, Yanming Huang, Yue Li, Jiale He
2020 J jnl
J. Real Time Image Process.
Jiale He, Gaobo Yang, Jingyu Song, Xiangling Ding, Ran Li
2020 J jnl
J. Real Time Image Process.
Yue Li, Gaobo Yang, Yapei Zhu, Xiangling Ding, Yun Song, Dengyong Zhang
2020 C conf
ISCAS
Xiangling Ding, Yanming Huang
2020 J jnl
IEEE Access
Xiangling Ding, Yanming Huang, Dengyong Zhang, Yun Song
2020 J jnl
Secur. Commun. Networks
Dengyong Zhang, Xiao Chen, Feng Li, Arun Kumar Sangaiah, Xiangling Ding
2020 J jnl
Signal Process. Image Commun.
Yue Li, Ningbo Zhu, Gaobo Yang, Yapei Zhu, Xiangling Ding
2020 J jnl
ACM Trans. Multim. Comput. Commun. Appl.
Jiale He, Gaobo Yang, Xin Liu, Xiangling Ding
2019 J jnl
Multim. Tools Appl.
Xiangling Ding, Yue Li, Ming Xia, Jiale He, Gaobo Yang
2019 J jnl
IEEE Trans. Circuits Syst. Video Technol.
Xiangling Ding, Ningbo Zhu, Leida Li, Yue Li, Gaobo Yang
2018 J jnl
IEEE Trans. Circuits Syst. Video Technol.
Xiangling Ding, Gaobo Yang, Ran Li, Lebing Zhang, Yue Li, Xingming Sun
2018 J jnl
ACM Trans. Multim. Comput. Commun. Appl.
Yue Li, Gaobo Yang, Yapei Zhu, Xiangling Ding, Rongrong Gong
2017 J jnl
IEEE Trans. Broadcast.
Yue Li, Gaobo Yang, Yapei Zhu, Xiangling Ding, Xingming Sun
2017 J jnl
IET Inf. Secur.
Xiangling Ding, Yingzhuo Deng, Gaobo Yang, Yun Song, Dajiang He, Xingming Sun
2017 J jnl
IEEE Trans. Multim.
Yue Li, Gaobo Yang, Yapei Zhu, Xiangling Ding, Xingming Sun
2016 J jnl
IEEE Trans. Broadcast.
Yue Li, Gaobo Yang, Ning Chen, Yapei Zhu, Xiangling Ding
2015 J jnl
J. Vis. Commun. Image Represent.
Zaoshan Liang, Gaobo Yang, Xiangling Ding, Leida Li
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"