Skip to content

Commit d087666

Browse files
committed
Add consumer ProGuard rules to Vosk Android AAR (JNA keep rules)
Vosk Android uses JNA; minified apps may need to keep JNA classes/members. This change adds consumer-rules.pro and wires it via consumerProguardFiles so Gradle/AGP users get the rules automatically when minifying.
1 parent 625e44c commit d087666

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

android/lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ android {
1212
versionName = version
1313
archivesBaseName = archiveName
1414
ndkVersion = "28.2.13676358"
15+
consumerProguardFiles 'consumer-rules.pro'
1516
}
1617
compileOptions {
1718
sourceCompatibility JavaVersion.VERSION_1_8

android/lib/consumer-rules.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# JNA rules - required for Vosk to work with R8/ProGuard minification
2+
-keep class com.sun.jna.* { *; }
3+
-keepclassmembers class * extends com.sun.jna.* { public *; }
4+
-dontwarn java.awt.**

0 commit comments

Comments
 (0)