Optimizations of NodeTransformer.

This commit is contained in:
zaxar163 2018-12-08 10:54:43 +03:00
parent 2a9e1258b5
commit 19cbc8ba8e
5 changed files with 3 additions and 13 deletions

View file

@ -105,8 +105,6 @@ public static final class Config extends ConfigObject {
public final String projectName;
public final String whitelistRejectString;
public final boolean genMappings;
public final boolean isUsingWrapper;
public final boolean isDownloadJava;
@ -150,7 +148,6 @@ private Config(BlockConfigEntry block, Path coredir, LaunchServer server) {
block.getEntry("hwidHandlerConfig", BlockConfigEntry.class));
// Set misc config
genMappings = block.getEntryValue("proguardPrintMappings", BooleanConfigEntry.class);
mirrors = block.getEntry("mirrors", ListConfigEntry.class);
launch4j = new ExeConf(block.getEntry("launch4J", BlockConfigEntry.class));
buildPostTransform = new PostBuildTransformConf(block.getEntry("buildExtendedOperation", BlockConfigEntry.class), coredir);

View file

@ -38,7 +38,7 @@ public ProguardConf(LaunchServer srv) {
words = proguard.resolve("random.pro");
confStrs = new ArrayList<>();
prepare(false);
if (srv.config.genMappings) confStrs.add("-printmapping \'" + mappings.toFile().getName() + "\'");
confStrs.add("-printmapping \'" + mappings.toFile().getName() + "\'");
confStrs.add("-obfuscationdictionary \'" + words.toFile().getName() + "\'");
confStrs.add("-injar \'" + srv.dir.toAbsolutePath() + IOHelper.PLATFORM_SEPARATOR + srv.config.binaryName + "-nonObf.jar\'");
confStrs.add("-outjar \'" + srv.dir.toAbsolutePath() + IOHelper.PLATFORM_SEPARATOR + srv.config.binaryName + "-obfed.jar\'");

View file

@ -154,10 +154,6 @@ public void registerProGuardHook(Transformer hook) {
POST_PROGUARD_HOOKS.add(hook);
}
public boolean isNeedPostProguardHook() {
return POST_PROGUARD_HOOKS.size() > 1 || !POST_PROGUARDRUN_HOOKS.isEmpty() || !POST_PROGUARD_BUILDHOOKS.isEmpty() || !proguardNoder.getTransLst().isEmpty();
}
public void registerPreHook(BuildHook hook) {
PRE_HOOKS.add(hook);
}

View file

@ -31,9 +31,9 @@ public NodeTransformer() {
public byte[] transform(byte[] input, String classname, JARLauncherBinary data) {
ClassReader cr = new ClassReader(input);
ClassNode cn = new ClassNode();
cr.accept(cn, ClassReader.SKIP_DEBUG);
cr.accept(cn, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
for (ClassNodeTransformer tr : transLst) tr.transform(cn, classname, data);
ClassWriter cw = new SafeClassWriter(data.reader, ClassWriter.COMPUTE_MAXS);
ClassWriter cw = new SafeClassWriter(data.reader, ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
cn.accept(cw);
return cw.toByteArray();
}

View file

@ -13,9 +13,6 @@ isDownloadJava: false;
# White list testers
whitelistRejectString: "Вас нет в белом списке";
# Proguard
proguardPrintMappings: false;
# Auth handler
authHandler: "textFile";
authHandlerConfig: {