Skip to content

Commit e241e7d

Browse files
committed
Prevent servers from fingerprinting you via the resource pack cache.
This allowed servers to track users even if they changed accounts. See: https://alaggydev.github.io/posts/cytooxien See: CCBlueX/LiquidBounce#7007
1 parent aaca110 commit e241e7d

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3+
* Copyright (c) Meteor Development.
4+
*/
5+
6+
package meteordevelopment.meteorclient.mixin;
7+
8+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
9+
import com.llamalad7.mixinextras.sugar.Local;
10+
import meteordevelopment.meteorclient.MeteorClient;
11+
import net.minecraft.util.Downloader;
12+
import org.spongepowered.asm.mixin.Final;
13+
import org.spongepowered.asm.mixin.Mixin;
14+
import org.spongepowered.asm.mixin.Shadow;
15+
import org.spongepowered.asm.mixin.injection.At;
16+
17+
import java.nio.file.Path;
18+
import java.util.UUID;
19+
20+
import static meteordevelopment.meteorclient.MeteorClient.mc;
21+
22+
/**
23+
* Taken from <a href="https://github.com/CCBlueX/LiquidBounce">LiquidBounce</a>
24+
* <p>
25+
* Copyright (c) 2021 - 2025 CCBlueX
26+
*
27+
* @author Izuna
28+
* @see <a href="https://github.com/CCBlueX/LiquidBounce/blob/nextgen/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/util/MixinDownloader.java">MixinDownloader.java</a>
29+
*/
30+
@Mixin(Downloader.class)
31+
public class DownloaderMixin {
32+
@Shadow
33+
@Final
34+
private Path directory;
35+
36+
@ModifyExpressionValue(method = "method_55485", at = @At(value = "INVOKE", target = "Ljava/nio/file/Path;resolve(Ljava/lang/String;)Ljava/nio/file/Path;"))
37+
private Path hookResolve(Path original, @Local(argsOnly = true) UUID id) {
38+
UUID accountId = mc.getSession().getUuidOrNull();
39+
if (accountId == null) {
40+
MeteorClient.LOG.warn("Failed to change resource pack download directory because the account id is null.");
41+
return original;
42+
}
43+
44+
return directory.resolve(accountId.toString()).resolve(id.toString());
45+
}
46+
}

src/main/resources/meteor-client.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"DefaultSkinHelperMixin",
7373
"DirectionAccessor",
7474
"DisconnectedScreenMixin",
75+
"DownloaderMixin",
7576
"DrawContextMixin",
7677
"ElytraFeatureRendererMixin",
7778
"EnchantingTableBlockEntityRendererMixin",

0 commit comments

Comments
 (0)