don't leak macaddrs into logs - could be possibly personally identifying

pull/28/head
geeksville 2020-04-21 08:18:46 -07:00
rodzic c00ca9b3db
commit 671bafa05f
2 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -17,6 +17,7 @@ import com.geeksville.android.GeeksvilleApplication
import com.geeksville.android.Logging import com.geeksville.android.Logging
import com.geeksville.concurrent.DeferredExecution import com.geeksville.concurrent.DeferredExecution
import com.geeksville.mesh.IRadioInterfaceService import com.geeksville.mesh.IRadioInterfaceService
import com.geeksville.mesh.anonymized
import com.geeksville.util.exceptionReporter import com.geeksville.util.exceptionReporter
import com.geeksville.util.ignoreException import com.geeksville.util.ignoreException
import com.geeksville.util.toRemoteExceptions import com.geeksville.util.toRemoteExceptions
@ -178,7 +179,7 @@ class RadioInterfaceService : Service(), Logging {
val address = getPrefs(context).getString(DEVADDR_KEY, null) val address = getPrefs(context).getString(DEVADDR_KEY, null)
if (address != null && !allPaired.contains(address)) { if (address != null && !allPaired.contains(address)) {
warn("Ignoring stale bond to $address") warn("Ignoring stale bond to ${address.anonymized}")
null null
} else } else
address address
@ -440,7 +441,7 @@ class RadioInterfaceService : Service(), Logging {
// device is off/not connected) // device is off/not connected)
val device = getBluetoothAdapter(this)?.getRemoteDevice(address) val device = getBluetoothAdapter(this)?.getRemoteDevice(address)
if (device != null) { if (device != null) {
info("Creating radio interface service. device=$address") info("Creating radio interface service. device=${address.anonymized}")
// Note this constructor also does no comm // Note this constructor also does no comm
val s = SafeBluetooth(this, device) val s = SafeBluetooth(this, device)

Wyświetl plik

@ -26,6 +26,7 @@ import com.geeksville.android.Logging
import com.geeksville.android.hideKeyboard import com.geeksville.android.hideKeyboard
import com.geeksville.mesh.MainActivity import com.geeksville.mesh.MainActivity
import com.geeksville.mesh.R import com.geeksville.mesh.R
import com.geeksville.mesh.anonymized
import com.geeksville.mesh.model.UIViewModel import com.geeksville.mesh.model.UIViewModel
import com.geeksville.mesh.service.RadioInterfaceService import com.geeksville.mesh.service.RadioInterfaceService
import com.geeksville.util.exceptionReporter import com.geeksville.util.exceptionReporter
@ -91,6 +92,10 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
data class BTScanEntry(val name: String, val macAddress: String, val bonded: Boolean) { data class BTScanEntry(val name: String, val macAddress: String, val bonded: Boolean) {
// val isSelected get() = macAddress == selectedMacAddr // val isSelected get() = macAddress == selectedMacAddr
override fun toString(): String {
return "BTScanEntry(name=${name.anonymized}, addr=${macAddress.anonymized})"
}
} }
override fun onCleared() { override fun onCleared() {
@ -264,7 +269,7 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
/// Change to a new macaddr selection, updating GUI and radio /// Change to a new macaddr selection, updating GUI and radio
fun changeScanSelection(context: MainActivity, newAddr: String) { fun changeScanSelection(context: MainActivity, newAddr: String) {
info("Changing BT device to $newAddr") info("Changing BT device to ${newAddr.anonymized}")
selectedMacAddr = newAddr selectedMacAddr = newAddr
changeDeviceSelection(context, newAddr) changeDeviceSelection(context, newAddr)
} }