mirror of
https://github.com/unmojang/authlib-injector.git
synced 2025-09-29 22:30:02 -04:00
fixes
This commit is contained in:
parent
3185f73f6b
commit
a1a4a3dbc2
@ -27,7 +27,7 @@ public final class AuthlibInjector {
|
|||||||
|
|
||||||
private static final String[] nonTransformablePackages = new String[] { "java.", "javax.", "com.sun.",
|
private static final String[] nonTransformablePackages = new String[] { "java.", "javax.", "com.sun.",
|
||||||
"com.oracle.", "jdk.", "sun.", "org.apache.", "com.google.", "oracle.", "com.oracle.", "com.paulscode.",
|
"com.oracle.", "jdk.", "sun.", "org.apache.", "com.google.", "oracle.", "com.oracle.", "com.paulscode.",
|
||||||
"io.netty.", "org.lwjgl.", "net.java.", "org.w3c.", "javassist." };
|
"io.netty.", "org.lwjgl.", "net.java.", "org.w3c.", "javassist.", "org.xml." };
|
||||||
|
|
||||||
private AuthlibInjector() {}
|
private AuthlibInjector() {}
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ public final class AuthlibInjector {
|
|||||||
|
|
||||||
private static Optional<InjectorConfig> tryRemoteConfig() {
|
private static Optional<InjectorConfig> tryRemoteConfig() {
|
||||||
String configProperty = System.getProperty("org.to2mbn.authlibinjector.config");
|
String configProperty = System.getProperty("org.to2mbn.authlibinjector.config");
|
||||||
if (!configProperty.startsWith("@")) {
|
if (configProperty == null || !configProperty.startsWith("@")) {
|
||||||
return empty();
|
return empty();
|
||||||
}
|
}
|
||||||
String url = configProperty.substring(1);
|
String url = configProperty.substring(1);
|
||||||
|
@ -13,11 +13,12 @@ import org.to2mbn.authlibinjector.transform.YggdrasilKeyTransformUnit;
|
|||||||
public class InjectorConfig {
|
public class InjectorConfig {
|
||||||
|
|
||||||
private static byte[] decodePublicKey(String input) {
|
private static byte[] decodePublicKey(String input) {
|
||||||
final String header = "-----BEGIN PUBLIC KEY-----\n";
|
input = input.replace("\n", "");
|
||||||
|
final String header = "-----BEGIN PUBLIC KEY-----";
|
||||||
final String end = "-----END PUBLIC KEY-----";
|
final String end = "-----END PUBLIC KEY-----";
|
||||||
if (input.startsWith(header) && input.endsWith(end)) {
|
if (input.startsWith(header) && input.endsWith(end)) {
|
||||||
return Base64.getDecoder()
|
return Base64.getDecoder()
|
||||||
.decode(input.substring(header.length(), input.length() - end.length()).replace("\n", ""));
|
.decode(input.substring(header.length(), input.length() - end.length()));
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Bad key format");
|
throw new IllegalArgumentException("Bad key format");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user