Il-Chul Moon

151 papers A* 32A 7B 9C 3Misc 7Journal 77Unranked 14
YearRankTypeTitle / Venue / Authors
2026 J jnl
CoRR
Yeongmin Kim, DongHyeok Shin, Byeonghu Na, Minsang Park, Richard Lee Kim, Il-Chul Moon
2026 J jnl
CoRR
Byeonghu Na, Hyungho Na, Yeongmin Kim, Suhyeon Jo, HeeSun Bae, Mina Kang, Il-Chul Moon
2025 J jnl
CoRR
DongHyeok Shin, Yeongmin Kim, Suhyeon Jo, Byeonghu Na, Il-Chul Moon
2025 J jnl
Syst.
Juho Choi, Il-Chul Moon, Jang Won Bae
2025 J jnl
CoRR
Byeonghu Na, Minsang Park, Gyuwon Sim, DongHyeok Shin, HeeSun Bae, Mina Kang, Se Jung Kwon, Wanmo Kang, Il-Chul Moon
2025 A* conf
ICLR
Yeongmin Kim, Kwanghyeon Lee, Minsang Park, Byeonghu Na, Il-Chul Moon
2025 J jnl
CoRR
Yeongmin Kim, DongHyeok Shin, Mina Kang, Byeonghu Na, Il-Chul Moon
2025 A* conf
ICLR
DongHyeok Shin, HeeSun Bae, Gyuwon Sim, Wanmo Kang, Il-Chul Moon
2025 J jnl
CoRR
DongHyeok Shin, HeeSun Bae, Gyuwon Sim, Wanmo Kang, Il-Chul Moon
2025 J jnl
J. Artif. Soc. Soc. Simul.
Yunkyeong Seo, Zeynep Altiner, Sumin Lee, Il-Chul Moon, Tae-Sub Yun
2025 J jnl
Pattern Recognit. Lett.
Weonyoung Joo, Dongjun Kim, Seungjae Shin, Il-Chul Moon
2025 J jnl
CoRR
Yeongmin Kim, HeeSun Bae, Byeonghu Na, Il-Chul Moon
2025 J jnl
CoRR
Jiwoo Shin, Byeonghu Na, Mina Kang, Wonhyeok Choi, Il-Chul Moon
2025 J jnl
CoRR
Byeonghu Na, Mina Kang, Jiseok Kwak, Minsang Park, Jiwoo Shin, SeJoon Jun, Gayoung Lee, Jin-Hwa Kim, Il-Chul Moon
2025 A* conf
ICLR
Hyungho Na, Kwanghyeon Lee, Sumin Lee, Il-Chul Moon
2025 J jnl
CoRR
Hyungho Na, Kwanghyeon Lee, Sumin Lee, Il-Chul Moon
2024 Misc conf
WSC
Juho Choi, Jang Won Bae, Il-Chul Moon
2024 J jnl
CoRR
Yeongmin Kim, Kwanghyeon Lee, Minsang Park, Byeonghu Na, Il-Chul Moon
2024 A* conf
ICML
Byeonghu Na, Yeongmin Kim, Minsang Park, DongHyeok Shin, Wanmo Kang, Il-Chul Moon
2024 J jnl
CoRR
Byeonghu Na, Yeongmin Kim, Minsang Park, DongHyeok Shin, Wanmo Kang, Il-Chul Moon
2024 A* conf
ICLR
HeeSun Bae, Seungjae Shin, Byeonghu Na, Il-Chul Moon
2024 J jnl
CoRR
HeeSun Bae, Seungjae Shin, Byeonghu Na, Il-Chul Moon
2024 A* conf
ICLR
Hyungho Na, Yunkyeong Seo, Il-Chul Moon
2024 J jnl
CoRR
Hyungho Na, Yunkyeong Seo, Il-Chul Moon
2024 A* conf
ICML
Hyungho Na, Il-Chul Moon
2024 J jnl
CoRR
Hyungho Na, Il-Chul Moon
2024 A* conf
ICLR
Byeonghu Na, Yeongmin Kim, HeeSun Bae, Jung Hyun Lee, Se Jung Kwon, Wanmo Kang, Il-Chul Moon
2024 J jnl
CoRR
Byeonghu Na, Yeongmin Kim, HeeSun Bae, Jung Hyun Lee, Se Jung Kwon, Wanmo Kang, Il-Chul Moon
2024 A* conf
AAAI
Youngjae Cho, HeeSun Bae, Seungjae Shin, Yeo Dong Youn, Weonyoung Joo, Il-Chul Moon
2024 J jnl
CoRR
Youngjae Cho, HeeSun Bae, Seungjae Shin, Yeo Dong Youn, Weonyoung Joo, Il-Chul Moon
2024 conf
ACL (1)
Byeonghu Na, Suhyeon Jo, Yeongmin Kim, Il-Chul Moon
2024 J jnl
CoRR
Byeonghu Na, Suhyeon Jo, Yeongmin Kim, Il-Chul Moon
2024 A* conf
ICLR
Yeongmin Kim, Byeonghu Na, Minsang Park, JoonHo Jang, Dongjun Kim, Wanmo Kang, Il-Chul Moon
2024 J jnl
CoRR
Yeongmin Kim, Byeonghu Na, Minsang Park, JoonHo Jang, Dongjun Kim, Wanmo Kang, Il-Chul Moon
2024 A* conf
ICLR
Seungjae Shin, HeeSun Bae, Byeonghu Na, Yoon-Yeong Kim, Il-Chul Moon
2024 J jnl
CoRR
Seungjae Shin, HeeSun Bae, Byeonghu Na, Yoon-Yeong Kim, Il-Chul Moon
2023 A* conf
NeurIPS
DongHyeok Shin, Seungjae Shin, Il-Chul Moon
2023 J jnl
CoRR
DongHyeok Shin, Seungjae Shin, Il-Chul Moon
2023 A conf
CIKM
Suhyeon Jo, DongHyeok Shin, Byeonghu Na, JoonHo Jang, Il-Chul Moon
2023 A conf
AISTATS
Seungjae Shin, HeeSun Bae, DongHyeok Shin, Weonyoung Joo, Il-Chul Moon
2023 J jnl
CoRR
Seungjae Shin, HeeSun Bae, DongHyeok Shin, Weonyoung Joo, Il-Chul Moon
2023 conf
ANNSIM
Tae-Sub Yun, Minsang Park, Il-Chul Moon
2023 A* conf
ICML
Dongjun Kim, Yeongmin Kim, Se Jung Kwon, Wanmo Kang, Il-Chul Moon
2023 A* conf
ICML
Yoon-Yeong Kim, Youngjae Cho, JoonHo Jang, Byeonghu Na, Yeongmin Kim, Kyungwoo Song, Wanmo Kang, Il-Chul Moon
2023 J jnl
Pattern Recognit. Lett.
Dongjun Kim, Kyungwoo Song, Yoon-Yeong Kim, Yongjin Shin, Wanmo Kang, Il-Chul Moon, Weonyoung Joo
2023 B conf
SMC
Muhyun Byun, Hyungho Na, Il-Chul Moon
2023 J jnl
J. Aerosp. Inf. Syst.
Hyungho Na, Jaemyung Ahn, Il-Chul Moon
2022 J jnl
J. Artif. Soc. Soc. Simul.
Tae-Sub Yun, Dongjun Kim, Il-Chul Moon, Jang Won Bae
2022 J jnl
CoRR
Dongjun Kim, Tae-Sub Yun, Il-Chul Moon, Jang Won Bae
2022 A conf
AAMAS
Dongjun Kim, Tae-Sub Yun, Il-Chul Moon, Jang Won Bae
2022 J jnl
Intell. Syst. Account. Finance Manag.
Hyeongwoo Kong, Wonje Yun, Weonyoung Joo, Ju-Hyun Kim, Kyoung-Kuk Kim, Il-Chul Moon, Woo Chang Kim
2022 A* conf
ICML
HeeSun Bae, Seungjae Shin, Byeonghu Na, JoonHo Jang, Kyungwoo Song, Il-Chul Moon
2022 J jnl
CoRR
HeeSun Bae, Seungjae Shin, Byeonghu Na, JoonHo Jang, Kyungwoo Song, Il-Chul Moon
2022 A* conf
NeurIPS
Dongjun Kim, Byeonghu Na, Se Jung Kwon, Dongsoo Lee, Wanmo Kang, Il-Chul Moon
2022 J jnl
CoRR
Dongjun Kim, Byeonghu Na, Se Jung Kwon, Dongsoo Lee, Wanmo Kang, Il-Chul Moon
2022 J jnl
Syst.
Jang Won Bae, Il-Chul Moon
2022 J jnl
CoRR
Dongjun Kim, Yeongmin Kim, Wanmo Kang, Il-Chul Moon
2022 A* conf
ICML
Dongjun Kim, Seungjae Shin, Kyungwoo Song, Wanmo Kang, Il-Chul Moon
2022 A* conf
NeurIPS
JoonHo Jang, Byeonghu Na, DongHyeok Shin, Mingi Ji, Kyungwoo Song, Il-Chul Moon
2022 J jnl
CoRR
JoonHo Jang, Byeonghu Na, DongHyeok Shin, Mingi Ji, Kyungwoo Song, Il-Chul Moon
2021 J jnl
Auton. Agents Multi Agent Syst.
Dongjun Kim, Tae-Sub Yun, Il-Chul Moon, Jang Won Bae
2021 J jnl
J. Aerosp. Inf. Syst.
Yoon-Yeong Kim, Hyemi Kim, Wonsung Lee, Han-Lim Choi, Il-Chul Moon
2021 A* conf
AAAI
Hyemi Kim, Seungjae Shin, JoonHo Jang, Kyungwoo Song, Weonyoung Joo, Wanmo Kang, Il-Chul Moon
2021 A* conf
AAAI
Kyungwoo Song, Yohan Jung, Dongjun Kim, Il-Chul Moon
2021 A* conf
NeurIPS
Yoon-Yeong Kim, Kyungwoo Song, JoonHo Jang, Il-Chul Moon
2021 J jnl
CoRR
Dongjun Kim, Kyungwoo Song, Seungjae Shin, Wanmo Kang, Il-Chul Moon
2021 B conf
SMC
Yeongmin Kim, Youngjae Cho, Hanbit Lee, Il-Chul Moon
2021 A* conf
CVPR
Mingi Ji, Seungjae Shin, Seunghyun Hwang, Gibeom Park, Il-Chul Moon
2021 J jnl
CoRR
Mingi Ji, Seungjae Shin, Seunghyun Hwang, Gibeom Park, Il-Chul Moon
2021 J jnl
CoRR
Dongjun Kim, Seungjae Shin, Kyungwoo Song, Wanmo Kang, Il-Chul Moon
2020 J jnl
CoRR
Dongjun Kim, Weonyoung Joo, Seungjae Shin, Il-Chul Moon
2020 Misc conf
WSC
Tae-Sub Yun, Il-Chul Moon, Young-Chul Kim, Ki-Sung Jin
2020 A* conf
AAAI
Kyungwoo Song, JoonHo Jang, Seungjae Shin, Il-Chul Moon
2020 J jnl
CoRR
Hyemi Kim, Seungjae Shin, JoonHo Jang, Kyungwoo Song, Weonyoung Joo, Wanmo Kang, Il-Chul Moon
2020 A conf
CIKM
Byeonghu Na, Hyemi Kim, Kyungwoo Song, Weonyoung Joo, Yoon-Yeong Kim, Il-Chul Moon
2020 J jnl
Pattern Recognit.
Weonyoung Joo, Wonsung Lee, Sungrae Park, Il-Chul Moon
2020 conf
DistributedML@CoNEXT
Yongjin Shin, Gihun Lee, Seungjae Shin, Seyoung Yun, Il-Chul Moon
2020 J jnl
Sensors
JoonHo Jang, Seungjae Shin, Hyunjin Lee, Il-Chul Moon
2020 J jnl
CoRR
Weonyoung Joo, Dongjun Kim, Seungjae Shin, Il-Chul Moon
2020 A* conf
AAAI
Su-Jin Shin, Kyungwoo Song, Il-Chul Moon
2020 J jnl
J. Artif. Soc. Soc. Simul.
Tae-Sub Yun, Il-Chul Moon
2020 J jnl
CoRR
Kyungwoo Song, Yohan Jung, Dongjun Kim, Il-Chul Moon
2020 J jnl
CoRR
Yoon-Yeong Kim, Kyungwoo Song, JoonHo Jang, Il-Chul Moon
2020 J jnl
IEEE Trans. Syst. Man Cybern. Syst.
Jang Won Bae, Junseok Lee, Do-Hyung Kim, Kanghoon Lee, Jongmin Lee, Kee-Eung Kim, Il-Chul Moon
2020 conf
EMNLP (Findings)
Seungjae Shin, Kyungwoo Song, JoonHo Jang, Hyemi Kim, Weonyoung Joo, Il-Chul Moon
2020 J jnl
CoRR
Seungjae Shin, Kyungwoo Song, JoonHo Jang, Hyemi Kim, Weonyoung Joo, Il-Chul Moon
2020 J jnl
CoRR
Dongjun Kim, Kyungwoo Song, Yoon-Yeong Kim, Yongjin Shin, Il-Chul Moon
2020 A* conf
AAAI
Mingi Ji, Weonyoung Joo, Kyungwoo Song, Yoon-Yeong Kim, Il-Chul Moon
2019 A* conf
AAAI
Sungrae Park, Kyungwoo Song, Mingi Ji, Wonsung Lee, Il-Chul Moon
2019 J jnl
CoRR
Sungrae Park, Kyungwoo Song, Mingi Ji, Wonsung Lee, Il-Chul Moon
2019 J jnl
CoRR
Dongjun Kim, Tae-Sub Yun, Il-Chul Moon
2019 J jnl
CoRR
Kyungwoo Song, JoonHo Jang, Seungjae Shin, Il-Chul Moon
2019 J jnl
CoRR
Weonyoung Joo, Wonsung Lee, Sungrae Park, Il-Chul Moon
2019 A* conf
AAAI
Kyungwoo Song, Mingi Ji, Sungrae Park, Il-Chul Moon
2019 J jnl
CoRR
Kyungwoo Song, Mingi Ji, Sungrae Park, Il-Chul Moon
2019 J jnl
CoRR
Su-Jin Shin, Kyungwoo Song, Il-Chul Moon
2019 J jnl
Comput. Math. Organ. Theory
Su-Jin Shin, Ahram Kang, Doyun Kim, Junseok Lee, Jang Won Bae, Il-Chul Moon
2019 J jnl
CoRR
Kyungwoo Song, Wonsung Lee, Il-Chul Moon
2019 J jnl
CoRR
Mingi Ji, Weonyoung Joo, Kyungwoo Song, Yoon-Yeong Kim, Il-Chul Moon
2018 A* conf
AAAI
Sungrae Park, Jun-Keon Park, Su-Jin Shin, Il-Chul Moon
2018 B conf
SMC
Il-Chul Moon, Dongjun Kim, Tae-Sub Yun, Jang Won Bae, Dong-oh Kang, Euihyun Paik
2018 B conf
SMC
Seongcheol Woo, Juneyeong Yeon, Mingi Ji, Il-Chul Moon, Jinkyoo Park
2018 A* conf
ICDM
Wonsung Lee, Sungrae Park, Weonyoung Joo, Il-Chul Moon
2018 J jnl
IEEE Trans. Syst. Man Cybern. Syst.
Jang Won Bae, Kyohong Shin, Hyun-Rok Lee, Hyun Jin Lee, Taesik Lee, Chu Hyun Kim, Won Chul Cha, Gi Woon Kim, Il-Chul Moon
2018 J jnl
Pattern Recognit. Lett.
Su-Jin Shin, Je-Yong Oh, Sungrae Park, Minki Kim, Il-Chul Moon
2018 A* conf
AAAI
Kyungwoo Song, Wonsung Lee, Il-Chul Moon
2017 J jnl
CoRR
Sungrae Park, Jun-Keon Park, Su-Jin Shin, Il-Chul Moon
2017 A conf
CIKM
Wonsung Lee, Kyungwoo Song, Il-Chul Moon
2017 J jnl
IEEE Trans. Knowl. Data Eng.
Su-Jin Shin, Il-Chul Moon
2017 B conf
SMC
Jang Won Bae, Bowon Nam, Kee-Eung Kim, Junseok Lee, Il-Chul Moon
2017 J jnl
J. Biomed. Informatics
Sungrae Park, Doosup Choi, Minki Kim, Won Chul Cha, Chu Hyun Kim, Il-Chul Moon
2017 B conf
SMC
Jun-Keon Park, Yeongyeon Na, Il-Chul Moon
2016 J jnl
J. Simulation
Jang Won Bae, J. H. Kim, Il-Chul Moon, Tag Gon Kim
2016 A* conf
IJCAI
Wonsung Lee, Youngmin Lee, Heeyoung Kim, Il-Chul Moon
2016 Misc conf
WSC
Taesik Lee, Kyohong Shin, Hyun-Rok Lee, Hyun Jin Lee, Inkyung Sung, Junseok Lee, Il-Chul Moon, Jang Won Bae
2016 C conf
FUSION
Kyungwoo Song, Sang-Hyeon Kim, Jinhyung Tak, Han-Lim Choi, Il-Chul Moon
2016 J jnl
ACM Trans. Model. Comput. Simul.
Jang Won Bae, Sang Won Bae, Il-Chul Moon, Tag Gon Kim
2016 J jnl
IEEE Trans. Syst. Man Cybern. Syst.
Jang Won Bae, Il-Chul Moon
2015 J jnl
J. Artif. Soc. Soc. Simul.
Woo-Seop Yun, Il-Chul Moon, Tae-Eog Lee
2015 J jnl
Inf. Process. Manag.
Sungrae Park, Wonsung Lee, Il-Chul Moon
2015 Misc conf
WSC
Ahram Kang, Doyun Kim, Junseok Lee, Jang Won Bae, Il-Chul Moon
2015 Misc conf
WSC
Il-Chul Moon, Jang Won Bae, Junseok Lee, Doyun Kim, Hyun-Rok Lee, Taesik Lee, Won Chul Cha, Ju-Hyun Kim, Gi Woon Kim
2015 J jnl
Pattern Recognit. Lett.
Sungrae Park, Wonsung Lee, Il-Chul Moon
2015 conf
ICDM Workshops
Su-Jin Shin, Je-Yong Oh, Sungrae Park, Minki Kim, Il-Chul Moon
2015 J jnl
J. Artif. Soc. Soc. Simul.
SeHoon Lee, Jeong-Hee Hong, Jang Won Bae, Il-Chul Moon
2015 conf
TM@CIKM
Sungrae Park, Wonsung Lee, Il-Chul Moon
2014 B conf
SMC
Sungrae Park, Doosup Choi, Wonsung Lee, Dain Jung, Minki Kim, Il-Chul Moon
2014 ch.
Modeling and Simulation-Based Systems Engineering Handbook
Il-Chul Moon
2014 B conf
SMC
Kyungwoo Song, Do-Hyeong Kim, Su-Jin Shin, Il-Chul Moon
2014 A conf
AAMAS
Wonsung Lee, Sungrae Park, Il-Chul Moon
2014 B conf
SMC
Wonsung Lee, Gene Yi, Dain Jung, Minki Kim, Il-Chul Moon
2014 conf
SpringSim (ADS)
SeHoon Lee, Jang Won Bae, Junseok Lee, Jeong-Hee Hong, Il-Chul Moon
2014 J jnl
Simul.
Jang Won Bae, SeHoon Lee, Jeong-Hee Hong, Il-Chul Moon
2013 conf
SpringSim (ADS)
SeHoon Lee, JoonSoo Shin, Geunho Lee, Il-Chul Moon
2013 book
Il-Chul Moon, Kathleen M. Carley, Tag Gon Kim
2013 Misc conf
WSC
Il-Chul Moon, Jeong-Hee Hong
2012 Misc conf
WSC
Jang Won Bae, Geunho Lee, Il-Chul Moon
2012 J jnl
Simul.
Jeong-Hoon Kim, Il-Chul Moon, Tag Gon Kim
2011 C conf
ISI
Il-Chul Moon, Alice H. Oh, Kathleen M. Carley
2010 C conf
WETICE
Chang Ho Sung, Il-Chul Moon, Tag Gon Kim
2010 conf
SpringSim
Jeong-Hoon Kim, Chang Beom Choi, Il-Chul Moon, Tag Gon Kim
2010 conf
SocialCom/PASSAT
Il-Chul Moon, Dongwoo Kim, Yohan Jo, Alice H. Oh
2010 J jnl
IEEE Intell. Syst.
Yiming Yang, Shinjae Yoo, Frank Lin, Il-Chul Moon
2009 A* conf
KDD
Shinjae Yoo, Yiming Yang, Frank Lin, Il-Chul Moon
2009 conf
CISDA
Il-Chul Moon
2009 conf
CSE (4)
Il-Chul Moon, Young-Min Kim, Hyun-Jong Lee, Alice H. Oh
2007 conf
SpringSim (2)
Il-Chul Moon, Kathleen M. Carley
2007 J jnl
IEEE Intell. Syst.
Il-Chul Moon, Kathleen M. Carley
2007 A conf
AAMAS
Il-Chul Moon, Kathleen M. Carley
2006 conf
AAAI Fall Symposium: Interaction and Emergent Phenomena in Societies of Agents
Il-Chul Moon, Kathleen M. Carley
2006 J jnl
Simul.
Il-Chul Moon, Mike Schneider, Kathleen M. Carley
tests/unit/test_apk_dataclasses.py
← Index tests/unit/test_apk_dataclasses.py python
"""
Unit tests for APK dataclasses in redb/models/dataclasses.py.
"""
import pytest
from dataclasses import asdict, fields

