Files
AFFiNE-Mirror/packages/frontend/apps/android/capacitor.config.ts
T
DarkSky da7781a751 feat(mobile): improve android edgeless & ci (#15118)
#### PR Dependency Tree


* **PR #15118** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Improved mobile CI workflow with change-aware Android/iOS build jobs
and updated completion dependencies so tests wait for the relevant
mobile builds.
* **Performance / App Behavior**
* Enhanced Android WebView behavior: improved viewport/WebView tuning,
disabled zoom and scrollbars, and made mixed-content allowance
environment-aware (debug vs non-debug).
* Adjusted Android cleartext traffic handling based on build/debug
settings and Capacitor server URL configuration.
* **Tests**
* Strengthened Electron BYOK storage tests with per-test temporary
directories, mock control, and added coverage for when secure storage is
unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-17 02:08:15 +08:00

53 lines
1.2 KiB
TypeScript

import { readFileSync } from 'node:fs';
import { join, resolve } from 'node:path';
import type { CapacitorConfig } from '@capacitor/cli';
const packageJson = JSON.parse(
readFileSync(resolve(__dirname, './package.json'), 'utf-8')
);
const capServerUrl = process.env.CAP_SERVER_URL;
const allowsCleartextServer = capServerUrl?.startsWith('http://') ?? false;
interface AppConfig {
affineVersion: string;
}
const config: CapacitorConfig & AppConfig = {
appId: 'app.affine.pro',
appName: 'AFFiNE',
webDir: 'dist',
affineVersion: packageJson.version,
android: {
path: 'App',
buildOptions: {
keystorePath: join(__dirname, 'affine.keystore'),
keystorePassword: process.env.AFFINE_ANDROID_KEYSTORE_PASSWORD,
keystoreAlias: 'key0',
keystoreAliasPassword: process.env.AFFINE_ANDROID_KEYSTORE_ALIAS_PASSWORD,
releaseType: 'AAB',
},
adjustMarginsForEdgeToEdge: 'force',
},
plugins: {
CapacitorHttp: {
enabled: false,
},
CapacitorCookies: {
enabled: false,
},
},
};
if (capServerUrl) {
Object.assign(config, {
server: {
url: capServerUrl,
cleartext: allowsCleartextServer,
},
});
}
export default config;