mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-02 14:07:32 +01:00
Reset AndroidID after switching login method
This commit is contained in:
parent
258b9936f3
commit
646eab8f2a
@ -158,7 +158,12 @@ public class LoginActivity extends AssistantActivity {
|
||||
super.onHuaweiButtonClicked();
|
||||
state++;
|
||||
if (state == 1) {
|
||||
CheckinClient.brandSpoof = true;
|
||||
CheckinClient.isHuaweiButtonClicked = true;
|
||||
if (CheckinClient.isLoginButtonClicked) {
|
||||
LastCheckinInfo.ClearCheckinInfo(this);
|
||||
CheckinClient.brandSpoof = true;
|
||||
CheckinClient.isLoginButtonClicked = false;
|
||||
}
|
||||
init();
|
||||
}
|
||||
}
|
||||
@ -168,7 +173,12 @@ public class LoginActivity extends AssistantActivity {
|
||||
super.onNextButtonClicked();
|
||||
state++;
|
||||
if (state == 1) {
|
||||
CheckinClient.brandSpoof = false;
|
||||
CheckinClient.isLoginButtonClicked = true;
|
||||
if (CheckinClient.isHuaweiButtonClicked) {
|
||||
LastCheckinInfo.ClearCheckinInfo(this);
|
||||
CheckinClient.brandSpoof = false;
|
||||
CheckinClient.isHuaweiButtonClicked = false;
|
||||
}
|
||||
init();
|
||||
} else if (state == -1) {
|
||||
setResult(RESULT_CANCELED);
|
||||
|
@ -45,6 +45,8 @@ public class CheckinClient {
|
||||
private static final List<String> TODO_LIST_STRING = new ArrayList<>(); // TODO
|
||||
private static final List<CheckinRequest.Checkin.Statistic> TODO_LIST_CHECKIN = new ArrayList<CheckinRequest.Checkin.Statistic>(); // TODO
|
||||
private static final String SERVICE_URL = "https://android.clients.google.com/checkin";
|
||||
public static boolean isHuaweiButtonClicked = false;
|
||||
public static boolean isLoginButtonClicked = false;
|
||||
public static boolean brandSpoof = false;
|
||||
|
||||
public static CheckinResponse request(CheckinRequest request) throws IOException {
|
||||
|
@ -57,4 +57,15 @@ public class LastCheckinInfo {
|
||||
.putString(PREF_DEVICE_DATA_VERSION_INFO, deviceDataVersionInfo)
|
||||
.commit();
|
||||
}
|
||||
|
||||
public static void ClearCheckinInfo(Context context) {
|
||||
context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE).edit()
|
||||
.putLong(PREF_ANDROID_ID, 0)
|
||||
.putString(PREF_DIGEST, INITIAL_DIGEST)
|
||||
.putLong(PREF_LAST_CHECKIN, 0)
|
||||
.putLong(PREF_SECURITY_TOKEN, 0)
|
||||
.putString(PREF_VERSION_INFO, "")
|
||||
.putString(PREF_DEVICE_DATA_VERSION_INFO, "")
|
||||
.commit();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user