mirror of
https://github.com/revanced/Apktool.git
synced 2025-04-30 22:24:25 +02:00
Androlib: using SmaliDecoder and SmaliBuilder instead of AndrolibSmali.
This commit is contained in:
parent
060572e824
commit
2891abf96b
@ -21,6 +21,8 @@ import brut.androlib.java.AndrolibJava;
|
|||||||
import brut.androlib.res.AndrolibResources;
|
import brut.androlib.res.AndrolibResources;
|
||||||
import brut.androlib.res.data.ResTable;
|
import brut.androlib.res.data.ResTable;
|
||||||
import brut.androlib.res.util.ExtFile;
|
import brut.androlib.res.util.ExtFile;
|
||||||
|
import brut.androlib.src.SmaliBuilder;
|
||||||
|
import brut.androlib.src.SmaliDecoder;
|
||||||
import brut.common.BrutException;
|
import brut.common.BrutException;
|
||||||
import brut.directory.*;
|
import brut.directory.*;
|
||||||
import brut.util.BrutIO;
|
import brut.util.BrutIO;
|
||||||
@ -33,7 +35,6 @@ import java.util.logging.Logger;
|
|||||||
*/
|
*/
|
||||||
public class Androlib {
|
public class Androlib {
|
||||||
private final AndrolibResources mAndRes = new AndrolibResources();
|
private final AndrolibResources mAndRes = new AndrolibResources();
|
||||||
private final AndrolibSmali mSmali = new AndrolibSmali();
|
|
||||||
|
|
||||||
public ResTable getResTable(ExtFile apkFile) throws AndrolibException {
|
public ResTable getResTable(ExtFile apkFile) throws AndrolibException {
|
||||||
LOGGER.info("Decoding resource table...");
|
LOGGER.info("Decoding resource table...");
|
||||||
@ -60,7 +61,7 @@ public class Androlib {
|
|||||||
OS.rmdir(smaliDir);
|
OS.rmdir(smaliDir);
|
||||||
smaliDir.mkdirs();
|
smaliDir.mkdirs();
|
||||||
LOGGER.info("Baksmaling...");
|
LOGGER.info("Baksmaling...");
|
||||||
mSmali.baksmali(apkFile, smaliDir);
|
SmaliDecoder.decode(apkFile, smaliDir, false);
|
||||||
} catch (BrutException ex) {
|
} catch (BrutException ex) {
|
||||||
throw new AndrolibException(ex);
|
throw new AndrolibException(ex);
|
||||||
}
|
}
|
||||||
@ -155,7 +156,7 @@ public class Androlib {
|
|||||||
|
|
||||||
public boolean buildSourcesSmali(File appDir, boolean forceBuildAll)
|
public boolean buildSourcesSmali(File appDir, boolean forceBuildAll)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
File smaliDir = new File(appDir, "smali");
|
ExtFile smaliDir = new ExtFile(appDir, "smali");
|
||||||
if (! smaliDir.exists()) {
|
if (! smaliDir.exists()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -166,7 +167,7 @@ public class Androlib {
|
|||||||
if (forceBuildAll || isModified(smaliDir, dex)) {
|
if (forceBuildAll || isModified(smaliDir, dex)) {
|
||||||
LOGGER.info("Smaling...");
|
LOGGER.info("Smaling...");
|
||||||
dex.delete();
|
dex.delete();
|
||||||
mSmali.smali(smaliDir, dex);
|
SmaliBuilder.build(smaliDir, dex, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user