diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java b/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java index 7696f0f..eb8d5dc 100644 --- a/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java +++ b/src/main/java/cuchaz/enigma/command/MapSpecializedMethodsCommand.java | |||
| @@ -36,10 +36,13 @@ public class MapSpecializedMethodsCommand extends Command { | |||
| 36 | 36 | ||
| 37 | @Override | 37 | @Override |
| 38 | public void run(String... args) throws IOException, MappingParseException { | 38 | public void run(String... args) throws IOException, MappingParseException { |
| 39 | run(Paths.get(args[0]), args[1], Paths.get(args[2]), args[3], Paths.get(args[4])); | ||
| 40 | } | ||
| 41 | |||
| 42 | public static void run(Path jar, String sourceFormat, Path sourcePath, String resultFormat, Path output) throws IOException, MappingParseException { | ||
| 39 | MappingSaveParameters saveParameters = new MappingSaveParameters(MappingFileNameFormat.BY_DEOBF); | 43 | MappingSaveParameters saveParameters = new MappingSaveParameters(MappingFileNameFormat.BY_DEOBF); |
| 40 | EntryTree<EntryMapping> source = MappingCommandsUtil.read(args[1], Paths.get(args[2]), saveParameters); | 44 | EntryTree<EntryMapping> source = MappingCommandsUtil.read(sourceFormat, sourcePath, saveParameters); |
| 41 | EntryTree<EntryMapping> result = new HashEntryTree<>(); | 45 | EntryTree<EntryMapping> result = new HashEntryTree<>(); |
| 42 | Path jar = Paths.get(args[0]); | ||
| 43 | ClassCache classCache = ClassCache.of(jar); | 46 | ClassCache classCache = ClassCache.of(jar); |
| 44 | JarIndex jarIndex = classCache.index(ProgressListener.none()); | 47 | JarIndex jarIndex = classCache.index(ProgressListener.none()); |
| 45 | BridgeMethodIndex bridgeMethodIndex = jarIndex.getBridgeMethodIndex(); | 48 | BridgeMethodIndex bridgeMethodIndex = jarIndex.getBridgeMethodIndex(); |
| @@ -60,8 +63,7 @@ public class MapSpecializedMethodsCommand extends Command { | |||
| 60 | result.insert(specialized, new EntryMapping(name)); | 63 | result.insert(specialized, new EntryMapping(name)); |
| 61 | } | 64 | } |
| 62 | 65 | ||
| 63 | Path output = Paths.get(args[4]); | ||
| 64 | Utils.delete(output); | 66 | Utils.delete(output); |
| 65 | MappingCommandsUtil.write(result, args[3], output, saveParameters); | 67 | MappingCommandsUtil.write(result, resultFormat, output, saveParameters); |
| 66 | } | 68 | } |
| 67 | } | 69 | } |