Gson display to not escape HTML character like "="

This commit is contained in:
yuhan6665
2021-03-27 19:01:49 -04:00
parent 62b928e6a0
commit 4d9aced5a4

View File

@@ -394,6 +394,7 @@ data class V2rayConfig(
fun toPrettyPrinting(): String {
return GsonBuilder()
.setPrettyPrinting()
.disableHtmlEscaping()
.registerTypeAdapter( // custom serialiser is needed here since JSON by default parse number as Double, core will fail to start
object : TypeToken<Double>() {}.type,
JsonSerializer { src: Double?, _: Type?, _: JsonSerializationContext? -> JsonPrimitive(src?.toInt()) }