EE3 jars are now signed for authenticity, and just log a warning message if the jar is modified. EE3 also now uses srg names for reobf, meaning EE3 should now not require updates if there are minor MC changes.

This commit is contained in:
pahimar 2013-04-07 20:29:57 -04:00
parent 7946024766
commit e89109513d
5 changed files with 26 additions and 7 deletions

View file

@ -14,6 +14,7 @@
<fileset dir="${dir.development}\source\Equivalent-Exchange-3\ee3_common\" />
</copy>
<replace dir="${dir.development}\mcp\src\minecraft" token="@VERSION@" value="${release.mod.version}" />
<replace dir="${dir.development}\mcp\src\minecraft" token="@FINGERPRINT@" value="${release.mod.fingerprint}" />
</target>
<target name="recompile">
@ -33,16 +34,16 @@
<target name="reobfuscate">
<exec dir="${dir.development}\mcp" executable="cmd" os="Windows 7">
<arg line="/c reobfuscate.bat" />
<arg line="/c reobfuscate_srg.bat" />
</exec>
<exec dir="${dir.development}\mcp" executable="cmd" os="Windows 8">
<arg line="/c reobfuscate.bat" />
<arg line="/c reobfuscate_srg.bat" />
</exec>
<exec dir="${dir.development}\mcp" executable="bash" os="Linux">
<arg line="reobfuscate.sh" />
<arg line="reobfuscate_srg.sh" />
</exec>
<exec dir="${dir.development}\mcp" executable="bash" os="Mac OS X">
<arg line="reobfuscate.sh" />
<arg line="reobfuscate_srg.sh" />
</exec>
</target>
@ -80,8 +81,10 @@
<fileset dir="${dir.development}\source\Equivalent-Exchange-3\resources" />
</jar>
<!-- Sign the jar -->
<signjar jar="${dir.release}\${release.minecraft.version}\${release.mod.version}\ee3-universal-${release.mod.version}.jar" keystore="${keystore.location}" alias="${keystore.alias}" storepass="${keystore.password}" />
<!-- Clean up the MCP source now that we are done -->
<antcall target="clean" />
</target>
</project>

View file

@ -1,6 +1,7 @@
package com.pahimar.ee3;
import java.io.File;
import java.util.logging.Level;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.crafting.CraftingManager;
@ -26,16 +27,19 @@ import com.pahimar.ee3.creativetab.CreativeTabEE3;
import com.pahimar.ee3.item.ModItems;
import com.pahimar.ee3.item.crafting.RecipesAlchemicalBagDyes;
import com.pahimar.ee3.lib.Reference;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.network.PacketHandler;
import com.pahimar.ee3.recipe.RecipesTransmutationStone;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.FingerprintWarning;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.Mod.ServerStarting;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLFingerprintViolationEvent;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@ -43,6 +47,7 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
@ -55,7 +60,7 @@ import cpw.mods.fml.relauncher.Side;
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*
*/
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, certificateFingerprint = Reference.FINGERPRINT)
@NetworkMod(channels = { Reference.CHANNEL_NAME }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
public class EquivalentExchange3 {
@ -67,6 +72,13 @@ public class EquivalentExchange3 {
public static CreativeTabs tabsEE3 = new CreativeTabEE3(CreativeTabs.getNextID(), Reference.MOD_ID);
@FingerprintWarning
public void invalidFingerprint(FMLFingerprintViolationEvent event) {
// Report (log) to the user that the version of Equivalent Exchange 3 they are using has been changed/tampered with
LogHelper.log(Level.SEVERE, LanguageRegistry.instance().getStringLocalization(Strings.INVALID_FINGERPRINT_MESSAGE));
}
@ServerStarting
public void serverStarting(FMLServerStartingEvent event) {
@ -155,6 +167,5 @@ public class EquivalentExchange3 {
// Initialize the Addon Handler
AddonHandler.init();
}
}

View file

@ -19,6 +19,7 @@ public class Reference {
public static final String MOD_NAME = "Equivalent Exchange 3";
public static final String VERSION = "@VERSION@";
public static final String CHANNEL_NAME = MOD_ID;
public static final String FINGERPRINT = "@FINGERPRINT@";
public static final int SECOND_IN_TICKS = 20;
public static final int SHIFTED_ID_RANGE_CORRECTION = 256;
public static final String SERVER_PROXY_CLASS = "com.pahimar.ee3.core.proxy.CommonProxy";

View file

@ -15,6 +15,9 @@ public class Strings {
public static final String TRUE = "true";
public static final String FALSE = "false";
/* Fingerprint check related constants */
public static final String INVALID_FINGERPRINT_MESSAGE = "fingerprint_check.invalid";
/* Version check related constants */
public static final String VERSION_CHECK_INIT_LOG_MESSAGE = "version.init_log_message";
public static final String UNINITIALIZED_MESSAGE = "version.uninitialized";

View file

@ -27,6 +27,7 @@
<entry key="container.alchemicalChest">Alchemical Chest</entry>
<entry key="container.alchemicalBag">Alchemical Bag</entry>
<entry key="itemGroup.EE3">Equivalent Exchange 3</entry>
<entry key="fingerprint_check.invalid">The copy of Equivalent Exchange 3 that you are running has been modified from the original, and unpredictable things may happen. Please consider re-downloading the original version of the mod.</entry>
<entry key="version.init_log_message">Initializing remote version check against remote version authority, located at</entry>
<entry key="version.uninitialized">Remote version check failed to initialize properly</entry>
<entry key="version.current">Currently using the most up to date version (@REMOTE_MOD_VERSION@) of Equivalent Exchange 3 for @MINECRAFT_VERSION@</entry>