Obfuscation problem with HealthVault SDK

Aug 23, 2013 at 2:31 PM

I need to obfuscate my project and all is okay except for the log4j-1.2.14.jar which is used by HealthVault SDK. See error trace below. I tried to remove some class files from the log4j-1.2.14.jar but it does not solve the problem.

also adding this to the proguard.cfg does not solve the issue.

-libraryjars android_healthvault/android/android-sdk/libs/log4j-1.2.14.jar
-libraryjars android_healthvault/android/android-sdk/libs/slf4j-api-1.4.2.jar
-libraryjars android_healthvault/android/android-sdk/libs/slf4j-log4j12-1.4.2.jar

Question is whether this SDK can be updated with log4j jar files that do not rely on Swing classes.

Unexpected error while performing partial evaluation:
Class = [org/apache/log4j/chainsaw/Main]
Method = [<init>()V]
Exception = [java.lang.IllegalArgumentException] (Can't find any super classes of [org/apache/log4j/chainsaw/LoadXMLAction] (not even immediate super class [javax/swing/AbstractAction]))

java.lang.IllegalArgumentException: Can't find any super classes of [org/apache/log4j/chainsaw/LoadXMLAction] (not even immediate super class [javax/swing/AbstractAction])
at proguard.evaluation.value.ReferenceValue.generalize(ReferenceValue.java:287)
Aug 26, 2013 at 3:44 PM

I haven't tried obfuscating the sdk. There are only a few log calls in the SDK and it would be straight forward to remove them and thus the dependency. Feel free to remove them from your own copy of the source and compile a new SDK. I'll have to work on a different log model in the future.

Aug 27, 2013 at 4:17 AM

I looked at the SDK and there are no Log statements in the code. Why do you have those jar files included in the SDK? It would be good to remove jar files you dont use. The log4j-1.2.14.jar is a big offender using Swing classes which are not used in Android and Proguard (the obfuscator) does not like it at all!

I tried removing some jar files but when i obfuscate it it wont work.

Aug 27, 2013 at 5:56 PM
I agree that logging should be streamlined/fixed/etc..

The log statements are in the base SDK. The Android SDK is written on top of a more generic SDK also used for web apps. You can find it in the folder "sdk". You will need maven to compile the sdk.