nurahmandani / asmack

Automatically exported from code.google.com/p/asmack
Other
0 stars 0 forks source link

Obfuscation with Proguard requires changing previously working code #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What are you doing to produce the error?

ConnectionConfiguration config = new ConnectionConfiguration(talk.google.com, 
5222, gmail.com);
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
connection.login(username@gmail.com, password);

What is the expected output?
successful authentication

What do you see instead? (Please attach a debug enabled logcat)

successful authentication, but if I obfuscate the code using Proguard, then 
login(...) results in an exception:

09-05 14:14:04.656: DEBUG/XMPP(6076): jid-malformed(400) Malformed JID 
'gmail.com@gmail.com': domain label contains illegal character '@'

When I remove the @gmail.com the result is the opposite: The authentication 
fails if not obfuscated, but succeeds if obfuscated.

What version of aSmack / Android / Device do you use?

aSmach version 5/07/10 (featured)
Android OS/device: the following device/os versions all result in the same 
behavior:

Motorola Backflip/2.1
HTC Aria/2.2
LG 3D/2.2
Samsung Galaxy S/2.2
HTC EVO 4G/2.3.3
Motorola ATRIX/2.3.4

What server do you use? Is there a public server to reproduce the problem?

Google Talk - talk.google.com (public)

What else might help us to reproduce and hunt down the problem?

Original issue reported on code.google.com by kaamel.i...@gmail.com on 5 Sep 2011 at 10:05

GoogleCodeExporter commented 9 years ago
This proguard configuration worked for me:

-dontwarn org.jivesoftware.**

-keepclasseswithmembers class de.measite.smack.** {
    *;
}

-keepclasseswithmembers class * extends 
org.jivesoftware.smack.sasl.SASLMechanism {
    public <init>(org.jivesoftware.smack.SASLAuthentication);
}

Original comment by Steeli...@gmail.com on 3 Feb 2013 at 9:02