Files
AFFiNE-Mirror/packages/frontend/apps/android/capacitor.config.ts
aki-chang-dev d91e64b46b fix(android): fix edge-to-edge (#12453)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Added the ability to retrieve the system navigation bar height on Android devices.

- **Bug Fixes**
  - Removed duplicate internal code to improve stability.

- **Chores**
  - Removed the dependency on the edge-to-edge support package and related configuration and code.
  - Updated configuration to adjust margins for edge-to-edge layouts.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-22 09:57:50 +00:00

52 lines
1.1 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')
);
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',
},
server: {
cleartext: true,
},
plugins: {
CapacitorHttp: {
enabled: false,
},
CapacitorCookies: {
enabled: false,
},
},
};
if (process.env.CAP_SERVER_URL) {
Object.assign(config, {
server: {
url: process.env.CAP_SERVER_URL,
},
});
}
export default config;