shivao-projeto/mobile/android/app/build.gradle
PontualTech / Karlão 578793d097
Some checks are pending
Build Android (APK + AAB) / build-android (push) Waiting to run
feat(bms): dashboard visual + RX log bytes + writeWithoutResponse fallback v1.10.1
3 problemas atacados após teste de Karlão:

1) BMS conectou mas não respondeu o comando 0x03:
   - Log mostra "← RX X bytes: hex" pra cada notification recebida
   - Listener registrado ANTES de startNotifications (fix de race condition)
   - Wait 500ms entre subscribe e primeiro write (alguns BMS precisam wake)
   - Após 5s sem resposta, tenta writeWithoutResponse automaticamente
   - Botão 🔄 Re-ler manual no card pra forçar query

2) Karlão pediu "monitor visual humano":
   - Modal full-screen " Monitor da Bateria" com:
     * Círculo SoC grande SVG (ring chart 160x160) com cor por nível
     * Status flow grande:  CARREGANDO / ↓ DESCARGA / — REPOUSO
     * Tempo restante calculado (descarga = remainCap/current)
     * Tempo até cheia (carga = (totalCap-remainCap)/current)
     * 4 cards: Tensão · Corrente · Potência · Capacidade
     * Linha info: ciclos · temperaturas · firmware version
     * Grid de células coloridas por health (vermelho <3.0V, verde >3.6V)
     * Auto-refresh 10s enquanto modal aberto
   - Botão 📊 Monitor no card BMS abre dashboard

3) Estado de erro mais claro:
   - Dashboard mostra "Aguardando dados..." se b.voltage ainda não chegou
   - Diagnóstico log destaca chunks RX em azul

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 17:06:44 -03:00

63 lines
2.4 KiB
Groovy

apply plugin: 'com.android.application'
android {
namespace "br.com.pontualtech.shivao"
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "br.com.pontualtech.shivao"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 17
versionName "1.10.1"
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 {
release {
storeFile file('shivao-release.keystore')
storePassword 'ShivaoKeystore2026!'
keyAlias 'shivao'
keyPassword 'ShivaoKeystore2026!'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
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")
}