Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd1be63f authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Fix handling of base64 consent data and never die when it's broken

parent 124ec3ac
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -85,8 +85,12 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub {
                i.putExtra(KEY_ACCOUNT_TYPE, authManager.getAccountType());
                i.putExtra(KEY_ACCOUNT_NAME, accountName);
                i.putExtra(KEY_AUTHTOKEN, scope);
                try {
                    if (res.consentDataBase64 != null)
                        i.putExtra(EXTRA_CONSENT_DATA, Base64.decode(res.consentDataBase64, Base64.URL_SAFE));
                } catch (Exception e) {
                    Log.w(TAG, "Can't decode consent data: ", e);
                }
                result.putParcelable(KEY_USER_RECOVERY_INTENT, i);
                return result;
            }
+6 −2
Original line number Diff line number Diff line
@@ -109,8 +109,12 @@ class AccountAuthenticator extends AbstractAccountAuthenticator {
                i.putExtra(KEY_ACCOUNT_TYPE, account.type);
                i.putExtra(KEY_ACCOUNT_NAME, account.name);
                i.putExtra(KEY_AUTHTOKEN, authTokenType);
                try {
                    if (res.consentDataBase64 != null)
                    i.putExtra(AskPermissionActivity.EXTRA_CONSENT_DATA, Base64.decode(res.consentDataBase64, Base64.DEFAULT));
                        i.putExtra(AskPermissionActivity.EXTRA_CONSENT_DATA, Base64.decode(res.consentDataBase64, Base64.URL_SAFE));
                } catch (Exception e) {
                    Log.w(TAG, "Can't decode consent data: ", e);
                }
                result.putParcelable(KEY_INTENT, i);
                return result;
            }