diff --git a/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java b/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java index d02b1efc..01dbcf3e 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java @@ -43,6 +43,7 @@ import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.StringRes; +import androidx.preference.PreferenceManager; import com.mgoogle.android.gms.R; @@ -96,6 +97,9 @@ public class LoginActivity extends AssistantActivity { private ViewGroup authContent; private int state = 0; + private String HuaweiButtonPreference = "huaweiloginbutton"; + private String LoginButtonPreference = "standardloginbutton"; + @SuppressLint("AddJavascriptInterface") @Override protected void onCreate(Bundle savedInstanceState) { @@ -158,11 +162,11 @@ public class LoginActivity extends AssistantActivity { super.onHuaweiButtonClicked(); state++; if (state == 1) { - CheckinClient.isHuaweiButtonClicked = true; - if (CheckinClient.isLoginButtonClicked) { + PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(HuaweiButtonPreference, true); + if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(LoginButtonPreference, false)) { LastCheckinInfo.ClearCheckinInfo(this); CheckinClient.brandSpoof = true; - CheckinClient.isLoginButtonClicked = false; + PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(LoginButtonPreference, true); } init(); } @@ -173,11 +177,11 @@ public class LoginActivity extends AssistantActivity { super.onNextButtonClicked(); state++; if (state == 1) { - CheckinClient.isLoginButtonClicked = true; - if (CheckinClient.isHuaweiButtonClicked) { + PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(LoginButtonPreference, true); + if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(HuaweiButtonPreference, false)) { LastCheckinInfo.ClearCheckinInfo(this); CheckinClient.brandSpoof = false; - CheckinClient.isHuaweiButtonClicked = false; + PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(HuaweiButtonPreference, true); } init(); } else if (state == -1) { diff --git a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java index c61e334b..49bf4d73 100755 --- a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java +++ b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java @@ -45,8 +45,6 @@ public class CheckinClient { private static final List TODO_LIST_STRING = new ArrayList<>(); // TODO private static final List TODO_LIST_CHECKIN = new ArrayList(); // 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 {