-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathproguard-rules.pro
More file actions
83 lines (70 loc) · 3.06 KB
/
Copy pathproguard-rules.pro
File metadata and controls
83 lines (70 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# ── Aggressive obfuscation ──
-dontoptimize
-ignorewarnings
-overloadaggressively
-allowaccessmodification
-useuniqueclassmembernames
-repackageclasses 'me.hackware.client'
-dontnote
-dontwarn me.hackware.dev.**
# Unicode obfuscation dictionaries
-obfuscationdictionary proguard-dictionary.txt
-classobfuscationdictionary proguard-dictionary.txt
-packageobfuscationdictionary proguard-dictionary.txt
# Keep only annotations needed for mixins; strip source/line metadata
-keepattributes *Annotation*, InnerClasses, EnclosingMethod
# ── Fabric entry point (class name rewritten in jar post-ProGuard) ──
-keep,allowobfuscation class me.hackware.client.HackwareClient {
public *;
}
# ── Generated build constants (read by name at runtime) ──
-keep,allowobfuscation class me.hackware.client.BuildConstants { *; }
# ── Mixins: keep class names + package to prevent -repackageclasses relocation ──
# Mixin classes MUST stay in me.hackware.client.mixin — if relocated to
# me.hackware.client, the Mixin framework can't resolve them (it prepends
# the config "package" prefix, doubling the path).
# Class-name obfuscation is sacrificed here; member names already kept for @Shadow/@Accessor.
-keeppackagenames me.hackware.client.mixin
-keep class me.hackware.client.mixin.**
-keepclassmembers class me.hackware.client.mixin.** { *; }
# ── Event system ──
# EventBus scans @SubscribeEvent via getDeclaredMethods + LambdaMetafactory
-keep,allowobfuscation class me.hackware.api.event.SubscribeEvent { *; }
-keep,allowobfuscation class me.hackware.api.event.Event { *; }
-keep,allowobfuscation class me.hackware.api.event.EventBus { *; }
-keep,allowobfuscation class me.hackware.api.event.EventPriority { *; }
# Event impl classes are used as parameter types in @SubscribeEvent methods
-keep,allowobfuscation class me.hackware.api.event.impl.** { *; }
# Keep @SubscribeEvent-annotated methods so the event bus can find them
-keepclassmembers,allowobfuscation class me.hackware.** {
@me.hackware.api.event.SubscribeEvent <methods>;
}
# ReflectionUtils uses MethodHandles.privateLookupIn + LambdaMetafactory
-keep,allowobfuscation class me.hackware.api.util.ReflectionUtils { *; }
# ── Enums ──
# Keep constant field names: Enum.name() is used for config serialization & GUI display
-keepclassmembers enum me.hackware.** {
public static **[] values();
public static ** valueOf(java.lang.String);
<fields>;
}
# Keep non-hackware enum methods only
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# ── Gson DTO field names (Microsoft OAuth, deserialized by bare field name) ──
-keepclassmembers class me.hackware.client.systems.auth.MicrosoftLogin$* {
<fields>;
}
# ── Suppress warnings for game/loader classes not in our jar ──
-dontwarn com.mojang.**
-dontwarn net.minecraft.**
-dontwarn net.fabricmc.**
-dontwarn org.spongepowered.asm.**
-dontwarn it.unimi.dsi.fastutil.**
-dontwarn org.lwjgl.**
-dontwarn io.netty.**
-dontwarn com.google.**
-dontwarn org.slf4j.**
-dontwarn org.joml.**