You've already forked AstralRinth
forked from didirus/AstralRinth
Inherit dependencies from workspace manifest, and optimize some out (#3655)
* chore: inherit dependencies from workspace, optimize some deps out * Update bitflags from 2.9.0 to 2.9.1 * Fix temp directory leak in check_java_at_filepath * Fix build * Fix lint * chore(app-lib): refactor overkill `futures` executor usage to Tokio MPSC * chore: fix Clippy lint * tweak: optimize out dependency on OpenSSL source build Contrary to what I expected before, this was caused due to the Tauri updater plugin using a different TLS stack than everything else. * chore(labrinth): drop now unused dependency * Update zip because 2.6.1 got yanked * Downgrade weezl to 0.1.8 * Mention that p256 is also a blocker for rand 0.9 * chore: sidestep GitHub review requirements * chore: sidestep GitHub review requirements (2) * chore: sidestep GitHub review requirements (3) --------- Co-authored-by: Josiah Glosson <soujournme@gmail.com>
This commit is contained in:
committed by
GitHub
parent
37cc81a36d
commit
f19643095e
@@ -1,6 +1,5 @@
|
||||
//! Platform-related code
|
||||
use daedalus::minecraft::{Os, OsRule};
|
||||
use regex::Regex;
|
||||
|
||||
// OS detection
|
||||
pub trait OsExt {
|
||||
@@ -92,12 +91,16 @@ pub fn os_rule(
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(version) = &rule.version {
|
||||
if let Ok(regex) = Regex::new(version.as_str()) {
|
||||
rule_match &=
|
||||
regex.is_match(&sys_info::os_release().unwrap_or_default());
|
||||
}
|
||||
}
|
||||
// `rule.version` is ignored because it's not usually seen on real recent
|
||||
// Minecraft version manifests, its alleged regex syntax is undefined and is
|
||||
// likely to not match `Regex`'s, and the way to get the value to match it
|
||||
// against is allegedly calling `System.getProperty("os.version")`, which
|
||||
// on Windows the OpenJDK implements by fetching the kernel32.dll version,
|
||||
// an approach that no public Rust library implements. Moreover, launchers
|
||||
// such as PrismLauncher also ignore this field. Code references:
|
||||
// - https://github.com/openjdk/jdk/blob/948ade8e7003a41683600428c8e3155c7ed798db/src/java.base/windows/native/libjava/java_props_md.c#L556
|
||||
// - https://github.com/PrismLauncher/PrismLauncher/blob/1c20faccf88999474af70db098a4c10e7a03af33/launcher/minecraft/Rule.h#L77
|
||||
// - https://github.com/FillZpp/sys-info-rs/blob/60ecf1470a5b7c90242f429934a3bacb6023ec4d/c/windows.c#L23-L38
|
||||
|
||||
rule_match
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user