Oliver Schneider

27 papers A* 10B 1Journal 8Unranked 7
YearRankTypeTitle / Venue / Authors
2026 conf
CHI Extended Abstracts
Easa AliAbbasi, Dennis Wittchen, Yinan Li, Shihan Lu, Thomas Müller, Donald Degraen, Thomas Leimkühler, Sang Ho Yoon, Hasti Seifi, Oliver Schneider, Heather Culbertson, Jürgen Steimle, Paul Strohmeier
2026 J jnl
Int. J. Hum. Comput. Stud.
Bibhushan Raj Joshi, Ana Lucia Diaz de Leon Derby, Jennifer J. Llewellyn, Kristina Llewellyn, Jennifer Roberts-Smith, Oliver Schneider
2026 A* conf
CHI
Florian 'Floyd' Mueller, Nadia Berthouze, Misha Sra, Mar González-Franco, Henning Pohl, Susanne Boll, Richard Byrne, Arthur Caetano, Masahiko Inami, Jarrod Knibbe, Per Ola Kristensson, Xiang Li, Zhuying Li, Joe Marshall, Louise Petersen Matjeka, Minna Orvokki Nygren, Rakesh Patibanda, Sara Price, Harald Reiterer, Aryan Saini, Oliver Schneider, Ambika Shahu, Phoebe O. Toups Dugas, Don Samitha Elvitigala
2026 J jnl
CoRR
Florian 'Floyd' Mueller, Nadia Bianchi-Berthouze, Misha Sra, Mar González-Franco, Henning Pohl, Susanne Boll, Richard Byrne, Arthur Caetano, Masahiko Inami, Jarrod Knibbe, Per Ola Kristensson, Xiang Li, Zhuying Li, Joe Marshall, Louise Petersen Matjeka, Minna Orvokki Nygren, Rakesh Patibanda, Sara Price, Harald Reiterer, Aryan Saini, Oliver Schneider, Ambika Shahu, Jürgen Steimle, Phoebe O. Toups Dugas, Don Samitha Elvitigala
2026 A* conf
CHI
Ludwig Wilhelm Wall, Oliver Schneider, Daniel Vogel
2025 J jnl
ACM Trans. Comput. Hum. Interact.
Tor-Salve Dalsgaard, Oliver Schneider
2025 J jnl
IEEE Trans. Haptics
Diana Khater, Louis-Pierre Guidetti, Stuart Mansbridge, Oliver Schneider
2025 A* conf
CHI
Tianzheng Shi, Oliver Schneider
2025 A* conf
CHI
Ludwig Wilhelm Wall, Oliver Schneider, Daniel Vogel
2025 conf
CUI
Anchit Mishra, Oliver Schneider
2024 conf
CHI Extended Abstracts
Bibhushan Raj Joshi, Sandeep Zechariah George Kollannur, Anchit Mishra, Tommy Nguyen, Oliver Schneider
2024 conf
CHI PLAY (Companion)
Ali Haider Rizvi, Oliver Schneider, Mark Hancock
2024 J jnl
IEEE Trans. Haptics
Karthikan Theivendran, Andy Wu, William Frier, Oliver Schneider
2024 conf
CHI Extended Abstracts
Ludwig Wilhelm Wall, Oliver Schneider, Daniel Vogel
2023 A* conf
CHI
Ahmed Anwar, Tianzheng Shi, Oliver Schneider
2023 A* conf
ICRA
Abhinav Dahiya, Yifan Cai, Oliver Schneider, Stephen L. Smith
2023 J jnl
CoRR
Abhinav Dahiya, Yifan Cai, Oliver Schneider, Stephen L. Smith
2023 A* conf
UIST
Ludwig Wilhelm Wall, Oliver Schneider, Daniel Vogel
2022 ed.
EuroHaptics
Hasti Seifi, Astrid M. L. Kappers, Oliver Schneider, Knut Drewing, Claudio Pacchierotti, Alireza Abbasi Moshaii, Gijs Huisman, Thorsten Alexander Kern
2022 conf
CHI Extended Abstracts
Oliver Schneider, Bruno Fruchard, Dennis Wittchen, Bibhushan Raj Joshi, Georg Freitag, Donald Degraen, Paul Strohmeier
2022 B conf
TEI
Dennis Wittchen, Katta Spiel, Bruno Fruchard, Donald Degraen, Oliver Schneider, Georg Freitag, Paul Strohmeier
2021 A* conf
CHI
Tanay Singhal, Oliver Schneider
2021 conf
WHC
Suji Sathiyamurthy, Melody Lui, Erin Kim, Oliver Schneider
2021 J jnl
Proc. ACM Hum. Comput. Interact.
Marco Moran-Ledesma, Oliver Schneider, Mark Hancock
2020 A* conf
CHI
Erin Kim, Oliver Schneider
2020 J jnl
Frontiers Comput. Sci.
Daniel Hajas, Damien Ablart, Oliver Schneider, Marianna Obrist
2020 A* conf
CHI
Nicole Dillen, Marko Ilievski, Edith Law, Lennart E. Nacke, Krzysztof Czarnecki, Oliver Schneider
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"