More fixes

This commit is contained in:
Christian 2012-12-16 21:22:55 -05:00
parent a26b495ef9
commit bbe4b9fbc2
2 changed files with 9 additions and 5 deletions

View file

@ -20,7 +20,7 @@ import cpw.mods.fml.relauncher.RelaunchClassLoader;
public class FMLSanityChecker implements IFMLCallHook
{
private static final String FMLFINGERPRINT = "";
private static final String FMLFINGERPRINT = "EE:E2:73:7A:8B:90:5F:7D:C6:02:D5:B7:23:9F:B6:29:C2:18:0F:3E".toLowerCase().replace(":","");
static class MLDetectorClassVisitor extends ClassVisitor
{
private boolean foundMarker = false;
@ -56,8 +56,13 @@ public class FMLSanityChecker implements IFMLCallHook
String fingerprint = CertificateHelper.getFingerprint(certificate);
if (fingerprint.equals(FMLFINGERPRINT))
{
FMLLog.info("Found valid fingerprint for FML: %s", fingerprint);
goodFML = true;
}
else
{
FMLLog.severe("Found invalid fingerprint for FML: %s", fingerprint);
}
}
}
else

View file

@ -118,7 +118,7 @@ public class RelaunchClassLoader extends URLClassLoader
{
CodeSigner[] signers = null;
int lastDot = name.lastIndexOf('.');
String pkgname = name.substring(0, lastDot);
String pkgname = lastDot == -1 ? "" : name.substring(0, lastDot);
String fName = name.replace('.', '/').concat(".class");
String pkgPath = pkgname.replace('.', '/');
URLConnection urlConnection = findCodeSourceConnectionFor(fName);
@ -131,13 +131,12 @@ public class RelaunchClassLoader extends URLClassLoader
Manifest mf = jf.getManifest();
JarEntry ent = jf.getJarEntry(fName);
Package pkg = getPackage(pkgname);
getClassBytes(name);
signers = ent.getCodeSigners();
if (pkg == null)
{
pkg = definePackage(pkgname, mf, jarUrlConn.getJarFileURL());
packageManifests.put(pkg, mf);
// need to read the bytes to force the signing to be checked
getClassBytes(name);
signers = ent.getCodeSigners();
}
else
{