-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
PatchObfuscator.java
34 lines (29 loc) · 1.15 KB
/
PatchObfuscator.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package me.nallar.tickthreading.patcher;
import javax.xml.transform.TransformerException;
import java.io.File;
import java.io.IOException;
import me.nallar.tickthreading.Log;
import me.nallar.tickthreading.mcp.MCPMappings;
import me.nallar.tickthreading.mcp.Mappings;
import org.xml.sax.SAXException;
public class PatchObfuscator {
public static void main(String[] args) {
String mcpConfigPath = args.length > 0 ? args[1] : "build/forge/mcp/conf";
String inputPatchPath = args.length > 1 ? args[2] : "resources/patches-unobfuscated.xml";
String outputPatchPath = args.length > 2 ? args[3] : "resources/patches.xml";
try {
Mappings mcpMappings = new MCPMappings(new File(mcpConfigPath));
PatchConfig patchConfig = new PatchConfig(new File(inputPatchPath), Patches.class);
try {
patchConfig.obfuscate(mcpMappings);
patchConfig.save(new File(outputPatchPath));
} catch (TransformerException e) {
Log.severe("Failed to save obfuscated patch");
}
} catch (IOException e) {
Log.severe("Failed to read input file", e);
} catch (SAXException e) {
Log.severe("Failed to parse input file", e);
}
}
}