Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAPTCHA is not handled correctly #371

Closed
wangxingge opened this issue Aug 15, 2023 · 6 comments
Closed

CAPTCHA is not handled correctly #371

wangxingge opened this issue Aug 15, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@wangxingge
Copy link

wangxingge commented Aug 15, 2023

I use local stored keys.smile and stores.smile file to logon, but i found my socket is not connected.
I use wireshark to track socket data, i found server send fin ack to my client.

my code as following:
`
public static void main(String[] args) throws InterruptedException, ExecutionException, TimeoutException {
MobileTest rt = new MobileTest();
// rt.createApi();
rt.createApiByUUID(UUID.fromString("eeaa936b-6562-45fd-a9ed-ab29838b37b4"));
api.connectAwaitingLogout();
latch = new CountDownLatch(3);

    rt.log("store: %s", api.store().toJson());
    rt.log("keys: %s", api.keys().toJson());
    rt.log("Connected:%s", api.isConnected());

    // test send message
    Chat chat = Chat.ofJid(ContactJid.of("__my_phone_no___"));
    api.sendMessage(chat, TextMessage.of("Hi,here is from test message!")).thenApply(messageInfo -> messageInfo.message());
    api.store().contacts().forEach(contact -> System.out.println(contact));
    List<Chat> chats = api.socketHandler().store().chats();
    chats.forEach(chat1 -> System.out.println(chat1));

    latch.await();
    rt.log("All threads have finished.");
}

`
my wireshark screenshot as following:
image

can you help me to figure out the reason? or is there any document to describe whatsapp risk rule?

@wangxingge
Copy link
Author

and i always get response from whatsapp server following mesage.
VerificationCodeResponse[number=my_mobile_no, lid=0, status=ERROR, errorReason=CAPTCHA, method=null, codeLength=0, notifyAfter=0, retryAfter=0, voiceLength=0, voiceWait=0, smsWait=0, whatsappOtpWait=0, flashType=0, oldWait=0, securityCodeSet=false, whatsappOtpEligible=false, imageCaptcha=null, audioCaptcha=null]

how to login android when this no already logon my iphone client.

@wangxingge
Copy link
Author

after register, i use following code to get my last connection.

        api = Whatsapp.mobileBuilder()
                .lastConnection()
                .registered()
                .get()
                .addListener(this);
    future = api.connectAwaitingLogout();

i found socket fire an event readMessage(), and this message was server fin request.

is that means the server address and server port should be change??
current address and port is hardcode in static class Whatsapp.

    public static final String APP_ENDPOINT_HOST = "g.whatsapp.net";
    public static final int APP_ENDPOINT_PORT = 443;

@Auties00
Copy link
Owner

I use local stored keys.smile and stores.smile file to logon, but i found my socket is not connected.
I use wireshark to track socket data, i found server send fin ack to my client.

my code as following:
`
public static void main(String[] args) throws InterruptedException, ExecutionException, TimeoutException {
MobileTest rt = new MobileTest();
// rt.createApi();
rt.createApiByUUID(UUID.fromString("eeaa936b-6562-45fd-a9ed-ab29838b37b4"));
api.connectAwaitingLogout();
latch = new CountDownLatch(3);

    rt.log("store: %s", api.store().toJson());
    rt.log("keys: %s", api.keys().toJson());
    rt.log("Connected:%s", api.isConnected());

    // test send message
    Chat chat = Chat.ofJid(ContactJid.of("__my_phone_no___"));
    api.sendMessage(chat, TextMessage.of("Hi,here is from test message!")).thenApply(messageInfo -> messageInfo.message());
    api.store().contacts().forEach(contact -> System.out.println(contact));
    List<Chat> chats = api.socketHandler().store().chats();
    chats.forEach(chat1 -> System.out.println(chat1));

    latch.await();
    rt.log("All threads have finished.");
}

`
my wireshark screenshot as following:
image

can you help me to figure out the reason? or is there any document to describe whatsapp risk rule?

Add a onNodeReceived and onNodeSent listener and send here the logs

@Auties00 Auties00 added the help wanted Extra attention is needed label Aug 16, 2023
@Auties00
Copy link
Owner

and i always get response from whatsapp server following mesage.
VerificationCodeResponse[number=my_mobile_no, lid=0, status=ERROR, errorReason=CAPTCHA, method=null, codeLength=0, notifyAfter=0, retryAfter=0, voiceLength=0, voiceWait=0, smsWait=0, whatsappOtpWait=0, flashType=0, oldWait=0, securityCodeSet=false, whatsappOtpEligible=false, imageCaptcha=null, audioCaptcha=null]

how to login android when this no already logon my iphone client.

This is the actual reason

@Auties00 Auties00 changed the title receive server fin package, when connecting with whatsapp server. CAPTCHA is not handled correctly Aug 16, 2023
@Auties00 Auties00 added bug Something isn't working and removed help wanted Extra attention is needed labels Aug 16, 2023
@wangxingge
Copy link
Author

I use local stored keys.smile and stores.smile file to logon, but i found my socket is not connected.
I use wireshark to track socket data, i found server send fin ack to my client.
my code as following:
`
public static void main(String[] args) throws InterruptedException, ExecutionException, TimeoutException {
MobileTest rt = new MobileTest();
// rt.createApi();
rt.createApiByUUID(UUID.fromString("eeaa936b-6562-45fd-a9ed-ab29838b37b4"));
api.connectAwaitingLogout();
latch = new CountDownLatch(3);

    rt.log("store: %s", api.store().toJson());
    rt.log("keys: %s", api.keys().toJson());
    rt.log("Connected:%s", api.isConnected());

    // test send message
    Chat chat = Chat.ofJid(ContactJid.of("__my_phone_no___"));
    api.sendMessage(chat, TextMessage.of("Hi,here is from test message!")).thenApply(messageInfo -> messageInfo.message());
    api.store().contacts().forEach(contact -> System.out.println(contact));
    List<Chat> chats = api.socketHandler().store().chats();
    chats.forEach(chat1 -> System.out.println(chat1));

    latch.await();
    rt.log("All threads have finished.");
}

`
my wireshark screenshot as following:
image
can you help me to figure out the reason? or is there any document to describe whatsapp risk rule?

Add a onNodeReceived and onNodeSent listener and send here the logs

thanks for your response, i'll update code and test it.

@Auties00
Copy link
Owner

Captcha is no longer necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants