gitwtfhub

wtf is whatsapp-code-automator?

henristr/whatsapp-code-automator — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 2/5LicenseSetup · moderate

TL;DR

A Python script that automates tapping a code regenerate button in WhatsApp on Android and compares each new code against a target value.

Mindmap

mindmap
  root((WhatsApp Code Automator))
    What it does
      Taps regenerate button
      Reads code from screen
      Compares to target code
    Tech stack
      Python
      uiautomator2
      ADB
    Use cases
      Automate repetitive code checks
      Log each attempt
      Stop on match or limit
    Audience
      Developer
    Setup
      Needs Android device
      Needs ADB connection
      Edit button text per language

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Automatically tap the regenerate button in WhatsApp until a specific target code appears.

REASON 2

Log every attempt with the code seen and whether it matched.

REASON 3

Adapt the script to a device set to a different language by editing one line of button text.

What's in the stack?

Pythonuiautomator2ADB

How it stacks up

henristr/whatsapp-code-automator0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity2/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires an Android device connected via ADB, WhatsApp installed, and editing hardcoded button text to match the device's language.

MIT license, use freely for any purpose including commercial use as long as you keep the copyright notice.

Wtf does this do

WhatsApp Code Automator is a small Python script that automates a repetitive task on an Android phone running WhatsApp. It repeatedly presses a button that generates a new short code inside the WhatsApp app, reads the code that appears on screen, and compares it against a code you have set as the target. It keeps doing this, attempt after attempt, until the code it sees matches the one you are looking for or it hits a maximum number of tries. The script controls the phone through a tool called uiautomator2, which lets Python code tap buttons and read text on an Android screen as if a person were doing it by hand. Because of this, the phone needs to be connected over ADB, the Android Debug Bridge, and WhatsApp needs to already be open on the relevant screen. There is no server component and no cloud service involved, everything runs locally against the connected device. A key detail is that the button text the script looks for is written in German by default, since that is the language the original author's phone was set to. Anyone using this on a device set to English, Spanish, French, or Portuguese has to edit one line in the code and swap in the matching button text for their language, since the script only works if it can find that exact phrase on screen. Three settings control its behavior: the target code to watch for, the maximum number of attempts before giving up, and a short delay between each attempt. While it runs, the script prints its progress in the terminal, showing each attempt and the code found, and it reports clearly when it either succeeds or runs out of attempts. The project is a single file script rather than a full application, aimed at someone comfortable running Python from the command line and connecting a phone through ADB. It is released under the MIT license.

Yoink these prompts

Prompt 1
Explain how uiautomator2 lets Python control an Android app's UI over ADB.
Prompt 2
Help me adapt a UI automation script's hardcoded button text to a different language.
Prompt 3
Show me how to connect an Android phone to a Python script using ADB for UI automation.
Prompt 4
Walk me through setting a retry limit and delay for a Python loop that polls an app's screen.

Frequently asked questions

wtf is whatsapp-code-automator?

A Python script that automates tapping a code regenerate button in WhatsApp on Android and compares each new code against a target value.

What language is whatsapp-code-automator written in?

Mainly Python. The stack also includes Python, uiautomator2, ADB.

What license does whatsapp-code-automator use?

MIT license, use freely for any purpose including commercial use as long as you keep the copyright notice.

How hard is whatsapp-code-automator to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is whatsapp-code-automator for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.