Rahul Santhanam

164 papers A* 22A 34B 4C 1Misc 1Journal 90Unranked 11
YearRankTypeTitle / Venue / Authors
2026 A conf
ITCS
Jiaqi Lu, Rahul Santhanam, Iddo Tzameret
2025 J jnl
CoRR
Jiaqi Lu, Rahul Santhanam, Iddo Tzameret
2025 J jnl
Electron. Colloquium Comput. Complex.
Jiaqi Lu, Rahul Santhanam, Iddo Tzameret
2025 J jnl
Dagstuhl Reports
Swastik Kopparty, Meena Mahajan, Rahul Santhanam, Till Tantau, Ian Mertz
2025 A conf
CCC
Oliver Korten, Rahul Santhanam
2025 J jnl
Electron. Colloquium Comput. Complex.
Oliver Korten, Rahul Santhanam
2025 J jnl
Comput. Complex.
Ninad Rajgopal, Rahul Santhanam
2024 A ed.
CCC
Rahul Santhanam
2024 J jnl
TheoretiCS
Lijie Chen, Ce Jin, Rahul Santhanam, Ryan Williams
2024 A* conf
ICALP
Noel Arteche, Erfan Khaniki, Ján Pich, Rahul Santhanam
2024 J jnl
CoRR
Noel Arteche, Erfan Khaniki, Ján Pich, Rahul Santhanam
2024 A* conf
ICALP
Zhenjian Lu, Rahul Santhanam
2024 J jnl
Electron. Colloquium Comput. Complex.
Zhenjian Lu, Rahul Santhanam
2024 A* conf
FOCS
Zhenjian Lu, Igor C. Oliveira, Hanlin Ren, Rahul Santhanam
2024 J jnl
Electron. Colloquium Comput. Complex.
Zhenjian Lu, Igor C. Oliveira, Hanlin Ren, Rahul Santhanam
2023 A conf
CCC
Rahul Santhanam
2023 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam
2023 J jnl
Dagstuhl Reports
Anna Gál, Meena Mahajan, Rahul Santhanam, Till Tantau, Manaswi Paraashar
2023 ch.
Logic, Automata, and Computational Complexity
Stephen A. Cook, Pierre McKenzie, Dustin Wehr, Mark Braverman, Rahul Santhanam
2023 A* conf
FOCS
Lijie Chen, Zhenjian Lu, Igor C. Oliveira, Hanlin Ren, Rahul Santhanam
2023 J jnl
CoRR
Lijie Chen, Zhenjian Lu, Igor C. Oliveira, Hanlin Ren, Rahul Santhanam
2023 J jnl
Electron. Colloquium Comput. Complex.
Lijie Chen, Zhenjian Lu, Igor Carboni Oliveira, Hanlin Ren, Rahul Santhanam
2023 J jnl
Electron. Colloquium Comput. Complex.
Ján Pich, Rahul Santhanam
2022 A conf
STACS
Hanlin Ren, Rahul Santhanam
2022 J jnl
J. ACM
Lijie Chen, Shuichi Hirahara, Igor Carboni Oliveira, Ján Pich, Ninad Rajgopal, Rahul Santhanam
2022 J jnl
CoRR
Lijie Chen, Ce Jin, Rahul Santhanam, R. Ryan Williams
2022 A conf
ITCS
Shuichi Hirahara, Rahul Santhanam
2022 A conf
ITCS
Shuichi Hirahara, Rahul Santhanam
2022 J jnl
Comput. Complex.
Igor C. Oliveira, Rahul Santhanam, Roei Tell
2022 A* conf
ICALP
Ján Pich, Rahul Santhanam
2022 A conf
CCC
Michael E. Saks, Rahul Santhanam
2022 J jnl
Electron. Colloquium Comput. Complex.
Michael E. Saks, Rahul Santhanam
2022 A* conf
FOCS
Hanlin Ren, Rahul Santhanam, Zhikun Wang
2022 J jnl
Electron. Colloquium Comput. Complex.
Hanlin Ren, Rahul Santhanam, Zhikun Wang
2022 A* conf
STOC
Rahul Ilango, Hanlin Ren, Rahul Santhanam
2022 conf
FSTTCS
Rahul Santhanam
2021 J jnl
Electron. Colloquium Comput. Complex.
Hanlin Ren, Rahul Santhanam
2021 J jnl
Dagstuhl Reports
Anna Gál, Meena Mahajan, Rahul Santhanam, Till Tantau
2021 Misc ed.
CSR
Rahul Santhanam, Daniil Musatov
2021 A* conf
FOCS
Lijie Chen, Ce Jin, Rahul Santhanam, R. Ryan Williams
2021 J jnl
Electron. Colloquium Comput. Complex.
Lijie Chen, Ce Jin, Rahul Santhanam, Ryan Williams
2021 J jnl
Theory Comput.
Igor C. Oliveira, Ján Pich, Rahul Santhanam
2021 A conf
CCC
Hanlin Ren, Rahul Santhanam
2021 J jnl
Electron. Colloquium Comput. Complex.
Hanlin Ren, Rahul Santhanam
2021 J jnl
IACR Cryptol. ePrint Arch.
Hanlin Ren, Rahul Santhanam
2021 J jnl
Electron. Colloquium Comput. Complex.
Rahul Ilango, Hanlin Ren, Rahul Santhanam
2021 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam, Iddo Tzameret
2021 A* conf
STOC
Rahul Santhanam, Iddo Tzameret
2021 J jnl
CoRR
Ján Pich, Rahul Santhanam
2021 A conf
CCC
Shafi Goldwasser, Russell Impagliazzo, Toniann Pitassi, Rahul Santhanam
2021 conf
APPROX-RANDOM
Ninad Rajgopal, Rahul Santhanam
2021 J jnl
Electron. Colloquium Comput. Complex.
Ninad Rajgopal, Rahul Santhanam
2021 J jnl
CoRR
Zhenjian Lu, Igor C. Oliveira, Rahul Santhanam
2021 J jnl
Electron. Colloquium Comput. Complex.
Zhenjian Lu, Igor Carboni Oliveira, Rahul Santhanam
2021 A* conf
STOC
Zhenjian Lu, Igor C. Oliveira, Rahul Santhanam
2021 A* conf
STOC
Ján Pich, Rahul Santhanam
2020 A conf
ITCS
Lijie Chen, Shuichi Hirahara, Igor C. Oliveira, Ján Pich, Ninad Rajgopal, Rahul Santhanam
2020 A conf
CCC
Michael E. Saks, Rahul Santhanam
2020 A conf
ITCS
Rahul Santhanam
2019 J jnl
CoRR
Lijie Chen, Shuichi Hirahara, Igor C. Oliveira, Ján Pich, Ninad Rajgopal, Rahul Santhanam
2019 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Lijie Chen, Shuichi Hirahara, Ján Pich, Ninad Rajgopal, Rahul Santhanam
2019 J jnl
Dagstuhl Reports
Anna Gál, Rahul Santhanam, Till Tantau
2019 A conf
ITCS
Igor Carboni Oliveira, Rahul Santhanam, Roei Tell
2019 A conf
CCC
Igor Carboni Oliveira, Ján Pich, Rahul Santhanam
2019 A conf
CCC
Igor Carboni Oliveira, Rahul Santhanam, Srikanth Srinivasan
2019 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Rahul Santhanam, Srikanth Srinivasan
2019 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam
2019 A* conf
FOCS
Ján Pich, Rahul Santhanam
2018 B conf
LATIN
Ruiwen Chen, Igor C. Oliveira, Rahul Santhanam
2018 J jnl
CoRR
Ruiwen Chen, Rahul Santhanam, Srikanth Srinivasan
2018 J jnl
Theory Comput.
Ruiwen Chen, Rahul Santhanam, Srikanth Srinivasan
2018 B conf
MFCS
Ninad Rajgopal, Rahul Santhanam, Srikanth Srinivasan
2018 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Rahul Santhanam, Roei Tell
2018 A* conf
FOCS
Igor Carboni Oliveira, Rahul Santhanam
2018 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Rahul Santhanam
2018 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Ján Pich, Rahul Santhanam
2018 A conf
CCC
Shuichi Hirahara, Igor C. Oliveira, Rahul Santhanam
2018 J jnl
Electron. Colloquium Comput. Complex.
Shuichi Hirahara, Igor Carboni Oliveira, Rahul Santhanam
2018 J jnl
Dagstuhl Reports
Albert Atserias, Jakob Nordström, Pavel Pudlák, Rahul Santhanam
2018 conf
APPROX-RANDOM
Igor Carboni Oliveira, Rahul Santhanam
2018 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Rahul Santhanam
2017 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Ruiwen Chen, Rahul Santhanam
2017 A conf
CCC
Igor C. Oliveira, Rahul Santhanam
2017 A conf
CCC
Shuichi Hirahara, Rahul Santhanam
2017 A* conf
STOC
Igor C. Oliveira, Rahul Santhanam
2017 J jnl
Inf. Comput.
Lance Fortnow, Rahul Santhanam
2016 A conf
CCC
Ruiwen Chen, Rahul Santhanam, Srikanth Srinivasan
2016 J jnl
CoRR
Igor C. Oliveira, Rahul Santhanam
2016 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Rahul Santhanam
2016 A conf
ESA
Andrew Drucker, Jesper Nederlof, Rahul Santhanam
2016 A conf
CCC
Lance Fortnow, Rahul Santhanam
2016 J jnl
CoRR
Igor C. Oliveira, Rahul Santhanam
2016 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Rahul Santhanam
2016 A conf
ITCS
Ruiwen Chen, Rahul Santhanam
2016 J jnl
SIAM J. Comput.
Andrew McGregor, Rahul Santhanam
2015 J jnl
Electron. Colloquium Comput. Complex.
Ruiwen Chen, Rahul Santhanam, Srikanth Srinivasan
2015 A* conf
SODA
Rahul Santhanam, Richard Ryan Williams
2015 J jnl
ACM Trans. Comput. Theory
Yuval Filmus, Toniann Pitassi, Rahul Santhanam
2015 A conf
SAT
Ruiwen Chen, Rahul Santhanam
2015 J jnl
Electron. Colloquium Comput. Complex.
Ruiwen Chen, Rahul Santhanam
2015 A conf
CCC
Igor Carboni Oliveira, Rahul Santhanam
2015 J jnl
Electron. Colloquium Comput. Complex.
Ruiwen Chen, Rahul Santhanam
2014 J jnl
Electron. Colloquium Comput. Complex.
Lance Fortnow, Rahul Santhanam
2014 J jnl
Electron. Colloquium Comput. Complex.
Igor Carboni Oliveira, Rahul Santhanam
2014 J jnl
Comput. Complex.
Rahul Santhanam, Ryan Williams
2014 J jnl
Dagstuhl Reports
Olaf Beyersdorff, Edward A. Hirsch, Jan Krajícek, Rahul Santhanam
2013 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam, Ryan Williams
2013 A conf
CCC
Rahul Santhanam, Ryan Williams
2013 J jnl
Inf. Comput.
Maurice J. Jansen, Rahul Santhanam
2012 J jnl
Electron. Colloquium Comput. Complex.
Chiranjit Chakraborty, Rahul Santhanam
2012 B conf
IPEC
Chiranjit Chakraborty, Rahul Santhanam
2012 J jnl
Bull. EATCS
Rahul Santhanam
2012 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam
2012 A* conf
FOCS
Arkadev Chattopadhyay, Rahul Santhanam
2012 J jnl
Electron. Colloquium Comput. Complex.
Arkadev Chattopadhyay, Rahul Santhanam
2012 J jnl
CoRR
Subramanian Ramamoorthy, András Z. Salamon, Rahul Santhanam
2012 A conf
ITCS
Maurice J. Jansen, Rahul Santhanam
2012 conf
ICALP (1)
Rahul Santhanam, Srikanth Srinivasan
2012 J jnl
ACM Trans. Comput. Theory
Stephen A. Cook, Pierre McKenzie, Dustin Wehr, Mark Braverman, Rahul Santhanam
2012 A conf
STACS
Maurice J. Jansen, Rahul Santhanam
2012 J jnl
Theory Comput. Syst.
Rahul Santhanam
2012 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam, Ryan Williams
2011 conf
ICALP (1)
Yuval Filmus, Toniann Pitassi, Rahul Santhanam
2011 J jnl
J. Comput. Syst. Sci.
Lance Fortnow, Rahul Santhanam
2011 J jnl
Electron. Colloquium Comput. Complex.
Maurice J. Jansen, Rahul Santhanam
2011 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam, Srikanth Srinivasan
2011 conf
ICALP (1)
Maurice J. Jansen, Rahul Santhanam
2011 conf
ICALP (1)
Lance Fortnow, Rahul Santhanam
2011 J jnl
Electron. Colloquium Comput. Complex.
Maurice J. Jansen, Rahul Santhanam
2010 A conf
ICS
Lance Fortnow, Rahul Santhanam
2010 A conf
ICS
Toniann Pitassi, Rahul Santhanam
2010 A* conf
FOCS
Rahul Santhanam
2010 J jnl
CoRR
Stephen A. Cook, Pierre McKenzie, Dustin Wehr, Mark Braverman, Rahul Santhanam
2010 J jnl
CoRR
Lance Fortnow, Rahul Santhanam
2010 C conf
CiE
Rahul Santhanam
2009 J jnl
CoRR
Lance Fortnow, Rahul Santhanam
2009 B conf
MFCS
Mark Braverman, Stephen A. Cook, Pierre McKenzie, Rahul Santhanam, Dustin Wehr
2009 J jnl
SIAM J. Comput.
Rahul Santhanam
2009 A conf
CCC
Lance Fortnow, Rahul Santhanam, Ryan Williams
2009 conf
FSTTCS
Mark Braverman, Stephen A. Cook, Pierre McKenzie, Rahul Santhanam, Dustin Wehr
2009 conf
Algebraic Methods in Computational Complexity
Harry Buhrman, Lance Fortnow, Rahul Santhanam
2009 conf
ICALP (1)
Harry Buhrman, Lance Fortnow, Rahul Santhanam
2009 J jnl
Electron. Colloquium Comput. Complex.
Harry Buhrman, Lance Fortnow, Rahul Santhanam
2008 A* conf
STOC
Lance Fortnow, Rahul Santhanam
2007 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam
2007 A* conf
STOC
Rahul Santhanam
2007 J jnl
Electron. Colloquium Comput. Complex.
Lance Fortnow, Rahul Santhanam
2007 J jnl
Electron. Colloquium Comput. Complex.
Lance Fortnow, Rahul Santhanam
2006 J jnl
Electron. Colloquium Comput. Complex.
Lance Fortnow, Rahul Santhanam
2006 A* conf
ICML
Ivona Bezáková, Adam Kalai, Rahul Santhanam
2006 J jnl
Discret. Appl. Math.
Rahul Santhanam, Kamala Krithivasan
2006 J jnl
Electron. Colloquium Comput. Complex.
Joshua Buresh-Oppenheim, Rahul Santhanam
2006 A conf
CCC
Joshua Buresh-Oppenheim, Rahul Santhanam
2006 conf
FSTTCS
Aduri Pavan, Rahul Santhanam, N. V. Vinodchandran
2006 J jnl
Electron. Colloquium Comput. Complex.
Joshua Buresh-Oppenheim, Valentine Kabanets, Rahul Santhanam
2005 A* conf
STOC
Lance Fortnow, Rahul Santhanam, Luca Trevisan
2005 J jnl
SIAM J. Comput.
Dieter van Melkebeek, Rahul Santhanam
2004 A* conf
FOCS
Lance Fortnow, Rahul Santhanam
2004 J jnl
Electron. Colloquium Comput. Complex.
Lance Fortnow, Rahul Santhanam, Luca Trevisan
2003 A conf
CCC
Rahul Santhanam, Dieter van Melkebeek
2002 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam
2001 J jnl
Inf. Process. Lett.
Rahul Santhanam
2001 A conf
CCC
Rahul Santhanam
2001 J jnl
Electron. Colloquium Comput. Complex.
Rahul Santhanam
redb/extractors/apk_extractors/apk_inconsistency_tests.py
← Index redb/extractors/apk_extractors/apk_inconsistency_tests.py python
import inspect
import re
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 APKInconsistencyTests

