louuke / whatsjava Goto Github PK
View Code? Open in Web Editor NEWImplementation of the WhatsApp Web API in Java
License: Apache License 2.0
Implementation of the WhatsApp Web API in Java
License: Apache License 2.0
A function to request this information including online status would be great.
This is very helpful to see if someone is or was online. After debugging there is a data packet when a client clicked on your profile (not 100% sure).
Online status is also returned if you requested the status at least once (at least in https://github.com/Enrico204/whatsapp-decoding/blob/master/PROTOCOL.md).
Tried extending, but none of that worked.`I am not 100% sure how the json is generated.
public void loadContact(String remoteJid) {
sendBinary("[\"query\", {type: \"Presence\", lastseen: \"" + remoteJid + "\"}, null]", WAMetric.queryStatus, WAFlag.ignore);
sendBinary("[\"query\", {type: \"ProfilePicThumb\"}, \""+remoteJid+"\"]", WAMetric.queryStatus, WAFlag.ignore)
}
How to get status send message, I detect Log when :
Or how to get this Log:
s73,["Msg",{"cmd":"ack","id":"31AABD2D96B7E8AF220B266CF3DAD3F3","ack":1,"from":"[email protected]","to":"[email protected]","t":1599140847}]
Thank
Hello
When I run :
client.addClientActionListener(new ClientActionListener() {
@Override
public void onQRCodeScanRequired(BufferedImage qr) {
System.out.println("Authentication required! Please scan the QR code!");
File outputFile = new File("qr.jpg");
try {
ImageIO.write(qr, "jpg", outputFile);
} catch (IOException e) {
e.printStackTrace();
}
}
});
int httpCode = client.openConnection();
if (httpCode == 200) {
System.out.println("Logged in successfully!");
} else {
System.out.println("Login failed! Code: " + httpCode);
}
throw an exception :
Exception in thread "main" java.lang.IllegalStateException: Not a JSON Object: ["Cmd",{"type":"update"}] at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:91) at icu.jnet.whatsjava.helper.Utils.encodeValidJson(Utils.java:56) at icu.jnet.whatsjava.whatsapp.WABackendConnector.initOrRestoreSession(WABackendConnector.java:101) at icu.jnet.whatsjava.whatsapp.WABackendConnector.openConnection(WABackendConnector.java:58)
java.lang.NegativeArraySizeException: null
at com.yqg.whatopia.service.whatsapp.binary.BinaryDecoder.readList(BinaryDecoder.java:279)
at com.yqg.whatopia.service.whatsapp.binary.BinaryDecoder.readNode(BinaryDecoder.java:227)
at com.yqg.whatopia.service.whatsapp.binary.BinaryDecoder.decode(BinaryDecoder.java:21)
at com.yqg.whatopia.service.whatsapp.impl.WAClient.onMessage(WAClient.java:301)
at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.java:326)
at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:221)
at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:105)
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:273)
at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:213)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Hello!
I try load session from another (not credentials.json) file, but when i create a WAClient via
WAClient client = new WAClient();
WAClient use default file "credentials.json" and after that constructor already set new auth :
public WABackendConnector() { this.auth = AuthCredentials.loadAuthCredentials(credentialsPath); }
After that i try set a new file
client.setCredentialsPath("wa-sessions/" + path);
But in WAClient in AuthCredentials auth i have a auth based on credentials.json
I think need on method
public void setCredentialsPath(String credentialsPath) { this.credentialsPath = credentialsPath; }
Reload auth
public void setCredentialsPath(String credentialsPath) { this.credentialsPath = credentialsPath; this.auth = AuthCredentials.loadAuthCredentials(credentialsPath); }
Thanks
Request features as developed by: go-whatsapp
include:
thank you very much and sorry if this is a bit troublesome ππππππ
I like this repo. Please keep the good work up!
Can you please update the library version?
How i can detect when a person delete a message in a chat o group, example:
Person send a message ("Test msg")
Person delete the message ("Test msg")
I need get the person and the message
trying to get chat count and unread messages, I query loadChats()
['query', {type: 'chat', epoch: '4'}, null]
response is
["response", {"duplicate":"true","type":"chat","status":"17931"}, null]
other requests works fine.
any help, please?
Hi,
The beta version of WhatsApp, where up to 4 open sessions are allowed, does not finish linking the account
It happens that when scanning the QR code, a poster appears on the cell phone requesting to scan again and it does not move from there
Thank you very much for the contribution to the community, the product works excellent, congratulations and thanks again
Hi,
How to send media like Images, Document, Videos, etc?
Hello,
When I try to send a message I am having this issue:
java.lang.NoClassDefFoundError: Could not initialize class com.google.protobuf.CodedOutputStream
at icu.jnet.whatsjava.encryption.proto.ProtoBuf$WebMessageInfo.getSerializedSize(ProtoBuf.java) ~[WhatsJava-v1.0.2.jar:na]
at com.google.protobuf.AbstractMessageLite.toByteArray(AbstractMessageLite.java:69) ~[WhatsJava-v1.0.2.jar:na]
at icu.jnet.whatsjava.messages.WAMessageBuilder.generateJson(WAMessageBuilder.java:20) ~[WhatsJava-v1.0.2.jar:na]
But 2 days before the same code was working well. Any suggestion?
Other question is how can I send the picture or video ?
Add delete message feature and clean messages in chat π
How to send emoji in message. and also need list of emoji codes.
please provide list and give example to send emoji.
Can you help me to create a function to encrypt media to be sent as picture / document / video / audio messages?
Thank you
Hello,
how can I retrieve a list of all chats?
Kind regards,
Michael.
Hello. Thank you for great work!
Can you help me how can i get Status view count? I know it's not implemented in your library.
Hi ! Do you have some example of how send Image ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.