diff --git a/scanpipe/pipelines/android_d2d.py b/scanpipe/pipelines/android_d2d.py index 9de85b96b..64a2d9995 100644 --- a/scanpipe/pipelines/android_d2d.py +++ b/scanpipe/pipelines/android_d2d.py @@ -58,13 +58,8 @@ def steps(cls): cls.collect_and_create_codebase_resources, cls.map_checksum, cls.find_java_packages, - cls.map_java_to_class, - cls.map_jar_to_source, - cls.flag_mapped_resources_archives_and_ignored_directories, - cls.remove_packages_without_resources, - cls.flag_deployed_from_resources_with_missing_license, - cls.create_local_files_packages, + cls.map_path, ) def convert_dex_to_java(self): - d2d.convert_dex_to_java(self.project) + d2d.convert_dex_to_java(self.project, to_only=True) diff --git a/scanpipe/pipes/d2d.py b/scanpipe/pipes/d2d.py index 356b1b2c2..ac064eb0c 100644 --- a/scanpipe/pipes/d2d.py +++ b/scanpipe/pipes/d2d.py @@ -1894,13 +1894,15 @@ def map_go_paths(project, logger=None): ) -def convert_dex_to_java(project): +def convert_dex_to_java(project, to_only=False): location = project.codebase_path abs_location = abspath(expanduser(location)) for top, _, files in fileutils.walk(abs_location): for f in files: if not f.endswith('.dex'): continue + if to_only and FROM in top: + continue loc = join(top, f) run_jadx(location=loc) @@ -1911,15 +1913,12 @@ def run_jadx(location): This will decompile the classes.dex file into Java source files. """ - rc, result, err = command.execute( + command.execute( cmd_loc="jadx", args=[ "-d", - f"{file_name(location)}-java", + f"{location}-out", location, ], to_files=False, ) - - if rc != 0: - raise Exception(err) diff --git a/setup.cfg b/setup.cfg index 63bc86982..ba536e1b6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -130,6 +130,7 @@ scancodeio_pipelines = analyze_docker_image = scanpipe.pipelines.docker:Docker analyze_root_filesystem_or_vm_image = scanpipe.pipelines.root_filesystem:RootFS analyze_windows_docker_image = scanpipe.pipelines.docker_windows:DockerWindows + android_d2d = scanpipe.pipelines.android_d2d:AndroidAPKDeployToDevelop collect_strings_gettext = scanpipe.pipelines.collect_strings_gettext:CollectStringsGettext collect_symbols_ctags = scanpipe.pipelines.collect_symbols_ctags:CollectSymbolsCtags collect_symbols_pygments = scanpipe.pipelines.collect_symbols_pygments:CollectSymbolsPygments