1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-24 02:46:50 +01:00

refined error message for invalid authentication key

Co-Authored-By: xaos <xaos@noreply.codeberg.org>
Co-Committed-By: xaos <xaos@noreply.codeberg.org>
This commit is contained in:
xaos 2020-12-20 00:25:44 +01:00 committed by Andreas Shimokawa
parent 02b85f4c11
commit 68e7a5fea9
2 changed files with 5 additions and 4 deletions

View File

@ -716,12 +716,12 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
SharedPreferences sharedPrefs = GBApplication.getDeviceSpecificSharedPrefs(deviceCandidate.getMacAddress());
String authKey = sharedPrefs.getString("authkey", null);
if (authKey == null ||
authKey.isEmpty() ||
authKey.getBytes().length < 34 ||
!authKey.startsWith("0x")) {
if (authKey == null || authKey.isEmpty() ) {
toast(DiscoveryActivity.this, getString(R.string.discovery_need_to_enter_authkey), Toast.LENGTH_LONG, GB.WARN);
return;
} else if (authKey.getBytes().length < 34 || !authKey.startsWith("0x")) {
toast(DiscoveryActivity.this, getString(R.string.discovery_entered_invalid_authkey), Toast.LENGTH_LONG, GB.WARN);
return;
}
}

View File

@ -358,6 +358,7 @@
<string name="appinstaller_install">Install</string>
<string name="discovery_connected_devices_hint">Make your device discoverable. Currently connected devices will likely not be discovered. Activate location (e.g. GPS) on Android 6+. Disable Privacy Guard for Gadgetbridge, because it may crash and reboot your phone. If no device is found after a few minutes, try again after rebooting your mobile device.</string>
<string name="discovery_need_to_enter_authkey">This device needs a secret auth key, long press on the device to enter it. Read the wiki.</string>
<string name="discovery_entered_invalid_authkey">The secret auth key you entered is invalid! Long press on the device to edit.</string>
<string name="discovery_note">Note:</string>
<string name="candidate_item_device_image">Device image</string>
<string name="miband_prefs_alias">Name/Alias</string>