Restore FingerprintViolationEvent with appropriate THIS IS F*CKING DEAD DELET WARNINGS.

Also, notify in UI if using legacy JDK without capability to read out security data from mod jars.

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw committed 2020-10-26 07:31:49 -04:00
1 parent ae160cad12
commit 80baad974e
5 files changed
+71 -2

No files matched your search

@@ -31,7 +31,9 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import com.mojang.blaze3d.matrix.MatrixStack;
import cpw.mods.modlauncher.Environment;
import net.minecraft.util.text.*;
import net.minecraftforge.fml.loading.FMLEnvironment;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -461,8 +463,12 @@ public class ModListScreen extends Screen
lines.add(null);
lines.add(selectedMod.getDescription());
lines.add(null);
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.signature", selectedMod.getOwningFile().getCodeSigningFingerprint().orElse(ForgeI18n.parseMessage("fml.menu.mods.info.signature.unsigned"))));
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.trust", selectedMod.getOwningFile().getTrustData().orElse(ForgeI18n.parseMessage("fml.menu.mods.info.trust.noauthority"))));
if (FMLEnvironment.secureJarsEnabled) {
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.signature", selectedMod.getOwningFile().getCodeSigningFingerprint().orElse(ForgeI18n.parseMessage("fml.menu.mods.info.signature.unsigned"))));
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.trust", selectedMod.getOwningFile().getTrustData().orElse(ForgeI18n.parseMessage("fml.menu.mods.info.trust.noauthority"))));
} else {
lines.add(ForgeI18n.parseMessage("fml.menu.mods.info.securejardisabled"));
}
if ((vercheck.status == VersionChecker.Status.OUTDATED || vercheck.status == VersionChecker.Status.BETA_OUTDATED) && vercheck.changes.size() > 0)
{
@@ -0,0 +1,57 @@
/*
* Minecraft Forge
* Copyright (c) 2016-2020.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraftforge.fml.event.lifecycle;
import java.io.File;
import java.util.Set;
import com.google.common.collect.ImmutableSet;
import net.minecraftforge.fml.common.Mod;
/**
* DEPRECATED WITHOUT REPLACEMENT. REMOVE FROM YOUR CODE!!!
* IT HAS NEVER BEEN FIRED IN 1.13+ AND WILL NEVER FIRE AGAIN!!!
* FIRE.JPG FIRE.JPG FIRE.JPG
* DELET THIS
*/
@Deprecated
public class FMLFingerprintViolationEvent extends ModLifecycleEvent
{
private final boolean isDirectory;
private final Set<String> fingerprints;
private final File source;
private final String expectedFingerprint;
public FMLFingerprintViolationEvent(boolean isDirectory, File source, ImmutableSet<String> fingerprints, String expectedFingerprint)
{
super(null);
this.isDirectory = isDirectory;
this.source = source;
this.fingerprints = fingerprints;
this.expectedFingerprint = expectedFingerprint;
}
public boolean isDirectory() { return isDirectory; }
public Set<String> getFingerprints() { return fingerprints; }
public File getSource() { return source; }
public String getExpectedFingerprint() { return expectedFingerprint; }
}