mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Remove sensitive information from crash and feedback reports
This commit is contained in:
@@ -36,6 +36,7 @@ import static android.content.Context.WIFI_SERVICE;
|
||||
import static android.net.ConnectivityManager.TYPE_MOBILE;
|
||||
import static android.net.ConnectivityManager.TYPE_WIFI;
|
||||
import static android.net.wifi.WifiManager.WIFI_STATE_ENABLED;
|
||||
import static org.briarproject.util.StringUtils.scrubMacAddress;
|
||||
|
||||
public class BriarReportPrimer implements ReportPrimer {
|
||||
|
||||
@@ -165,10 +166,8 @@ public class BriarReportPrimer implements ReportPrimer {
|
||||
if (wifiInfo != null) {
|
||||
int ip = wifiInfo.getIpAddress(); // Nice API, Google
|
||||
int ip1 = ip & 0xFF;
|
||||
int ip2 = (ip >> 8) & 0xFF;
|
||||
int ip3 = (ip >> 16) & 0xFF;
|
||||
int ip4 = (ip >> 24) & 0xFF;
|
||||
String address = ip1 + "." + ip2 + "." + ip3 + "." + ip4;
|
||||
String address = ip1 + ".[scrubbed]." + ip4;
|
||||
customData.put("Wi-Fi address", address);
|
||||
}
|
||||
}
|
||||
@@ -200,7 +199,8 @@ public class BriarReportPrimer implements ReportPrimer {
|
||||
customData.put("Bluetooth status", btStatus);
|
||||
|
||||
if (bt != null)
|
||||
customData.put("Bluetooth address", bt.getAddress());
|
||||
customData.put("Bluetooth address",
|
||||
scrubMacAddress(bt.getAddress()));
|
||||
String btSettingsAddr;
|
||||
try {
|
||||
btSettingsAddr = Settings.Secure.getString(
|
||||
@@ -208,7 +208,8 @@ public class BriarReportPrimer implements ReportPrimer {
|
||||
} catch (SecurityException e) {
|
||||
btSettingsAddr = "Could not get address from settings";
|
||||
}
|
||||
customData.put("Bluetooth address from settings", btSettingsAddr);
|
||||
customData.put("Bluetooth address from settings",
|
||||
scrubMacAddress(btSettingsAddr));
|
||||
|
||||
return Collections.unmodifiableMap(customData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user