# Emulator detection indicator strings
EMULATOR_INDICATORS = {
    "generic", "sdk", "google_sdk", "Emulator",
    "goldfish", "ranchu", "Andy", "Genymotion",
    "BlueStacks", "nox", "ttVM_Hdragon",
}

# Root detection indicator strings
ROOT_INDICATORS = {
    "/system/app/Superuser.apk",
    "/system/xbin/su",
    "/system/bin/su",
    "com.noshufou.android.su",
    "com.thirdparty.superuser",
    "eu.chainfire.supersu",
    "com.koushikdutta.superuser",
    "com.topjohnwu.magisk",
}

# Standard DEX filename pattern
STANDARD_DEX_PATTERN = re.compile(r"^classes\d*\.dex$")


class APKInconsistencyTestsExtractor(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.test_results = None
        self.log.debug(inspect.currentframe().f_code.co_name)

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

    def _test_zip_bomb(self):
        """Check if any ZIP entry has compression ratio > 100:1."""
        try:
            zf = self._get_zip_file()
            if not zf:
                return None
            with zf:
                for info in zf.infolist():
                    if info.compress_size > 0:
                        ratio = info.file_size / info.compress_size
                        if ratio > 100:
                            return True
            return False
        except Exception as e:
            self.log.warning(f"Error in zip bomb test: {e}")
            return None

    def _test_zip_duplicate_entries(self):
        """Check for duplicate filenames in ZIP directory."""
        try:
            zf = self._get_zip_file()
            if not zf:
                return None
            with zf:
                names = [info.filename for info in zf.infolist()]
                return len(names) != len(set(names))
        except Exception as e:
            self.log.warning(f"Error in duplicate entries test: {e}")
            return None

    def _test_zip_path_traversal(self):
        """Check for path traversal (../) in ZIP entry names."""
        try:
            for f in self._list_files():
                if ".." in f or f.startswith("/"):
                    return True
            return False
        except Exception as e:
            self.log.warning(f"Error in path traversal test: {e}")
            return None

    def _test_zip_suspicious_timestamps(self):
        """Check for timestamps at epoch (1980) or in the future."""
        try:
            zf = self._get_zip_file()
            if not zf:
                return None
            now = datetime.now()
            with zf:
                for info in zf.infolist():
                    try:
                        dt = datetime(*info.date_time)
                        if dt.year <= 1980 or dt > now:
                            return True
                    except (ValueError, TypeError):
                        continue
            return False
        except Exception as e:
            self.log.warning(f"Error in suspicious timestamps test: {e}")
            return None

    def _test_hidden_dex_files(self):
        """Check for DEX files not matching classes*.dex pattern."""
        try:
            for f in self._list_files():
                if f.endswith(".dex"):
                    basename = f.split("/")[-1]
                    if not STANDARD_DEX_PATTERN.match(basename):
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in hidden DEX files test: {e}")
            return None

    def _test_manifest_component_mismatch(self):
        """Check for declared components that don't exist in DEX."""
        try:
            if not self._is_valid_apk():
                return None

            # Get all class names from DEX
            dex_classes = set()
            try:
                from androguard.core.dex import DEX
                for dex_data in (self.apk.get_all_dex() or []):
                    try:
                        d = DEX(dex_data)
                        for cls in d.get_classes():
                            name = cls.get_name()
                            if name:
                                # Convert "Lcom/example/Foo;" to "com.example.Foo"
                                dex_classes.add(
                                    name[1:-1].replace("/", ".") if name.startswith("L") else name
                                )
                    except Exception:
                        continue
            except Exception:
                return None

            if not dex_classes:
                return None

            # Check manifest components against DEX classes
            components = []
            try:
                components.extend(self.apk.get_activities() or [])
                components.extend(self.apk.get_services() or [])
                components.extend(self.apk.get_receivers() or [])
                components.extend(self.apk.get_providers() or [])
            except Exception:
                return None

            for comp in components:
                if comp and comp not in dex_classes:
                    # Component might use a shorthand; check with package prefix
                    package = self.apk.get_package() or ""
                    full_name = package + comp if comp.startswith(".") else comp
                    if full_name not in dex_classes:
                        return True

            return False
        except Exception as e:
            self.log.warning(f"Error in manifest component mismatch test: {e}")
            return None

    def _test_debuggable_release(self):
        """Check android:debuggable=true combined with a release signature."""
        try:
            if not self._is_valid_apk():
                return None

            is_debuggable = self.apk.get_attribute_value(
                "application", "debuggable"
            ) == "true"

            if not is_debuggable:
                return False

            # Check if it has a signing certificate (release builds have certs)
            try:
                certs = self.apk.get_certificates()
                if certs and len(certs) > 0:
                    return True
            except Exception:
                pass

            return False
        except Exception as e:
            self.log.warning(f"Error in debuggable release test: {e}")
            return None

    def _get_dex_strings(self):
        """Get all string constants from DEX files."""
        all_strings = set()
        try:
            from androguard.core.dex import DEX
            for dex_data in (self.apk.get_all_dex() or []):
                try:
                    d = DEX(dex_data)
                    for s in d.get_strings():
                        if s:
                            all_strings.add(s)
                except Exception:
                    continue
        except Exception:
            pass
        return all_strings

    def _test_emulator_detection_strings(self):
        """Check for emulator detection patterns in DEX strings."""
        try:
            if not self._is_valid_apk():
                return None

            dex_strings = self._get_dex_strings()
            for indicator in EMULATOR_INDICATORS:
                for s in dex_strings:
                    if indicator in s:
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in emulator detection test: {e}")
            return None

    def _test_debugger_detection(self):
        """Check for debugger detection API calls in DEX."""
        try:
            if not self._is_valid_apk():
                return None

            dex_strings = self._get_dex_strings()
            debugger_patterns = {
                "isDebuggerConnected",
                "waitingForDebugger",
                "Debug.isDebuggerConnected",
            }
            for pattern in debugger_patterns:
                for s in dex_strings:
                    if pattern in s:
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in debugger detection test: {e}")
            return None

    def _test_root_detection(self):
        """Check for root detection patterns in DEX."""
        try:
            if not self._is_valid_apk():
                return None

            dex_strings = self._get_dex_strings()
            for indicator in ROOT_INDICATORS:
                for s in dex_strings:
                    if indicator in s:
                        return True
            return False
        except Exception as e:
            self.log.warning(f"Error in root detection test: {e}")
            return None

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

        self.test_results = APKInconsistencyTests(
            test_zip_bomb=self._test_zip_bomb(),
            test_zip_duplicate_entries=self._test_zip_duplicate_entries(),
            test_zip_path_traversal=self._test_zip_path_traversal(),
            test_zip_suspicious_timestamps=self._test_zip_suspicious_timestamps(),
            test_hidden_dex_files=self._test_hidden_dex_files(),
            test_manifest_component_mismatch=self._test_manifest_component_mismatch(),
            test_debuggable_release=self._test_debuggable_release(),
            test_emulator_detection_strings=self._test_emulator_detection_strings(),
            test_debugger_detection=self._test_debugger_detection(),
            test_root_detection=self._test_root_detection(),
        )
        return self.test_results

    def _bool_to_nullable(self, val):
        """Convert bool/None to ClickHouse Nullable(UInt8)."""
        if val is None:
            return None
        return int(val)

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

            current_time = datetime.now(timezone.utc)
            t = self.test_results

            data = [[
                self.sha256,
                self._bool_to_nullable(t.test_zip_bomb),
                self._bool_to_nullable(t.test_zip_duplicate_entries),
                self._bool_to_nullable(t.test_zip_path_traversal),
                self._bool_to_nullable(t.test_zip_suspicious_timestamps),
                self._bool_to_nullable(t.test_hidden_dex_files),
                self._bool_to_nullable(t.test_manifest_component_mismatch),
                self._bool_to_nullable(t.test_debuggable_release),
                self._bool_to_nullable(t.test_emulator_detection_strings),
                self._bool_to_nullable(t.test_debugger_detection),
                self._bool_to_nullable(t.test_root_detection),
                current_time,
            ]]

            column_names = [
                'sha256',
                'test_zip_bomb', 'test_zip_duplicate_entries',
                'test_zip_path_traversal', 'test_zip_suspicious_timestamps',
                'test_hidden_dex_files', 'test_manifest_component_mismatch',
                'test_debuggable_release', 'test_emulator_detection_strings',
                'test_debugger_detection', 'test_root_detection',
                'analysis_date',
            ]

            column_type_names = [
                'FixedString(64)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                'Nullable(UInt8)', 'Nullable(UInt8)',
                "DateTime64(3, 'UTC')",
            ]

            return (data, column_names, column_type_names)

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