mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
advanced; option to disable decryption
This commit is contained in:
parent
716a6545e9
commit
c6cb928837
@ -101,6 +101,7 @@ public class HConnection {
|
||||
}
|
||||
|
||||
|
||||
public static boolean DECRYPTPACKETS = true;
|
||||
public static boolean DEBUG = false;
|
||||
private static final HostReplacer hostsReplacer = HostReplacerFactory.get();
|
||||
|
||||
|
@ -50,6 +50,8 @@ public class Rc4Obtainer {
|
||||
|
||||
|
||||
private void onSendFirstEncryptedMessage(Handler handler) {
|
||||
if (!HConnection.DECRYPTPACKETS) return;
|
||||
|
||||
outgoingHandler.block();
|
||||
incomingHandler.block();
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package gearth.protocol.packethandler;
|
||||
|
||||
import gearth.protocol.HConnection;
|
||||
import gearth.protocol.HMessage;
|
||||
import gearth.protocol.HPacket;
|
||||
import gearth.protocol.TrafficListener;
|
||||
@ -51,6 +52,11 @@ public abstract class Handler {
|
||||
if (!isEncryptedStream) {
|
||||
payloadBuffer.push(buffer);
|
||||
}
|
||||
else if (!HConnection.DECRYPTPACKETS) {
|
||||
synchronized (lock) {
|
||||
out.write(buffer);
|
||||
}
|
||||
}
|
||||
else if (decryptcipher == null) {
|
||||
for (int i = 0; i < buffer.length; i++) {
|
||||
tempEncryptedBuffer.add(buffer[i]);
|
||||
|
@ -7,6 +7,7 @@ import gearth.ui.info.Info;
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.GridPane;
|
||||
|
||||
/**
|
||||
* Created by Jonas on 06/04/18.
|
||||
@ -21,8 +22,11 @@ public class Extra extends SubForm {
|
||||
public Hyperlink url_troubleshooting;
|
||||
|
||||
public CheckBox cbx_advanced;
|
||||
public GridPane grd_advanced;
|
||||
|
||||
public CheckBox cbx_ovcinfo;
|
||||
public GridPane grd_ovcinfo;
|
||||
|
||||
public TextField txt_realPort;
|
||||
public TextField txt_mitmIP;
|
||||
public TextField txt_realIp;
|
||||
@ -41,6 +45,9 @@ public class Extra extends SubForm {
|
||||
}
|
||||
|
||||
cbx_debug.selectedProperty().addListener(observable -> HConnection.DEBUG = cbx_debug.isSelected());
|
||||
cbx_disableDecryption.selectedProperty().addListener(observable -> HConnection.DECRYPTPACKETS = !cbx_disableDecryption.isSelected());
|
||||
|
||||
cbx_ovcinfo.selectedProperty().addListener(observable -> grd_ovcinfo.setDisable(!cbx_ovcinfo.isSelected()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -54,6 +61,8 @@ public class Extra extends SubForm {
|
||||
updateAdvancedUI();
|
||||
}
|
||||
});
|
||||
|
||||
updateAdvancedUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -62,6 +71,15 @@ public class Extra extends SubForm {
|
||||
}
|
||||
|
||||
private void updateAdvancedUI() {
|
||||
if (!cbx_advanced.isSelected()) {
|
||||
cbx_debug.setSelected(false);
|
||||
cbx_ovcinfo.setSelected(false);
|
||||
if (getHConnection().getState() == HConnection.State.NOT_CONNECTED) {
|
||||
cbx_disableDecryption.setSelected(false);
|
||||
}
|
||||
}
|
||||
grd_advanced.setDisable(!cbx_advanced.isSelected());
|
||||
|
||||
cbx_disableDecryption.setDisable(getHConnection().getState() != HConnection.State.NOT_CONNECTED);
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
<RowConstraints maxHeight="235.0" minHeight="10.0" prefHeight="232.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<GridPane disable="true" style="-fx-border-color: #888888; -fx-border-radius: 5px;" GridPane.rowIndex="1">
|
||||
<GridPane fx:id="grd_advanced" disable="true" style="-fx-border-color: #888888; -fx-border-radius: 5px;" GridPane.rowIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
@ -55,7 +55,7 @@
|
||||
</padding>
|
||||
<children>
|
||||
<CheckBox fx:id="cbx_ovcinfo" mnemonicParsing="false" text="Override connection info:" />
|
||||
<GridPane prefHeight="119.0" prefWidth="259.0" GridPane.rowIndex="1">
|
||||
<GridPane fx:id="grd_ovcinfo" disable="true" prefHeight="119.0" prefWidth="259.0" GridPane.rowIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="159.0" minWidth="10.0" prefWidth="68.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="193.0" minWidth="10.0" prefWidth="145.0" />
|
||||
@ -71,7 +71,7 @@
|
||||
<Label text="MITM IP:" GridPane.rowIndex="1" />
|
||||
<Label text="Real port:" GridPane.rowIndex="2" />
|
||||
<Label text="MITM port:" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="txt_realPort" disable="true" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<TextField fx:id="txt_realPort" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
@ -79,7 +79,7 @@
|
||||
<Insets bottom="3.0" right="7.0" top="3.0" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="txt_mitmIP" disable="true" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<TextField fx:id="txt_mitmIP" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
@ -87,7 +87,7 @@
|
||||
<Insets bottom="3.0" right="7.0" top="3.0" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="txt_realIp" disable="true" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1">
|
||||
<TextField fx:id="txt_realIp" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1">
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
@ -95,7 +95,7 @@
|
||||
<Insets bottom="3.0" right="7.0" top="3.0" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="txt_mitmPort" disable="true" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
<TextField fx:id="txt_mitmPort" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
|
Loading…
Reference in New Issue
Block a user