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

Commit 9b84b6e1 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

AM: Use /e/OS browser for custom tab intents

- Only allow /e/ OS browser, so that other webapp work properly
parent 8e8191a8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ import java.net.URL
@Module
@InstallIn(SingletonComponent::class)
object OAuthModule {
    const val DEFAULT_BROWSER = "foundation.e.browser"

    /**
     * Make sure to call [AuthorizationService.dispose] when obtaining an instance.
@@ -29,6 +30,9 @@ object OAuthModule {
    fun authorizationService(@ApplicationContext context: Context): AuthorizationService =
        AuthorizationService(context,
            AppAuthConfiguration.Builder()
                .setBrowserMatcher {
                    it.packageName == DEFAULT_BROWSER
                }
                .setConnectionBuilder { uri ->
                    val url = URL(uri.toString())
                    (url.openConnection() as HttpURLConnection).apply {