pytestmark = [pytest.mark.unit, pytest.mark.dataclass, pytest.mark.apk]


# ============================================================================
# APKFeatures
# ============================================================================

class TestAPKFeaturesDataclass:
    """Tests for APKFeatures dataclass."""

    def test_named_fields(self):
        from redb.models.dataclasses import APKFeatures

        f = APKFeatures(
            package_name="com.example.app",
            app_name="Example App",
            version_code=1,
            version_name="1.0.0",
        )
        assert f.package_name == "com.example.app"
        assert f.app_name == "Example App"
        assert f.version_code == 1
        assert f.version_name == "1.0.0"

    def test_all_fields_default_none_or_safe(self):
        from redb.models.dataclasses import APKFeatures

        f = APKFeatures()
        # Nullable fields default to None
        assert f.package_name is None
        assert f.app_name is None
        assert f.version_code is None
        assert f.version_name is None
        assert f.min_sdk_version is None
        assert f.target_sdk_version is None
        assert f.compile_sdk_version is None
        assert f.main_activity is None
        # Non-nullable fields have safe defaults
        assert f.is_debuggable is False
        assert f.allow_backup is True
        assert f.uses_cleartext_traffic is False
        assert f.supported_abis == []
        assert f.dex_count == 0
        assert f.total_dex_size == 0
        assert f.total_file_count == 0
        assert f.has_native_code is False
        assert f.has_assets is False
        assert f.uses_libraries == []
        assert f.earliest_content_modification is None
        assert f.latest_content_modification is None
        assert f.contains_embedded_apk is False

    def test_all_fields_populated(self):
        from redb.models.dataclasses import APKFeatures

        f = APKFeatures(
            package_name="com.malware.test",
            app_name="Malware",
            version_code=42,
            version_name="6.6.6",
            min_sdk_version=21,
            target_sdk_version=33,
            compile_sdk_version=33,
            main_activity="com.malware.test.MainActivity",
            is_debuggable=True,
            allow_backup=False,
            uses_cleartext_traffic=True,
            supported_abis=["armeabi-v7a", "arm64-v8a", "x86"],
            dex_count=3,
            total_dex_size=5000000,
            total_file_count=200,
            has_native_code=True,
            has_assets=True,
            uses_libraries=["com.google.android.maps"],
            earliest_content_modification="2024-01-01T00:00:00Z",
            latest_content_modification="2024-06-15T12:00:00Z",
            contains_embedded_apk=True,
        )
        assert f.is_debuggable is True
        assert f.dex_count == 3
        assert len(f.supported_abis) == 3
        assert f.contains_embedded_apk is True

    def test_asdict_roundtrip(self):
        from redb.models.dataclasses import APKFeatures

        f = APKFeatures(
            package_name="com.test",
            app_name="Test",
            version_code=1,
            version_name="1.0",
        )
        d = asdict(f)
        assert d["package_name"] == "com.test"
        assert d["is_debuggable"] is False
        assert d["supported_abis"] == []

    def test_partial_extraction(self):
        """Verify that APKFeatures can be created with only some fields populated,
        simulating a partial extraction where some fields failed."""
        from redb.models.dataclasses import APKFeatures

        f = APKFeatures(
            package_name="com.example.app",
            # app_name failed to extract — left as None
            version_code=10,
            # version_name failed to extract — left as None
            is_debuggable=True,
            dex_count=2,
        )
        assert f.package_name == "com.example.app"
        assert f.app_name is None
        assert f.version_code == 10
        assert f.version_name is None
        assert f.is_debuggable is True
        assert f.dex_count == 2


