Package 

Class ConnectivityChecker

  • 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 interface ConnectivityChecker.CallBack

      Callback interface for receiving network connection events.Implementations are notified when a network connection is detectedvia the `onNetworkDetected` method.

      public enum ConnectivityChecker.NetworkType
    • Method Summary

      Modifier and Type Method Description
      void run()
      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 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.
      • Methods inherited from class java.lang.Runnable

        run
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.