mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-02 15:15:09 +00:00
Do not complain if there is no public key.
This commit is contained in:
@@ -202,12 +202,14 @@ public class LanPairingHandler extends BasePairingHandler {
|
|||||||
//Log.e("KDE/PairingDone", "Pairing Done");
|
//Log.e("KDE/PairingDone", "Pairing Done");
|
||||||
SharedPreferences.Editor editor = mDevice.getContext().getSharedPreferences(mDevice.getDeviceId(), Context.MODE_PRIVATE).edit();
|
SharedPreferences.Editor editor = mDevice.getContext().getSharedPreferences(mDevice.getDeviceId(), Context.MODE_PRIVATE).edit();
|
||||||
|
|
||||||
|
if (mDevice.publicKey != null) {
|
||||||
try {
|
try {
|
||||||
String encodedPublicKey = Base64.encodeToString(mDevice.publicKey.getEncoded(), 0);
|
String encodedPublicKey = Base64.encodeToString(mDevice.publicKey.getEncoded(), 0);
|
||||||
editor.putString("publicKey", encodedPublicKey);
|
editor.putString("publicKey", encodedPublicKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/PairingDone", "Error encoding public key");
|
Log.e("KDE/PairingDone", "Error encoding public key");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String encodedCertificate = Base64.encodeToString(mDevice.certificate.getEncoded(), 0);
|
String encodedCertificate = Base64.encodeToString(mDevice.certificate.getEncoded(), 0);
|
||||||
|
Reference in New Issue
Block a user