summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle7
-rw-r--r--src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java22
2 files changed, 20 insertions, 9 deletions
diff --git a/build.gradle b/build.gradle
index 45e6dee5d7..a8af5dfa2a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -91,10 +91,5 @@ publishing {
tasks.publish.dependsOn build
static String getVersionSuffix() {
- if (System.getenv("IS_PUBLICATION") != null) {
- return ""
- } else if (System.getenv("GITHUB_RUN_NUMBER") != null && System.getenv("GITHUB_SHA") != null) {
- return "-s." + System.getenv("GITHUB_RUN_NUMBER") + "-" + System.getenv("GITHUB_SHA").substring(0, 7)
- }
- return "-LOCAL"
+ return ""
}
diff --git a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java
index a007a7790a..f9aa328e5a 100644
--- a/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java
+++ b/src/main/java/io/github/zekerzhayard/forgewrapper/installer/detector/IFileDetector.java
@@ -184,14 +184,24 @@ public interface IFileDetector {
// Check all cached libraries.
boolean checked = true;
for (Map.Entry<String, Path> entry : libsMap.entrySet()) {
- checked = checkExtraFile(entry.getValue(), hashMap.get(entry.getKey() + "_SHA"));
+ String sha1 = "";
+ String entryKey = entry.getKey();
+ /**
+ * NOTE: workaround for https://github.com/MultiMC/Launcher/issues/4400
+ * We ignore the hash of the client file and instead just rely on it being 'correct, maybe' if it's present at all
+ */
+ System.out.println("Checking: " + entryKey);
+ if(!entryKey.equals("PATCHED")) {
+ sha1 = hashMap.get(entryKey + "_SHA");
+ }
+ checked = checkExtraFile(entry.getValue(), sha1);
if (!checked) {
System.out.println("Missing: " + entry.getValue());
break;
}
}
return checked;
- }
+ }
// Skip installing process if installer profile doesn't exist.
return true;
}
@@ -203,7 +213,13 @@ public interface IFileDetector {
* @return True represents the file is ready.
*/
static boolean checkExtraFile(Path path, String sha1) {
- return sha1 == null || sha1.equals("") || (isFile(path) && sha1.toLowerCase(Locale.ENGLISH).equals(getFileSHA1(path)));
+ if (!isFile(path)) {
+ return false;
+ }
+ if(sha1 == null || sha1.equals("")) {
+ return true;
+ }
+ return sha1.toLowerCase(Locale.ENGLISH).equals(getFileSHA1(path));
}
static boolean isFile(Path path) {