build: rebase patches onto v0.21.4

Upstream now depends on the md5 crate, so the offline account UUID uses it instead of md-5.
This commit is contained in:
Felitendo committed 2026-09-17 16:14:11 +02:00
1 parent 997483b3d4
commit 0842e602b3
9 files changed
+29 -51

No files matched your search

@@ -49,7 +49,7 @@ index 5f863d5..32a86a3 100644
macos: {
id: 'app.settings.operating-system.macos',
diff --git a/apps/app-frontend/src/locales/en-US/index.json b/apps/app-frontend/src/locales/en-US/index.json
index e81abe7..ba08ca7 100644
index 09f98ec..b03a35d 100644
--- a/apps/app-frontend/src/locales/en-US/index.json
+++ b/apps/app-frontend/src/locales/en-US/index.json
@@ -1626,7 +1626,7 @@
+1 -1
View File
@@ -302,7 +302,7 @@ index bb20aa9..46a9749 100644
+ void router
}
diff --git a/apps/app-frontend/src/locales/en-US/index.json b/apps/app-frontend/src/locales/en-US/index.json
index ba08ca7..28d0366 100644
index b03a35d..2a589bd 100644
--- a/apps/app-frontend/src/locales/en-US/index.json
+++ b/apps/app-frontend/src/locales/en-US/index.json
@@ -2745,7 +2745,7 @@
+12 -34
View File
@@ -36,7 +36,6 @@ which offered Microsoft and nothing else:
same choice.
---
Cargo.lock | 1 +
Cargo.toml | 1 +
apps/app-frontend/src/App.vue | 12 +-
.../src/components/ui/AccountsCard.vue | 30 ++++
.../src/components/ui/OfflineAccountModal.vue | 136 ++++++++++++++++++
@@ -46,34 +45,22 @@ which offered Microsoft and nothing else:
apps/app/src/api/auth.rs | 7 +
packages/app-lib/Cargo.toml | 1 +
packages/app-lib/src/api/minecraft_auth.rs | 39 +++++
packages/app-lib/src/state/minecraft_auth.rs | 68 +++++++++
12 files changed, 331 insertions(+), 8 deletions(-)
packages/app-lib/src/state/minecraft_auth.rs | 66 +++++++++
11 files changed, 328 insertions(+), 8 deletions(-)
create mode 100644 apps/app-frontend/src/components/ui/OfflineAccountModal.vue
diff --git a/Cargo.lock b/Cargo.lock
index bdc7307..9006b00 100644
index 28231e3..f94d0fe 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -11534,6 +11534,7 @@ dependencies = [
@@ -12361,6 +12361,7 @@ dependencies = [
"indicatif",
"itertools 0.14.0",
"json5",
+ "md-5",
+ "md5",
"modrinth-content-management",
"notify",
"notify-debouncer-mini",
diff --git a/Cargo.toml b/Cargo.toml
index b8b227e..8348c8d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -132,6 +132,7 @@ lz4_flex = { version = "0.11.5", default-features = false, features = [
"std",
] }
maxminddb = "0.26.0"
+md-5 = "0.10.6"
modrinth-content-management = { path = "packages/modrinth-content-management" }
modrinth-log = { path = "packages/modrinth-log" }
modrinth-util = { path = "packages/modrinth-util" }
diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue
index 447f636..d750a5f 100644
--- a/apps/app-frontend/src/App.vue
@@ -476,14 +463,14 @@ index 8227d94..f4eded6 100644
pub async fn remove_user(user: uuid::Uuid) -> Result<()> {
Ok(minecraft_auth::remove_user(user).await?)
diff --git a/packages/app-lib/Cargo.toml b/packages/app-lib/Cargo.toml
index 15a1dc9..4fe7643 100644
index 9bb14ce..58f85e3 100644
--- a/packages/app-lib/Cargo.toml
+++ b/packages/app-lib/Cargo.toml
@@ -52,6 +52,7 @@ image = { workspace = true, features = ["gif", "jpeg", "png", "webp"] }
indicatif = { workspace = true, optional = true }
itertools = { workspace = true }
json5 = { workspace = true }
+md-5 = { workspace = true }
+md5 = { workspace = true }
modrinth-content-management = { workspace = true }
notify = { workspace = true }
notify-debouncer-mini = { workspace = true }
@@ -538,18 +525,10 @@ index e7195c6..a7fac4a 100644
pub async fn get_default_user() -> crate::Result<Option<uuid::Uuid>> {
let state = State::get().await?;
diff --git a/packages/app-lib/src/state/minecraft_auth.rs b/packages/app-lib/src/state/minecraft_auth.rs
index b835ad4..d97d233 100644
index b835ad4..14455ec 100644
--- a/packages/app-lib/src/state/minecraft_auth.rs
+++ b/packages/app-lib/src/state/minecraft_auth.rs
@@ -6,6 +6,7 @@ use chrono::{DateTime, Duration, TimeZone, Utc};
use dashmap::DashMap;
use futures::TryStreamExt;
use heck::ToTitleCase;
+use md5::Md5;
use p256::ecdsa::signature::Signer;
use p256::ecdsa::{Signature, SigningKey, VerifyingKey};
use p256::pkcs8::{DecodePrivateKey, EncodePrivateKey, LineEnding};
@@ -212,6 +213,34 @@ pub struct Credentials {
@@ -212,6 +212,33 @@ pub struct Credentials {
pub active: bool,
}
@@ -574,8 +553,7 @@ index b835ad4..d97d233 100644
+/// means a world played here keeps the same player data when it is opened from
+/// somewhere else.
+pub fn offline_uuid(username: &str) -> Uuid {
+ let mut bytes: [u8; 16] =
+ Md5::digest(format!("OfflinePlayer:{username}").as_bytes()).into();
+ let mut bytes = md5::compute(format!("OfflinePlayer:{username}")).0;
+ bytes[6] = (bytes[6] & 0x0f) | 0x30; // Version 3
+ bytes[8] = (bytes[8] & 0x3f) | 0x80; // RFC 4122 variant
+ Uuid::from_bytes(bytes)
@@ -584,7 +562,7 @@ index b835ad4..d97d233 100644
/// An entry in the player profile cache, keyed by player UUID.
pub(super) enum ProfileCacheEntry {
/// A cached profile that is valid, even though it may be stale.
@@ -265,12 +294,45 @@ impl OnlineProfileCacheIntent {
@@ -265,12 +292,45 @@ impl OnlineProfileCacheIntent {
}
impl Credentials {
@@ -630,7 +608,7 @@ index b835ad4..d97d233 100644
// Use a margin of 5 minutes to give e.g. Minecraft and potentially
// other operations that depend on a fresh token 5 minutes to complete
// from now, and deal with some classes of clock skew
@@ -351,6 +413,12 @@ impl Credentials {
@@ -351,6 +411,12 @@ impl Credentials {
&self,
cache_intent: OnlineProfileCacheIntent,
) -> Option<Arc<MinecraftProfile>> {
@@ -586,10 +586,10 @@ index 320112f..ba6c342 100644
pub use ariadne::users::UserStatus;
pub use modrinth_content_management::{
diff --git a/packages/app-lib/src/state/minecraft_auth.rs b/packages/app-lib/src/state/minecraft_auth.rs
index 25c6dfb..4c87e82 100644
index 4130488..1331a24 100644
--- a/packages/app-lib/src/state/minecraft_auth.rs
+++ b/packages/app-lib/src/state/minecraft_auth.rs
@@ -37,6 +37,7 @@ use uuid::Uuid;
@@ -36,6 +36,7 @@ use uuid::Uuid;
pub enum MinecraftAuthStep {
GetDeviceToken,
SisuAuthenticate,
@@ -597,7 +597,7 @@ index 25c6dfb..4c87e82 100644
GetOAuthToken,
RefreshOAuthToken,
SisuAuthorize,
@@ -108,6 +109,16 @@ pub struct MinecraftLoginFlow {
@@ -107,6 +108,16 @@ pub struct MinecraftLoginFlow {
pub auth_request_uri: String,
}
@@ -614,7 +614,7 @@ index 25c6dfb..4c87e82 100644
#[tracing::instrument]
pub async fn login_begin(
exec: impl sqlx::Executor<'_, Database = sqlx::Sqlite> + Copy,
@@ -144,13 +155,37 @@ pub async fn login_finish(
@@ -143,13 +154,37 @@ pub async fn login_finish(
code: &str,
flow: MinecraftLoginFlow,
exec: impl sqlx::Executor<'_, Database = sqlx::Sqlite> + Copy,
@@ -654,7 +654,7 @@ index 25c6dfb..4c87e82 100644
&oauth_token.value.access_token,
&pair.token.token,
&pair.key,
@@ -1273,6 +1308,112 @@ async fn oauth_token(
@@ -1271,6 +1306,112 @@ async fn oauth_token(
})
}
@@ -1427,10 +1427,10 @@ index ba6c342..a175675 100644
pub mod handler;
pub mod instance;
diff --git a/packages/app-lib/src/state/minecraft_auth.rs b/packages/app-lib/src/state/minecraft_auth.rs
index 4c87e82..904d1d8 100644
index 1331a24..2514d8e 100644
--- a/packages/app-lib/src/state/minecraft_auth.rs
+++ b/packages/app-lib/src/state/minecraft_auth.rs
@@ -992,12 +992,14 @@ impl Serialize for Credentials {
@@ -990,12 +990,14 @@ impl Serialize for Credentials {
),
};
@@ -2493,10 +2493,10 @@ index a482f66..76bedc7 100644
if !arg.is_empty() {
parsed_arguments.push(arg);
diff --git a/packages/app-lib/src/launcher/mod.rs b/packages/app-lib/src/launcher/mod.rs
index e623cab..e352716 100644
index 93cfd20..5378b99 100644
--- a/packages/app-lib/src/launcher/mod.rs
+++ b/packages/app-lib/src/launcher/mod.rs
@@ -1018,6 +1018,28 @@ pub async fn launch_minecraft(
@@ -1031,6 +1031,28 @@ pub async fn launch_minecraft(
let rpc_server = RpcServerBuilder::new().launch().await?;
@@ -2525,7 +2525,7 @@ index e623cab..e352716 100644
command.args(
args::get_jvm_arguments(
args.get(&d::minecraft::ArgumentType::Jvm)
@@ -1044,6 +1066,7 @@ pub async fn launch_minecraft(
@@ -1057,6 +1079,7 @@ pub async fn launch_minecraft(
.as_ref()
.and_then(|x| x.get(&LoggingSide::Client)),
rpc_server.address(),
@@ -649,7 +649,7 @@ index 833349d..84b9a87 100644
#[cfg_attr(feature = "export-ts", ts(flatten))]
pub event: LogEvent,
diff --git a/packages/app-lib/src/launcher/mod.rs b/packages/app-lib/src/launcher/mod.rs
index e352716..6e7de28 100644
index 5378b99..658c529 100644
--- a/packages/app-lib/src/launcher/mod.rs
+++ b/packages/app-lib/src/launcher/mod.rs
@@ -825,6 +825,9 @@ pub async fn launch_minecraft(
@@ -704,8 +704,8 @@ index e352716..6e7de28 100644
+ }
}
let natives_dir = state.directories.version_natives_dir(&version_jar);
@@ -1212,6 +1221,8 @@ pub async fn launch_minecraft(
if let Some(path) = download::missing_runtime_file(
@@ -1225,6 +1234,8 @@ pub async fn launch_minecraft(
&instance.id,
&instance.path,
&instance.name,
+1 -1
View File
@@ -1 +1 @@
v0.21.2
v0.21.4
+1 -1
View File
@@ -1 +1 @@
v0.21.2
v0.21.4