Skip to content

Commit 738ddd9

Browse files
committed
Add support for lambdas
1 parent 105bf5c commit 738ddd9

File tree

5 files changed

+33
-31
lines changed

5 files changed

+33
-31
lines changed

Diff for: build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = "com.urielsalis"
11-
version = "2.0.3"
11+
version = "2.0.4"
1212

1313
val arrowVersion = "0.10.4"
1414

Diff for: src/main/kotlin/com/urielsalis/mccrashlib/deobfuscator/Deobfuscator.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ fun getDeobfuscation(
7979
}
8080
// Matches <whitespace>at<whitespace>(modulename)//(className).(method)((sourcefile):(line))
8181
val java16Regex = "(?:.*?\\bat\\s+[a-zA-Z]*\\//)%c\\.%m\\(%s:%l\\)"
82-
val regex = ReTrace.REGULAR_EXPRESSION + "|(?:" + java16Regex + ")"
82+
// Matches <whitespace>at<whitespace>(optional module name//)(className)$$Lambda$(anything).(method)(sourcefile)
83+
val lambdaRegex = "(?:.*?\\bat\\s+(?:[a-zA-Z]*\\/\\/)?)%c\\\$\\\$Lambda\\\$\\d*\\/(.*)\\.%m\\((.*)\\)"
84+
val regex = ReTrace.REGULAR_EXPRESSION + "|(?:" + java16Regex + ")|(?:" + lambdaRegex + ")"
8385
val retrace = ReTrace(regex, false, true, mappingFile)
8486
val stringWriter = StringWriter()
8587
val printWriter = PrintWriter(stringWriter)

Diff for: src/test/resources/crashes/deobfuscator/client-deobf.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ java.lang.OutOfMemoryError: Java heap space
2929
at net.minecraft.nbt.NbtIo.net.minecraft.nbt.CompoundTag readCompressed(java.io.InputStream)(NbtIo.java:32)
3030
at net.minecraft.nbt.NbtIo.net.minecraft.nbt.CompoundTag readCompressed(java.io.File)(NbtIo.java:26)
3131
at net.minecraft.world.level.storage.LevelStorageSource.net.minecraft.world.level.storage.LevelSummary lambda$levelSummaryReader$5(java.io.File,boolean,java.io.File,com.mojang.datafixers.DataFixer)(LevelStorageSource.java:229)
32-
at cyg$$Lambda$2987/857564250.apply(Unknown Source)
32+
at net.minecraft.world.level.storage.LevelStorageSource$$Lambda$2987/null 857564250(null).apply(Unknown Source)
3333
at net.minecraft.world.level.storage.LevelStorageSource.java.lang.Object readLevelData(java.io.File,java.util.function.BiFunction)(LevelStorageSource.java:178)
3434
at net.minecraft.world.level.storage.LevelStorageSource.java.util.List getLevelList()(LevelStorageSource.java:157)
3535
at net.minecraft.client.gui.screens.worldselection.WorldSelectionList.void refreshList(java.util.function.Supplier,boolean)(WorldSelectionList.java:91)
@@ -38,7 +38,7 @@ java.lang.OutOfMemoryError: Java heap space
3838
at net.minecraft.client.gui.screens.Screen.void init(net.minecraft.client.Minecraft,int,int)(Screen.java:325)
3939
at net.minecraft.client.Minecraft.void setScreen(net.minecraft.client.gui.screens.Screen)(Minecraft.java:922)
4040
at net.minecraft.client.gui.screens.TitleScreen.void lambda$createNormalMenuOptions$4(net.minecraft.client.gui.components.Button)(TitleScreen.java:141)
41-
at doy$$Lambda$2670/1502984812.onPress(Unknown Source)
41+
at net.minecraft.client.gui.screens.TitleScreen$$Lambda$2670/null 1502984812(null).onPress(Unknown Source)
4242
at net.minecraft.client.gui.components.Button.void onPress()(Button.java:33)
4343

4444

@@ -77,10 +77,10 @@ Stacktrace:
7777
at net.minecraft.client.gui.screens.Screen.void wrapScreenError(java.lang.Runnable,java.lang.String,java.lang.String)(Screen.java:438)
7878
at net.minecraft.client.MouseHandler.void onPress(long,int,int,int)(MouseHandler.java:92)
7979
at net.minecraft.client.MouseHandler.void lambda$null$4(long,int,int,int)(MouseHandler.java:162)
80-
at dka$$Lambda$2975/534027987.run(Unknown Source)
80+
at net.minecraft.client.MouseHandler$$Lambda$2975/null 534027987(null).run(Unknown Source)
8181
at net.minecraft.util.thread.BlockableEventLoop.void execute(java.lang.Runnable)(BlockableEventLoop.java:94)
8282
at net.minecraft.client.MouseHandler.void lambda$setup$5(long,int,int,int)(MouseHandler.java:162)
83-
at dka$$Lambda$2334/656802017.invoke(Unknown Source)
83+
at net.minecraft.client.MouseHandler$$Lambda$2334/null 656802017(null).invoke(Unknown Source)
8484
at org.lwjgl.glfw.GLFWMouseButtonCallbackI.null callback(null)(GLFWMouseButtonCallbackI.java:36)
8585
at org.lwjgl.system.JNI.null invokeV(null)(JNI.java)
8686
at org.lwjgl.glfw.GLFW.null glfwWaitEventsTimeout(null)(GLFW.java:3174)

0 commit comments

Comments
 (0)