55c0407d73
- Release signing via android/keystore.properties (git-ignored); build.gradle
signs release builds when the props file is present, stays unsigned otherwise.
- android/mirror-init.gradle: injects the myket.ir Maven mirror into every
project's buildscript (dl.google.com is unreachable here) and pins Build-Tools
to the installed 36.0.0. Build with:
gradlew assembleRelease bundleRelease -I mirror-init.gradle
(JAVA_HOME must point at a JDK 21 — Capacitor 8 compiles against Java 21.)
- gitignore keystores, keystore.properties, and /dist artifacts.
- Native-app feel: kill tap-highlight, long-press callout, and stray text
selection (inputs/messages opt back in); touch-action: manipulation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
77 lines
2.9 KiB
Groovy
77 lines
2.9 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
// Release signing is read from android/keystore.properties (git-ignored). When it
|
|
// is absent (e.g. fresh checkout / CI without secrets) the release build stays
|
|
// unsigned instead of failing the configuration.
|
|
def keystorePropsFile = rootProject.file("keystore.properties")
|
|
def keystoreProps = new Properties()
|
|
if (keystorePropsFile.exists()) {
|
|
keystoreProps.load(new FileInputStream(keystorePropsFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "com.bargevasat.app"
|
|
compileSdk = rootProject.ext.compileSdkVersion
|
|
defaultConfig {
|
|
applicationId "com.bargevasat.app"
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
versionCode 1
|
|
versionName "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:!*~'
|
|
}
|
|
}
|
|
signingConfigs {
|
|
if (keystorePropsFile.exists()) {
|
|
release {
|
|
storeFile file(keystoreProps['storeFile'])
|
|
storePassword keystoreProps['storePassword']
|
|
keyAlias keystoreProps['keyAlias']
|
|
keyPassword keystoreProps['keyPassword']
|
|
}
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
if (keystorePropsFile.exists()) {
|
|
signingConfig signingConfigs.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")
|
|
}
|