Skip to content

add a flag to control the hash checking #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
public class SimpleInstaller {
public static boolean headless = false;
public static boolean debug = false;
public static boolean skipHashCheck = false;
public static URL mirror = null;

public static void main(String[] args) throws IOException, URISyntaxException {
Expand Down Expand Up @@ -73,6 +74,7 @@ public static void main(String[] args) throws IOException, URISyntaxException {
OptionSpec<Void> helpOption = parser.acceptsAll(Arrays.asList("h", "help"),"Help with this installer");
OptionSpec<Void> offlineOption = parser.accepts("offline", "Don't attempt any network calls");
OptionSpec<Void> debugOption = parser.accepts("debug", "Run in debug mode -- don't delete any files");
OptionSpec<Void> skipHashCheckOption = parser.accepts("skipHashCheck", "skips the hash check when verifing outputs");
OptionSpec<URL> mirrorOption = parser.accepts("mirror", "Use a specific mirror URL").withRequiredArg().ofType(URL.class);
OptionSet optionSet = parser.parse(args);

Expand All @@ -84,6 +86,7 @@ public static void main(String[] args) throws IOException, URISyntaxException {
debug = optionSet.has(debugOption);
if (optionSet.has(mirrorOption))
mirror = optionSet.valueOf(mirrorOption);
skipHashCheck = optionSet.has(skipHashCheckOption);

String badCerts = "";
if (optionSet.has(offlineOption) || SimpleInstaller.class.getResource("/" + OfflineAction.OFFLINE_FLAG) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public Set<File> process(File librariesDir, File minecraft, File root, File inst
ret.add(output.file);
if (!output.file.exists()) {
err.append("\n ").append(output.file).append(" missing");
} else {
} else if (!SimpleInstaller.skipHashCheck) {
String sha = DownloadUtils.getSha1(output.file);
if (sha.equals(output.sha1)) {
log(" Output: " + output.file + " Checksum Validated: " + sha);
Expand Down