Vincent Courboulay

50 papers A 3B 9C 1Misc 1Journal 11Unranked 23
YearRankTypeTitle / Venue / Authors
2025 Misc conf
SoftCOM
Angela Voinea Ciocan, Sofiane Hamrioui, Pascal Lorenz, Vincent Courboulay, Adrian Ciocan
2024 J jnl
SN Comput. Sci.
Ikhlasse Hamzaoui, Benjamin Duthil, Vincent Courboulay, Hicham Medromi
2024 conf
ICT4S
Aiste Rugeviciute, Vincent Courboulay
2023 conf
INFORSID
Guillaume Bourgeois, Kassandra Bigot, Vincent Courboulay, Benjamin Duthil
2023 conf
ICT4S
Aiste Rugeviciute, Vincent Courboulay, Lorenz M. Hilty
2023 conf
INFORSID
Aiste Rugeviciute, Vincent Courboulay
2022 J jnl
IEEE Access
Ikhlasse Hamzaoui, Benjamin Duthil, Vincent Courboulay, Hicham Medromi
2022 J jnl
J. King Saud Univ. Comput. Inf. Sci.
Ikhlasse Hamzaoui, Benjamin Duthil, Vincent Courboulay, Hicham Medromi
2022 conf
EMCIS
Guillaume Bourgeois, Kassandra Bigot, Vincent Courboulay, Benjamin Duthil
2021 J jnl
IEEE Access
Ikhlasse Hamzaoui, Guillaume Bourgeois, Benjamin Duthil, Vincent Courboulay, Hicham Medromi
2021 conf
SOHOMA
Ikhlasse Hamzaoui, Benjamin Duthil, Vincent Courboulay, Hicham Medromi
2020 J jnl
SN Comput. Sci.
Ikhlasse Hamzaoui, Benjamin Duthil, Vincent Courboulay, Hicham Medromi
2020 conf
Cloudtech
Ikhlasse Hamzaoui, Benjamin Duthil, Vincent Courboulay, Hicham Medromi
2017 ch.
Visual Content Indexing and Retrieval with Psycho-Visual Models
Vincent Courboulay, Arnaud Revel
2017 A conf
ICDAR
Axel Jean-Caurant, Nouredine Tamani, Vincent Courboulay, Jean-Christophe Burie
2017 conf
DH
Axel Jean-Caurant, Cyrille Suire, Vincent Courboulay, Jean-Christophe Burie
2016 J jnl
EAI Endorsed Trans. Creative Technol.
Patrice Denis, Vincent Courboulay, Arnaud Revel, Syntyche Gbèhounou, François Lecellier, Christine Fernandez-Maloigne
2016 conf
JCDL
Cyrille Suire, Axel Jean-Caurant, Vincent Courboulay, Jean-Christophe Burie, Pascal Estraillier
2015 conf
EUSIPCO
Dounia Awad, Matei Mancas, Nicolas Riche, Vincent Courboulay, Arnaud Revel
2015 B conf
FG
Van-Toi Nguyen, Thi-Lan Le, Thanh-Hai Tran, Rémy Mullot, Vincent Courboulay
2015 J jnl
EAI Endorsed Trans. Creative Technol.
Vincent Courboulay, Matei Mancas
2015 A conf
ICDAR
Elodie Carel, Jean-Christophe Burie, Vincent Courboulay, Jean-Marc Ogier, Vincent Poulain D'Andecy
2015 conf
KSE
Van-Toi Nguyen, Thanh-Hai Tran, Thi-Lan Le, Rémy Mullot, Vincent Courboulay
2014 B conf
ICPR
Dounia Awad, Vincent Courboulay, Arnaud Revel
2014 conf
EGC
Benjamin Duthil, Mickaël Coustaty, Vincent Courboulay, Jean-Marc Ogier
2014 conf
IHCI
Van-Toi Nguyen, Thi-Lan Le, Thanh-Hai Tran, Rémy Mullot, Vincent Courboulay
2014 conf
CORIA-CIFED
Benjamin Duthil, Vincent Courboulay, Mickaël Coustaty, Jean-Marc Ogier
2013 conf
CAIP (1)
Syntyche Gbèhounou, François Lecellier, Christine Fernandez-Maloigne, Vincent Courboulay
2013 B conf
ACM Symposium on Document Engineering
Elodie Carel, Vincent Courboulay, Jean-Christophe Burie, Jean-Marc Ogier
2013 conf
GREC
Benjamin Duthil, Mickaël Coustaty, Vincent Courboulay, Jean-Marc Ogier
2013 B conf
ACM Symposium on Document Engineering
Benjamin Duthil, Mickaël Coustaty, Vincent Courboulay, Jean-Marc Ogier
2012 conf
ICME Workshops
Matthieu Perreira Da Silva, Vincent Courboulay, Patrick Le Callet
2012 B conf
ACIVS
Dounia Awad, Vincent Courboulay, Arnaud Revel
2011 B conf
ICIP
Matthieu Perreira Da Silva, Vincent Courboulay, Pascal Estraillier
2011 J jnl
Traitement du Signal
Matthieu Perreira Da Silva, Vincent Courboulay
2011 conf
EUVIP
Matthieu Perreira Da Silva, Vincent Courboulay, Pascal Estraillier
2010 conf
EGC (best of volume)
Mickaël Coustaty, Vincent Courboulay, Jean-Marc Ogier
2010 conf
EGC
Mickaël Coustaty, Giap Nguyen, Vincent Courboulay, Jean-Marc Ogier
2010 conf
VISAPP (2)
Matthieu Perreira Da Silva, Vincent Courboulay, Armelle Prigent, Pascal Estraillier
2009 J jnl
Int. J. Intell. Games Simul.
Nicolas Rempulsky, Armelle Prigent, Pascal Estraillier, Vincent Courboulay, Matthieu Perreira Da Silva
2009 J jnl
PsychNology J.
Matthieu Perreira Da Silva, Vincent Courboulay, Armelle Prigent, Pascal Estraillier
2008 C conf
ICVS
Matthieu Perreira Da Silva, Vincent Courboulay, Armelle Prigent, Pascal Estraillier
2007 conf
ICINCO-RA (2)
Aymeric Histace, Vincent Courboulay, Michel Ménard
2006 A conf
ASSETS
A. Ould Mohamed, Vincent Courboulay, Karim Sehaba, Michel Ménard
2005 conf
FIMH
Aymeric Histace, Christine Cavaro-Ménard, Vincent Courboulay, Michel Ménard
2003 J jnl
Pattern Recognit.
Michel Ménard, Vincent Courboulay, Pierre-André Dardignac
2002 B conf
FUZZ-IEEE
Vincent Courboulay, Michel Ménard, Michel Eboueya, Pierre Courtellemont, Régis Vaillant, Damien Coisne
2002
Vincent Courboulay
2001 B conf
Image Processing
Vincent Courboulay, Michel Eboueya, Michel Ménard, Pierre Courtellemont, Régis Vaillant, Damien Coisne
2000 B conf
ICPR
Michel Ménard, Pierre-André Dardignac, Vincent Courboulay
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"