The web client already has a full mobile UI (MobileShell and 17 sibling screens) and ships as a PWA, so what was missing to get an APK was a native container, not an interface. The WebView loads the instance over the network instead of bundling a copy of the web build. Bundling would mean republishing an APK on every site deploy — there is no electron-updater equivalent here — and it would move the page to https://localhost, turning every same-origin /api and /ws call into a cross-origin one. The cost is no offline mode, which for a realtime chat app costs nothing: public/index.html covers the unreachable-server case. packages/mobile sits outside the pnpm workspace on purpose. Capacitor's CLI and Gradle both assume a flat node_modules, and keeping it out leaves pnpm-lock.yaml and the existing web/desktop CI untouched by it. Icons are generated from the existing brand art. The launch screen is a layer-list over the brand background rather than Capacitor's per-density splash.png set, which is light and flashed white before the WebView painted. CI builds an *unsigned* APK. The signing key stays on the VPS and is applied there — an APK signature is what proves an update came from us, so the key has no reason to exist on a second machine. Background voice (foreground service) is not in this commit: a plain WebView is throttled when the screen goes off and the call drops. That is the next phase. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
58 lines
2.3 KiB
Groovy
58 lines
2.3 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
namespace "com.resenhacord.app"
|
|
compileSdk rootProject.ext.compileSdkVersion
|
|
defaultConfig {
|
|
applicationId "com.resenhacord.app"
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
// Mantidos em sincronia com a versao do monorepo. O versionCode e o
|
|
// numero que o Android usa para decidir se um APK e mais novo, e ele
|
|
// precisa ser inteiro e sempre crescente: 2.1.0 -> 20100.
|
|
versionCode 20100
|
|
versionName "2.1.0"
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
aaptOptions {
|
|
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
|
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
|
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
flatDir{
|
|
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
|
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
|
implementation project(':capacitor-android')
|
|
testImplementation "junit:junit:$junitVersion"
|
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
implementation project(':capacitor-cordova-android-plugins')
|
|
}
|
|
|
|
apply from: 'capacitor.build.gradle'
|
|
|
|
try {
|
|
def servicesJSON = file('google-services.json')
|
|
if (servicesJSON.text) {
|
|
apply plugin: 'com.google.gms.google-services'
|
|
}
|
|
} catch(Exception e) {
|
|
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
|
}
|