use of seemoo.fitbit.information.InformationList in project fitness-app by seemoo-lab.
the class WorkActivity method collectBasicInformation.
/**
* Collects basic information about the selected device, stores them in 'information' and displays them to the user.
*/
public void collectBasicInformation() {
if (!firstPress) {
saveButton.setVisibility(View.VISIBLE);
}
InformationList list = new InformationList("basic");
currentInformationList = "basic";
list.add(new Information("MAC Address: " + device.getAddress()));
list.add(new Information("Name: " + device.getName()));
int type = device.getType();
if (type == BluetoothDevice.DEVICE_TYPE_UNKNOWN) {
list.add(new Information(getString(R.string.device_type0)));
} else if (type == BluetoothDevice.DEVICE_TYPE_CLASSIC) {
list.add(new Information(getString(R.string.device_type1)));
} else if (type == BluetoothDevice.DEVICE_TYPE_LE) {
list.add(new Information(getString(R.string.device_type2)));
} else if (type == BluetoothDevice.DEVICE_TYPE_DUAL) {
list.add(new Information(getString(R.string.device_type3)));
}
int bondState = device.getBondState();
if (bondState == BluetoothDevice.BOND_NONE) {
list.add(new Information(getString(R.string.bond_state0)));
} else if (bondState == BluetoothDevice.BOND_BONDING) {
list.add(new Information(getString(R.string.bond_state1)));
} else if (bondState == BluetoothDevice.BOND_BONDED) {
list.add(new Information(getString(R.string.bond_state2)));
}
InternalStorage.loadAuthFiles(activity);
if (AuthValues.AUTHENTICATION_KEY == null) {
list.add(new Information("Authentication credentials unavailable, user login with previously associated tracker required. Association is only supported by the official Fitbit app."));
} else {
list.add(new Information("Authentication Key & Nonce: " + AuthValues.AUTHENTICATION_KEY + ", " + AuthValues.NONCE));
}
if (AuthValues.ENCRYPTION_KEY == null) {
list.add(new Information("Encryption key unavailable, requires authenticated memory readout on vulnerable tracker models."));
} else {
list.add(new Information("Encryption Key: " + AuthValues.ENCRYPTION_KEY));
}
information.put("basic", list);
informationToDisplay.override(information.get("basic"), mListView);
}
Aggregations