Add jar signing, fixes #1514

This commit is contained in:
raoulvdberge
2017-11-05 10:05:03 +01:00
parent 5927a6e78a
commit 14a11c8a1a
3 changed files with 25 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
- The Crafter can now only store 1 stack size pattern per slot (raoulvdberge)
- You can now re-insert a Pattern in the pattern output slot in the Pattern Grid to modify an existing pattern (raoulvdberge)
- Fixed not being able to use JEI R and U keys on Grid with tabs (raoulvdberge)
- The Refined Storage jar is now signed (raoulvdberge)
### 1.5.21
- Updated Portuguese (Brazilian) translation (Pinz714)

View File

@@ -96,6 +96,21 @@ task apiJar(type: Jar, dependsOn: 'sourceMainJava') {
classifier 'api'
}
task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf {
project.hasProperty('keyStore')
}
keyStore = project.findProperty('keyStore')
alias = project.findProperty('keyStoreAlias')
storePass = project.findProperty('keyStorePass')
keyPass = project.findProperty('keyStoreKeyPass')
inputFile = jar.archivePath
outputFile = jar.archivePath
}
build.dependsOn signJar
artifacts {
archives deobfJar
archives apiJar

View File

@@ -4,17 +4,19 @@ import com.raoulvdberge.refinedstorage.proxy.ProxyCommon;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
@Mod(modid = RS.ID, version = RS.VERSION, dependencies = RS.DEPENDENCIES, acceptedMinecraftVersions = "[1.12,1.13)", guiFactory = RS.GUI_FACTORY, updateJSON = RS.UPDATE_JSON)
@Mod(modid = RS.ID, version = RS.VERSION, dependencies = RS.DEPENDENCIES, acceptedMinecraftVersions = "[1.12,1.13)", guiFactory = RS.GUI_FACTORY, updateJSON = RS.UPDATE_JSON, certificateFingerprint = RS.FINGERPRINT)
public final class RS {
static {
FluidRegistry.enableUniversalBucket();
@@ -25,6 +27,7 @@ public final class RS {
public static final String DEPENDENCIES = "required-after:forge@[14.21.0.2363,);after:mcmultipart@[2.2.1,);after:storagedrawers@[1.12-5.2.2,);";
public static final String GUI_FACTORY = "com.raoulvdberge.refinedstorage.gui.config.ModGuiFactory";
public static final String UPDATE_JSON = "https://refinedstorage.raoulvdberge.com/update";
public static final String FINGERPRINT = "57893d5b90a7336e8c63fe1c1e1ce472c3d59578";
@SidedProxy(clientSide = "com.raoulvdberge.refinedstorage.proxy.ProxyClient", serverSide = "com.raoulvdberge.refinedstorage.proxy.ProxyCommon")
public static ProxyCommon PROXY;
@@ -57,4 +60,9 @@ public final class RS {
public void postInit(FMLPostInitializationEvent e) {
PROXY.postInit(e);
}
@EventHandler
public void onFingerprintViolation(FMLFingerprintViolationEvent e) {
FMLLog.bigWarning("Invalid fingerprint detected for the Refined Storage jar file! The file " + e.getSource().getName() + " may have been tampered with. This version will NOT be supported!");
}
}