From 75300292ec34c00486d179b1b1170d97a2208f21 Mon Sep 17 00:00:00 2001 From: mac Date: Mon, 23 Feb 2026 16:47:22 -0500 Subject: [PATCH] test --- app/proguard-rules.pro | 77 ++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index d6ae0ca..9a979df 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,26 +1,61 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html +# --- SCAN-WICH SECURITY RULES --- -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} +# Optimisations agressives +-optimizationpasses 5 +-allowaccessmodification +-mergeinterfacesaggressively -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +# Supprimer les informations de débogage +-renamesourcefileattribute SourceFile +-keepattributes SourceFile,LineNumberTable -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile +# Offusquer plus profondément +-repackageclasses '' -# Obfuscation pour protéger les clés d'API --keep class com.example.scanwich.BuildConfig { *; } +# --- FIREBASE / GOOGLE --- +# Les bibliothèques Google fournissent leurs propres règles optimisées. +-dontwarn com.google.firebase.** +-dontwarn com.google.android.gms.** +-dontwarn com.google.errorprone.annotations.** + +# --- ITEXT --- +# On cible plus précisément les packages iText utilisés pour le rapport PDF -dontwarn com.itextpdf.** --keep class com.itextpdf.** { *; } +-keep class com.itextpdf.kernel.** { public protected *; } +-keep class com.itextpdf.layout.** { public protected *; } +-keep class com.itextpdf.io.** { public protected *; } + +# --- RETROFIT / OKHTTP --- +-keepattributes Signature, InnerClasses, EnclosingMethod +-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations + +# Garder uniquement les annotations Retrofit +-keep @interface retrofit2.http.* +-dontwarn retrofit2.** +# Note: On laisse Retrofit gérer ses propres règles internes (incluses dans l'AAR) + +# --- ROOM --- +# On ne garde que les classes liées à la base de données +-keep class * extends androidx.room.RoomDatabase +-dontwarn androidx.room.paging.** + +# --- DATA MODELS --- +# Crucial : On garde tout ce qui est nécessaire au parsing JSON et à Room +-keepclassmembers class com.example.scanwich.** { + @com.google.gson.annotations.SerializedName ; + @androidx.room.PrimaryKey ; +} + +-keep @androidx.room.Entity class com.example.scanwich.** { *; } + +# On liste explicitement les modèles pour plus de précision +-keep class com.example.scanwich.Meal { *; } +-keep class com.example.scanwich.SportActivity { *; } +-keep class com.example.scanwich.Glycemia { *; } +-keep class com.example.scanwich.FavoriteMeal { *; } +-keep class com.example.scanwich.N8nMealRequest { *; } +-keep class com.example.scanwich.StravaActivity { *; } +-keep class com.example.scanwich.StravaTokenResponse { *; } + +# --- CONFIGURATION --- +-keep class com.example.scanwich.BuildConfig { *; }