More fixes, binpatching works
This commit is contained in:
parent
5b5f05859c
commit
572c9acc59
7 changed files with 30 additions and 27 deletions
|
@ -381,23 +381,21 @@
|
|||
<signjar alias="FML" jar="${basedir}/target/${universal.jarname}.zip" keypass="${sign.KEYPASS}" keystore="${env.JENKINS_HOME}/${sign.KEYSTORE}" storepass="${sign.STOREPASS}" verbose="true" />
|
||||
</target>
|
||||
<target name="makebinpatches" depends="buildenvsetup,makeversion">
|
||||
<path id="diffset.libs">
|
||||
<pathelement path="${mcp.home}/jars/libraries/com/google/guava/guava/14.0/guava-14.0.jar"/>
|
||||
<pathelement path="${mcp.home}/jars/libraries/org/ow2/asm/asm-all/4.1/asm-all-4.1.jar"/>
|
||||
<pathelement path="${mcp.home}/jars/libraries/lzma/lzma/0.0.1/lzma-0.0.1.jar"/>
|
||||
<pathelement path="${mcp.obfoutput}/minecraft"/>
|
||||
</path>
|
||||
<delete dir="${basedir}/binpatch" verbose="true"/>
|
||||
<java classname="cpw.mods.fml.common.patcher.GenDiffSet">
|
||||
<classpath>
|
||||
<pathelement path="${mcp.obfoutput}/minecraft"/>
|
||||
<fileset dir="${mcp.home}/lib" includes="guava-14.0-rc3.jar,asm-debug-all-4.1.jar"/>
|
||||
</classpath>
|
||||
<java classname="cpw.mods.fml.common.patcher.GenDiffSet" classpathref="diffset.libs">
|
||||
<arg path="${mcp.home}/jars/versions/${version.minecraft}/${version.minecraft}.jar.backup"/>
|
||||
<arg path="${mcp.obfoutput}/minecraft"/>
|
||||
<arg path="${basedir}/deobfuscation_data-${version.minecraft}.lzma"/>
|
||||
<arg path="${basedir}/binpatch/client"/>
|
||||
<arg value="false"/>
|
||||
</java>
|
||||
<java classname="cpw.mods.fml.common.patcher.GenDiffSet">
|
||||
<classpath>
|
||||
<pathelement path="${mcp.obfoutput}/minecraft"/>
|
||||
<fileset dir="${mcp.home}/lib" includes="guava-14.0-rc3.jar,asm-debug-all-4.1.jar"/>
|
||||
</classpath>
|
||||
<java classname="cpw.mods.fml.common.patcher.GenDiffSet" classpathref="diffset.libs">
|
||||
<arg path="${mcp.home}/jars/minecraft_server.${version.minecraft}.jar.backup"/>
|
||||
<arg path="${mcp.obfoutput}/minecraft"/>
|
||||
<arg path="${basedir}/deobfuscation_data-${version.minecraft}.lzma"/>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
@ -21,6 +21,7 @@ public class GuiCustomModLoadingErrorScreen extends GuiErrorScreen
|
|||
private CustomModLoadingErrorDisplayException customException;
|
||||
public GuiCustomModLoadingErrorScreen(CustomModLoadingErrorDisplayException customException)
|
||||
{
|
||||
super(null,null);
|
||||
this.customException = customException;
|
||||
}
|
||||
@Override
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ public class GuiDupesFound extends GuiErrorScreen
|
|||
|
||||
public GuiDupesFound(DuplicateModsFoundException dupes)
|
||||
{
|
||||
super(null,null);
|
||||
this.dupes = dupes;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ public class GuiModsMissing extends GuiErrorScreen
|
|||
|
||||
public GuiModsMissing(MissingModsException modsMissing)
|
||||
{
|
||||
super(null,null);
|
||||
this.modsMissing = modsMissing;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* are made available under the terms of the GNU Lesser Public License v2.1
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*
|
||||
* Contributors:
|
||||
* cpw - implementation
|
||||
*/
|
||||
|
@ -22,6 +22,7 @@ public class GuiWrongMinecraft extends GuiErrorScreen
|
|||
private WrongMinecraftVersionException wrongMC;
|
||||
public GuiWrongMinecraft(WrongMinecraftVersionException wrongMC)
|
||||
{
|
||||
super(null,null);
|
||||
this.wrongMC = wrongMC;
|
||||
}
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,10 @@ package cpw.mods.fml.common.patcher;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Level;
|
||||
|
@ -19,11 +22,13 @@ import cpw.mods.fml.repackage.com.nothome.delta.Delta;
|
|||
|
||||
public class GenDiffSet {
|
||||
|
||||
private static final List<String> RESERVED_NAMES = Arrays.asList("CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9");
|
||||
|
||||
public static void main(String[] args) throws IOException
|
||||
{
|
||||
String sourceJar = args[0]; //Clean Vanilla jar minecraft.jar or minecraft_server.jar
|
||||
String targetDir = args[1]; //Directory containing obfed output classes, typically mcp/reobf/minecraft
|
||||
String deobfData = args[2]; //Path to FML's deobfusication_data.zip
|
||||
String deobfData = args[2]; //Path to FML's deobfusication_data.lzma
|
||||
String outputDir = args[3]; //Path to place generated .binpatch
|
||||
String killTarget = args[4]; //"true" if we should destroy the target file if it generated a successful .binpatch
|
||||
|
||||
|
@ -40,12 +45,19 @@ public class GenDiffSet {
|
|||
for (String name : remapper.getObfedClasses())
|
||||
{
|
||||
// Logger.getLogger("GENDIFF").info(String.format("Evaluating path for data :%s",name));
|
||||
File targetFile = new File(targetDir, name.replace('/', File.separatorChar) + ".class");
|
||||
String fileName = name;
|
||||
String jarName = name;
|
||||
if (RESERVED_NAMES.contains(name.toUpperCase(Locale.ENGLISH)))
|
||||
{
|
||||
fileName = "_"+name;
|
||||
}
|
||||
File targetFile = new File(targetDir, fileName.replace('/', File.separatorChar) + ".class");
|
||||
jarName = jarName+".class";
|
||||
if (targetFile.exists())
|
||||
{
|
||||
String sourceClassName = name.replace('/', '.');
|
||||
String targetClassName = remapper.map(name).replace('/', '.');
|
||||
JarEntry entry = sourceZip.getJarEntry(name);
|
||||
JarEntry entry = sourceZip.getJarEntry(jarName);
|
||||
|
||||
byte[] vanillaBytes = entry != null ? ByteStreams.toByteArray(sourceZip.getInputStream(entry)) : new byte[0];
|
||||
byte[] patchedBytes = Files.toByteArray(targetFile);
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiErrorScreen.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiErrorScreen.java
|
||||
@@ -22,6 +22,8 @@
|
||||
this.field_73887_h.add(new GuiButton(0, this.field_73880_f / 2 - 100, 140, I18n.func_135053_a("gui.cancel")));
|
||||
}
|
||||
|
||||
+ public GuiErrorScreen(){}
|
||||
+
|
||||
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||
{
|
||||
this.func_73733_a(0, 0, this.field_73880_f, this.field_73881_g, -12574688, -11530224);
|
Loading…
Reference in a new issue