Skip to content

Commit

Permalink
Syncronize and check that they are not trying to break us
Browse files Browse the repository at this point in the history
  • Loading branch information
urielsalis committed May 11, 2021
1 parent 9d6fb46 commit f64f680
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,26 @@ fun getDeobfuscation(modded: Boolean, version: String, content: String, isClient
if (modded) {
return null
}

if (version.isBlank() || version.contains("\\") || version.contains("/")) {
return null
}

val name = if (isClient) {
"$version-client"
} else {
"$version-server"
}
val mappingFile = File(mappingsFile, name)
if (!mappingFile.exists()) {
downloadMapping(version, name, isClient)
}
if (!mappingFile.exists()) {
return null

val mappingFile = synchronized(mappingsFile) {
val mappingFile = File(mappingsFile, name)
if (!mappingFile.exists()) {
downloadMapping(version, name, isClient)
}
if (!mappingFile.exists()) {
return null
}
mappingFile
}
val retrace = ReTrace(ReTrace.REGULAR_EXPRESSION, false, true, mappingFile)
val stringWriter = StringWriter()
Expand Down

0 comments on commit f64f680

Please sign in to comment.