This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
app/src/main/java/com/elynx/pogoxmitm/module/ModuleManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |