Skip to content

Commit

Permalink
强制要求userType为"msa"
Browse files Browse the repository at this point in the history
  • Loading branch information
Vera-Firefly committed Sep 12, 2024
1 parent defd662 commit 068b097
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,20 +377,6 @@ public static String[] getMinecraftClientArgs(MinecraftAccount profile, JMinecra
versionName = versionInfo.inheritsFrom;
}

String userType = "mojang";
try {
Date creationDate = DateUtils.getOriginalReleaseDate(versionInfo);
// Minecraft 22w43a which adds chat reporting (and signing) was released on
// 26th October 2022. So, if the date is not before that (meaning it is equal or higher)
// change the userType to MSA to fix the missing signature
if(creationDate != null && !DateUtils.dateBefore(creationDate, 2022, 9, 26)) {
userType = "msa";
}
}catch (ParseException e) {
Log.e("CheckForProfileKey", "Failed to determine profile creation date, using \"mojang\"", e);
}


Map<String, String> varArgMap = new ArrayMap<>();
varArgMap.put("auth_session", profile.accessToken); // For legacy versions of MC
varArgMap.put("auth_access_token", profile.accessToken);
Expand All @@ -402,7 +388,7 @@ public static String[] getMinecraftClientArgs(MinecraftAccount profile, JMinecra
varArgMap.put("game_assets", ProfilePathHome.getAssetsHome());
varArgMap.put("game_directory", gameDir.getAbsolutePath());
varArgMap.put("user_properties", "{}");
varArgMap.put("user_type", userType);
varArgMap.put("user_type", "msa");
varArgMap.put("version_name", versionName);
varArgMap.put("version_type", versionInfo.type);

Expand Down

0 comments on commit 068b097

Please sign in to comment.