What are the Proguard rules for SciChart?
Does any of the charting/core/data/drawing component uses reflection?
- abc def asked 7 years ago
- You must login to post comments
Hi there,
As I’m aware of SciChart Android doesn’t use reflection which could cause problem with ProGuard minifacation process. So I think it just should work without any special rules for SciChart libraries.
Best regards,
Yura
- Yura Khariton answered 7 years ago
-
cant survive proguard, the error given: JNI DETECTED ERROR IN APPLICATION: java_class == null in call to GetMethodID from void com.scichart.charting.visuals.renderableSeries.SeriesDrawingManager.initialize()
- You must login to post comments
Hi abc def (what’s your name btw?)
I’ve attached our pro guard rules below. Does this help?
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:/Program Files/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# typical library config from http://proguard.sourceforge.net/manual/examples.html#library
-keepparameternames
-renamesourcefileattribute SourceFile
-keepattributes Exceptions,InnerClasses,Signature,Deprecated, SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
# skip public classes + its protected and public methods, fields etc.
-keep public class * {
public protected *;
}
# These methods are inserted by the javac compiler and the jikes compiler respectively, in JDK 1.2 and older, to implement the .class construct.
# ProGuard will automatically detect them and deal with them, even when their names have been obfuscated. However, other obfuscators may rely on the original method names.
# It may therefore be helpful to preserve them, in case these other obfuscators are ever used for further obfuscation of the library.
-keepclassmembernames class * {
java.lang.Class class$(java.lang.String);
java.lang.Class class$(java.lang.String, boolean);
}
# leave native methods - we need to save method's names to correctly call C++ code
-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# need to preserve some methods for enum classes
-keepclassmembers,allowoptimization enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
- Andrew Burnett-Thompson answered 7 years ago
-
haha, my name is in my email addr. “abd def” was just to speed up registration process. Only made it work by applying this rule. -keep public class com.scichart.** { public protected *; }. had to keep everything, it seems native code accesses some java methods. e.g. Point2DSeries#setSize() method not found in native lib. I used proguard-android-optimize, probably it stripped it away.
- You must login to post comments
Please login first to submit.