Giter Club home page Giter Club logo

Comments (2)

kodewithaayush avatar kodewithaayush commented on July 18, 2024

Update:

I was able to resolve this.
Now I am facing another issue while deserialization

I just want to obfuscate one package and want to keep rest of my classes as it is, still I guess proguard is modifying the byte code of the class I added as Keep in the pro rules.
java.lang.IllegalStateException: unread block data
at java.base/java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:3033)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1722)
at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2496)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2390)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2228)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1687)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:489)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:447)
at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:87)
at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:129)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:507)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

sample.pro
-keep class java.** { ; }
-keep class kotlin.
* { ; }
-keep class groovy.
* { *; }

-keep interface java.** { ; }
-keep interface kotlin.
* { ; }
-keep interface groovy.
* { *; }

#-dontnote kotlin.**
#-dontnote kotlinx.**
#-dontnote com.google.gson.**

-keep class com.datametica.eagle.service.* {
*;
}

-keep class com.datametica.eagle.input.* {
;
}
-keep class com.datametica.eaglecore.enrichstatement.result.
* {
*;
}

-keep class com.datametica.eaglecore.enrichstatement.domain.entity.** {
;
}
-keep class com.datametica.eaglecore.relationshipextraction.services.
{
;
}
-keep class com.datametica.eagle.schema.
{
;
}
-keep class com.datametica.eagle.sql.dictionary.
{
;
}
-keep class com.datametica.eagle.extensions.
{
;
}
-keep class com.datametica.eaglecore.relationshipextraction.domain.
{
*;
}

-keep interface com.datametica.eaglecore.relationshipextraction.domain.* {
*;
}

-keep interface com.datametica.eaglecore.relationshipextraction.services.* {
;
}
-keep,includedescriptorclasses,includecode class com.datametica.eagle.serialization.kryo.
* {
*;
}

-keep enum ** {
*;
}

-keepclassmembers class ** {
static java.lang.String *;
}

-keepclassmembers class ** {
synthetic ;
synthetic ;
}
-keepparameternames

-keep class com.datametica.eaglecore.commons.dictionary.* {
;
}
-keep class com.datametica.eagle.provider.querylogprovider.
{
;
}
-keep class com.datametica.eaglecore.enrichstatement.builder.domain.
{
;
}
-keep class com.datametica.eaglecore.enrichstatement.expression.
{
;
}
-keep interface com.datametica.eaglecore.enrichstatement.expression.
{
;
}
-keep public class com.datametica.eaglecore.definitionExtraction.helper.
{
;
}
-keep public class com.datametica.eaglecore.definitionExtraction.domain.
{
;
}
-keep public class com.datametica.eaglecore.definitionExtraction.core.
{
;
}
-keep public class com.datametica.eaglecore.calcite.
* {
*;
}
#Testing purpose

-keepattributes Signature
-keepattributes SourceFile,ConstantValue,LineNumberTable,RuntimeVisibleAnnotations,RuntimeInvisibleAnnotations,RuntimeVisibleParameterAnnotations,RuntimeInvisibleParameterAnnotations,StackMapTable,EnclosingMethod
-keepnames class **
-keepnames interface **
-keeppackagenames

-dontshrink
-dontoptimize
-ignorewarnings
-dontpreverify
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontusemixedcaseclassnames
-printconfiguration config-output.txt
-verbose
-forceprocessing
#-dontobfuscate
#-target 11
-printmapping proguard.map

Thanks in advance

from proguard.

mrjameshamilton avatar mrjameshamilton commented on July 18, 2024

If you're running code on the JVM then you must preverify the classes: so you should remove -dontpreverify from the configuration.

If you enable any of shrinking, optimization or obfuscation, then the stackmap frames are removed at the beginning of ProGuard here.

The preverification is then executed at the end of ProGuard to recompute the stackmap frames after any modifications that ProGuard would have made due to shrinking, optimization or obfuscation here.

It's not clear how your problem is related to your configuration though. Can you provide a reproducible sample?

from proguard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.