android - Proguard error if i use itext Library jar -
proguard won't work itext library. errors related org.spongycastle.**
org.bouncycastle.*
, com.itext.pdf.**
have tried use keep on these packages without success.
my proguard config file this:
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* -optimizationpasses 5 -allowaccessmodification -dontpreverify -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose -keepattributes *annotation* -keep public class com.google.vending.licensing.ilicensingservice -keep public class com.android.vending.licensing.ilicensingservice # native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames class * { native <methods>; } -keepclassmembers public class * extends android.view.view { void set*(***); *** get*(); } -keepclassmembers class * extends android.app.activity { public void *(android.view.view); } -keepclassmembers enum * { public static **[] values(); public static ** valueof(java.lang.string); } -keep class * implements android.os.parcelable { public static final android.os.parcelable$creator *; } -keepclassmembers class * implements java.io.serializable { static final long serialversionuid; private static final java.io.objectstreamfield[] serialpersistentfields; private void writeobject(java.io.objectoutputstream); private void readobject(java.io.objectinputstream); java.lang.object writereplace(); java.lang.object readresolve(); } -keepclassmembers class **.r$* { public static <fields>; } -dontwarn android.support.** -dontwarn javax.activation.** -dontwarn org.apache.** -dontwarn org.bouncycastle.** -dontwarn sun.misc.unsafe -dontwarn com.google.** -dontwarn com.esotericsoftware.** -dontwarn javax.naming.** -libraryjars <java.home>/lib/rt.jar -keepattributes *annotation* -keep public class * extends android.content.broadcastreceiver -keep public class * extends android.content.contentprovider -keep public class com.android.vending.licensing.ilicensingservice -keep class com.google.** -keep class * extends com.google.api.client.json.genericjson { *; } -keep class javax.** {*;} -keep class java.lang.reflect.** -keep class com.sun.** {*;} -keep class myjava.** {*;} -keep class org.apache.** -keep class org.bouncycastle.** -keep public class mail {*;} -keep public class * extends android.app.service -keep public class * extends android.content.broadcastreceiver -keep public class * extends android.content.contentprovider -keep class org.spongycastle.** -keep class com.itextpdf.text.pdf.** {*;} -keep class com.esotericsoftware.** -dontshrink
the error log
error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.ripemd160$digest error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.ripemd256$digest error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.gost3411$digest error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.md2 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.md5 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.sha1 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.sha224 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.sha256 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.sha384 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.sha512 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.ripemd128 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.ripemd160 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.ripemd256 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.bouncycastledigest: can't find referenced class org.spongycastle.jcajce.provider.digest.gost3411 error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo: can't find referenced class org.spongycastle.asn1.asn1sequence error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo: can't find referenced class org.spongycastle.asn1.asn1inputstream error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo: can't find referenced class org.spongycastle.asn1.asn1taggedobject error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo: can't find referenced class org.spongycastle.asn1.asn1primitive error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo$x500name: can't find referenced class org.spongycastle.asn1.asn1sequence error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo$x500name: can't find referenced class org.spongycastle.asn1.asn1set error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo$x500name: can't find referenced class org.spongycastle.asn1.asn1string error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateinfo$x500name: can't find referenced class org.spongycastle.asn1.asn1objectidentifier error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateutil: can't find referenced class org.spongycastle.asn1.x509.extension error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.certificateutil: can't find referenced class org.spongycastle.asn1.asn1objectidentifier error:proguard: [myapp] warning: com.itextpdf.text.pdf.security.tsainfobouncycastle: can't find referenced class org.spongycastle.tsp.timestamptokeninfo error:proguard: [myapp] warning: there 667 unresolved references classes or interfaces. error:proguard: [myapp] may need add missing library jars or update versions. error:proguard: [myapp] if code works fine without missing classes, can suppress error:proguard: [myapp] warnings '-dontwarn' options.
try these 2 lines:
-keep class org.spongycastle.** { *; } -dontwarn org.spongycastle.**
your logcat saying:
if code works fine without missing classes, can suppress warnings '-dontwarn' options.
Comments
Post a Comment