mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
Replace the assetlinks.json placeholder with the Play App Signing key SHA-256 certificate fingerprint so Android App Links for https://sauci.app/join/* can verify. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import { readFile } from 'node:fs/promises'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const aasaPath = new URL('./apple-app-site-association', import.meta.url)
|
|
const assetlinksPath = new URL('./assetlinks.json', import.meta.url)
|
|
|
|
describe('apple-app-site-association', () => {
|
|
it('is valid JSON that covers /join/*', async () => {
|
|
const raw = await readFile(aasaPath, 'utf8')
|
|
const data = JSON.parse(raw)
|
|
|
|
expect(data.applinks.details).toHaveLength(1)
|
|
expect(data.applinks.details[0].paths).toContain('/join/*')
|
|
// com.sauci.app matches apps/mobile/app.json ios.bundleIdentifier.
|
|
expect(data.applinks.details[0].appID).toMatch(/\.com\.sauci\.app$/)
|
|
})
|
|
})
|
|
|
|
describe('assetlinks.json', () => {
|
|
it('is valid JSON that targets the Android package', async () => {
|
|
const raw = await readFile(assetlinksPath, 'utf8')
|
|
const data = JSON.parse(raw)
|
|
|
|
expect(data[0].target.package_name).toBe('com.sauci.app')
|
|
expect(data[0].target.namespace).toBe('android_app')
|
|
// Must be the Play App Signing key certificate fingerprint (Play Console >
|
|
// Test and release > Setup > App signing), colon-separated uppercase hex.
|
|
expect(data[0].target.sha256_cert_fingerprints[0]).toMatch(/^([0-9A-F]{2}:){31}[0-9A-F]{2}$/)
|
|
})
|
|
})
|