Revert "SBrowser: do not use customtabs for OAuth"

This reverts commit fd60e82d76.
This commit is contained in:
M66B 2022-11-05 17:36:39 +01:00
parent bd75f2774a
commit 2bdf999484
1 changed files with 6 additions and 15 deletions

View File

@ -389,24 +389,15 @@ public class FragmentOAuth extends FragmentBase {
Browsers.SBrowser.SIGNATURE_SET,
false,
VersionRange.atMost("5.3"));
final BrowserMatcher SBROWSER_TAB = new VersionedBrowserMatcher(
Browsers.SBrowser.PACKAGE_NAME,
Browsers.SBrowser.SIGNATURE_SET,
true,
VersionRange.atMost("5.3"));
@Override
public boolean matches(@NonNull BrowserDescriptor descriptor) {
/*
java.lang.IllegalStateException: Too many bind requests(999+) for service Intent { act=android.support.customtabs.action.CustomTabsService pkg=com.sec.android.app.sbrowser }
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:2115)
at android.app.ContextImpl.bindService(ContextImpl.java:2024)
at android.content.ContextWrapper.bindService(ContextWrapper.java:870)
at android.content.ContextWrapper.bindService(ContextWrapper.java:870)
at androidx.browser.customtabs.CustomTabsClient.bindCustomTabsService(CustomTabsClient:80)
at net.openid.appauth.browser.CustomTabManager.bind(CustomTabManager:95)
at net.openid.appauth.AuthorizationService.<init>(AuthorizationService:117)
at net.openid.appauth.AuthorizationService.<init>(AuthorizationService:95)
at eu.faircode.email.FragmentOAuth.onAuthorize(FragmentOAuth:412)
*/
boolean accept = !(SBROWSER.matches(descriptor) ||
(descriptor.useCustomTab &&
Browsers.SBrowser.PACKAGE_NAME.equals(descriptor.packageName)));
boolean accept = !(SBROWSER.matches(descriptor) || SBROWSER_TAB.matches(descriptor));
EntityLog.log(context,
"Browser=" + descriptor.packageName +
":" + descriptor.version +