From 4b31fc23d0aafd003be083f8b8c99e021ff097a1 Mon Sep 17 00:00:00 2001 From: ELynx Date: Fri, 9 Sep 2016 01:44:42 +0300 Subject: [PATCH] Extend calls for #18 --- .../main/java/com/elynx/pogoxmitm/module/ModuleManager.java | 4 ++-- app/src/main/java/com/elynx/pogoxmitm/test/AlwaysFails.java | 4 ++-- .../java/com/elynx/pogoxmitm/test/ResponseOnlyTest.java | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/elynx/pogoxmitm/module/ModuleManager.java b/app/src/main/java/com/elynx/pogoxmitm/module/ModuleManager.java index 176da6c..35fb24f 100644 --- a/app/src/main/java/com/elynx/pogoxmitm/module/ModuleManager.java +++ b/app/src/main/java/com/elynx/pogoxmitm/module/ModuleManager.java @@ -70,7 +70,7 @@ public interface ModuleManager { * @param data Data of request * @return Modified data if changes are made, null otherwise */ - ByteString processRequest(Requests.RequestType type, ByteString data); + ByteString processRequest(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk); /** * Process response from server to client @@ -79,5 +79,5 @@ public interface ModuleManager { * @param data Data of response * @return Modified data if changes are made, null otherwise */ - ByteString processResponse(Requests.RequestType type, ByteString data); + ByteString processResponse(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk); } diff --git a/app/src/main/java/com/elynx/pogoxmitm/test/AlwaysFails.java b/app/src/main/java/com/elynx/pogoxmitm/test/AlwaysFails.java index ffb64d9..17eade4 100644 --- a/app/src/main/java/com/elynx/pogoxmitm/test/AlwaysFails.java +++ b/app/src/main/java/com/elynx/pogoxmitm/test/AlwaysFails.java @@ -44,11 +44,11 @@ public Set responseTypes() { return new HashSet<>(); } - public ByteString processRequest(Requests.RequestType type, ByteString data) { + public ByteString processRequest(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk) { return null; } - public ByteString processResponse(Requests.RequestType type, ByteString data) { + public ByteString processResponse(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk) { return null; } } diff --git a/app/src/main/java/com/elynx/pogoxmitm/test/ResponseOnlyTest.java b/app/src/main/java/com/elynx/pogoxmitm/test/ResponseOnlyTest.java index cf7caea..ce5817b 100644 --- a/app/src/main/java/com/elynx/pogoxmitm/test/ResponseOnlyTest.java +++ b/app/src/main/java/com/elynx/pogoxmitm/test/ResponseOnlyTest.java @@ -15,7 +15,7 @@ public String userspaceName() { } public String userspaceBrief() { - return "Module that does nothing"; + return "Module that doubles even responses"; } public String userspaceInfo() { @@ -33,8 +33,8 @@ public Set responseTypes() { return types; } - public ByteString processResponse(Requests.RequestType type, ByteString data) { - if (data.size() < 5) { + public ByteString processResponse(Requests.RequestType type, ByteString data, int exchangeId, boolean connectionOk) { + if (connectionOk && ((exchangeId & 1) == 0)) { //TODO valid? return data.concat(data); }