# ============================================================================
# APKManifestComponent
# ============================================================================

class TestAPKManifestComponentDataclass:

    def test_creation(self):
        from redb.models.dataclasses import APKManifestComponent

        c = APKManifestComponent(
            component_type="activity",
            class_name="com.example.MainActivity",
            is_exported=True,
            intent_actions=["android.intent.action.MAIN"],
            intent_categories=["android.intent.category.LAUNCHER"],
        )
        assert c.component_type == "activity"
        assert c.class_name == "com.example.MainActivity"
        assert c.is_exported is True
        assert len(c.intent_actions) == 1
        assert len(c.intent_categories) == 1

    def test_defaults(self):
        from redb.models.dataclasses import APKManifestComponent

        c = APKManifestComponent(
            component_type="service",
            class_name="com.example.MyService",
            is_exported=False,
        )
        assert c.intent_actions == []
        assert c.intent_categories == []


# ============================================================================
# APKManifest
# ============================================================================

class TestAPKManifestDataclass:

    def test_required_fields(self):
        from redb.models.dataclasses import APKManifest

        m = APKManifest(
            activity_count=5,
            service_count=2,
            receiver_count=3,
            provider_count=1,
        )
        assert m.activity_count == 5
        assert m.service_count == 2
        assert m.receiver_count == 3
        assert m.provider_count == 1

    def test_optional_list_defaults(self):
        from redb.models.dataclasses import APKManifest

        m = APKManifest(
            activity_count=0,
            service_count=0,
            receiver_count=0,
            provider_count=0,
        )
        assert m.activities == []
        assert m.services == []
        assert m.receivers == []
        assert m.providers == []
        assert m.exported_components == []
        assert m.intent_filters_by_action == []
        assert m.intent_filters_by_category == []
        assert m.uses_features == []
        assert m.meta_data is None
        assert m.manifest_xml is None

    def test_fully_populated(self):
        from redb.models.dataclasses import APKManifest

        m = APKManifest(
            activity_count=2,
            service_count=1,
            receiver_count=1,
            provider_count=0,
            activities=["MainActivity", "SettingsActivity"],
            services=["SyncService"],
            receivers=["BootReceiver"],
            providers=[],
            exported_components=["MainActivity", "BootReceiver"],
            intent_filters_by_action=["android.intent.action.MAIN"],
            uses_features=["android.hardware.camera"],
            manifest_xml="<manifest>...</manifest>",
        )
        assert len(m.activities) == 2
        assert len(m.exported_components) == 2
        assert m.manifest_xml is not None


