From b6ea3e0aa5dccf099726681c89ae7f799adbd434 Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 24 Sep 2018 18:02:07 +0700 Subject: [PATCH] Transformer proguard hook --- .../launchserver/manangers/BuildHookManager.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/BuildHookManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/BuildHookManager.java index e2f47e4d..25caa0cc 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/BuildHookManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/BuildHookManager.java @@ -22,10 +22,6 @@ public interface PostBuildHook { public interface PreBuildHook { void build(BuildContext context); } - @FunctionalInterface - public interface ProGuardTransformHook { - byte[] transform(byte[] input, CharSequence classname); - } @FunctionalInterface public interface Transformer { @@ -34,7 +30,7 @@ public interface Transformer { private boolean BUILDRUNTIME; private final Set POST_HOOKS; - private final Set POST_PROGUARD_HOOKS; + private final Set POST_PROGUARD_HOOKS; private final Set PRE_HOOKS; private final Set CLASS_TRANSFORMER; private final Set CLASS_BLACKLIST; @@ -72,7 +68,7 @@ public byte[] classTransform(byte[] clazz, CharSequence classname) { } public byte[] proGuardClassTransform(byte[] clazz, CharSequence classname) { byte[] result = clazz; - for (ProGuardTransformHook transformer : POST_PROGUARD_HOOKS) result = transformer.transform(result, classname); + for (Transformer transformer : POST_PROGUARD_HOOKS) result = transformer.transform(result, classname); return result; } @@ -115,7 +111,7 @@ public void registerIgnoredClass(String clazz) { public void registerPostHook(PostBuildHook hook) { POST_HOOKS.add(hook); } - public void registerProGuardHook(ProGuardTransformHook hook) { + public void registerProGuardHook(Transformer hook) { POST_PROGUARD_HOOKS.add(hook); } public boolean isNeedPostProguardHook()