Skip to content

Commit

Permalink
app/proguard-rules.pro: Keep TreeDocumentFile constructor
Browse files Browse the repository at this point in the history
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 <accounts+github@chiller3.com>
  • Loading branch information
chenxiaolong committed Mar 1, 2023
1 parent 6f865de commit 98db351
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<init>(androidx.documentfile.provider.DocumentFile, android.content.Context, android.net.Uri);
}

0 comments on commit 98db351

Please sign in to comment.