knowledgecode / WebSocket-for-Android

Cordova/PhoneGap plugin that makes WebSocket available on Android
Apache License 2.0
143 stars 53 forks source link

Unescape string in SendingTask before sending it to server #28

Closed shilder closed 8 years ago

shilder commented 8 years ago

SendingTask.java line 58

conn.sendMessage(rawArgs.substring(11, rawArgs.length() - 2));

rawArgs contains JSON.stringifyed string, which escapes some symbols (specifically double quotes)

You should unescape them before sending it to server.

Something like

JSONArray json = new JSONArray(rawArgs);
String str = (String)json.get(0);
conn.sendMessage(str.substring(9, str.length()));
knowledgecode commented 8 years ago

Sorry for my late response, and thank you for pointing out the bug. I've just fixed it and published as ver.0.11.1.