# R8 rules for the ThreadCount shell. # # Capacitor's own AAR already contributes consumerProguardFiles that keep anything extending # com.getcapacitor.Plugin and the @CapacitorPlugin / @PluginMethod members. These rules cover the # things that sit outside that net — everything the bridge, the WebView or the manifest reaches by # name rather than by a reference R8 can see. # # The cost of getting this wrong is a build that installs and then fails the moment someone scans, # so the bias here is deliberately towards keeping too much: the bundle is 15 MB of native # libraries, and none of what follows is where the size is. # The plugins named in assets/capacitor.plugins.json. Capacitor resolves these by string at # startup, so R8 sees no reference to them at all. -keep class io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.** { *; } -keep class com.capacitorjs.plugins.haptics.** { *; } # The bridge, its WebView plumbing, and the annotations that drive plugin dispatch. -keep class com.getcapacitor.** { *; } -keep interface com.getcapacitor.** { *; } -keep @interface com.getcapacitor.** { *; } # Anything the WebView calls from JavaScript. proguard-android.txt carries this rule too; it is # repeated here because losing it silently breaks every call from the page into the app. -keepclassmembers class * { @android.webkit.JavascriptInterface ; } # The activity is named in AndroidManifest.xml, and it subclasses BridgeWebViewClient to keep the # back button honest. -keep class tech.threadcount.app.** { *; } # MLKit resolves its barcode models and CameraX its implementation classes reflectively. Both ship # consumer rules of their own; these are belt and braces on the paths that actually run here. -keep class com.google.mlkit.** { *; } -keep class com.google.android.gms.internal.mlkit_vision_barcode.** { *; } -dontwarn com.google.mlkit.** # Keep source file and line numbers in stack traces, and tell Play's symbolicator where to look. # Without these a crash report names the class but not the line that threw. -keepattributes SourceFile,LineNumberTable -renamesourcefileattribute SourceFile # Annotations drive both Capacitor's dispatch and AndroidX's lifecycle wiring. -keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod