mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 05:37:43 +00:00
Show encryption info in device activity too
This commit is contained in:
parent
7fec58d6b2
commit
7c9d6630d0
@ -506,7 +506,7 @@ public class Device implements BaseLink.PackageReceiver {
|
||||
if (np.getType().equals(NetworkPackage.PACKAGE_TYPE_PAIR)) {
|
||||
|
||||
Log.i("KDE/Device", "Pair package");
|
||||
Log.e("KDE/Device", "Pairing Handler Count " + pairingHandlers.size());
|
||||
|
||||
for (BasePairingHandler ph: pairingHandlers.values()) {
|
||||
try {
|
||||
ph.packageReceived(np);
|
||||
|
@ -21,6 +21,9 @@
|
||||
package org.kde.kdeconnect.UserInterface;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
@ -35,6 +38,7 @@ import android.widget.TextView;
|
||||
|
||||
import org.kde.kdeconnect.BackgroundService;
|
||||
import org.kde.kdeconnect.Device;
|
||||
import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper;
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.UserInterface.List.ButtonItem;
|
||||
import org.kde.kdeconnect.UserInterface.List.CustomItem;
|
||||
@ -185,6 +189,28 @@ public class DeviceActivity extends ActionBarActivity {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
menu.add(R.string.encryption_info_title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||
Context context = DeviceActivity.this;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(context.getResources().getString(R.string.encryption_info_title));
|
||||
builder.setPositiveButton(context.getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
if (device.certificate == null) {
|
||||
builder.setMessage(R.string.encryption_info_msg_no_ssl);
|
||||
} else {
|
||||
builder.setMessage(context.getResources().getString(R.string.my_device_fingerprint) + " " + SslHelper.getCertificateHash(SslHelper.certificate) + "\n\n"
|
||||
+ context.getResources().getString(R.string.remote_device_fingerprint) + " " + SslHelper.getCertificateHash(device.certificate));
|
||||
}
|
||||
builder.create().show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
menu.add(R.string.device_menu_unpair).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user