powered by Jive Software

Smack and proguard

I’‘m trying to obfuscate an application I’'ve written using smack 1.4.1 (running w/ messenger 2.1.1). The whole app is packaged in one jar. I obfuscate it with proguard by keeping just the main methods in the client and server application classes.

The server runs fine and is able to see the client login and send the client the first message. The client logs in and the smack debug output shows me that it is receiving the first message. However, my call to the packet collector for the next packet never returns so my application can process this message that was received on the client side.

At some point, presumably after the message is received (but not processed by my app), the client logs itself out on its own. The server sees this change in presence. The client logout is not processed through my logout infrastructure using my own single call to XMPPConnection.close(). It appears to be happening somewhere at the smack level, but I can’'t figure out where or how or when.

As if that weren’'t confounding enough, the real weirdness is that this ONLY happens on the obfuscated jar. If I run against the original, unobfuscated jar, everything runs normally.

Any insights would be appreciated.

Cheers

UPDATE: this appears to be a problem with obfuscation in general. I tried obfuscating w/ yguard and had the same effect. The client logs out upon receiving its first message, but not processing it.

Message was edited by:

daxis

Bonehead mistake. My software provides a couple of IQ extensions. I forgot that Smack would be looking for interface methods on these classes. Once I exposed those methods, everything works again.

Woohoo!