Rahul Jain

159 papers A* 15A 10B 9C 2Misc 2Journal 112Unranked 7
YearRankTypeTitle / Venue / Authors
2026 J jnl
CoRR
Rahul Jain, Srijita Kundu
2025 J jnl
SIAM J. Comput.
Rahul Jain, Srijita Kundu
2025 J jnl
IEEE Trans. Inf. Theory
Rishabh Batra, Naresh Goud Boddu, Rahul Jain
2025 J jnl
IEEE Trans. Inf. Theory
Naresh Goud Boddu, Vipul Goyal, Rahul Jain, João Ribeiro
2024 A* conf
STOC
Itai Arad, Raz Firanko, Rahul Jain
2024 A* conf
FOCS
Rishabh Batra, Rahul Jain
2024 J jnl
CoRR
Rishabh Batra, Rahul Jain
2024 B conf
ISIT
Michael X. Cao, Rahul Jain, Marco Tomamichel
2024 J jnl
CoRR
Michael X. Cao, Rahul Jain, Marco Tomamichel
2024 J jnl
IEEE Trans. Inf. Theory
Divesh Aggarwal, Naresh Goud Boddu, Rahul Jain, Maciej Obremski
2024 J jnl
IEEE Trans. Inf. Theory
Divesh Aggarwal, Naresh Goud Boddu, Rahul Jain
2024 J jnl
IACR Cryptol. ePrint Arch.
Naresh Goud Boddu, Vipul Goyal, Rahul Jain, João Ribeiro
2024 conf
TCC (2)
Naresh Goud Boddu, Vipul Goyal, Rahul Jain, João Ribeiro
2023 J jnl
CoRR
Itai Arad, Raz Firanko, Rahul Jain
2023 J jnl
Quantum
Naresh Goud Boddu, Rahul Jain, Han-Hsuan Lin
2023 conf
Allerton
Sayantan Chakraborty, Rahul Jain, Pranab Sen
2023 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Shima Bab Hadiashar, Rahul Jain, Ashwin Nayak, Dave Touchette
2023 J jnl
CoRR
Rishabh Batra, Naresh Goud Boddu, Rahul Jain
2023 J jnl
CoRR
Naresh Goud Boddu, Vipul Goyal, Rahul Jain, João Ribeiro
2022 J jnl
CoRR
Naresh Goud Boddu, Rahul Jain
2021 A conf
CCC
Rahul Jain, Srijita Kundu
2021 A* conf
FOCS
Rahul Jain, Srijita Kundu
2021 J jnl
CoRR
Rahul Jain, Srijita Kundu
2021 J jnl
Electron. Colloquium Comput. Complex.
Rahul Jain, Srijita Kundu
2021 B conf
ISIT
Rahul Jain
2021 J jnl
CoRR
Naresh Goud Boddu, Rahul Jain, Han-Hsuan Lin
2021 B conf
ISIT
Anurag Anshu, Shima Bab Hadiashar, Rahul Jain, Ashwin Nayak, Dave Touchette
2021 J jnl
CoRR
Anurag Anshu, Shima Bab Hadiashar, Rahul Jain, Ashwin Nayak, Dave Touchette
2021 J jnl
CoRR
Divesh Aggarwal, Naresh Goud Boddu, Rahul Jain, Maciej Obremski
2021 J jnl
CoRR
Naresh Goud Boddu, Rahul Jain, Upendra Kapshikar
2020 J jnl
CoRR
Rahul Jain, Srijita Kundu
2020 J jnl
Electron. Colloquium Comput. Complex.
Rahul Jain, Srijita Kundu
2020 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Min-Hsiu Hsieh, Rahul Jain
2020 J jnl
IEEE Trans. Inf. Theory
Farzin Salek, Anurag Anshu, Min-Hsiu Hsieh, Rahul Jain, Javier Rodríguez Fonollosa
2020 J jnl
IEEE Trans. Inf. Theory
Rahul Jain, Carl A. Miller, Yaoyun Shi
2020 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Mario Berta, Rahul Jain, Marco Tomamichel
2020 J jnl
Theory Comput. Syst.
Rahul Jain, Hartmut Klauck, Srijita Kundu, Troy Lee, Miklos Santha, Swagato Sanyal, Jevgenijs Vihrovs
2019 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2019 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2019 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2019 B conf
ISIT
Anurag Anshu, Mario Berta, Rahul Jain, Marco Tomamichel
2018 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2018 B conf
ISIT
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2018 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2018 B conf
ISIT
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2018 J jnl
SIAM J. Comput.
Mika Göös, Rahul Jain, Thomas Watson
2018 B conf
ISIT
Farzin Salek, Anurag Anshu, Min-Hsiu Hsieh, Rahul Jain, Javier R. Fonollosa
2018 J jnl
CoRR
Farzin Salek, Anurag Anshu, Min-Hsiu Hsieh, Rahul Jain, Javier R. Fonollosa
2018 J jnl
CoRR
Anurag Anshu, Mario Berta, Rahul Jain, Marco Tomamichel
2018 Misc conf
CSR
Rahul Jain, Hartmut Klauck, Srijita Kundu, Troy Lee, Miklos Santha, Swagato Sanyal, Jevgenijs Vihrovs
2017 conf
FSTTCS
Anurag Anshu, Dmitry Gavinsky, Rahul Jain, Srijita Kundu, Troy Lee, Priyanka Mukhopadhyay, Miklos Santha, Swagato Sanyal
2017 J jnl
CoRR
Anurag Anshu, Dmitry Gavinsky, Rahul Jain, Srijita Kundu, Troy Lee, Priyanka Mukhopadhyay, Miklos Santha, Swagato Sanyal
2017 J jnl
Electron. Colloquium Comput. Complex.
Anurag Anshu, Dmitry Gavinsky, Rahul Jain, Srijita Kundu, Troy Lee, Priyanka Mukhopadhyay, Miklos Santha, Swagato Sanyal
2017 J jnl
CoRR
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2017 J jnl
CoRR
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2017 J jnl
CoRR
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2017 B conf
ITW
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2017 J jnl
Comput. Complex.
Gábor Braun, Rahul Jain, Troy Lee, Sebastian Pokutta
2017 J jnl
Electron. Colloquium Comput. Complex.
Anurag Anshu, Naresh B. Goud, Rahul Jain, Srijita Kundu, Priyanka Mukhopadhyay
2017 B conf
VMCAI
Supratik Chakraborty, Ashutosh Gupta, Rahul Jain
2017 J jnl
CoRR
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2017 J jnl
Comput. Complex.
Rahul Jain, Zhaohui Wei, Penghui Yao, Shengyu Zhang
2017 J jnl
CoRR
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2017 J jnl
CoRR
Dmitry Gavinsky, Rahul Jain, Hartmut Klauck, Srijita Kundu, Troy Lee, Miklos Santha, Swagato Sanyal, Jevgenijs Vihrovs
2017 J jnl
Electron. Colloquium Comput. Complex.
Dmitry Gavinsky, Rahul Jain, Hartmut Klauck, Srijita Kundu, Troy Lee, Miklos Santha, Swagato Sanyal, Jevgenijs Vihrovs
2017 A conf
CCC
Anurag Anshu, Shalev Ben-David, Ankit Garg, Rahul Jain, Robin Kothari, Troy Lee
2017 J jnl
CoRR
Anurag Anshu, Rahul Jain, Naqueeb Ahmad Warsi
2017 J jnl
Inf. Comput.
Rahul Jain, Sanjay Jain, Frank Stephan
2016 J jnl
Algorithmica
Rahul Jain, Attila Pereszlényi, Penghui Yao
2016 A* conf
FOCS
Mika Göös, Rahul Jain, Thomas Watson
2016 J jnl
CoRR
Mika Göös, Rahul Jain, Thomas Watson
2016 J jnl
Electron. Colloquium Comput. Complex.
Mika Göös, Rahul Jain, Thomas Watson
2016 J jnl
CoRR
Supratik Chakraborty, Ashutosh Gupta, Rahul Jain
2016 J jnl
IEEE Trans. Inf. Theory
Anurag Anshu, Rahul Jain, Priyanka Mukhopadhyay, Ala Shayeghi, Penghui Yao
2016 A* conf
ICALP
Prahladh Harsha, Rahul Jain, Jaikumar Radhakrishnan
2016 J jnl
ACM Trans. Comput. Theory
Lila Fontes, Rahul Jain, Iordanis Kerenidis, Sophie Laplante, Mathieu Laurière, Jérémie Roland
2016 J jnl
CoRR
Anurag Anshu, Shalev Ben-David, Ankit Garg, Rahul Jain, Robin Kothari, Troy Lee
2016 A* conf
FOCS
Anurag Anshu, Aleksandrs Belovs, Shalev Ben-David, Mika Göös, Rahul Jain, Robin Kothari, Troy Lee, Miklos Santha
2016 J jnl
CoRR
Anurag Anshu, Aleksandrs Belovs, Shalev Ben-David, Mika Göös, Rahul Jain, Robin Kothari, Troy Lee, Miklos Santha
2016 J jnl
Electron. Colloquium Comput. Complex.
Anurag Anshu, Aleksandrs Belovs, Shalev Ben-David, Mika Göös, Rahul Jain, Robin Kothari, Troy Lee, Miklos Santha
2016 ch.
Encyclopedia of Algorithms
Anurag Anshu, Vamsi Krishna Devabathini, Rahul Jain, Priyanka Mukhopadhyay
2015 J jnl
J. ACM
Rahul Jain
2015 conf
ICALP (1)
Lila Fontes, Rahul Jain, Iordanis Kerenidis, Sophie Laplante, Mathieu Laurière, Jérémie Roland
2015 J jnl
Electron. Colloquium Comput. Complex.
Lila Fontes, Rahul Jain, Iordanis Kerenidis, Sophie Laplante, Mathieu Laurière, Jérémie Roland
2015 J jnl
CoRR
Prahladh Harsha, Rahul Jain, Jaikumar Radhakrishnan
2015 J jnl
Electron. Colloquium Comput. Complex.
Prahladh Harsha, Rahul Jain, Jaikumar Radhakrishnan
2015 C ed.
TAMC
Rahul Jain, Sanjay Jain, Frank Stephan
2014 A conf
CCC
Rahul Jain, Attila Pereszlényi, Penghui Yao
2014 J jnl
CoRR
Anurag Anshu, Rahul Jain, Priyanka Mukhopadhyay, Ala Shayeghi, Penghui Yao
2014 J jnl
CoRR
Rahul Jain, Troy Lee, Nisheeth K. Vishnoi
2014 J jnl
CoRR
Rahul Jain, Zhaohui Wei, Penghui Yao, Shengyu Zhang
2014 J jnl
CoRR
Anurag Anshu, Vamsi Krishna Devabathini, Rahul Jain
2014 J jnl
IEEE Trans. Inf. Theory
Rahul Jain, Ashwin Nayak
2014 conf
APPROX-RANDOM
Nathanaël François, Rahul Jain, Frédéric Magniez
2013 conf
FSTTCS
Prahladh Harsha, Rahul Jain
2013 J jnl
CoRR
Rahul Jain, Attila Pereszlényi, Penghui Yao
2013 J jnl
CoRR
Prahladh Harsha, Rahul Jain
2013 J jnl
IEEE Trans. Inf. Theory
Rahul Jain, Yaoyun Shi, Zhaohui Wei, Shengyu Zhang
2013 A* conf
SODA
Rahul Jain, Yaoyun Shi, Zhaohui Wei, Shengyu Zhang
2013 J jnl
Electron. Colloquium Comput. Complex.
Gábor Braun, Rahul Jain, Troy Lee, Sebastian Pokutta
2012 A* conf
FOCS
Rahul Jain, Attila Pereszlényi, Penghui Yao
2012 J jnl
CoRR
Rahul Jain, Attila Pereszlényi, Penghui Yao
2012 J jnl
CoRR
Rahul Jain, Penghui Yao
2012 J jnl
CoRR
Rahul Jain, Penghui Yao
2012 J jnl
CoRR
Rahul Jain, Yaoyun Shi, Zhaohui Wei, Shengyu Zhang
2012 J jnl
Theory Comput.
Rahul Jain, Iordanis Kerenidis, Greg Kuperberg, Miklos Santha, Or Sattath, Shengyu Zhang
2012 J jnl
J. Cryptol.
Rahul Jain
2012 J jnl
IEEE Trans. Inf. Theory
Rahul Jain, Ashwin Nayak
2011 J jnl
CoRR
Rahul Jain, Penghui Yao
2011 A* conf
FOCS
Rahul Jain, Penghui Yao
2011 J jnl
CoRR
Rahul Jain, Ashwin Nayak
2011 J jnl
Electron. Colloquium Comput. Complex.
Rahul Jain
2011 J jnl
J. ACM
Rahul Jain, Zhengfeng Ji, Sarvagya Upadhyay, John Watrous
2011 J jnl
Theory Comput.
Rahul Jain, Shengyu Zhang
2011 J jnl
CoRR
Rahul Jain, Shengyu Zhang
2011 J jnl
Electron. Colloquium Comput. Complex.
Rahul Jain, Shengyu Zhang
2010 J jnl
Math. Struct. Comput. Sci.
Rahul Jain, Ashwin Nayak, Yi Su
2010 J jnl
CoRR
Rahul Jain
2010 Misc conf
COCOON
Rahul Jain, Hartmut Klauck, Shengyu Zhang
2010 A conf
ICS
Rahul Jain, Iordanis Kerenidis, Greg Kuperberg, Miklos Santha, Or Sattath, Shengyu Zhang
2010 J jnl
CoRR
Rahul Jain, Hartmut Klauck, Miklos Santha
2010 J jnl
Inf. Process. Lett.
Rahul Jain, Hartmut Klauck, Miklos Santha
2010 A* conf
STOC
Rahul Jain, Zhengfeng Ji, Sarvagya Upadhyay, John Watrous
2010 J jnl
Commun. ACM
Rahul Jain, Zhengfeng Ji, Sarvagya Upadhyay, John Watrous
2010 J jnl
CoRR
Rahul Jain
2010 A conf
CCC
Rahul Jain, Hartmut Klauck
2010 J jnl
IEEE Trans. Inf. Theory
Prahladh Harsha, Rahul Jain, David A. McAllester, Jaikumar Radhakrishnan
2010 J jnl
CoRR
Rahul Jain, Ashwin Nayak
2010 J jnl
Electron. Colloquium Comput. Complex.
Rahul Jain, Ashwin Nayak
2009 J jnl
J. ACM
Rahul Jain, Jaikumar Radhakrishnan, Pranab Sen
2009 J jnl
CoRR
Rahul Jain, Hartmut Klauck, Shengyu Zhang
2009 J jnl
Quantum Inf. Comput.
Richard Cleve, Dmitry Gavinsky, Rahul Jain
2009 J jnl
CoRR
Rahul Jain, Hartmut Klauck
2009 A conf
CCC
Rahul Jain, Hartmut Klauck
2009 J jnl
Theor. Comput. Sci.
Rahul Jain, Shengyu Zhang
2009 J jnl
Quantum Inf. Comput.
Rahul Jain, Alexandra Kolla, Gatis Midrijanis, Ben W. Reichardt
2009 A conf
CCC
Rahul Jain, John Watrous
2009 J jnl
CoRR
Rahul Jain, Hartmut Klauck
2009 A* conf
FOCS
Rahul Jain, Sarvagya Upadhyay, John Watrous
2009 J jnl
CoRR
Rahul Jain, Sarvagya Upadhyay, John Watrous
2008 C conf
TAMC
Rahul Jain, Ashwin Nayak, Yi Su
2008 A* conf
STOC
Rahul Jain, Hartmut Klauck, Ashwin Nayak
2008 J jnl
J. Cryptol.
Rahul Jain
2008 J jnl
CoRR
Rahul Jain, Shengyu Zhang
2008 J jnl
CoRR
Rahul Jain, Pranab Sen, Jaikumar Radhakrishnan
2008 ch.
Encyclopedia of Algorithms
Rahul Jain
2007 J jnl
Electron. Colloquium Comput. Complex.
Rahul Jain, Hartmut Klauck, Ashwin Nayak
2007 A conf
CCC
Prahladh Harsha, Rahul Jain, David A. McAllester, Jaikumar Radhakrishnan
2006 J jnl
Quantum Inf. Comput.
Rahul Jain
2006 J jnl
Electron. Colloquium Comput. Complex.
Prahladh Harsha, Rahul Jain, David A. McAllester, Jaikumar Radhakrishnan
2006 J jnl
CoRR
Rahul Jain
2005 J jnl
Random Struct. Algorithms
Amit Deshpande, Rahul Jain, Telikepalli Kavitha, Satyanarayana V. Lokam, Jaikumar Radhakrishnan
2005 A conf
CCC
Rahul Jain, Jaikumar Radhakrishnan, Pranab Sen
2003 A* conf
ICALP
Rahul Jain, Jaikumar Radhakrishnan, Pranab Sen
2003 A* conf
FOCS
Rahul Jain, Jaikumar Radhakrishnan, Pranab Sen
2003 J jnl
CoRR
Rahul Jain, Jaikumar Radhakrishnan, Pranab Sen
2002 A conf
CCC
Amit Deshpande, Rahul Jain, Telikepalli Kavitha, Jaikumar Radhakrishnan, Satyanarayana V. Lokam
2002 A* conf
FOCS
Rahul Jain, Jaikumar Radhakrishnan, Pranab Sen
2002 conf
FSTTCS
Rahul Jain, Jaikumar Radhakrishnan, Pranab Sen
tests/unit/test_apk_jadx_wrapper.py
← Index tests/unit/test_apk_jadx_wrapper.py python
"""
Unit tests for JADX wrapper subprocess management and output parsing.

All subprocess calls are mocked — no JADX/Java installation required.
"""
import os
import tempfile
import textwrap

