mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-01 22:14:01 +03:00
Optimizations of NodeTransformer.
This commit is contained in:
parent
2a9e1258b5
commit
19cbc8ba8e
5 changed files with 3 additions and 13 deletions
|
@ -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);
|
||||
|
|
|
@ -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\'");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -13,9 +13,6 @@ isDownloadJava: false;
|
|||
# White list testers
|
||||
whitelistRejectString: "Вас нет в белом списке";
|
||||
|
||||
# Proguard
|
||||
proguardPrintMappings: false;
|
||||
|
||||
# Auth handler
|
||||
authHandler: "textFile";
|
||||
authHandlerConfig: {
|
||||
|
|
Loading…
Reference in a new issue