mirror of
https://github.com/revanced/Apktool.git
synced 2024-09-04 13:35:44 +02: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);
|
||||
}
|
||||
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")) {
|
||||
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 {
|
||||
try {
|
||||
File smaliDir;
|
||||
@ -93,7 +93,7 @@ public class Androlib {
|
||||
OS.rmdir(smaliDir);
|
||||
smaliDir.mkdirs();
|
||||
LOGGER.info("Baksmaling " + filename + "...");
|
||||
SmaliDecoder.decode(apkFile, smaliDir, filename, bakdeb, api);
|
||||
SmaliDecoder.decode(apkFile, smaliDir, filename, bakDeb, apiLevel);
|
||||
} catch (BrutException ex) {
|
||||
throw new AndrolibException(ex);
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ public class ApkDecoder {
|
||||
mOutDir = outDir;
|
||||
}
|
||||
|
||||
public void setApi(int api) {
|
||||
mApi = api;
|
||||
public void setApiLevel(int apiLevel) {
|
||||
mApiLevel = apiLevel;
|
||||
}
|
||||
|
||||
public void decode() throws AndrolibException, IOException, DirectoryException {
|
||||
@ -142,7 +142,7 @@ public class ApkDecoder {
|
||||
break;
|
||||
case DECODE_SOURCES_SMALI:
|
||||
case DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES:
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, "classes.dex", mBakDeb, mApi);
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, "classes.dex", mBakDeb, mApiLevel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -158,11 +158,11 @@ public class ApkDecoder {
|
||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
||||
break;
|
||||
case DECODE_SOURCES_SMALI:
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApi);
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApiLevel);
|
||||
break;
|
||||
case DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES:
|
||||
if (file.startsWith("classes") && file.endsWith(".dex")) {
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApi);
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, file, mBakDeb, mApiLevel);
|
||||
} else {
|
||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, file);
|
||||
}
|
||||
@ -235,12 +235,12 @@ public class ApkDecoder {
|
||||
|
||||
Map<String, String> sdkInfo = mResTable.getSdkInfo();
|
||||
if (sdkInfo.get("targetSdkVersion") != null) {
|
||||
mApi = Integer.parseInt(sdkInfo.get("targetSdkVersion"));
|
||||
mApiLevel = Integer.parseInt(sdkInfo.get("targetSdkVersion"));
|
||||
}
|
||||
}
|
||||
|
||||
public void setBaksmaliDebugMode(boolean bakdeb) {
|
||||
mBakDeb = bakdeb;
|
||||
public void setBaksmaliDebugMode(boolean bakDeb) {
|
||||
mBakDeb = bakDeb;
|
||||
}
|
||||
|
||||
public void setForceDelete(boolean forceDelete) {
|
||||
@ -471,5 +471,5 @@ public class ApkDecoder {
|
||||
private boolean mBakDeb = true;
|
||||
private Collection<String> mUncompressedFiles;
|
||||
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 File mDexFile;
|
||||
private int mApiLevel = 0;
|
||||
private final int mApiLevel;
|
||||
|
||||
private final static Logger LOGGER = Logger.getLogger(SmaliBuilder.class.getName());
|
||||
}
|
||||
|
@ -31,17 +31,17 @@ import java.io.IOException;
|
||||
|
||||
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 {
|
||||
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;
|
||||
mOutDir = outDir;
|
||||
mDexFile = dexName;
|
||||
mBakDeb = bakdeb;
|
||||
mApi = api;
|
||||
mBakDeb = bakDeb;
|
||||
mApiLevel = apiLevel;
|
||||
}
|
||||
|
||||
private void decode() throws AndrolibException {
|
||||
@ -67,7 +67,7 @@ public class SmaliDecoder {
|
||||
}
|
||||
|
||||
// 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;
|
||||
DexBackedDexFile dexFile;
|
||||
|
||||
@ -105,5 +105,5 @@ public class SmaliDecoder {
|
||||
private final File mOutDir;
|
||||
private final String mDexFile;
|
||||
private final boolean mBakDeb;
|
||||
private final int mApi;
|
||||
private final int mApiLevel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user