Cannot include Proguard in Android project containing jsch lib

I am trying to use Proguard to obfuscate my Android application that uses the jsch-1.50.jar library to upload files to an SFTP server.

When I do an export from Eclipse, I get a warning “cannot refer to a class” and nothing is generated. I tried all sorts of options to tell Proguard to ignore jsch classes, but that doesn't make any difference, and so I wonder if I am not mistaken how this works. I'm not too worried about optimization, but I would like the code to be confused.

I set the proguard properties as follows:

-keep class com.jcraft.jsch.jce.*
-keep class * extends com.jcraft.jsch.KeyExchange
-keep class com.jcraft.jsch.**
-keep class com.jcraft.jzlib.ZStream
-keep class com.jcraft.jsch.Compression
-keep class org.ietf.jgss.*

-libraryjars /libs/jsch-0.1.50.jar

The project properties file contains an entry for "proguard.config = proguard-project.txt".

Duplicate export result deleted: -

Warning: com.jcraft.jsch.jcraft.Compression: can't find referenced class com.jcraft.jzlib.ZStream
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.Oid
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.GSSManager
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.GSSException
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.GSSContext
Warning: com.jcraft.jsch.jgss.GSSContextKrb5: can't find referenced class org.ietf.jgss.MessageProp
Warning: there were 44 unresolved references to classes or interfaces.
You may need to specify additional library jars (using '-libraryjars').
Error: Please correct the above warnings first.

.

Mike

+4
1

...

jzlib-1.1.1.jar

-libraryjars /libs/jzlib-1.1.1.jar

proguard-properties.txt.

, "class org.ietf.jgss",

-libraryjars /libs/jsch-0.1.50.jar(!com.jcraft.jsch.jgss/GSSContextKrb5.class)

. : -

-dontwarn org.ietf.jgss.**
+7

All Articles