ReportScrubber

class ReportScrubber(names: Collection<String> = emptyList(), keep: Collection<String> = emptyList())(source)

Removes what identifies a person from text that goes into a problem report (logs, system values): phone numbers, e-mail addresses, full Bluetooth / MAC addresses (only the last two bytes stay), IP addresses, IMEI- or serial-like digit runs, long keys and tokens, and any names given (Bluetooth device names, the client's name, SIM and carrier names). Timestamps, versions, build fingerprints, durations, counters and percentages stay as they are.

Pure and idempotent: scrubbing a scrubbed text changes nothing. The same rules run in the iPhone app (TetherCore ReportScrubber), so both apps' reports read alike.

names shorter than 2 characters, and words a report needs (keep, plus "iPhone", "Android", "Tether", …) are never replaced.

Constructors

Link copied to clipboard
constructor(names: Collection<String> = emptyList(), keep: Collection<String> = emptyList())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun scrub(text: String): String

text with everything personal replaced by <number>, <email>, <ip>, <id>, <secret>, <name>, …XX:XX.

Link copied to clipboard

Each of lines scrubbed.