Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit a996ef7

Browse files
committed
Removed Adware and updated url requests
Removed the last remains of adware and updated the methods with uhash. The register method isn't updated yet.
1 parent 7284c01 commit a996ef7

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

src/examples/ConsoleExample.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@ public static void main(String[] args) {
1919
if(transfer.get(0).getSuccess()){
2020
System.out.println("Got $" + transfer.get(0).getMoneyAmount());
2121
System.out.println("Gained " + transfer.get(0).getRepGained() + " rep.");
22-
}
23-
if(api.getAdwareManager().uploadAdware(ip.get(0))){
24-
System.out.println("Adware uploaded successfully.");
25-
}
26-
else{
27-
System.out.println("Failed to upload Adware.");
28-
}
29-
22+
}
3023
}
3124

3225
}

src/me/checkium/vhackapi/Utils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ public static String generateURL(String str, String str2, String str3) {
214214
byte[] bytes3 = str5.getBytes();
215215
byte[] bytes4 = str6.getBytes();
216216
String a3 = hashString(secret + hashString(hashString(generateUser(bytes2, 0, bytes2.length, byt, false))));
217-
String str6 = generateUser(bytes3, 0, bytes3.length, byt, false);
217+
String str9 = generateUser(bytes3, 0, bytes3.length, byt, false);
218218
String str7 = generateUser(bytes4, 0, bytes4.length, byt, false);
219-
String str8 = hashString(hashString(a3 + hashString(hashString(str6) + str7)));
219+
String str8 = hashString(hashString(a3 + hashString(hashString(str9) + str7)));
220220
return url + str3 + "?user=" + a + "&pass=" + str8;
221221
}
222222

src/me/checkium/vhackapi/upgrades/UpgradeManager.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ public class UpgradeManager {
2020

2121
protected String username;
2222
protected String password;
23+
protected String userHash;
2324

24-
public UpgradeManager(String user, String pass) {
25+
public UpgradeManager(String user, String pass, String uhash) {
2526
username = user;
2627
password = pass;
28+
userHash = uhash;
2729
}
2830

2931
public UpgradeResult addUpdate(UpgradeType type) {
3032

3133
JSONObject json = new JSONObject();
3234
try {
3335
TimeUnit.MILLISECONDS.sleep(100);
34-
InputStream is = new URL(Utils.generateURL("user::::pass::::utype", username + "::::" + password + "::::" + type.toString(), "vh_addUpdate.php")).openStream();
36+
InputStream is = new URL(Utils.generateURL("user::::pass::::uhash::::utype", username + "::::" + password + "::::" + userHash + "::::" + type.toString(), "vh_addUpdate.php")).openStream();
3537
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
3638
String jsonText;
3739

@@ -62,7 +64,7 @@ public ArrayList<Task> getTasks() {
6264
JSONObject json = new JSONObject();
6365
try {
6466
TimeUnit.MILLISECONDS.sleep(100);
65-
InputStream is = new URL(Utils.generateURL("user::::pass", username + "::::" + password, "vh_tasks.php")).openStream();
67+
InputStream is = new URL(Utils.generateURL("user::::pass::::uhash", username + "::::" + password + "::::" + userHash, "vh_tasks.php")).openStream();
6668
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
6769
String jsonText;
6870

@@ -95,7 +97,7 @@ public boolean finishTask(Task task) {
9597
URLConnection in;
9698
try {
9799
TimeUnit.MILLISECONDS.sleep(100);
98-
in = new URL(Utils.generateURL("user::::pass::::taskid", username + "::::" + password + "::::" + task.getTaskID(), "vh_finishTask.php")).openConnection();
100+
in = new URL(Utils.generateURL("user::::pass::::uhash::::taskid", username + "::::" + password + "::::" + userHash + "::::" + task.getTaskID(), "vh_finishTask.php")).openConnection();
99101

100102
BufferedReader br = new BufferedReader(new InputStreamReader((in.getInputStream())));
101103
String line = br.readLine();
@@ -125,7 +127,7 @@ public boolean abortTask(Task task) {
125127
URLConnection in;
126128
try {
127129
TimeUnit.MILLISECONDS.sleep(100);
128-
in = new URL(Utils.generateURL("user::::pass::::taskid", username + "::::" + password + "::::" + task.getTaskID(), "vh_abortTask.php")).openConnection();
130+
in = new URL(Utils.generateURL("user::::pass::::uhash::::taskid", username + "::::" + password + "::::" + userHash + "::::" + task.getTaskID(), "vh_abortTask.php")).openConnection();
129131

130132
BufferedReader br = new BufferedReader(new InputStreamReader((in.getInputStream())));
131133
String line = br.readLine();

src/me/checkium/vhackapi/vHackAPI.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.json.JSONObject;
1212

1313
import me.checkium.vhackapi.chat.Chat;
14-
import me.checkium.vhackapi.console.AdwareManager;
1514
import me.checkium.vhackapi.console.Console;
1615
import me.checkium.vhackapi.others.Others;
1716
import me.checkium.vhackapi.upgrades.UpgradeManager;
@@ -20,23 +19,18 @@ public class vHackAPI {
2019

2120
protected String password;
2221
protected String username;
22+
protected String userHash;
2323

2424

2525
public Console getConsole() {
26-
Console console = new Console(username, password);
26+
Console console = new Console(username, password, userHash);
2727
return console;
2828
}
2929

3030
public UpgradeManager getUpgradeManager() {
31-
UpgradeManager manager = new UpgradeManager(username, password);
31+
UpgradeManager manager = new UpgradeManager(username, password, userHash);
3232
return manager;
33-
}
34-
35-
public AdwareManager getAdwareManager() {
36-
AdwareManager manager = new AdwareManager(password, username);
37-
return manager;
38-
}
39-
33+
}
4034

4135
public String getStats(Stats stat) {
4236
try {
@@ -47,7 +41,7 @@ public String getStats(Stats stat) {
4741
JSONObject json = null;
4842
InputStream is;
4943
try {
50-
is = new URL(Utils.generateURL("user::::pass", username + "::::" + password, "vh_update.php")).openStream();
44+
is = new URL(Utils.generateURL("user::::pass::::uhash", username + "::::" + password + "::::" + userHash, "vh_update.php")).openStream();
5145
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
5246
String jsonText = Utils.readJson(rd);
5347
json = new JSONObject(jsonText);
@@ -61,7 +55,7 @@ public String getStats(Stats stat) {
6155
}
6256

6357
public Others getOthers() {
64-
Others others = new Others(username, password);
58+
Others others = new Others(username, password, userHash);
6559
return others;
6660
}
6761

@@ -76,11 +70,13 @@ public Chat getChat() {
7670
Chat chat = new Chat();
7771
return chat;
7872
}
79-
public vHackAPI(String user, String pass) {
73+
public vHackAPI(String user, String pass, String uhash) {
8074
username = user;
8175
password = pass;
76+
userHash = uhash;
8277
//return this;
8378
}
79+
8480
@Deprecated
8581
public vHackAPI getAPI() {
8682
return this;

0 commit comments

Comments
 (0)