Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Interface for single module #18
Browse files Browse the repository at this point in the history
  • Loading branch information
ELynx committed Sep 8, 2016
1 parent 1b52863 commit 1274944
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions app/src/main/java/com/elynx/pogoxmitm/module/ModuleManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package com.elynx.pogoxmitm.module;

import com.github.aeonlucid.pogoprotos.networking.Requests;

import com.google.protobuf.ByteString;

import java.util.List;

/**
* Interface defining communications between MitM provider and single hack
*/
public interface ModuleManager {
/**
* Module name in module list
* @return Module name
*/
String userspaceName();

/**
* Module description in module list
* @return Module brief description
*/
String userspaceBrief();

/**
* Module "about" info, presented to user on demand
* Will be rendered as HTML
* @return Module about info
*/
String userspaceInfo();

/**
* Called once per module life cycle
* Upon call module starts with default environment
* Failed modules do not receive any communications, and are off/disabled in module list
* @return True if module may be executed, False otherwise
*/
boolean init();

/**
* Types of requests this module wants to receive
* May be different from response types
* @return Request types processed in module
*/
List<Requests.RequestType> requestTypes();

/**
* Types of responses this module wants to receive
* May be different from request types
* @return Response types processed in module
*/
List<Requests.RequestType> responseTypes();

/**
* Process request from client to server
* @param type Type of request
* @param data Data of request
* @return Modified data if changes are made, null otherwise
*/
ByteString processRequest(Requests.RequestType type, ByteString data);

/**
* Process response from server to client
* @param type Type of response
* @param data Data of response
* @return Modified data if changes are made, null otherwise
*/
ByteString processResponse(Requests.RequestType type, ByteString data);
}

0 comments on commit 1274944

Please sign in to comment.