mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 11:49:28 +00:00
Regex inventory stays the proposer. MAP attaches promote/demote/unadjudicated/coverage from intra-file taint (tree-sitter when a grammar parses, Python ast as last resort). Deep sandboxes promotions only, ordered by the existing heuristic ranker plus optional OpenRouter mechanism recall. The SAST pair slice scores overlay outcomes; the stage-1 detection gate and local pair gate stay inventory-only.
23 lines
791 B
Python
23 lines
791 B
Python
# Provenance: SVEN train CWE-78 function pair from
|
|
# https://github.com/google/mobly/commit/3862e8ba359040fbdd6e1a6d36e51d07cda8e1ee
|
|
# file mobly/controllers/android_device_lib/adb.py function _exec_cmd
|
|
import logging
|
|
import subprocess
|
|
|
|
|
|
class AdbError(Exception):
|
|
def __init__(self, **kwargs):
|
|
super().__init__(kwargs)
|
|
|
|
|
|
class Adb:
|
|
def _exec_cmd(self, args, shell):
|
|
"""Executes adb commands."""
|
|
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
|
|
(out, err) = proc.communicate()
|
|
ret = proc.returncode
|
|
logging.debug("cmd: %s, stdout: %s, stderr: %s, ret: %s", args, out, err, ret)
|
|
if ret == 0:
|
|
return out
|
|
raise AdbError(cmd=args, stdout=out, stderr=err, ret_code=ret)
|