mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[FIX] Фикс неработоспособности Mojang авторизации (портирован)
This commit is contained in:
parent
a96365cf77
commit
1a3d231252
4 changed files with 5 additions and 5 deletions
|
@ -24,7 +24,7 @@ public static final class Entry {
|
|||
public Entry(UUID uuid, String username, String accessToken, String serverID) {
|
||||
this.uuid = Objects.requireNonNull(uuid, "uuid");
|
||||
this.username = Objects.requireNonNull(username, "username");
|
||||
this.accessToken = accessToken == null ? null : SecurityHelper.verifyToken(accessToken);
|
||||
this.accessToken = accessToken == null ? null : accessToken;
|
||||
this.serverID = serverID == null ? null : VerifyHelper.verifyServerID(serverID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public JoinServerResponse(LaunchServer server, long session, HInput input, HOutp
|
|||
@Override
|
||||
public void reply() throws IOException {
|
||||
String username = VerifyHelper.verifyUsername(input.readString(SerializeLimits.MAX_LOGIN));
|
||||
String accessToken = SecurityHelper.verifyToken(input.readASCII(-SecurityHelper.TOKEN_STRING_LENGTH));
|
||||
String accessToken = input.readASCII(-SecurityHelper.TOKEN_STRING_LENGTH);
|
||||
String serverID = VerifyHelper.verifyServerID(input.readASCII(SerializeLimits.MAX_SERVERID)); // With minus sign
|
||||
if (!clientData.isAuth || clientData.type != Client.Type.USER) {
|
||||
requestError("Access denied");
|
||||
|
|
|
@ -90,7 +90,7 @@ public Params(byte[] launcherDigest, Path assetDir, Path clientDir, PlayerProfil
|
|||
this.clientDir = clientDir;
|
||||
// Client params
|
||||
this.pp = pp;
|
||||
this.accessToken = SecurityHelper.verifyToken(accessToken);
|
||||
this.accessToken = accessToken;
|
||||
this.autoEnter = autoEnter;
|
||||
this.fullScreen = fullScreen;
|
||||
this.ram = ram;
|
||||
|
@ -110,7 +110,7 @@ public Params(HInput input) throws Exception {
|
|||
pp = new PlayerProfile(input);
|
||||
byte[] encryptedAccessToken = input.readByteArray(SecurityHelper.CRYPTO_MAX_LENGTH);
|
||||
String accessTokenD = new String(SecurityHelper.decrypt(Launcher.getConfig().secretKeyClient.getBytes(), encryptedAccessToken));
|
||||
accessToken = SecurityHelper.verifyToken(accessTokenD);
|
||||
accessToken = accessTokenD;
|
||||
autoEnter = input.readBoolean();
|
||||
fullScreen = input.readBoolean();
|
||||
ram = input.readVarInt();
|
||||
|
|
|
@ -24,7 +24,7 @@ public final class JoinServerRequest extends Request<JoinServerRequestEvent> {
|
|||
public JoinServerRequest(LauncherConfig config, String username, String accessToken, String serverID) {
|
||||
super(config);
|
||||
this.username = VerifyHelper.verifyUsername(username);
|
||||
this.accessToken = SecurityHelper.verifyToken(accessToken);
|
||||
this.accessToken = accessToken;
|
||||
this.serverID = VerifyHelper.verifyServerID(serverID);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue