mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Disable jar verification by default (#1454)
* Disable jar verification by default * Delete invalid jars * Fix? * Fix?
This commit is contained in:
@@ -122,7 +122,7 @@ public abstract class MinecraftProvider {
|
||||
}
|
||||
|
||||
private void verifyJars() throws IOException, SignatureVerificationFailure {
|
||||
if (GradleUtils.getBooleanProperty(getProject(), Constants.Properties.DISABLE_MINECRAFT_VERIFICATION)) {
|
||||
if (!GradleUtils.getBooleanProperty(getProject(), Constants.Properties.ENABLE_MINECRAFT_VERIFICATION)) {
|
||||
LOGGER.info("Skipping Minecraft jar verification!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
package net.fabricmc.loom.configuration.providers.minecraft.verify;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -72,6 +73,13 @@ public abstract class MinecraftJarVerification {
|
||||
}
|
||||
|
||||
LOGGER.error("Verification of Minecraft {} signature failed: {}", path.getFileName(), e.getMessage());
|
||||
|
||||
try {
|
||||
Files.delete(path);
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.error("Failed to delete invalid Minecraft jar: {}", path, ioe);
|
||||
}
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class Constants {
|
||||
/**
|
||||
* Skip the signature verification of the Minecraft jar after downloading it.
|
||||
*/
|
||||
public static final String DISABLE_MINECRAFT_VERIFICATION = "fabric.loom.disableMinecraftVerification";
|
||||
public static final String ENABLE_MINECRAFT_VERIFICATION = "fabric.loom.enableMinecraftVerification";
|
||||
/**
|
||||
* When using the MojangMappingLayer this will remove names for non root methods by using the intermediary mappings.
|
||||
*/
|
||||
|
||||
@@ -109,7 +109,11 @@ public final class GradleUtils {
|
||||
}
|
||||
|
||||
public static boolean getBooleanProperty(Project project, String key) {
|
||||
return getBooleanPropertyProvider(project, key).getOrElse(false);
|
||||
return getBooleanProperty(project, key, false);
|
||||
}
|
||||
|
||||
public static boolean getBooleanProperty(Project project, String key, boolean defaultValue) {
|
||||
return getBooleanPropertyProvider(project, key).getOrElse(defaultValue);
|
||||
}
|
||||
|
||||
public static Object getProperty(Project project, String key) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
fabric.loom.enableMinecraftVerification=true
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
|
||||
Reference in New Issue
Block a user