# ============================================================================
# APKPermission / APKPermissions
# ============================================================================

class TestAPKPermissionDataclass:

    def test_creation(self):
        from redb.models.dataclasses import APKPermission

        p = APKPermission(
            permission_name="android.permission.CAMERA",
            protection_level="dangerous",
        )
        assert p.permission_name == "android.permission.CAMERA"
        assert p.protection_level == "dangerous"
        assert p.is_custom is False

    def test_custom_permission(self):
        from redb.models.dataclasses import APKPermission

        p = APKPermission(
            permission_name="com.example.CUSTOM_PERM",
            protection_level="signature",
            is_custom=True,
        )
        assert p.is_custom is True


class TestAPKPermissionsDataclass:

    def test_required_fields(self):
        from redb.models.dataclasses import APKPermissions

        p = APKPermissions(
            total_permission_count=10,
            dangerous_permission_count=3,
        )
        assert p.total_permission_count == 10
        assert p.dangerous_permission_count == 3

    def test_defaults(self):
        from redb.models.dataclasses import APKPermissions

        p = APKPermissions(
            total_permission_count=0,
            dangerous_permission_count=0,
        )
        assert p.permissions == []
        assert p.dangerous_permissions == []
        assert p.custom_permissions == []
        assert p.permission_details == []
        assert p.permhash is None

    def test_with_permission_details(self):
        from redb.models.dataclasses import APKPermission, APKPermissions

        details = [
            APKPermission("android.permission.INTERNET", "normal"),
            APKPermission("android.permission.CAMERA", "dangerous"),
        ]
        p = APKPermissions(
            total_permission_count=2,
            dangerous_permission_count=1,
            permissions=["android.permission.INTERNET", "android.permission.CAMERA"],
            dangerous_permissions=["android.permission.CAMERA"],
            permission_details=details,
            permhash="abc123def456",
        )
        assert len(p.permission_details) == 2
        assert p.permhash == "abc123def456"


