feat: smart input pro v2.3.11
This commit is contained in:
2
activation.conf.example
Normal file
2
activation.conf.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[SmartInput]
|
||||||
|
EQUAL,O00oOOO0
|
@@ -1,14 +1,27 @@
|
|||||||
package com.yelochick;
|
package com.yelochick;
|
||||||
|
|
||||||
|
import com.janetfilter.core.Environment;
|
||||||
|
import com.janetfilter.core.models.FilterRule;
|
||||||
import com.janetfilter.core.plugin.MyTransformer;
|
import com.janetfilter.core.plugin.MyTransformer;
|
||||||
|
import com.janetfilter.core.plugin.PluginConfig;
|
||||||
import com.janetfilter.core.plugin.PluginEntry;
|
import com.janetfilter.core.plugin.PluginEntry;
|
||||||
import com.yelochick.coolrequest.VipApiTransformer;
|
import com.yelochick.coolrequest.VipApiTransformer;
|
||||||
import com.yelochick.smartinput.OsLanguageManagerProxyTransformer;
|
import com.yelochick.smartinput.OsLanguageManagerProxyTransformer;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ActivationPlugin implements PluginEntry {
|
public class ActivationPlugin implements PluginEntry {
|
||||||
|
|
||||||
|
private List<FilterRule> smartInputRules;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Environment environment, PluginConfig config) {
|
||||||
|
smartInputRules = Collections.unmodifiableList(config.getBySection("SmartInput"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "ACTIVATION";
|
return "ACTIVATION";
|
||||||
@@ -21,9 +34,11 @@ public class ActivationPlugin implements PluginEntry {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MyTransformer> getTransformers() {
|
public List<MyTransformer> getTransformers() {
|
||||||
return Arrays.asList(
|
List<MyTransformer> transformers = new ArrayList<>();
|
||||||
new VipApiTransformer(),
|
transformers.add(new VipApiTransformer());
|
||||||
new OsLanguageManagerProxyTransformer()
|
for (FilterRule rule : smartInputRules) {
|
||||||
);
|
transformers.add(new OsLanguageManagerProxyTransformer(rule.getRule()));
|
||||||
|
}
|
||||||
|
return transformers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,9 +14,15 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||||||
*/
|
*/
|
||||||
public class OsLanguageManagerProxyTransformer implements MyTransformer {
|
public class OsLanguageManagerProxyTransformer implements MyTransformer {
|
||||||
|
|
||||||
|
private final String hookClassName;
|
||||||
|
|
||||||
|
public OsLanguageManagerProxyTransformer(String hookClassName) {
|
||||||
|
this.hookClassName = hookClassName;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getHookClassName() {
|
public String getHookClassName() {
|
||||||
return "O00oOo";
|
return hookClassName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user