diff --git a/baksmali/src/main/java/org/jf/baksmali/AnalysisArguments.java b/baksmali/src/main/java/org/jf/baksmali/AnalysisArguments.java index 1d1904ef..d5286a12 100644 --- a/baksmali/src/main/java/org/jf/baksmali/AnalysisArguments.java +++ b/baksmali/src/main/java/org/jf/baksmali/AnalysisArguments.java @@ -32,6 +32,7 @@ package org.jf.baksmali; import com.beust.jcommander.Parameter; +import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import org.jf.dexlib2.analysis.ClassPath; import org.jf.dexlib2.analysis.ClassPathResolver; @@ -54,10 +55,11 @@ public class AnalysisArguments { public int apiLevel = 15; @Parameter(names = {"-b", "--bootclasspath", "--bcp"}, - description = "A colon separated list of the files to include in the bootclasspath when analyzing the dex " + - "file. If not specified, baksmali will attempt to choose an " + + description = "A colon separated list of the files to include in the bootclasspath when analyzing the " + + "dex file. If not specified, baksmali will attempt to choose an " + "appropriate default. When analyzing oat files, this can simply be the path to the device's " + - "boot.oat file. See baksmali help classpath for more information.", + "boot.oat file. A single empty string can be used to specify that an empty bootclasspath should " + + "be used. (e.g. --bootclasspath \"\") See baksmali help classpath for more information.", splitter = ColonParameterSplitter.class) @ExtendedParameter(argumentNames = "classpath") public List bootClassPath = null; @@ -105,6 +107,10 @@ public class AnalysisArguments { // TODO: we should be able to get the api from the Opcodes object associated with the dexFile.. // except that the oat version -> api mapping doesn't fully work yet resolver = new ClassPathResolver(filteredClassPathDirectories, classPath, dexFile, apiLevel); + } else if (bootClassPath.size() == 1 && bootClassPath.get(0).length() == 0) { + // --bootclasspath "" is a special case, denoting that no bootclasspath should be used + resolver = new ClassPathResolver( + ImmutableList.of(), ImmutableList.of(), classPath, dexFile); } else { resolver = new ClassPathResolver(filteredClassPathDirectories, bootClassPath, classPath, dexFile); }