[FIX] SecurityCheckCommand fix

This commit is contained in:
Gravit 2020-09-29 01:08:05 +07:00
parent f9066d1782
commit fe00a62971
No known key found for this signature in database
GPG key ID: 98A079490768CCE5

View file

@ -149,19 +149,19 @@ public void invoke(String... args) throws Exception {
boolean bad = false; boolean bad = false;
String profileModuleName = String.format("profiles.%s", profile.getTitle()); String profileModuleName = String.format("profiles.%s", profile.getTitle());
for (String exc : profile.getUpdateExclusions()) { for (String exc : profile.getUpdateExclusions()) {
StringTokenizer tokenizer = new StringTokenizer(exc, "\\/"); StringTokenizer tokenizer = new StringTokenizer(exc, "/");
if (exc.endsWith(".jar")) { if (exc.endsWith(".jar")) {
printCheckResult(LogHelper.Level.INFO, profileModuleName, String.format("updateExclusions %s not safe. Cheats may be injected very easy!", exc), false); printCheckResult(LogHelper.Level.INFO, profileModuleName, String.format("updateExclusions %s not safe. Cheats may be injected very easy!", exc), false);
bad = true; bad = true;
continue; continue;
} }
if (tokenizer.hasMoreTokens() && tokenizer.nextToken().equals("mods")) { if (tokenizer.hasMoreTokens() && tokenizer.nextToken().equals("mods")) {
String nextToken = tokenizer.nextToken();
if (!tokenizer.hasMoreTokens()) { if (!tokenizer.hasMoreTokens()) {
printCheckResult(LogHelper.Level.INFO, profileModuleName, String.format("updateExclusions %s not safe. Cheats may be injected very easy!", exc), false); printCheckResult(LogHelper.Level.INFO, profileModuleName, String.format("updateExclusions %s not safe. Cheats may be injected very easy!", exc), false);
bad = true; bad = true;
} else { } else {
String nextToken = tokenizer.nextToken(); if (nextToken.equals("memory_repo") || nextToken.equals(profile.getVersion().name)) {
if (nextToken.equals("memory_repo") || nextToken.equals("1.12.2") || nextToken.equals("1.7.10")) {
printCheckResult(LogHelper.Level.INFO, profileModuleName, String.format("updateExclusions %s not safe. Cheats may be injected very easy!", exc), false); printCheckResult(LogHelper.Level.INFO, profileModuleName, String.format("updateExclusions %s not safe. Cheats may be injected very easy!", exc), false);
bad = true; bad = true;
} }