# ============================================================================
# APKCertificate / APKCodeSigningInfo
# ============================================================================

class TestAPKCertificateDataclass:

    def test_required_fields(self):
        from redb.models.dataclasses import APKCertificate

        c = APKCertificate(
            subject="CN=Android Debug",
            issuer="CN=Android Debug",
            serial_number="1234567890",
            valid_from="2024-01-01",
            valid_to="2054-01-01",
            thumbprint_sha1="aabbccdd" * 5,
            thumbprint_sha256="aabbccdd" * 8,
        )
        assert c.subject == "CN=Android Debug"
        assert c.issuer == "CN=Android Debug"
        assert c.is_self_signed is False

    def test_optional_fields(self):
        from redb.models.dataclasses import APKCertificate

        c = APKCertificate(
            subject="CN=Test",
            issuer="CN=CA",
            serial_number="1",
            valid_from="2024-01-01",
            valid_to="2025-01-01",
            thumbprint_sha1="aa" * 20,
            thumbprint_sha256="bb" * 32,
            algorithm="SHA256withRSA",
            key_size=2048,
            is_self_signed=True,
        )
        assert c.algorithm == "SHA256withRSA"
        assert c.key_size == 2048
        assert c.is_self_signed is True


class TestAPKCodeSigningInfoDataclass:

    def test_required_fields(self):
        from redb.models.dataclasses import APKCodeSigningInfo

        info = APKCodeSigningInfo(
            _id="abcdef1234567890" * 4,
            is_signed=True,
        )
        assert info.is_signed is True
        assert info.signature_scheme_versions == []
        assert info.number_of_certificates == 0
        assert info.x509_certificates is None
        assert info.apk_signer_subject is None
        assert info.apk_signer_issuer is None

    def test_fully_populated(self):
        from redb.models.dataclasses import APKCertificate, APKCodeSigningInfo

        cert = APKCertificate(
            subject="CN=Test",
            issuer="CN=Test",
            serial_number="1",
            valid_from="2024-01-01",
            valid_to="2025-01-01",
            thumbprint_sha1="aa" * 20,
            thumbprint_sha256="bb" * 32,
        )
        info = APKCodeSigningInfo(
            _id="cc" * 32,
            is_signed=True,
            signature_scheme_versions=[1, 2, 3],
            number_of_certificates=1,
            x509_certificates=[cert],
            apk_signer_subject="CN=Test",
            apk_signer_issuer="CN=Test",
        )
        assert len(info.signature_scheme_versions) == 3
        assert info.number_of_certificates == 1
        assert len(info.x509_certificates) == 1


