James Hays

159 papers A* 33A 10B 3Misc 2Journal 76Unranked 33
YearRankTypeTitle / Venue / Authors
2026 J jnl
CoRR
Ruixin Yang, Ethan Mendes, Arthur Wang, James Hays, Sauvik Das, Wei Xu, Alan Ritter
2026 J jnl
CoRR
Mohit Talreja, Joshua Diao, Jim Thannikary James, Radu Casapu, Tejas Santanam, Ethan Mendes, Alan Ritter, Wei Xu, James Hays
2025 J jnl
CoRR
Jim James, Ben Wilson, Simon Lucey, James Hays
2025 J jnl
CoRR
Shivam Singh, Yiming Chen, Agneet Chatterjee, Amit Raj, James Hays, Yezhou Yang, Chitta Baral
2025 J jnl
CoRR
Mengyu Yang, Yiming Chen, Haozheng Pei, Siddhant Agarwal, Arun Balajee Vasudevan, James Hays
2025 J jnl
CoRR
Lingjun Zhao, Sizhe Wei, James Hays, Lu Gan
2025 J jnl
CoRR
Sanghun Jung, Daehoon Gwak, Byron Boots, James Hays
2024 J jnl
CoRR
Sohan Anisetty, James Hays
2024 A* conf
EMNLP
Ethan Mendes, Yang Chen, James Hays, Sauvik Das, Wei Xu, Alan Ritter
2024 J jnl
CoRR
Ethan Mendes, Yang Chen, James Hays, Sauvik Das, Wei Xu, Alan Ritter
2024 conf
ECCV (18)
Ishan Khatri, Kyle Vedder, Neehar Peri, Deva Ramanan, James Hays
2024 J jnl
CoRR
Ishan Khatri, Kyle Vedder, Neehar Peri, Deva Ramanan, James Hays
2024 conf
ECCV (75)
Akshay Krishnan, Abhijit Kundu, Kevis-Kokitsi Maninis, James Hays, Matthew Brown
2024 J jnl
CoRR
Akshay Krishnan, Abhijit Kundu, Kevis-Kokitsi Maninis, James Hays, Matthew Brown
2024 A* conf
CVPR
Cusuh Ham, Matthew Fisher, James Hays, Nicholas I. Kolkin, Yuchen Liu, Richard Zhang, Tobias Hinz
2024 J jnl
CoRR
Cusuh Ham, Matthew Fisher, James Hays, Nicholas I. Kolkin, Yuchen Liu, Richard Zhang, Tobias Hinz
2024 A conf
WACV
Patrick Grady, Jeremy A. Collins, Chengcheng Tang, Christopher D. Twigg, Kunal Aneja, James Hays, Charles C. Kemp
2024 conf
WACV (Workshops)
Marissa Ramirez de Chanlatte, Phillip Colella, Trevor Darrell, Alexandra Carlson, Peter H. N. de With, Huayu Deng, Shanyan Guan, James Hays, Tim Houben, Thomas Huisman, Nikita Jaipuria, Hans Johansen, Shuja Khalid, Akshay Krishnan, Chuming Li, Maxim Pisarenco, Amit Raj, Frank Rudzicz, Tim J. Schoonbeek, Sandhya Sridhar, Nathan Tseng, Fons van der Sommen, Chen Wang, Yunbo Wang, Tong Wu, Xiaokang Yang, Jiawei Yao, Derek Young, Xianling Zhang
2024 J jnl
CoRR
John Lambert, Yuguang Li, Ivaylo Boyadzhiev, Lambert Wixson, Manjunath Narayana, Will Hutchcroft, James Hays, Frank Dellaert, Sing Bing Kang
2024 Misc conf
CoRL
Mehar Khurana, Neehar Peri, James Hays, Deva Ramanan
2024 J jnl
CoRR
Mehar Khurana, Neehar Peri, Deva Ramanan, James Hays
2024 A* conf
ICRA
Mengyu Yang, Patrick Grady, Samarth Brahmbhatt, Arun Balajee Vasudevan, Charles C. Kemp, James Hays
2024 Misc conf
CoRL
Benjamin Wilson, Nicholas Autio Mitchell, Jhony Kaesemodel Pontes, James Hays
2024 J jnl
CoRR
Benjamin Wilson, Nicholas Autio Mitchell, Jhony Kaesemodel Pontes, James Hays
2024 A* conf
ICLR
Kyle Vedder, Neehar Peri, Nathaniel Chodosh, Ishan Khatri, Eric Eaton, Dinesh Jayaraman, Yang Liu, Deva Ramanan, James Hays
2023 conf
ICCV (Workshops)
Neehar Peri, Mengtian Li, Benjamin Wilson, Yu-Xiong Wang, James Hays, Deva Ramanan
2023 J jnl
CoRR
Neehar Peri, Mengtian Li, Benjamin Wilson, Yu-Xiong Wang, James Hays, Deva Ramanan
2023 J jnl
CoRR
Benjamin Wilson, William Qi, Tanmay Agarwal, John Lambert, Jagjeet Singh, Siddhesh Khandelwal, Bowen Pan, Ratnesh Kumar, Andrew Hartnett, Jhony Kaesemodel Pontes, Deva Ramanan, Peter Carr, James Hays
2023 conf
CogMI
Feng Luo, Ling Liu, G. Geoff Wang, Vijay Kumar, Mark S. Ashton, Jacob D. Abernethy, Fatemeh Afghah, Matthew H. E. M. Browning, David Coyle, Philip M. Dames, Tom O'Halloran, James Hays, Patrick Hiesl, Chenfanfu Jiang, Puskar Khanal, Venkat Narayan Krovi, Sara Kuebbing, Nianyi Li, Jingjing Liang, Ninghao Liu, Steve McNulty, Christopher M. Oswalt, Neil Pederson, Demetri Terzopoulos, Christopher W. Woodall, Yongkai Wu, Jian Yang, Yin Yang, Liang Zhao
2023 A conf
WACV
Shubham Gupta, Jeet Kanjani, Mengtian Li, Francesco Ferroni, James Hays, Deva Ramanan, Shu Kong
2023 J jnl
CoRR
Akshay Krishnan, Amit Raj, Xianling Zhang, Alexandra Carlson, Nathan Tseng, Sandhya Sridhar, Nikita Jaipuria, James Hays
2023 A* conf
ICML
Shengcao Cao, Mengtian Li, James Hays, Deva Ramanan, Yu-Xiong Wang, Liangyan Gui
2023 J jnl
CoRR
Shengcao Cao, Mengtian Li, James Hays, Deva Ramanan, Yu-Xiong Wang, Liang-Yan Gui
2023 A conf
IROS
Abhinav Agarwalla, Xuhua Huang, Jason Ziglar, Francesco Ferroni, Laura Leal-Taixé, James Hays, Aljosa Osep, Deva Ramanan
2023 J jnl
CoRR
Abhinav Agarwalla, Xuhua Huang, Jason Ziglar, Francesco Ferroni, Laura Leal-Taixé, James Hays, Aljosa Osep, Deva Ramanan
2023 J jnl
CoRR
Sohan Anisetty, Amit Raj, James Hays
2023 J jnl
IEEE Trans. Pattern Anal. Mach. Intell.
John Lambert, Zhuang Liu, Ozan Sener, James Hays, Vladlen Koltun
2023 conf
SIGGRAPH (Conference Paper Track)
Cusuh Ham, James Hays, Jingwan Lu, Krishna Kumar Singh, Zhifei Zhang, Tobias Hinz
2023 J jnl
CoRR
Cusuh Ham, James Hays, Jingwan Lu, Krishna Kumar Singh, Zhifei Zhang, Tobias Hinz
2023 A* conf
CVPR
Yang Liu, Shen Yan, Laura Leal-Taixé, James Hays, Deva Ramanan
2023 J jnl
CoRR
Mengyu Yang, Patrick Grady, Samarth Brahmbhatt, Arun Balajee Vasudevan, Charles C. Kemp, James Hays
2023 J jnl
CoRR
Patrick Grady, Jeremy A. Collins, Chengcheng Tang, Christopher D. Twigg, James Hays, Charles C. Kemp
2023 J jnl
CoRR
Kyle Vedder, Neehar Peri, Nathaniel Chodosh, Ishan Khatri, Eric Eaton, Dinesh Jayaraman, Yang Liu, Deva Ramanan, James Hays
2022 J jnl
CoRR
Patsorn Sangkloy, Wittawat Jitkrittum, Diyi Yang, James Hays
2022 conf
ECCV (38)
Patsorn Sangkloy, Wittawat Jitkrittum, Diyi Yang, James Hays
2022 conf
ECCV (16)
Cusuh Ham, Gemma Canet Tarrés, Tu Bui, James Hays, Zhe Lin, John P. Collomosse
2022 J jnl
CoRR
Cusuh Ham, Gemma Canet Tarrés, Tu Bui, James Hays, Zhe Lin, John P. Collomosse
2022 J jnl
CoRR
Amit Raj, Umar Iqbal, Koki Nagano, Sameh Khamis, Pavlo Molchanov, James Hays, Jan Kautz
2022 J jnl
CoRR
Shubham Gupta, Jeet Kanjani, Mengtian Li, Francesco Ferroni, James Hays, Deva Ramanan, Shu Kong
2022 conf
ECCV (6)
Patrick Grady, Chengcheng Tang, Samarth Brahmbhatt, Christopher D. Twigg, Chengde Wan, James Hays, Charles C. Kemp
2022 J jnl
CoRR
Patrick Grady, Chengcheng Tang, Samarth Brahmbhatt, Christopher D. Twigg, Chengde Wan, James Hays, Charles C. Kemp
2022 conf
ECCV (31)
John Lambert, Yuguang Li, Ivaylo Boyadzhiev, Lambert Wixson, Manjunath Narayana, Will Hutchcroft, James Hays, Frank Dellaert, Sing Bing Kang
2022 J jnl
CoRR
Yang Liu, Shen Yan, Laura Leal-Taixé, James Hays, Deva Ramanan
2022 J jnl
CoRR
John Lambert, James Hays
2022 A conf
IROS
Patrick Grady, Jeremy A. Collins, Samarth Brahmbhatt, Christopher D. Twigg, Chengcheng Tang, James Hays, Charles C. Kemp
2022 J jnl
CoRR
Patrick Grady, Jeremy A. Collins, Samarth Brahmbhatt, Christopher D. Twigg, Chengcheng Tang, James Hays, Charles C. Kemp
2021 A* conf
CVPR
Amit Raj, Julian Tanke, James Hays, Minh Vo, Carsten Stoll, Christoph Lassner
2021 conf
NeurIPS Datasets and Benchmarks
Benjamin Wilson, William Qi, Tanmay Agarwal, John Lambert, Jagjeet Singh, Siddhesh Khandelwal, Bowen Pan, Ratnesh Kumar, Andrew Hartnett, Jhony Kaesemodel Pontes, Deva Ramanan, Peter Carr, James Hays
2021 J jnl
CoRR
John Lambert, Zhuang Liu, Ozan Sener, James Hays, Vladlen Koltun
2021 J jnl
CoRR
Amit Raj, Michael Zollhöfer, Tomas Simon, Jason M. Saragih, Shunsuke Saito, James Hays, Stephen Lombardi
2021 A* conf
CVPR
Amit Raj, Michael Zollhöfer, Tomas Simon, Jason M. Saragih, Shunsuke Saito, James Hays, Stephen Lombardi
2021 conf
NeurIPS Datasets and Benchmarks
John Lambert, James Hays
2020 J jnl
CoRR
Benjamin Wilson, Zsolt Kira, James Hays
2020 J jnl
CoRR
Amit Raj, Julian Tanke, James Hays, Minh Vo, Carsten Stoll, Christoph Lassner
2020 conf
ECCV (13)
Samarth Brahmbhatt, Chengcheng Tang, Christopher D. Twigg, Charles C. Kemp, James Hays
2020 J jnl
CoRR
Samarth Brahmbhatt, Chengcheng Tang, Christopher D. Twigg, Charles C. Kemp, James Hays
2020 A* conf
CVPR
John Lambert, Zhuang Liu, Ozan Sener, James Hays, Vladlen Koltun
2020 conf
3DV
Jhony Kaesemodel Pontes, James Hays, Simon Lucey
2020 J jnl
CoRR
Jhony Kaesemodel Pontes, James Hays, Simon Lucey
2020 conf
ECCV (3)
Daniel Bolya, Sean Foley, James Hays, Judy Hoffman
2020 J jnl
CoRR
Daniel Bolya, Sean Foley, James Hays, Judy Hoffman
2019 A* conf
CVPR
Ming-fang Chang, John Lambert, Patsorn Sangkloy, Jagjeet Singh, Slawomir Bak, Andrew Hartnett, De Wang, Peter Carr, Simon Lucey, Deva Ramanan, James Hays
2019 J jnl
CoRR
Ming-fang Chang, John Lambert, Patsorn Sangkloy, Jagjeet Singh, Slawomir Bak, Andrew Hartnett, De Wang, Peter Carr, Simon Lucey, Deva Ramanan, James Hays
2019 A* conf
CVPR
Nam Vo, Lu Jiang, Chen Sun, Kevin Murphy, Li-Jia Li, Li Fei-Fei, James Hays
2019 A* conf
CVPR
Samarth Brahmbhatt, Cusuh Ham, Charles C. Kemp, James Hays
2019 J jnl
CoRR
Samarth Brahmbhatt, Cusuh Ham, Charles C. Kemp, James Hays
2019 A conf
IROS
Samarth Brahmbhatt, Ankur Handa, James Hays, Dieter Fox
2019 J jnl
CoRR
Samarth Brahmbhatt, Ankur Handa, James Hays, Dieter Fox
2019 A conf
WACV
Nam Vo, James Hays
2019 A* conf
ICML
Wittawat Jitkrittum, Patsorn Sangkloy, Muhammad Waleed Gondal, Amit Raj, James Hays, Bernhard Schölkopf
2019 J jnl
CoRR
Wittawat Jitkrittum, Patsorn Sangkloy, Muhammad Waleed Gondal, Amit Raj, James Hays, Bernhard Schölkopf
2019 conf
CVPR Workshops
Amit Raj, Cusuh Ham, Connelly Barnes, Vladimir G. Kim, Jingwan Lu, James Hays
2019 J jnl
CoRR
Nam Vo, Lu Jiang, James Hays
2019 J jnl
IEEE Trans. Pattern Anal. Mach. Intell.
Kilho Son, James Hays, David B. Cooper
2019 A* conf
CHI
Xi Wang, Andreas Ley, Sebastian Koch, David Lindlbauer, James Hays, Kenneth Holmqvist, Marc Alexa
2019 J jnl
CoRR
Samarth Brahmbhatt, Charles C. Kemp, James Hays
2018 J jnl
CoRR
Nam Vo, Lu Jiang, Chen Sun, Kevin Murphy, Li-Jia Li, Li Fei-Fei, James Hays
2018 J jnl
CoRR
Nam N. Vo, James Hays
2018 A* conf
CVPR
Samarth Brahmbhatt, Jinwei Gu, Kihwan Kim, James Hays, Jan Kautz
2018 A* conf
NeurIPS
Wittawat Jitkrittum, Heishiro Kanagawa, Patsorn Sangkloy, James Hays, Bernhard Schölkopf, Arthur Gretton
2018 J jnl
CoRR
Wittawat Jitkrittum, Heishiro Kanagawa, Patsorn Sangkloy, James Hays, Bernhard Schölkopf, Arthur Gretton
2018 J jnl
CoRR
Daniel Castro, Steven Hickson, Patsorn Sangkloy, Bhavishya Mittal, Sean Dai, James Hays, Irfan A. Essa
2018 A* conf
CVPR
Wengling Chen, James Hays
2018 J jnl
CoRR
Wengling Chen, James Hays
2018 conf
ECCV (12)
Amit Raj, Patsorn Sangkloy, Huiwen Chang, James Hays, Duygu Ceylan, Jingwan Lu
2018 A* conf
CVPR
Wenqi Xian, Patsorn Sangkloy, Varun Agrawal, Amit Raj, Jingwan Lu, Chen Fang, Fisher Yu, James Hays
2017 A conf
WACV
Unaiza Ahsan, Chen Sun, James Hays, Irfan A. Essa
2017 J jnl
CoRR
Unaiza Ahsan, Chen Sun, James Hays, Irfan A. Essa
2017 A* conf
CVPR
Samarth Brahmbhatt, James Hays
2017 J jnl
CoRR
Samarth Brahmbhatt, James Hays
2017 J jnl
CoRR
Naveen Kodali, Jacob D. Abernethy, James Hays, Zsolt Kira
2017 J jnl
CoRR
Samarth Brahmbhatt, Jinwei Gu, Kihwan Kim, James Hays, Jan Kautz
2017 A* conf
ICCV
Nam N. Vo, Nathan Jacobs, James Hays
2017 J jnl
CoRR
Nam N. Vo, Nathan Jacobs, James Hays
2017 A* conf
CVPR
Patsorn Sangkloy, Jingwan Lu, Chen Fang, Fisher Yu, James Hays
2017 A conf
WACV
Samarth Brahmbhatt, Henrik I. Christensen, James Hays
2017 J jnl
CoRR
Libin Sun, James Hays
2017 J jnl
CoRR
Wenqi Xian, Patsorn Sangkloy, Jingwan Lu, Chen Fang, Fisher Yu, James Hays
2016 conf
ECCV (6)
Genevieve Patterson, James Hays
2016 ch.
Large-Scale Visual Geo-Localization
Tsung-Yi Lin, Serge J. Belongie, James Hays
2016 A* conf
CVPR
Hani Altwaijry, Eduard Trulls, James Hays, Pascal Fua, Serge J. Belongie
2016 conf
ECCV (1)
Nam N. Vo, James Hays
2016 J jnl
CoRR
Nam N. Vo, James Hays
2016 J jnl
Int. J. Comput. Vis.
Jianxiong Xiao, Krista A. Ehinger, James Hays, Antonio Torralba, Aude Oliva
2016 J jnl
CoRR
Patsorn Sangkloy, Jingwan Lu, Chen Fang, Fisher Yu, James Hays
2016 A* conf
CVPR
Kilho Son, Daniel Moreno, James Hays, David B. Cooper
2016 J jnl
CoRR
Samarth Brahmbhatt, Henrik I. Christensen, James Hays
2016 J jnl
ACM Trans. Graph.
Patsorn Sangkloy, Nathan Burnell, Cusuh Ham, James Hays
2016 A* conf
IJCAI
Alexandra Papoutsaki, Patsorn Sangkloy, James Laskey, Nediyana Daskalova, Jeff Huang, James Hays
2015 J jnl
Int. J. Comput. Vis.
Derek Hoiem, James Hays, Jianxiong Xiao, Aditya Khosla
2015 ch.
Multimodal Location Estimation of Videos and Images
James Hays, Alexei A. Efros
2015 A* conf
CVPR
Tsung-Yi Lin, Yin Cui, Serge J. Belongie, James Hays
2015 J jnl
CoRR
Libin Sun, Neel Joshi, Brian Guenter, James Hays
2015 B conf
HCOMP
Genevieve Patterson, Grant Van Horn, Serge J. Belongie, Pietro Perona, James Hays
2014 conf
ECCV (4)
Libin Sun, Sunghyun Cho, Jue Wang, James Hays
2014 conf
ECCV (5)
Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, C. Lawrence Zitnick
2014 J jnl
CoRR
Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, C. Lawrence Zitnick
2014 conf
ECCV (6)
Kilho Son, James Hays, David B. Cooper
2014 J jnl
Int. J. Comput. Vis.
Genevieve Patterson, Chen Xu, Hang Su, James Hays
2014 J jnl
ACM Trans. Graph.
Pierre-Yves Laffont, Zhile Ren, Xiaofeng Tao, Chao Qian, James Hays
2013 A* conf
CVPR
Tsung-Yi Lin, Serge J. Belongie, James Hays
2013 B conf
ICCP
Libin Sun, Sunghyun Cho, Jue Wang, James Hays
2013 conf
SIGGRAPH ASIA Posters
Pierre-Yves Laffont, James Hays
2013 A* conf
CVPR
Yinda Zhang, Jianxiong Xiao, James Hays, Ping Tan
2012 conf
SIGGRAPH Asia Technical Briefs
Jianxiong Xiao, Bryan C. Russell, James Hays, Krista A. Ehinger, Aude Oliva, Antonio Torralba
2012 conf
ECCV (6)
Frank Palermo, James Hays, Alexei A. Efros
2012 J jnl
ACM Trans. Graph.
Mathias Eitz, James Hays, Marc Alexa
2012 A* conf
CVPR
Genevieve Patterson, James Hays
2012 B conf
ICCP
Libin Sun, James Hays
2011 conf
SIGGRAPH Talks
Mathias Eitz, James Hays
2011 A conf
BMVC
Sirion Vittayakorn, James Hays
2010 A* conf
CVPR
Jianxiong Xiao, James Hays, Krista A. Ehinger, Aude Oliva, Antonio Torralba
2009 A* conf
CVPR
Santosh Kumar Divvala, Derek Hoiem, James Hays, Alexei A. Efros, Martial Hebert
2009 A* conf
ICCV
Evangelos Kalogerakis, Olga Vesselova, James Hays, Alexei A. Efros, Aaron Hertzmann
2008 A* conf
CVPR
James Hays, Alexei A. Efros
2008 A* conf
CVPR
Yanxi Liu, Tamara Belkina, James Hays, Roberto Lublinerman
2008 J jnl
Commun. ACM
James Hays, Alexei A. Efros
2007 J jnl
IEEE Trans. Vis. Comput. Graph.
Eugene Zhang, James Hays, Greg Turk
2007 J jnl
ACM Trans. Graph.
James Hays, Alexei A. Efros
2006 conf
ECCV (2)
James Hays, Marius Leordeanu, Alexei A. Efros, Yanxi Liu
2006 conf
CVPR (1)
Wen-Chieh Lin, James Hays, Chenyu Wu, Yanxi Liu, Vivek Kwatra
2005 conf
SIGGRAPH Sketches
Yanxi Liu, James Hays, Ying-Qing Xu, Heung-Yeung Shum
2005 conf
SIGGRAPH Sketches
Eugene Zhang, James Hays, Greg Turk
2004 conf
SIGGRAPH Posters
Wen-Chieh Lin, James Hays, Chenyu Wu, Vivek Kwatra, Yanxi Liu
2004 conf
NPAR
James Hays, Irfan A. Essa
2004 J jnl
ACM Trans. Graph.
Yanxi Liu, Wen-Chieh Lin, James Hays
2003 conf
Software Engineering Research and Practice
Christian Rayburn, James Hays, Bryan Phillips, Frederick C. Harris Jr.
1990 A conf
SIGCSE
James Hays, Leland R. Miller, Bobbie Othmer, Mohammad Saeed
1989 J jnl
ACM SIGCSE Bull.
James Hays
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"