use of org.jf.baksmali.baksmaliOptions in project Apktool by iBotPeaches.
the class SmaliDecoder method decode.
private void decode() throws AndrolibException {
try {
baksmaliOptions options = new baksmaliOptions();
// options
options.deodex = false;
options.outputDirectory = mOutDir.toString();
options.noParameterRegisters = false;
options.useLocalsDirective = true;
options.useSequentialLabels = true;
options.outputDebugInfo = mBakDeb;
options.addCodeOffsets = false;
options.jobs = -1;
options.noAccessorComments = false;
options.registerInfo = 0;
options.ignoreErrors = false;
options.inlineResolver = null;
options.checkPackagePrivateAccess = false;
// set jobs automatically
options.jobs = Runtime.getRuntime().availableProcessors();
if (options.jobs > 6) {
options.jobs = 6;
}
// create the dex
DexBackedDexFile dexFile = DexFileFactory.loadDexFile(mApkFile, mDexFile, mApi, false);
if (dexFile.isOdexFile()) {
throw new AndrolibException("Warning: You are disassembling an odex file without deodexing it.");
}
if (dexFile instanceof DexBackedOdexFile) {
options.inlineResolver = InlineMethodResolver.createInlineMethodResolver(((DexBackedOdexFile) dexFile).getOdexVersion());
}
baksmali.disassembleDexFile(dexFile, options);
} catch (IOException ex) {
throw new AndrolibException(ex);
}
}
use of org.jf.baksmali.baksmaliOptions in project dex2jar by pxb1988.
the class SmaliTest method baksmali.
private static String baksmali(DexBackedClassDef def) throws IOException {
baksmaliOptions opts = new baksmaliOptions();
opts.outputDebugInfo = false;
opts.syntheticAccessorResolver = new SyntheticAccessorResolver(Collections.EMPTY_LIST);
ClassDefinition classDefinition = new ClassDefinition(opts, def);
StringWriter bufWriter = new StringWriter();
IndentingWriter writer = new IndentingWriter(bufWriter);
classDefinition.writeTo((IndentingWriter) writer);
writer.flush();
return bufWriter.toString();
}
use of org.jf.baksmali.baksmaliOptions in project atlas by alibaba.
the class SmaliDiffUtils method getBuildOption.
public static BaksmaliOptions getBuildOption(Iterable<? extends ClassDef> collection, int apiLevel) {
BaksmaliOptions options = new BaksmaliOptions();
options.deodex = false;
options.parameterRegisters = false;
options.localsDirective = true;
options.sequentialLabels = true;
options.debugInfo = true;
options.codeOffsets = false;
options.accessorComments = false;
// 128
options.registerInfo = 0;
options.inlineResolver = null;
options.apiLevel = apiLevel;
if (!options.accessorComments) {
options.syntheticAccessorResolver = new SyntheticAccessorResolver(Opcodes.getDefault(), collection);
}
return options;
}
use of org.jf.baksmali.baksmaliOptions in project atlas by alibaba.
the class SmaliUtils method createBaksmaliOptions.
/**
* 生成解析成smali代码的选项
* @return
*/
private static BaksmaliOptions createBaksmaliOptions() {
BaksmaliOptions options = new BaksmaliOptions();
options.deodex = false;
options.parameterRegisters = false;
options.localsDirective = true;
options.sequentialLabels = true;
options.debugInfo = true;
options.codeOffsets = false;
options.accessorComments = false;
// 128
options.registerInfo = 0;
options.inlineResolver = null;
options.apiLevel = DEFAULT_API_LEVEL;
return options;
}
use of org.jf.baksmali.baksmaliOptions in project atlas by alibaba.
the class SmaliCodeUtils method createBaksmaliOptions.
/**
* 生成解析成smali代码的选项
*
* @return
*/
private static BaksmaliOptions createBaksmaliOptions(ClassDef classDef) {
BaksmaliOptions options = new BaksmaliOptions();
options.deodex = false;
options.parameterRegisters = false;
options.localsDirective = true;
options.sequentialLabels = true;
options.debugInfo = false;
options.codeOffsets = false;
options.accessorComments = false;
// 128
options.registerInfo = 0;
options.inlineResolver = null;
options.apiLevel = DEFAULT_API_LEVEL;
List<ClassDef> classDefs = Lists.newArrayList();
classDefs.add(classDef);
options.syntheticAccessorResolver = new SyntheticAccessorResolver(Opcodes.getDefault(), classDefs);
return options;
}
Aggregations