-
- All Implemented Interfaces:
-
java.lang.Runnable
public class ConnectivityChecker implements Runnable
Created by Dubai Ferot Sodrul Amin Shaon on 9/7/2017.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceConnectivityChecker.CallBackCallback interface for receiving network connection events.Implementations are notified when a network connection is detectedvia the `onNetworkDetected` method.
public enumConnectivityChecker.NetworkType
-
Field Summary
Fields Modifier and Type Field Description public static StringdetectedPublicIP
-
Method Summary
Modifier and Type Method Description voidrun()Array<byte>getDynamicFacebookClientHello()Generates a dynamic Facebook client hello message.This method constructs a client hello message used in the TLS handshake with Facebook servers.It includes a static header, random data, a timestamp, and a list of supported cipher suites and extensions. Array<byte>hexStringToByteArray(String s)Converts a hexadecimal string representation to a byte array. static Array<byte>concatenateByteArrays(Array<byte> a, Array<byte> b)Concatenates two byte arrays into a single byte array. static Array<byte>getRandomData(int len)Generates a byte array filled with random data. static intreadByte(InputStream is)Reads a byte array from an InputStream.This method reads a byte array from the provided InputStream.It first reads a 5-byte header to determine the length of the subsequent byte array.Then, it reads the byte array of the specified length. -
-
Method Detail
-
run
void run()
-
getDynamicFacebookClientHello
Array<byte> getDynamicFacebookClientHello()
Generates a dynamic Facebook client hello message.This method constructs a client hello message used in the TLS handshake with Facebook servers.It includes a static header, random data, a timestamp, and a list of supported cipher suites and extensions.The random data is generated using getRandomData and includes the current timestamp.The cipher suites and extensions are hardcoded in the method.
-
hexStringToByteArray
Array<byte> hexStringToByteArray(String s)
Converts a hexadecimal string representation to a byte array.
- Parameters:
s- The hexadecimal string to convert.
-
concatenateByteArrays
static Array<byte> concatenateByteArrays(Array<byte> a, Array<byte> b)
Concatenates two byte arrays into a single byte array.
- Parameters:
a- The first byte array.b- The second byte array.
-
getRandomData
static Array<byte> getRandomData(int len)
Generates a byte array filled with random data.
- Parameters:
len- The desired length of the byte array.
-
readByte
static int readByte(InputStream is)
Reads a byte array from an InputStream.This method reads a byte array from the provided InputStream.It first reads a 5-byte header to determine the length of the subsequent byte array.Then, it reads the byte array of the specified length.
- Parameters:
is- The InputStream to read from.
-
-
-
-