Commit ce5f3361 authored by fangzhipeng's avatar fangzhipeng

修复一些问题

parent 49b2510e
result.png

1.47 KB | W: | H:

result.png

1.48 KB | W: | H:

result.png
result.png
result.png
result.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -193,7 +193,7 @@ public class WeChat {
Pattern pattern = Pattern.compile("retcode:\"(.*)\",selector:\"(.*)\"");
Matcher m = pattern.matcher(msg);
m.find();
if ("2".equals(m.group(2))) {
if (!"0".equals(m.group(2))) {
receiveMsg();
}
return m.group(1);
......@@ -350,16 +350,17 @@ public class WeChat {
break;
}
}
SYNC_TIMER.schedule(new TimerTask() {
@Override
public void run() {
try {
sync();
} catch (Exception e) {
e.printStackTrace();
}
}
}, 1000, 2000);
new ReceiveMsgThread().start();
// SYNC_TIMER.schedule(new TimerTask() {
// @Override
// public void run() {
// try {
// sync();
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// }, 1000, 2000);
}
private void initMyAcount(JSONObject msgObject) {
......@@ -397,4 +398,17 @@ public class WeChat {
System.out.println(m.find());
}
class ReceiveMsgThread extends Thread {
@Override
public void run() {
while (true) {
try {
sync();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment