From 98db351718699294a341b6a73dae1a0820b85d8a Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Wed, 1 Mar 2023 16:15:38 -0500 Subject: [PATCH] app/proguard-rules.pro: Keep TreeDocumentFile constructor We call it via reflection in our faster DocumentFile extensions and the first parameter was being optimized out in release builds because it is always null in the usages that R8 is able to analyze. Related-to: #257 Fixes: #260 Signed-off-by: Andrew Gunnerson --- app/proguard-rules.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index a53f59c5a..e396b8a1b 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -23,3 +23,9 @@ # Disable obfuscation completely for BCR. As an open source project, # shrinking is the only goal of minification. -dontobfuscate + +# We construct TreeDocumentFile via reflection in DocumentFileExtensions +# to speed up SAF performance when doing path lookups. +-keepclassmembers class androidx.documentfile.provider.TreeDocumentFile { + (androidx.documentfile.provider.DocumentFile, android.content.Context, android.net.Uri); +}