I use the iText library to write new information to existing PDF files. To encrypt PDF files, iText (for Android) uses the SpongyCastle library, which is an Android BouncyCastle port. Unfortunately, both iText and Spongycastle contain a very large number of methods (15k +). Android has a hard limit on the number of methods you can use (64k). Fortunately, iText does not use many classes at Spongycastle Bank.
I was able to unzip the Spongycastle jar and delete all classes that iText does not use and does not decompress the file.
Everything worked fine until I ran proguard in the maven build to create the final apk. I get the following IOException, which makes no sense to me.
Your help in resolving this error will be greatly appreciated.
Thanks in advance. I also included the proguard.cfg part, which refers to the bouncycastle.
-keep class org.bouncycastle.crypto.** {*;} [DEBUG] Reading program jar [.m2/repository/com/madgag/sc-light-jdk15on/1.47.0.2/sc-light-jdk15on-1.47.0.2-reduced.jar] (filtered) [INFO] Warning: class [spongycastleseriouslyreduced/org/spongycastle/asn1/ASN1InputStream.class] unexpectedly contains class [org.spongycastle.asn1.ASN1InputStream] [INFO] Warning: class [spongycastleseriouslyreduced/org/spongycastle/asn1/DEROutputStream.class] unexpectedly contains class [org.spongycastle.asn1.DEROutputStream] [INFO] Warning: class [spongycastleseriouslyreduced/org/spongycastle/crypto/BlockCipher.class] unexpectedly contains class [org.spongycastle.crypto.BlockCipher] [INFO] java.io.IOException: Can't read [.m2/repository/com/madgag/sc-light-jdk15on/1.47.0.2/sc-light-jdk15on-1.47.0.2-reduced.jar(;;;;!META-INF/maven
source share