# ============================================================================
# APKDexFile
# ============================================================================

class TestAPKDexFileDataclass:

    def test_required_fields(self):
        from redb.models.dataclasses import APKDexFile

        d = APKDexFile(
            filename="classes.dex",
            sha256="aa" * 32,
            class_count=100,
            method_count=500,
            string_count=1000,
        )
        assert d.filename == "classes.dex"
        assert d.class_count == 100
        assert d.method_count == 500
        assert d.string_count == 1000

    def test_optional_fields_defaults(self):
        from redb.models.dataclasses import APKDexFile

        d = APKDexFile(
            filename="classes2.dex",
            sha256="bb" * 32,
            class_count=0,
            method_count=0,
            string_count=0,
        )
        assert d.tlsh is None
        assert d.top_packages is None
        assert d.api_usage is None
        assert d.obfuscation_indicators is None

    def test_tlsh_populated(self):
        from redb.models.dataclasses import APKDexFile

        tlsh_value = "T1" + "A" * 68
        d = APKDexFile(
            filename="classes.dex",
            sha256="aa" * 32,
            class_count=100,
            method_count=500,
            string_count=1000,
            tlsh=tlsh_value,
        )
        assert d.tlsh == tlsh_value

    def test_with_api_usage(self):
        from redb.models.dataclasses import APKDexFile

        d = APKDexFile(
            filename="classes.dex",
            sha256="cc" * 32,
            class_count=50,
            method_count=200,
            string_count=300,
            top_packages=[{"name": "com.example", "class_count": 30}],
            api_usage={
                "crypto": ["Ljavax/crypto/Cipher;->getInstance"],
                "reflection": ["Ljava/lang/Class;->forName"],
            },
            obfuscation_indicators={"short_class_names_ratio": 0.8, "single_char_methods_ratio": 0.5},
        )
        assert len(d.api_usage) == 2
        assert d.obfuscation_indicators["short_class_names_ratio"] == 0.8