import pytest
from unittest.mock import MagicMock, patch, call

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


class TestJADXDecompiler:
    """Tests for JADXDecompiler subprocess wrapper."""

    @patch.dict(os.environ, {}, clear=False)
    def test_init_defaults(self):
        os.environ.pop("JADX_PATH", None)
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        j = JADXDecompiler()
        assert j.jadx_path == "jadx"
        assert j.timeout == 300

    def test_init_custom_path(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        j = JADXDecompiler(jadx_path="/usr/local/bin/jadx", timeout=300)
        assert j.jadx_path == "/usr/local/bin/jadx"
        assert j.timeout == 300

    def test_init_from_env(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        with patch.dict(os.environ, {"JADX_PATH": "/opt/jadx/bin/jadx", "JADX_TIMEOUT": "120"}):
            j = JADXDecompiler()
            assert j.jadx_path == "/opt/jadx/bin/jadx"
            assert j.timeout == 120

    @patch("subprocess.Popen")
    def test_decompile_success(self, mock_popen):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        mock_proc = MagicMock()
        mock_proc.communicate.return_value = ("output", "")
        mock_proc.returncode = 0
        mock_popen.return_value = mock_proc

        j = JADXDecompiler()
        result = j.decompile("/test.apk", "/output")
        assert result is True

    @patch("subprocess.Popen")
    def test_decompile_nonzero_exit_no_sources(self, mock_popen):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        mock_proc = MagicMock()
        mock_proc.communicate.return_value = ("", "error msg")
        mock_proc.returncode = 1
        mock_popen.return_value = mock_proc

        j = JADXDecompiler(log=MagicMock())
        result = j.decompile("/test.apk", "/nonexistent_output")
        assert result is False

    @patch("subprocess.Popen")
    def test_decompile_timeout(self, mock_popen):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        import subprocess
        mock_proc = MagicMock()
        mock_proc.communicate.side_effect = subprocess.TimeoutExpired(cmd="jadx", timeout=10)
        mock_proc.pid = 12345
        mock_popen.return_value = mock_proc

        with patch("os.getpgid", return_value=12345), \
             patch("os.killpg"):
            j = JADXDecompiler(timeout=10, log=MagicMock())
            result = j.decompile("/test.apk", "/output")
            assert result is False

    @patch("subprocess.Popen", side_effect=FileNotFoundError)
    def test_decompile_not_found(self, mock_popen):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        j = JADXDecompiler(log=MagicMock())
        result = j.decompile("/test.apk", "/output")
        assert result is False

    @patch("subprocess.Popen")
    def test_decompile_command_args(self, mock_popen):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        mock_proc = MagicMock()
        mock_proc.communicate.return_value = ("", "")
        mock_proc.returncode = 0
        mock_popen.return_value = mock_proc

        j = JADXDecompiler(jadx_path="/opt/jadx")
        j.decompile("/test.apk", "/output")

        cmd = mock_popen.call_args[0][0]
        assert cmd[0] == "/opt/jadx"
        assert "--no-res" in cmd
        assert "--no-imports" in cmd
        assert "--threads-count" in cmd
        assert "/test.apk" in cmd

    def test_parse_java_methods_empty_dir(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        j = JADXDecompiler()
        result = j.parse_java_methods("/nonexistent")
        assert result == {}

    def test_parse_java_methods_with_files(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        with tempfile.TemporaryDirectory() as tmpdir:
            sources_dir = os.path.join(tmpdir, "sources", "com", "example")
            os.makedirs(sources_dir)

            java_content = textwrap.dedent("""\
                package com.example;

                public class MyClass {
                    public void doStuff(int x) {
                        System.out.println(x);
                    }

                    private String getName() {
                        return "test";
                    }
                }
            """)
            with open(os.path.join(sources_dir, "MyClass.java"), "w") as f:
                f.write(java_content)

            j = JADXDecompiler()
            methods = j.parse_java_methods(tmpdir)
            assert len(methods) >= 1

    def test_extract_methods_from_java(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        source = textwrap.dedent("""\
            public void foo(int x) {
                if (x > 0) {
                    System.out.println(x);
                }
            }
        """)
        j = JADXDecompiler()
        methods = j._extract_methods_from_java(source, "com.example.Test")
        assert len(methods) == 1
        key = list(methods.keys())[0]
        assert "foo" in key

    def test_is_method_declaration_valid(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        j = JADXDecompiler()
        result = j._is_method_declaration("    public void foo(int x) {")
        assert result is not None
        assert result[0] == "foo"

    def test_is_method_declaration_control_flow(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        j = JADXDecompiler()
        # 'if', 'for', etc. should not be recognized as methods
        assert j._is_method_declaration("        if (x > 0) {") is None
        assert j._is_method_declaration("        for (int i = 0; i < 10; i++) {") is None

    def test_is_method_declaration_static(self):
        from redb.extractors.decompiler.apk.jadx_wrapper import JADXDecompiler
        j = JADXDecompiler()
        result = j._is_method_declaration("    public static void main(String[] args) {")
        assert result is not None
        assert result[0] == "main"