Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ either through custom URI scheme redirects, or App Links.
AS's that assume all clients are web-based or require clients to maintain
confidentiality of the client secrets may not work well.

From Android API 30 (R) and above, set [queries](https://developer.android.com/preview/privacy/package-visibility) in the manifest,
to enable AppAuth searching for usable installed browsers.
```xml
<manifest package="com.example.game">
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.APP_BROWSER" />
<data android:scheme="https" />
</intent>
</queries>
...
</manifest>
```

## Demo app

A demo app is contained within this repository. For instructions on how to
Expand Down
13 changes: 0 additions & 13 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@

<uses-permission android:name="android.permission.INTERNET" />

<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.APP_BROWSER" />
<data android:scheme="https" />
</intent>
</queries>

<application
android:allowBackup="false"
android:fullBackupContent="false"
Expand Down
8 changes: 8 additions & 0 deletions library/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@
</activity>
</application>

<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>

</manifest>
3 changes: 1 addition & 2 deletions library/java/net/openid/appauth/browser/BrowserSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ private static boolean hasWarmupService(PackageManager pm, String packageName) {
private static boolean isFullBrowser(ResolveInfo resolveInfo) {
// The filter must match ACTION_VIEW, CATEGORY_BROWSEABLE, and at least one scheme,
if (!resolveInfo.filter.hasAction(Intent.ACTION_VIEW)
|| !(resolveInfo.filter.hasCategory(Intent.CATEGORY_BROWSABLE)
|| (resolveInfo.filter.hasCategory(Intent.CATEGORY_APP_BROWSER)))
|| !resolveInfo.filter.hasCategory(Intent.CATEGORY_BROWSABLE)
Comment thread
agologan marked this conversation as resolved.
|| resolveInfo.filter.schemesIterator() == null) {
return false;
}
Expand Down