Giter Club home page Giter Club logo

wapi's Introduction

WAPI - The WhatsApp API

Connect your project to WhatsApp!

Installation

First, add the JitPack repository to your POM:

<repository>
	<id>jitpack.io</id>
	<url>https://jitpack.io</url>
</repository>

Then, add the following dependency to your POM:

<dependency>
	<groupId>com.github.ben221199</groupId>
	<artifactId>WAPI</artifactId>
	<version>master</version>
</dependency>

Usage

Verification

import nl.ben221199.wapi.Verification;

public class VerificationExample{

	public static void main(String... args){
		String userAgent = "";
		boolean encrypted = true;

		//Check if account already exists
		String[] existParams = {};
		Verification.exist(userAgent,encrypted,existParams);

		//Request code
		String[] codeParams = {};
		Verification.code(userAgent,encrypted,codeParams);

		//Register account using code
		String[] registerParams = {};
		Verification.register(userAgent,encrypted,registerParams);
	}

}

Connection

import com.whatsapp.proto.WA4Protos;
import java.security.KeyPair;
import java.security.PublicKey;
import nl.ben221199.wapi.Connection;

public class ConnectionExample{

	public static void main(String... args){
		//Connection arguments
		byte[] edge_routing_info = null;
		KeyPair client_static_keypair = null;
		PublicKey server_static_key = null;
		WA4Protos.ClientPayload payload = null;

		//Create connection
		Connection conn = new Connection("g.whatsapp.net",443)
			.setEdgeRoutingInfo(edge_routing_info)
			.setS(client_static_keypair)
			.setRS(server_static_key)
			.setPayload(payload);

		//Start connection
		conn.start();

		//Get IO
		FunInputStream in = conn.getInputStream();
		FunOutputStream out = conn.getOutputStream();
	}

}

wapi's People

Contributors

ben221199 avatar dependabot[bot] avatar

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.