Fix deprecations

This commit is contained in:
Mygod
2020-08-18 05:02:09 +08:00
parent 8a1df227c1
commit 35055bc074
10 changed files with 33 additions and 34 deletions

View File

@@ -92,11 +92,11 @@ fun makeMacSpan(mac: String) = if (app.hasTouch) SpannableString(mac).apply {
fun NetworkInterface.formatAddresses(macOnly: Boolean = false) = SpannableStringBuilder().apply {
try {
hardwareAddress?.let { appendln(makeMacSpan(MacAddressCompat.bytesToString(it))) }
hardwareAddress?.let { appendLine(makeMacSpan(MacAddressCompat.bytesToString(it))) }
} catch (_: SocketException) { }
if (!macOnly) for (address in interfaceAddresses) {
append(makeIpSpan(address.address))
appendln("/${address.networkPrefixLength}")
appendLine("/${address.networkPrefixLength}")
}
}.trimEnd()