mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-05 02:22:55 +01:00
style: rename vars for consistency
This commit is contained in:
parent
5599e30206
commit
bb42159880
@ -152,7 +152,7 @@ public class Main {
|
|||||||
decoder.setAnalysisMode(true, false);
|
decoder.setAnalysisMode(true, false);
|
||||||
}
|
}
|
||||||
if (cli.hasOption("api") || cli.hasOption("api-level")) {
|
if (cli.hasOption("api") || cli.hasOption("api-level")) {
|
||||||
decoder.setApi(Integer.parseInt(cli.getOptionValue("api")));
|
decoder.setApiLevel(Integer.parseInt(cli.getOptionValue("api")));
|
||||||
}
|
}
|
||||||
if (cli.hasOption("o") || cli.hasOption("output")) {
|
if (cli.hasOption("o") || cli.hasOption("output")) {
|
||||||
outDir = new File(cli.getOptionValue("o"));
|
outDir = new File(cli.getOptionValue("o"));
|
||||||
|
@ -81,7 +81,7 @@ public class Androlib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void decodeSourcesSmali(File apkFile, File outDir, String filename, boolean bakdeb, int api)
|
public void decodeSourcesSmali(File apkFile, File outDir, String filename, boolean bakDeb, int apiLevel)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
try {
|
try {
|
||||||
File smaliDir;
|
File smaliDir;
|
||||||
@ -93,7 +93,7 @@ public class Androlib {
|
|||||||
OS.rmdir(smaliDir);
|
OS.rmdir(smaliDir);
|
||||||
smaliDir.mkdirs();
|
smaliDir.mkdirs();
|
||||||
LOGGER.info("Baksmaling " + filename + "...");
|
LOGGER.info("Baksmaling " + filename + "...");
|
||||||
SmaliDecoder.decode(apkFile, smaliDir, filename, bakdeb, api);
|
SmaliDecoder.decode(apkFile, smaliDir, filename, bakDeb, apiLevel);
|
||||||
} catch (BrutException ex) {
|
} catch (BrutException ex) {
|
||||||
throw new AndrolibException(ex);
|
throw new AndrolibException(ex);
|
||||||
}
|
}
|
||||||
|
@ -71,8 +71,8 @@ public class ApkDecoder {
|
|||||||
mOutDir = outDir;
|
mOutDir = outDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setApi(int api) {
|
public void setApiLevel(int apiLevel) {
|
||||||
mApi = api;
|
mApiLevel = apiLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void decode() throws AndrolibException, IOException, DirectoryException {
|
public void decode() throws AndrolibException, IOException, DirectoryException {
|
||||||
@ -142,7 +142,7 @@ public class ApkDecoder {
|
|||||||
break;
|
break;
|
||||||
case DECODE_SOURCES_SMALI:
|
case DECODE_SOURCES_SMALI:
|
||||||
case DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES:
|
case DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES:
|
||||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, "classes.dex", mBakDeb, mApi);
|
mAndrolib.decodeSourcesSmali(mApkFile, outDir, "classes.dex", mBakDeb, mApiLevel);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,11 +158,11 @@ public class ApkDecoder {
|
|||||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
||||||
break;
|
break;
|
||||||
case DECODE_SOURCES_SMALI:
|
case DECODE_SOURCES_SMALI:
|
||||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApi);
|
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApiLevel);
|
||||||
break;
|
break;
|
||||||
case DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES:
|
case DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES:
|
||||||
if (file.startsWith("classes") && file.endsWith(".dex")) {
|
if (file.startsWith("classes") && file.endsWith(".dex")) {
|
||||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApi);
|
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApiLevel);
|
||||||
} else {
|
} else {
|
||||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
||||||
}
|
}
|
||||||
@ -235,12 +235,12 @@ public class ApkDecoder {
|
|||||||
|
|
||||||
Map<String, String> sdkInfo = mResTable.getSdkInfo();
|
Map<String, String> sdkInfo = mResTable.getSdkInfo();
|
||||||
if (sdkInfo.get("targetSdkVersion") != null) {
|
if (sdkInfo.get("targetSdkVersion") != null) {
|
||||||
mApi = Integer.parseInt(sdkInfo.get("targetSdkVersion"));
|
mApiLevel = Integer.parseInt(sdkInfo.get("targetSdkVersion"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBaksmaliDebugMode(boolean bakdeb) {
|
public void setBaksmaliDebugMode(boolean bakDeb) {
|
||||||
mBakDeb = bakdeb;
|
mBakDeb = bakDeb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setForceDelete(boolean forceDelete) {
|
public void setForceDelete(boolean forceDelete) {
|
||||||
@ -471,5 +471,5 @@ public class ApkDecoder {
|
|||||||
private boolean mBakDeb = true;
|
private boolean mBakDeb = true;
|
||||||
private Collection<String> mUncompressedFiles;
|
private Collection<String> mUncompressedFiles;
|
||||||
private boolean mAnalysisMode = false;
|
private boolean mAnalysisMode = false;
|
||||||
private int mApi = 15;
|
private int mApiLevel = 15;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public class SmaliBuilder {
|
|||||||
|
|
||||||
private final ExtFile mSmaliDir;
|
private final ExtFile mSmaliDir;
|
||||||
private final File mDexFile;
|
private final File mDexFile;
|
||||||
private int mApiLevel = 0;
|
private final int mApiLevel;
|
||||||
|
|
||||||
private final static Logger LOGGER = Logger.getLogger(SmaliBuilder.class.getName());
|
private final static Logger LOGGER = Logger.getLogger(SmaliBuilder.class.getName());
|
||||||
}
|
}
|
||||||
|
@ -31,17 +31,17 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class SmaliDecoder {
|
public class SmaliDecoder {
|
||||||
|
|
||||||
public static void decode(File apkFile, File outDir, String dexName, boolean bakdeb, int api)
|
public static void decode(File apkFile, File outDir, String dexName, boolean bakDeb, int apiLevel)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
new SmaliDecoder(apkFile, outDir, dexName, bakdeb, api).decode();
|
new SmaliDecoder(apkFile, outDir, dexName, bakDeb, apiLevel).decode();
|
||||||
}
|
}
|
||||||
|
|
||||||
private SmaliDecoder(File apkFile, File outDir, String dexName, boolean bakdeb, int api) {
|
private SmaliDecoder(File apkFile, File outDir, String dexName, boolean bakDeb, int apiLevel) {
|
||||||
mApkFile = apkFile;
|
mApkFile = apkFile;
|
||||||
mOutDir = outDir;
|
mOutDir = outDir;
|
||||||
mDexFile = dexName;
|
mDexFile = dexName;
|
||||||
mBakDeb = bakdeb;
|
mBakDeb = bakDeb;
|
||||||
mApi = api;
|
mApiLevel = apiLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void decode() throws AndrolibException {
|
private void decode() throws AndrolibException {
|
||||||
@ -67,7 +67,7 @@ public class SmaliDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create the container
|
// create the container
|
||||||
MultiDexContainer<? extends DexBackedDexFile> container = DexFileFactory.loadDexContainer(mApkFile, Opcodes.forApi(mApi));
|
MultiDexContainer<? extends DexBackedDexFile> container = DexFileFactory.loadDexContainer(mApkFile, Opcodes.forApi(mApiLevel));
|
||||||
MultiDexContainer.DexEntry<? extends DexBackedDexFile> dexEntry;
|
MultiDexContainer.DexEntry<? extends DexBackedDexFile> dexEntry;
|
||||||
DexBackedDexFile dexFile;
|
DexBackedDexFile dexFile;
|
||||||
|
|
||||||
@ -105,5 +105,5 @@ public class SmaliDecoder {
|
|||||||
private final File mOutDir;
|
private final File mOutDir;
|
||||||
private final String mDexFile;
|
private final String mDexFile;
|
||||||
private final boolean mBakDeb;
|
private final boolean mBakDeb;
|
||||||
private final int mApi;
|
private final int mApiLevel;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user