3.5 KiB · text History a76b392
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-feature android:name="android.hardware.camera" android:required="false"/>

    <application
        android:label="@string/app_name"
        android:icon="@mipmap/ic_icon"
        android:roundIcon="@mipmap/ic_icon"
        android:allowBackup="false"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:supportsRtl="true"
        android:theme="@style/Theme.Vigil"
        android:usesCleartextTraffic="${cleartext}">

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>

            <!--
                vigil://pair?base=<server>&token=<api token>: the link beside
                the QR on the web's Settings → API tokens, opened on the
                phone rather than scanned.
            -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme="vigil" android:host="pair"/>
            </intent-filter>

            <!--
                vigil://auth?code=… — the end of a "Sign in with NEIAM" in the
                browser (Custom Tab): the server's one-time code, useless
                without the PKCE verifier that never leaves the app. A custom
                scheme because the server is whichever the user picked, and
                an App Link would have to name its host here.
            -->
            <intent-filter android:autoVerify="false">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme="vigil" android:host="auth"/>
            </intent-filter>

            <!--
                Magic links, as verified App Links (autoVerify), on the
                production host only (appLinksHost in app/build.gradle.kts):
                Android opens them in this app only when
                https://<host>/.well-known/assetlinks.json lists this
                package and its signing certificate (ANDROID_CERT_FINGERPRINTS
                on the server). Otherwise they open in the browser, where
                they work as before. Never a custom scheme: the token is a
                credential by itself.

                  /users/log-in/<token>   the web's magic link (phx.gen.auth)
            -->
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme="https"/>
                <data android:host="${appLinksHost}"/>
                <data android:pathPrefix="/users/log-in/"/>
            </intent-filter>
        </activity>
    </application>
</manifest>