ecb44f1934
🐛 Bugfixes: - Correction des noms en double : vérification uniques des joueurs (insensible à la casse) - Accord des verbes selon le nombre de joueurs : "boit/distribue" (1 joueur) vs "boivent/distribuent" (2+) - Défis minimum 3 manches au lieu de 2 (réglable via slider -5 à +15, défaut 0) - Gorgées minimum 1 au lieu de 2 🎨 Design: - Bouton de suppression élégant : circulaire blanc avec icône grise (remplace croix rouge sur fond noir) ♻️ Refactoring (Jeux.java): - Extraction de méthodes longues : processQuestion(), updateQuestion(), displayQuestion() - Constantes pour nombres magiques : MIN_DEFI_ROUNDS, MAX_DEFI_ROUNDS_RANDOM, MIN_AI_GORGEE, etc. - Nouvelles classes internes : PlayerSelectionResult, GorgeeResult, ActionChoiceResult - Méthodes extraites : processVariantes(), processManches(), replacePlayers(), processGorgees(), etc. 🔒 Sécurité: - Suppression des credentials exposés (DB_PASSWORD dans BuildConfig) - Création de SecureConfig.java pour gestion sécurisée des clés API - Validation des clés API avec vérification de format (OpenAI, OpenRouter, Z.ai) - Protection HTML : ErrorHandler.escapeHtml() pour les noms de joueurs ⚠️ Gestion des erreurs: - ErrorHandler.java : centralisation avec logError(), showError(), escapeHtml() - Remplacement de tous les printStackTrace() par Log.e() avec TAG descriptif - Messages utilisateurs clairs et informatifs 🧪 Tests: - QuestionTest.java : 18 tests (constructeur, getters, setters, cas limites) - PlayerStatsTest.java : 22 tests (opérations, Parcelable, indépendance) - QuestionCategoryTest.java : 28 tests (détection catégories, couleurs, priorités) - GameEngineTest.java : +15 tests (manches, états, préservation questions) - Couverture : ~89% sur les classes testées 📦 Dépendances: - compileSdk/targetSdk : 33 → 35 - OkHttp : 4.9.1 → 4.12.0 - Material : 1.9.0 → 1.12.0 - AppCompat : 1.6.1 → 1.7.0 - Gson : 2.8.8 → 2.11.0 📝 Documentation: - Javadoc améliorée pour Question.java, PlayerStats.java - PreferencesKeys.java : constantes centralisées pour SharedPreferences 🔨 Nettoyage: - Suppression de Jeuxold.java (fichier obsolète) - question.json : 165 questions avec IDs uniques (correction des doublons) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
2.0 KiB
Groovy
60 lines
2.0 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
}
|
|
|
|
// Load local.properties
|
|
def localProperties = new Properties()
|
|
def localPropertiesFile = rootProject.file('local.properties')
|
|
if (localPropertiesFile.exists()) {
|
|
localPropertiesFile.withInputStream { localProperties.load(it) }
|
|
}
|
|
|
|
android {
|
|
namespace 'com.example.boidelov3'
|
|
compileSdk 35
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
packagingOptions { resources.excludes.add("META-INF/*") } // This line is added to avoid the error: Duplicate files copied in APK META-INF/LICENSE.txt
|
|
defaultConfig {
|
|
applicationId "com.example.boidelov3"
|
|
minSdk 24
|
|
targetSdk 35
|
|
versionCode 1
|
|
versionName "1.0"
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
// IMPORTANT: Database credentials should NEVER be stored in BuildConfig
|
|
// Use a secure backend API instead, or Android Keystore for local storage
|
|
// These fields are kept empty for backward compatibility but will be removed
|
|
buildConfigField "String", "DB_URL", "\"\""
|
|
buildConfigField "String", "DB_USER", "\"\""
|
|
buildConfigField "String", "DB_PASSWORD", "\"\""
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
|
|
implementation 'androidx.appcompat:appcompat:1.7.0'
|
|
implementation 'com.google.android.material:material:1.12.0'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
|
implementation 'com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.3'
|
|
implementation 'com.google.code.gson:gson:2.11.0'
|
|
|
|
} |