md-5 / SpecialSource

Automatic generator and renamer of jar obfuscation mappings.
Other
206 stars 49 forks source link

Update source to 1.8 and add support for loading an InputStream as mappings #62

Closed BigBadE closed 2 years ago

BigBadE commented 3 years ago

The source file JarMapping.java has the following snippet: Remapper reverseMapper = new Remapper() { @Override public String map(String cls) { return clsMap.getOrDefault(cls, cls); } }; Referencing the Javadocs (https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#getOrDefault-java.lang.Object-V-), you can see that this method is marked 1.8+. This is also reflected in the JavaSE 7 Javadocs where the method isn't found (https://docs.oracle.com/javase/7/docs/api/java/util/Map.html).

Since Spigot requires Java 8 anyways, there is no reason to stay behind on Java 7.

I also added support for loading mappings via InputStream and File. This allows mappings to be loaded from a URL/URI.