Olga Barinova

26 papers A* 3A 2Misc 1Journal 12Unranked 8
YearRankTypeTitle / Venue / Authors
2020 A* conf
CVPR
Konstantin Sofiiuk, Ilia A. Petrov, Olga Barinova, Anton Konushin
2020 conf
S+SSPR
Danila Rukhovich, Konstantin Sofiiuk, Danil Galeev, Olga Barinova, Anton Konushin
2020 J jnl
CoRR
Danila Rukhovich, Konstantin Sofiiuk, Danil Galeev, Olga Barinova, Anton Konushin
2020 conf
S+SSPR
Danil Galeev, Konstantin Sofiiuk, Danila Rukhovich, Mikhail Romanov, Olga Barinova, Anton Konushin
2020 J jnl
CoRR
Danil Galeev, Konstantin Sofiiuk, Danila Rukhovich, Mikhail Romanov, Olga Barinova, Anton Konushin
2020 conf
VSIP
Igor Slinko, Anna Vorontsova, Dmitry Zhukov, Olga Barinova, Anton Konushin
2020 J jnl
CoRR
Konstantin Sofiiuk, Ilia A. Petrov, Olga Barinova, Anton Konushin
2019 A* conf
ICCV
Konstantin Sofiiuk, Olga Barinova, Anton Konushin
2019 J jnl
CoRR
Konstantin Sofiiuk, Olga Barinova, Anton Konushin
2019 A conf
IROS
Pavel Kirsanov, Anton Konushin, Airat Gaskarov, Filipp Konokhov, Konstantin Sofiiuk, Anna Vorontsova, Igor Slinko, Dmitry Zhukov, Sergey Bykov, Olga Barinova
2019 J jnl
CoRR
Pavel Kirsanov, Airat Gaskarov, Filipp Konokhov, Konstantin Sofiiuk, Anna Vorontsova, Igor Slinko, Dmitry Zhukov, Sergey Bykov, Olga Barinova, Anton Konushin
2019 Misc conf
MVA
David Prokhorov, Dmitry Zhukov, Olga Barinova, Anton Konushin, Anna Vorontsova
2019 J jnl
CoRR
David Prokhorov, Dmitry Zhukov, Olga Barinova, Anna Vorontsova, Anton Konushin
2019 J jnl
CoRR
Igor Slinko, Anna Vorontsova, Filipp Konokhov, Olga Barinova, Anton Konushin
2019 J jnl
CoRR
Igor Slinko, Anna Vorontsova, Dmitry Zhukov, Olga Barinova, Anton Konushin
2015 J jnl
Int. J. Document Anal. Recognit.
Sergey Milyaev, Olga Barinova, Tatiana Novikova, Pushmeet Kohli, Victor S. Lempitsky
2013 A conf
ICDAR
Sergey Milyaev, Olga Barinova, Tatiana Novikova, Pushmeet Kohli, Victor S. Lempitsky
2013 J jnl
Trans. Comput. Sci.
Sergey Milyaev, Olga Barinova
2012 J jnl
Int. J. Comput. Vis.
Elena Tretyak, Olga Barinova, Pushmeet Kohli, Victor S. Lempitsky
2012 conf
ECCV (6)
Tatiana Novikova, Olga Barinova, Pushmeet Kohli, Victor S. Lempitsky
2012 J jnl
IEEE Trans. Pattern Anal. Mach. Intell.
Olga Barinova, Victor S. Lempitsky, Pushmeet Kohli
2010 conf
ECCV (2)
Olga Barinova, Victor S. Lempitsky, Elena Tretiak, Pushmeet Kohli
2010 A* conf
CVPR
Olga Barinova, Victor S. Lempitsky, Pushmeet Kohli
2009 conf
MLDM
Olga Barinova, Dmitry P. Vetrov
2008 conf
ECCV (2)
Olga Barinova, Vadim Konushin, Anton Yakubenko, KeeChang Lee, Hwasup Lim, Anton Konushin
2007 conf
ECML
Alexander Vezhnevets, Olga Barinova
redb/extractors/decompiler/apk/apktool_wrapper.py
← Index redb/extractors/decompiler/apk/apktool_wrapper.py python
"""Apktool disassembler subprocess wrapper.

Manages apktool subprocess execution for smali disassembly,
following the CAPA extractor subprocess pattern.
"""

import os
import signal
import subprocess
from typing import List, Optional


class ApktoolDisassembler:
    """Subprocess wrapper for apktool smali disassembly."""

    def __init__(
        self, apktool_path: str = None, timeout: int = None, log=None
    ):
        self.apktool_path = apktool_path or os.getenv("APKTOOL_PATH", "apktool")
        self.timeout = timeout or int(os.getenv("APKTOOL_TIMEOUT", "120"))
        self.log = log

    def disassemble(self, apk_path: str, output_dir: str) -> bool:
        """Run apktool disassembly on an APK file.

        Returns True on success, False on failure.
        """
        cmd = [
            self.apktool_path,
            "d",
            "--no-res",
            "--force",
            "--output", output_dir,
            apk_path,
        ]

        try:
            process = subprocess.Popen(
                cmd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
                text=True,
                preexec_fn=os.setsid,
            )

            try:
                stdout, stderr = process.communicate(timeout=self.timeout)
                if process.returncode != 0:
                    if self.log:
                        self.log.warning(
                            f"apktool returned non-zero exit code {process.returncode}: "
                            f"{stderr[:500] if stderr else 'no stderr'}"
                        )
                    return False
                return True

            except subprocess.TimeoutExpired:
                if self.log:
                    self.log.error(
                        f"apktool timed out after {self.timeout}s"
                    )
                try:
                    os.killpg(os.getpgid(process.pid), signal.SIGTERM)
                    process.wait(timeout=3)
                except (ProcessLookupError, subprocess.TimeoutExpired):
                    try:
                        os.killpg(os.getpgid(process.pid), signal.SIGKILL)
                    except ProcessLookupError:
                        pass
                return False

        except FileNotFoundError:
            if self.log:
                self.log.error(
                    f"apktool not found at '{self.apktool_path}'. "
                    "Install apktool or set APKTOOL_PATH env var."
                )
            return False
        except Exception as e:
            if self.log:
                self.log.error(f"apktool execution error: {e}")
            return False

    def get_smali_directories(self, output_dir: str) -> List[str]:
        """Return paths to all smali output directories.

        Handles multi-DEX: smali/, smali_classes2/, smali_classes3/, etc.
        """
        smali_dirs = []
        if not os.path.isdir(output_dir):
            return smali_dirs

        for entry in sorted(os.listdir(output_dir)):
            if entry == "smali" or entry.startswith("smali_classes"):
                full_path = os.path.join(output_dir, entry)
                if os.path.isdir(full_path):
                    smali_dirs.append(full_path)

        return smali_dirs