Exclude signature files (.DSA, .SF) from remapped jar
The remapped jar is altered and will fail to validate against the included signatures from the original jar, if any. Normally not a problem, you can compile against the remapped jar as a library with no errors. However, when loading the jar from Maven (hit with the Forge jar), signature validation will fail. Stripping the signature files fixes this.
This commit is contained in:
parent
3decd36620
commit
e6addcde3b
@ -113,14 +113,18 @@ public class JarRemapper extends Remapper {
|
||||
try {
|
||||
byte[] data;
|
||||
if (name.endsWith(".class")) {
|
||||
// remap classes
|
||||
name = name.substring(0, name.length() - CLASS_LEN);
|
||||
|
||||
data = remapClassFile(is);
|
||||
String newName = map(name);
|
||||
|
||||
entry = new JarEntry(newName == null ? name : newName + ".class");
|
||||
|
||||
} else if (name.endsWith(".DSA") || name.endsWith(".SF")) {
|
||||
// skip signatures
|
||||
continue;
|
||||
} else {
|
||||
// copy other resources
|
||||
entry = new JarEntry(name);
|
||||
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
|
Loading…
Reference in New Issue
Block a user