Skip to content

Commit

Permalink
comment explaining the purpose of the workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Uval committed Feb 24, 2019
1 parent c758d5d commit 77d4917
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/java/net/openid/appauth/browser/BrowserSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ public final class BrowserSelector {

/**
* The service we expect to find on a web browser that indicates it supports custom tabs.
*
* Workaround for Android Jetifier bug (https://issuetracker.google.com/issues/119183822)
*
* Problem: Projects that are using androidx are using a Jetifier compiler as a dependency.
* The Jetifier compiler is replacing "android.support" with "androidx" inside all the
* dependencies, AppAuth included. But "android.support" is still required by the platform in
* order to open a chrome tab. As a result - a chrome tab is not found, and an external browser
* is opened instead.
* Workaround: Using StringBuilder to create the string
* "android.support.customtabs.action.CustomTabsService" in runtime prevents the jetifier static
* regex from matching "android.support" in the compiled class, thus avoiding the androidx
* replacement.
*/
@SuppressWarnings("StringBufferReplaceableByString")
@VisibleForTesting
Expand Down

0 comments on commit 77d4917

Please sign in to comment.