# ============================================================================
# APKResource
# ============================================================================

class TestAPKResourceDataclass:

    def test_creation(self):
        from redb.models.dataclasses import APKResource

        r = APKResource(
            path="res/drawable/icon.png",
            size=1024,
            sha256="dd" * 32,
            filetype_magika="png",
        )
        assert r.path == "res/drawable/icon.png"
        assert r.size == 1024
        assert r.is_suspicious is False

    def test_suspicious_resource(self):
        from redb.models.dataclasses import APKResource

        r = APKResource(
            path="assets/payload.dex",
            size=50000,
            sha256="ee" * 32,
            filetype_magika="dex",
            is_suspicious=True,
        )
        assert r.is_suspicious is True


# ============================================================================
# APKNativeLib
# ============================================================================

class TestAPKNativeLibDataclass:

    def test_creation(self):
        from redb.models.dataclasses import APKNativeLib

        lib = APKNativeLib(
            abi="arm64-v8a",
            filename="libnative.so",
            size=200000,
            sha256="ff" * 32,
        )
        assert lib.abi == "arm64-v8a"
        assert lib.filename == "libnative.so"
        assert lib.is_known_packer is False

    def test_known_packer(self):
        from redb.models.dataclasses import APKNativeLib

        lib = APKNativeLib(
            abi="armeabi-v7a",
            filename="libjiagu.so",
            size=100000,
            sha256="aa" * 32,
            is_known_packer=True,
        )
        assert lib.is_known_packer is True


