Code Monkey home page Code Monkey logo

whatsjava's People

Contributors

louuke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whatsjava's Issues

"Invalid tag for list size" and "Invalid node"

Does anyone know what might be causing this exception all the time?

image

Is that critical? Are there tags that are not mapped, or is it something else, like a real bug?

On Baileys project this does not seem to happen, but I could not find the difference comparing both implementations.
Any help?

Adding new feature to request status information for a contact

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

How to get status send message, I detect Log when :

  • My Message is Sent, the log is Cmd,ack:1
  • My Message is Receive to remoteJid, the log is Cmd,ack:2
  • My Message is Read by remoteJid, the log is Cmd,ack:3

Or how to get this Log:
s73,["Msg",{"cmd":"ack","id":"31AABD2D96B7E8AF220B266CF3DAD3F3","ack":1,"from":"[email protected]","to":"[email protected]","t":1599140847}]

Thank

Library completely not work

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)

receive message exception

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)

Auth with specify path

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 Feature 😁

Request features as developed by: go-whatsapp
include:

  • HandleDocumentMessage, solved by me πŸ‘
  • HandleAudioMessage, solved by me πŸ‘
  • HandleContactMessage, solved by me πŸ‘
  • HandleBatteryMessage
    and
  • sendContactMessage, solved by me πŸ‘

thank you very much and sorry if this is a bit troublesome πŸ™πŸ™πŸ™πŸ™πŸ™πŸ™

Update library version

I like this repo. Please keep the good work up!

Can you please update the library version?

Detect deleted messages

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

loadChats give null

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?

incompatibility WhatsAPP beta

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

sendMessage

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 ?

Help To Encrypt Media

Can you help me to create a function to encrypt media to be sent as picture / document / video / audio messages?

Thank you

Status view count

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.

Run Error

I Try you library always error after login success...!
image

but is oke for send & receive message

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.