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;
|
||||
|
||||
import com.janetfilter.core.Environment;
|
||||
import com.janetfilter.core.models.FilterRule;
|
||||
import com.janetfilter.core.plugin.MyTransformer;
|
||||
import com.janetfilter.core.plugin.PluginConfig;
|
||||
import com.janetfilter.core.plugin.PluginEntry;
|
||||
import com.yelochick.coolrequest.VipApiTransformer;
|
||||
import com.yelochick.smartinput.OsLanguageManagerProxyTransformer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivationPlugin implements PluginEntry {
|
||||
|
||||
private List<FilterRule> smartInputRules;
|
||||
|
||||
@Override
|
||||
public void init(Environment environment, PluginConfig config) {
|
||||
smartInputRules = Collections.unmodifiableList(config.getBySection("SmartInput"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "ACTIVATION";
|
||||
@@ -21,9 +34,11 @@ public class ActivationPlugin implements PluginEntry {
|
||||
|
||||
@Override
|
||||
public List<MyTransformer> getTransformers() {
|
||||
return Arrays.asList(
|
||||
new VipApiTransformer(),
|
||||
new OsLanguageManagerProxyTransformer()
|
||||
);
|
||||
List<MyTransformer> transformers = new ArrayList<>();
|
||||
transformers.add(new VipApiTransformer());
|
||||
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 {
|
||||
|
||||
private final String hookClassName;
|
||||
|
||||
public OsLanguageManagerProxyTransformer(String hookClassName) {
|
||||
this.hookClassName = hookClassName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookClassName() {
|
||||
return "O00oOo";
|
||||
return hookClassName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user