# ============================================================================
# APKInconsistencyTests
# ============================================================================

class TestAPKInconsistencyTestsDataclass:

    def test_all_defaults_none(self):
        from redb.models.dataclasses import APKInconsistencyTests

        t = APKInconsistencyTests()
        assert t.test_zip_bomb is None
        assert t.test_zip_duplicate_entries is None
        assert t.test_zip_path_traversal is None
        assert t.test_zip_suspicious_timestamps is None
        assert t.test_hidden_dex_files is None
        assert t.test_manifest_component_mismatch is None
        assert t.test_debuggable_release is None
        assert t.test_emulator_detection_strings is None
        assert t.test_debugger_detection is None
        assert t.test_root_detection is None

    def test_all_fields_populated(self):
        from redb.models.dataclasses import APKInconsistencyTests

        t = APKInconsistencyTests(
            test_zip_bomb=True,
            test_zip_duplicate_entries=False,
            test_zip_path_traversal=True,
            test_zip_suspicious_timestamps=False,
            test_hidden_dex_files=True,
            test_manifest_component_mismatch=False,
            test_debuggable_release=True,
            test_emulator_detection_strings=True,
            test_debugger_detection=False,
            test_root_detection=True,
        )
        assert t.test_zip_bomb is True
        assert t.test_debuggable_release is True
        # Count true values
        d = asdict(t)
        true_count = sum(1 for v in d.values() if v is True)
        assert true_count == 6

    def test_field_count(self):
        from redb.models.dataclasses import APKInconsistencyTests

        # Exactly 10 inconsistency tests per PDD specification
        assert len(fields(APKInconsistencyTests)) == 10


# ============================================================================
# Hashes dataclass — APK permhash field
# ============================================================================

class TestHashesAPKField:

    def test_permhash_default_none(self):
        from redb.models.dataclasses import Hashes

        h = Hashes(md5="a", sha1="b", sha256="c", ssdeep_hash="d", tlsh_hash="e")
        assert h.permhash is None

    def test_permhash_populated(self):
        from redb.models.dataclasses import Hashes

        h = Hashes(
            md5="a", sha1="b", sha256="c", ssdeep_hash="d", tlsh_hash="e",
            permhash="abc123" * 10 + "abcd",
        )
        assert h.permhash is not None
        assert len(h.permhash) == 64


# ============================================================================
# Tag enum — APK entries
# ============================================================================

class TestAPKTagEnum:

    def test_all_apk_tags_exist(self):
        from redb.extractors.enum import Tag

        expected_tags = [
            "APK_FEATURES", "APK_MANIFEST", "APK_PERMISSIONS", "APK_SIGNATURE",
            "APK_DEX", "APK_RESOURCES", "APK_NATIVE_LIBS", "APK_INCONSISTENCY_TESTS",
        ]
        for name in expected_tags:
            assert hasattr(Tag, name), f"Tag.{name} missing"

    def test_apk_tag_values(self):
        from redb.extractors.enum import Tag

        assert Tag.APK_FEATURES.value == "apk_features"
        assert Tag.APK_MANIFEST.value == "apk_manifest"
        assert Tag.APK_PERMISSIONS.value == "apk_permissions"
        assert Tag.APK_SIGNATURE.value == "apk_signature"
        assert Tag.APK_DEX.value == "apk_dex"
        assert Tag.APK_RESOURCES.value == "apk_resources"
        assert Tag.APK_NATIVE_LIBS.value == "apk_native_libs"
        assert Tag.APK_INCONSISTENCY_TESTS.value == "apk_inconsistency_tests"