mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-20 15:36:47 +01:00
adapt SmaliDecoder to dexlib2
This commit is contained in:
parent
7904ec2a7c
commit
570eaa7023
@ -18,8 +18,10 @@ package brut.androlib.src;
|
|||||||
|
|
||||||
import brut.androlib.AndrolibException;
|
import brut.androlib.AndrolibException;
|
||||||
import org.jf.baksmali.baksmali;
|
import org.jf.baksmali.baksmali;
|
||||||
import org.jf.dexlib.Code.Analysis.ClassPath;
|
import org.jf.baksmali.baksmaliOptions;
|
||||||
import org.jf.dexlib.DexFile;
|
import org.jf.dexlib2.DexFileFactory;
|
||||||
|
import org.jf.dexlib2.analysis.ClassPath;
|
||||||
|
import org.jf.dexlib2.DexFileFactory;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
@ -54,10 +56,24 @@ public class SmaliDecoder {
|
|||||||
private void decode() throws AndrolibException {
|
private void decode() throws AndrolibException {
|
||||||
try {
|
try {
|
||||||
ClassPath.dontLoadClassPath = mDebug;
|
ClassPath.dontLoadClassPath = mDebug;
|
||||||
baksmali.disassembleDexFile(mApkFile.getAbsolutePath(),
|
|
||||||
new DexFile(mApkFile), false, mOutDir.toAbsolutePath().toString(),
|
baksmaliOptions options = new baksmaliOptions();
|
||||||
null, null, null, false, true, true, mBakDeb, false, false,
|
|
||||||
mDebug ? org.jf.baksmali.main.DIFFPRE : 0, false, false, null, false);
|
// options
|
||||||
|
options.deodex = false;
|
||||||
|
options.outputDirectory = mOutDir.toAbsolutePath().toString();
|
||||||
|
options.noParameterRegisters = false;
|
||||||
|
options.useLocalsDirective = true;
|
||||||
|
options.useSequentialLabels = true;
|
||||||
|
options.outputDebugInfo = mBakDeb;
|
||||||
|
options.addCodeOffsets = false;
|
||||||
|
options.noAccessorComments = false;
|
||||||
|
options.registerInfo = (mDebug ? baksmaliOptions.DIFFPRE : 0);
|
||||||
|
options.ignoreErrors = false;
|
||||||
|
options.inlineResolver = null;
|
||||||
|
options.checkPackagePrivateAccess = false;
|
||||||
|
|
||||||
|
baksmali.disassembleDexFile(DexFileFactory.loadDexFile(mApkFile, 0), options);
|
||||||
|
|
||||||
if (mDebug) {
|
if (mDebug) {
|
||||||
Files.walkFileTree(mOutDir, new SmaliFileVisitor());
|
Files.walkFileTree(mOutDir, new SmaliFileVisitor());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user