From 68ebb4caae5d37b738c8a7bcdb39101a61a06d8b Mon Sep 17 00:00:00 2001 From: Roman Zimmer Date: Mon, 19 Sep 2022 23:42:04 +0200 Subject: [PATCH] Update R8/ProGuard rules to avoid crash in release The following exception in `PDFMergerUtility` happened without the additional keep-rule: ``` java.io.IOException: Error while trying to create value in number tree:com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDParentTreeValue. [class com.tom_roush.pdfbox.cos.COSArray] at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:20) at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:189) at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:18) Caused by: java.lang.NoSuchMethodException: com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDParentTreeValue. [class com.tom_roush.pdfbox.cos.COSArray] at java.lang.Class.getConstructor0(Class.java:2332) at java.lang.Class.getDeclaredConstructor(Class.java:2170) at com.tom_roush.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:16) ``` --- library/consumer-proguard-rules.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/consumer-proguard-rules.txt b/library/consumer-proguard-rules.txt index 6a94f4b8..316429f5 100644 --- a/library/consumer-proguard-rules.txt +++ b/library/consumer-proguard-rules.txt @@ -2,3 +2,5 @@ -keep,allowobfuscation class * extends com.tom_roush.pdfbox.pdmodel.encryption.SecurityHandler { public (...); } + + -keep,allowobfuscation class com.tom_roush.pdfbox.pdmodel.documentinterchange.** { *; }