OAuth is approved for official builds only

This commit is contained in:
M66B 2020-10-20 20:40:01 +02:00
parent cc42940dff
commit 26079e9c09
3 changed files with 16 additions and 11 deletions

4
FAQ.md
View File

@ -3137,7 +3137,9 @@ Therefore you are advised to switch to the GitHub release.
The F-Droid version is built from the same source code, but signed differently.
This means that all features are available in the F-Droid version too,
except for using the Gmail quick setup wizard because Google approved (and allows) one signature only.
except for using the Gmail quick setup wizard because Google approved (and allows) one app signature only.
For all other email providers, OAuth access is only available in Play Store versions and Github releases,
as the email providers only permit the use of OAuth for official builds.
Note that you'll need to uninstall the F-Droid build first before you can install a GitHub release
because Android refuses to install the same app with a different signature for security reasons.

View File

@ -171,15 +171,14 @@ public class FragmentSetup extends FragmentBase {
popupMenu.getMenu().add(Menu.NONE, R.string.title_setup_gmail, order++, R.string.title_setup_gmail);
popupMenu.getMenu().add(Menu.NONE, R.string.title_setup_outlook, order++, R.string.title_setup_outlook);
if (Helper.hasValidFingerprint(getContext()) || BuildConfig.DEBUG)
for (EmailProvider provider : EmailProvider.loadProfiles(getContext()))
if (provider.oauth != null && provider.oauth.enabled)
popupMenu.getMenu()
.add(Menu.NONE, -1, order++, getString(R.string.title_setup_oauth, provider.name))
.setIntent(new Intent(ActivitySetup.ACTION_QUICK_OAUTH)
.putExtra("id", provider.id)
.putExtra("name", provider.name)
.putExtra("askAccount", provider.oauth.askAccount));
for (EmailProvider provider : EmailProvider.loadProfiles(getContext()))
if (provider.oauth != null && provider.oauth.enabled)
popupMenu.getMenu()
.add(Menu.NONE, -1, order++, getString(R.string.title_setup_oauth, provider.name))
.setIntent(new Intent(ActivitySetup.ACTION_QUICK_OAUTH)
.putExtra("id", provider.id)
.putExtra("name", provider.name)
.putExtra("askAccount", provider.oauth.askAccount));
//popupMenu.getMenu().add(Menu.NONE, R.string.title_setup_activesync, order++, R.string.title_setup_activesync);
popupMenu.getMenu().add(Menu.NONE, R.string.title_setup_other, order++, R.string.title_setup_other);
@ -206,7 +205,10 @@ public class FragmentSetup extends FragmentBase {
if (item.getIntent() == null)
return false;
else {
lbm.sendBroadcast(item.getIntent());
if (Helper.hasValidFingerprint(getContext()) || BuildConfig.DEBUG)
lbm.sendBroadcast(item.getIntent());
else
ToastEx.makeText(getContext(), R.string.title_setup_oauth_permission, Toast.LENGTH_LONG).show();
return true;
}
}

View File

@ -172,6 +172,7 @@
<string name="title_setup_gmail" translatable="false">Gmail</string>
<string name="title_setup_outlook" translatable="false">Outlook, Live, Hotmail</string>
<string name="title_setup_oauth" translatable="false">%1$s (OAuth)</string>
<string name="title_setup_oauth_permission">The email provider has approved OAuth only for official app versions</string>
<string name="title_setup_activesync" translatable="false">Exchange ActiveSync</string>
<string name="title_setup_other">Other provider</string>
<string name="title_setup_gmail_support">Authorizing Google accounts will work in official versions only because Android checks the app signature</string>