Class JarMapping

java.lang.Object
net.md_5.specialsource.JarMapping

public class JarMapping extends Object
  • Field Details

  • Constructor Details

    • JarMapping

      public JarMapping()
    • JarMapping

      public JarMapping(JarComparer oldJar, JarComparer newJar, File logFile, boolean compact) throws IOException
      Throws:
      IOException
    • JarMapping

      public JarMapping(JarComparer oldJar, JarComparer newJar, File logfile, boolean compact, boolean full) throws IOException
      Generate a mapping given an original jar and renamed jar
      Parameters:
      oldJar - Original jar
      newJar - Renamed jar
      logfile - Optional .srg file to output mappings to
      compact - If true, generate .csrg logfile instead of .srg
      full - if true, generate duplicates
      Throws:
      IOException
  • Method Details

    • setInheritanceMap

      public void setInheritanceMap(InheritanceMap inheritanceMap)
      Set the inheritance map used for caching superclass/interfaces. This call be omitted to use a local cache, or set to your own global cache.
    • setFallbackInheritanceProvider

      public void setFallbackInheritanceProvider(InheritanceProvider fallbackInheritanceProvider)
      Set the inheritance provider to be consulted if the inheritance map has no information on the requested class (results will be cached in the inheritance map).
    • addExcludedPackage

      public void addExcludedPackage(String packageName)
      Add a class name prefix to the mapping ignore list. Note: this only applies before loading mappings, not after
    • tryClimb

      public String tryClimb(Map<String,String> map, NodeType type, String owner, String name, String desc, int access)
    • loadMappings

      public void loadMappings(File file) throws IOException
      Throws:
      IOException
    • loadMappings

      public void loadMappings(InputStream stream) throws IOException
      Throws:
      IOException
    • loadMappings

      public void loadMappings(String filename, boolean reverse, boolean numericSrgNames, String inShadeRelocation, String outShadeRelocation) throws IOException
      Parameters:
      filename - A filename of a .srg/.csrg or an MCP directory of .srg+.csv, local or remote
      reverse - Swap input and output mappings
      numericSrgNames - When reading mapping directory, load numeric "srg" instead obfuscated names
      inShadeRelocation - Apply relocation on mapping input
      outShadeRelocation - Apply relocation on mapping output
      Throws:
      IOException
    • loadMappings

      public void loadMappings(BufferedReader reader, MappingTransformer inputTransformer, MappingTransformer outputTransformer, boolean reverse) throws IOException
      Load a mapping given a .csrg file
      Parameters:
      reader - Mapping file reader
      inputTransformer - Transformation to apply on input
      outputTransformer - Transformation to apply on output
      reverse - Swap input and output mappings (after applying any input/output transformations)
      Throws:
      IOException