poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Stadler <dominik.stad...@gmx.at>
Subject Re: Android + Proguard + Apache POI
Date Wed, 07 Jun 2017 19:28:48 GMT
Hi,

I am not an expert in proguard, so cannot give help in that regard, but
some time ago I built a project that allows me to do some stuff with POI on
Android, see https://github.com/centic9/poi-on-android/ for details. Maybe
some of the build-files there let you see your problem.

Also the error does not necessarily indicate a problem with obfuscation, it
seems the com.bea.xml.stream package is tried when no other XML Parser is
found and thus it might just be that you do not have an XML Parser
available. In poi-on-android I use a separate implementation aalto-xml
<https://github.com/FasterXML/aalto-xml> to account for that...

Dominik.

On Sat, Jun 3, 2017 at 2:38 PM, Delphian <delphian@tut.by> wrote:

> Someone was able to get the Apache POI library to work after obfuscation. I
> read a lot of information, tried different methods, but still get the
> error:
>
> *a.a.b.a: Provider com.bea.xml.stream.EventFactory not found
> org.apache.poi.openxml4j.opc.internal.marshallers.
> PackagePropertiesMarshaller.<clinit>(Unknown
> Source)
> at org.apache.poi.openxml4j.opc.OPCPackage.init(Unknown Source)
> at org.apache.poi.openxml4j.opc.OPCPackage.<init>(Unknown Source)
> at org.apache.poi.openxml4j.opc.Package.<init>(Unknown Source)
> at org.apache.poi.openxml4j.opc.ZipPackage.<init>(Unknown Source)
> at org.apache.poi.openxml4j.opc.OPCPackage.create(Unknown Source)
> at org.apache.poi.xssf.usermodel.XSSFWorkbook.newPackage(Unknown Source)
> at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(Unknown Source)
> at org.apache.poi.xssf.streaming.SXSSFWorkbook.<init>(Unknown Source)
> at org.apache.poi.xssf.streaming.SXSSFWorkbook.<init>(Unknown Source)
> at org.apache.poi.xssf.streaming.SXSSFWorkbook.<init>(Unknown Source)*
>
> I added the jars files into libs folder:
> poi-ooxml-schemas-3.12-20150511-a.jar and poi-3.12-android-a.jar.
>
> My proguard-rules.pro:
>
> -dontwarn org.apache.**
> -dontwarn org.openxmlformats.**
> -dontwarn schemasMicrosoftComVml.**
> -dontwarn org.w3.x2000.**
> -dontwarn org.etsi.uri.**
> -dontwarn com.microsoft.schemas.**
> -dontwarn schemasMicrosoftComOfficeOffice.**
> -dontwarn schemasMicrosoftComOfficeExcel.**
> -dontwarn com.google.common.**
>
> -keeppackagenames org.jsoup.nodes
> -keepattributes *Annotation*, EnclosingMethod,Signature,
> JavascriptInterface
> -keep class com.google.common.**
>
> #Parcel
> -keep class * implements android.os.Parcelable {
>   public static final android.os.Parcelable$Creator *;
> }
> -keep class org.parceler.Parceler$$Parcels
>
> #Apache poi
> -keep public class org.apache.poi.** {*;}
> -keep class com.fasterxml.aalto.** {*;}
> -keep class org.apache.xmlbeans.** {*;}
> -keep class org.openxmlformats.schemas.** {*;}
> -keep class com.microsoft.schemas.** {*;}
>
> #BUTTERKNIFE
> -keep public class * implements butterknife.internal.ViewBinder { public
> <init>(); }
>
> # Prevent obfuscation of types which use ButterKnife annotations since the
> simple name
> # is used to reflectively look up the generated ViewBinder.
> -keep class butterknife.*
> -keepclasseswithmembernames class * { @butterknife.* <methods>; }
> -keepclasseswithmembernames class * { @butterknife.* <fields>; }
>
>
>
> --
> View this message in context: http://apache-poi.1045710.n5.
> nabble.com/Android-Proguard-Apache-POI-tp5727688.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message