mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 12:20:11 +02:00
Fix issues with initialization of bootClassPath and inlineResolver
This commit is contained in:
parent
60ab9b199c
commit
74436bdd2f
@ -32,6 +32,7 @@ import com.google.common.collect.Lists;
|
|||||||
import org.apache.commons.cli.*;
|
import org.apache.commons.cli.*;
|
||||||
import org.jf.dexlib2.DexFileFactory;
|
import org.jf.dexlib2.DexFileFactory;
|
||||||
import org.jf.dexlib2.analysis.CustomInlineMethodResolver;
|
import org.jf.dexlib2.analysis.CustomInlineMethodResolver;
|
||||||
|
import org.jf.dexlib2.analysis.InlineMethodResolver;
|
||||||
import org.jf.dexlib2.dexbacked.DexBackedDexFile;
|
import org.jf.dexlib2.dexbacked.DexBackedDexFile;
|
||||||
import org.jf.dexlib2.dexbacked.DexBackedOdexFile;
|
import org.jf.dexlib2.dexbacked.DexBackedOdexFile;
|
||||||
import org.jf.util.ConsoleUtil;
|
import org.jf.util.ConsoleUtil;
|
||||||
@ -99,9 +100,9 @@ public class main {
|
|||||||
boolean disassemble = true;
|
boolean disassemble = true;
|
||||||
boolean doDump = false;
|
boolean doDump = false;
|
||||||
String dumpFileName = null;
|
String dumpFileName = null;
|
||||||
|
boolean setBootClassPath = false;
|
||||||
|
|
||||||
String[] remainingArgs = commandLine.getArgs();
|
String[] remainingArgs = commandLine.getArgs();
|
||||||
|
|
||||||
Option[] clOptions = commandLine.getOptions();
|
Option[] clOptions = commandLine.getOptions();
|
||||||
|
|
||||||
for (int i=0; i<clOptions.length; i++) {
|
for (int i=0; i<clOptions.length; i++) {
|
||||||
@ -181,6 +182,7 @@ public class main {
|
|||||||
if (bcp != null && bcp.charAt(0) == ':') {
|
if (bcp != null && bcp.charAt(0) == ':') {
|
||||||
options.addExtraClassPath(bcp);
|
options.addExtraClassPath(bcp);
|
||||||
} else {
|
} else {
|
||||||
|
setBootClassPath = true;
|
||||||
options.setBootClassPath(bcp);
|
options.setBootClassPath(bcp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -250,15 +252,19 @@ public class main {
|
|||||||
options.deodex = false;
|
options.deodex = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!setBootClassPath && (options.deodex || options.registerInfo != 0)) {
|
||||||
if ((options.deodex || options.registerInfo != 0) && options.bootClassPathEntries == null) {
|
|
||||||
if (dexFile instanceof DexBackedOdexFile) {
|
if (dexFile instanceof DexBackedOdexFile) {
|
||||||
((DexBackedOdexFile)dexFile).getDependencies();
|
options.bootClassPathEntries = ((DexBackedOdexFile)dexFile).getDependencies();
|
||||||
} else {
|
} else {
|
||||||
options.bootClassPathEntries = getDefaultBootClassPathForApi(options.apiLevel);
|
options.bootClassPathEntries = getDefaultBootClassPathForApi(options.apiLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.inlineResolver == null && dexFile instanceof DexBackedOdexFile) {
|
||||||
|
options.inlineResolver =
|
||||||
|
InlineMethodResolver.createInlineMethodResolver(((DexBackedOdexFile)dexFile).getOdexVersion());
|
||||||
|
}
|
||||||
|
|
||||||
boolean errorOccurred = false;
|
boolean errorOccurred = false;
|
||||||
if (disassemble) {
|
if (disassemble) {
|
||||||
errorOccurred = !baksmali.disassembleDexFile(dexFile, options);
|
errorOccurred = !baksmali.disassembleDexFile(dexFile, options);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user