mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 09:39:25 -04:00
[MSA] Bug fix on obtaining code
This commit is contained in:
parent
0c1443d20d
commit
4bd35a10be
@ -43,13 +43,14 @@ public class MicrosoftAuthenticator extends AsyncTask<String, Void, Object> {
|
|||||||
build.setMessage(ctx.getString(R.string.global_waiting));
|
build.setMessage(ctx.getString(R.string.global_waiting));
|
||||||
build.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
build.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||||
build.setCancelable(false);
|
build.setCancelable(false);
|
||||||
|
build.setMax(5);
|
||||||
build.show();
|
build.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object doInBackground(String... args) {
|
public Object doInBackground(String... args) {
|
||||||
try {
|
try {
|
||||||
String authCode = args[1];
|
String authCode = args[0];
|
||||||
|
|
||||||
publishProgress();
|
publishProgress();
|
||||||
String msaAccessToken = acquireAccessToken(authCode);
|
String msaAccessToken = acquireAccessToken(authCode);
|
||||||
@ -67,12 +68,14 @@ public class MicrosoftAuthenticator extends AsyncTask<String, Void, Object> {
|
|||||||
// TODO migrate account format to json
|
// TODO migrate account format to json
|
||||||
MinecraftAccount acc = checkMcProfile(mcAccessToken);
|
MinecraftAccount acc = checkMcProfile(mcAccessToken);
|
||||||
|
|
||||||
MCProfile.Builder profilePath = MCProfile.load(args[0]);
|
MCProfile.Builder profilePath = new MCProfile.Builder();
|
||||||
|
|
||||||
profilePath.setClientID("0" /* FIXME */);
|
profilePath.setClientID("0" /* FIXME */);
|
||||||
profilePath.setAccessToken(acc.accessToken);
|
profilePath.setAccessToken(acc.accessToken);
|
||||||
profilePath.setUsername(acc.username);
|
profilePath.setUsername(acc.username);
|
||||||
profilePath.setProfileID(acc.profileId);
|
profilePath.setProfileID(acc.profileId);
|
||||||
|
profilePath.setIsMojangAccount(false);
|
||||||
|
|
||||||
MCProfile.build(profilePath);
|
MCProfile.build(profilePath);
|
||||||
|
|
||||||
return profilePath;
|
return profilePath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user