diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 75fc17add7..848e2cdb4a 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -64,10 +64,6 @@ tools:replace="android:supportsRtl" tools:ignore="UnusedAttribute"> - - diff --git a/android/build.gradle b/android/build.gradle index e06be96d42..c8b3000a0c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -58,7 +58,6 @@ dependencies { implementation 'androidx.multidex:multidex:' + propMultiDexVersion // Google Services - implementation 'com.google.android.gms:play-services-auth:17.0.0' if (googleServiceEnabled) { implementation 'com.google.android.gms:play-services-location:17.0.0' implementation 'com.google.firebase:firebase-analytics:17.4.4' diff --git a/android/flavors/google-services-enabled/AndroidManifest.xml b/android/flavors/google-services-enabled/AndroidManifest.xml new file mode 100644 index 0000000000..efa46c0a6c --- /dev/null +++ b/android/flavors/google-services-enabled/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + diff --git a/android/gradle.properties b/android/gradle.properties index e8cf5fcbbf..3be425e82e 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,8 +2,8 @@ propMinSdkVersion=21 propTargetSdkVersion=29 propCompileSdkVersion=29 propBuildToolsVersion=27.0.3 -propVersionCode=1056 -propVersionName=10.5.6 +propVersionCode=1057 +propVersionName=10.5.7 propDebugNdkFlags=V=1 NDK_DEBUG=1 DEBUG=1 propReleaseNdkFlags=V=1 NDK_DEBUG=0 PRODUCTION=1 propMultiDexVersion=2.0.1 diff --git a/android/res/layout/fragment_auth_passport_dialog.xml b/android/res/layout/fragment_auth_passport_dialog.xml index 62c8518a1d..df8d41ef4e 100644 --- a/android/res/layout/fragment_auth_passport_dialog.xml +++ b/android/res/layout/fragment_auth_passport_dialog.xml @@ -81,25 +81,6 @@ android:textAppearance="@style/MwmTextAppearance.Body3.Primary" android:text="@string/sign_agree_news_gdpr"/> - task = GoogleSignIn.getSignedInAccountFromIntent(data); - try - { - GoogleSignInAccount account = task.getResult(ApiException.class); - if (account != null) - mToken = account.getIdToken(); - return !TextUtils.isEmpty(mToken); - } - catch (ApiException e) - { - // The ApiException status code indicates the detailed failure reason. - // Please refer to the GoogleSignInStatusCodes class reference for more information. - Logger logger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC); - logger.w(GoogleTokenHandler.class.getSimpleName(), - "signInResult:failed code=" + e.getStatusCode()); - } - return false; - } - - @Nullable - @Override - public String getToken() - { - return mToken; - } - - @Override - public int getType() - { - return Framework.SOCIAL_TOKEN_GOOGLE; - } -} diff --git a/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java b/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java index 1fbeeaa65f..299b82085e 100644 --- a/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java +++ b/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java @@ -16,11 +16,7 @@ import androidx.annotation.IdRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.google.android.gms.auth.api.signin.GoogleSignIn; -import com.google.android.gms.auth.api.signin.GoogleSignInClient; -import com.google.android.gms.auth.api.signin.GoogleSignInOptions; import com.mapswithme.maps.Framework; -import com.mapswithme.maps.PrivateVariables; import com.mapswithme.maps.R; import com.mapswithme.maps.base.BaseMwmDialogFragment; import com.mapswithme.util.UiUtils; @@ -35,12 +31,9 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment { private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC); private static final String TAG = SocialAuthDialogFragment.class.getSimpleName(); - @SuppressWarnings("NullableProblems") - @NonNull - private GoogleSignInClient mGoogleSignInClient; @NonNull private final List mTokenHandlers = Arrays.asList( - new GoogleTokenHandler(), new PhoneTokenHandler() + new PhoneTokenHandler() ); @Nullable private TokenHandler mCurrentTokenHandler; @@ -49,18 +42,7 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment { PhoneAuthActivity.startForResult(this); }; - @NonNull - private final View.OnClickListener mGoogleClickListener = new View.OnClickListener() - { - @Override - public void onClick(View v) - { - Intent intent = mGoogleSignInClient.getSignInIntent(); - startActivityForResult(intent, Constants.REQ_CODE_GOOGLE_SIGN_IN); - } - }; @SuppressWarnings("NullableProblems") - @NonNull private CheckBox mPrivacyPolicyCheck; @SuppressWarnings("NullableProblems") @NonNull @@ -85,11 +67,6 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment { super.onCreate(savedInstanceState); setTargetCallback(); - GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) - .requestIdToken(PrivateVariables.googleWebClientId()) - .requestEmail() - .build(); - mGoogleSignInClient = GoogleSignIn.getClient(requireActivity(), gso); } private void setTargetCallback() @@ -111,20 +88,19 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment { View view = inflater.inflate(R.layout.fragment_auth_passport_dialog, container, false); - setLoginButton(view, R.id.google_button, mGoogleClickListener); setLoginButton(view, R.id.phone_button, mPhoneClickListener); mPromoCheck = view.findViewById(R.id.newsCheck); mPrivacyPolicyCheck = view.findViewById(R.id.privacyPolicyCheck); mPrivacyPolicyCheck.setOnCheckedChangeListener((buttonView, isChecked) -> { setButtonAvailability(view, isChecked && mTermOfUseCheck.isChecked(), - R.id.google_button, R.id.phone_button); + R.id.phone_button); }); mTermOfUseCheck = view.findViewById(R.id.termOfUseCheck); mTermOfUseCheck.setOnCheckedChangeListener((buttonView, isChecked) -> { setButtonAvailability(view, isChecked && mPrivacyPolicyCheck.isChecked(), - R.id.google_button, R.id.phone_button); + R.id.phone_button); }); UiUtils.linkifyView(view, R.id.privacyPolicyLink, R.string.sign_agree_pp_gdpr, @@ -133,7 +109,6 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment UiUtils.linkifyView(view, R.id.termOfUseLink, R.string.sign_agree_tof_gdpr, Framework.nativeGetTermsOfUseLink()); - setButtonAvailability(view, false, R.id.google_button, R.id.phone_button); return view; }