mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-06 10:05:54 +01:00
From now there is no need to use -s/-r switch, when apk doesn't contain sources/resources.
This commit is contained in:
parent
f07aae158a
commit
25ec196cfa
@ -53,10 +53,8 @@ public class Androlib {
|
||||
LOGGER.warning("Debug mode not available.");
|
||||
}
|
||||
Directory apk = apkFile.getDirectory();
|
||||
if (apk.containsFile("classes.dex")) {
|
||||
LOGGER.info("Copying raw classes.dex file...");
|
||||
apkFile.getDirectory().copyToDir(outDir, "classes.dex");
|
||||
}
|
||||
LOGGER.info("Copying raw classes.dex file...");
|
||||
apkFile.getDirectory().copyToDir(outDir, "classes.dex");
|
||||
} catch (DirectoryException ex) {
|
||||
throw new AndrolibException(ex);
|
||||
}
|
||||
@ -85,11 +83,8 @@ public class Androlib {
|
||||
throws AndrolibException {
|
||||
try {
|
||||
Directory apk = apkFile.getDirectory();
|
||||
if (apk.containsFile("resources.arsc")) {
|
||||
LOGGER.info("Copying raw resources...");
|
||||
apkFile.getDirectory().copyToDir(
|
||||
outDir, APK_RESOURCES_FILENAMES);
|
||||
}
|
||||
LOGGER.info("Copying raw resources...");
|
||||
apkFile.getDirectory().copyToDir(outDir, APK_RESOURCES_FILENAMES);
|
||||
} catch (DirectoryException ex) {
|
||||
throw new AndrolibException(ex);
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ package brut.androlib;
|
||||
import brut.androlib.res.data.ResTable;
|
||||
import brut.androlib.res.util.ExtFile;
|
||||
import brut.common.BrutException;
|
||||
import brut.directory.Directory;
|
||||
import brut.directory.DirectoryException;
|
||||
import brut.util.OS;
|
||||
import java.io.File;
|
||||
|
||||
@ -61,24 +63,36 @@ public class ApkDecoder {
|
||||
}
|
||||
outDir.mkdirs();
|
||||
|
||||
switch (mDecodeSources) {
|
||||
case DECODE_SOURCES_NONE:
|
||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, mDebug);
|
||||
break;
|
||||
case DECODE_SOURCES_SMALI:
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, mDebug);
|
||||
break;
|
||||
case DECODE_SOURCES_JAVA:
|
||||
mAndrolib.decodeSourcesJava(mApkFile, outDir, mDebug);
|
||||
break;
|
||||
Directory apk = null;
|
||||
try {
|
||||
apk = mApkFile.getDirectory();
|
||||
} catch (DirectoryException ex) {
|
||||
throw new AndrolibException(ex);
|
||||
}
|
||||
switch (mDecodeResources) {
|
||||
case DECODE_RESOURCES_NONE:
|
||||
mAndrolib.decodeResourcesRaw(mApkFile, outDir);
|
||||
break;
|
||||
case DECODE_RESOURCES_FULL:
|
||||
mAndrolib.decodeResourcesFull(mApkFile, outDir, getResTable());
|
||||
break;
|
||||
|
||||
if (apk.containsFile("classes.dex")) {
|
||||
switch (mDecodeSources) {
|
||||
case DECODE_SOURCES_NONE:
|
||||
mAndrolib.decodeSourcesRaw(mApkFile, outDir, mDebug);
|
||||
break;
|
||||
case DECODE_SOURCES_SMALI:
|
||||
mAndrolib.decodeSourcesSmali(mApkFile, outDir, mDebug);
|
||||
break;
|
||||
case DECODE_SOURCES_JAVA:
|
||||
mAndrolib.decodeSourcesJava(mApkFile, outDir, mDebug);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (apk.containsFile("resources.arsc")) {
|
||||
switch (mDecodeResources) {
|
||||
case DECODE_RESOURCES_NONE:
|
||||
mAndrolib.decodeResourcesRaw(mApkFile, outDir);
|
||||
break;
|
||||
case DECODE_RESOURCES_FULL:
|
||||
mAndrolib.decodeResourcesFull(mApkFile, outDir,
|
||||
getResTable());
|
||||
break;
|
||||
}
|
||||
}
|
||||
mAndrolib.decodeRawFiles(mApkFile, outDir);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user