mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 13:47:41 +00:00
Show encryption info in device activity too
This commit is contained in:
@@ -506,7 +506,7 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
if (np.getType().equals(NetworkPackage.PACKAGE_TYPE_PAIR)) {
|
if (np.getType().equals(NetworkPackage.PACKAGE_TYPE_PAIR)) {
|
||||||
|
|
||||||
Log.i("KDE/Device", "Pair package");
|
Log.i("KDE/Device", "Pair package");
|
||||||
Log.e("KDE/Device", "Pairing Handler Count " + pairingHandlers.size());
|
|
||||||
for (BasePairingHandler ph: pairingHandlers.values()) {
|
for (BasePairingHandler ph: pairingHandlers.values()) {
|
||||||
try {
|
try {
|
||||||
ph.packageReceived(np);
|
ph.packageReceived(np);
|
||||||
|
@@ -21,6 +21,9 @@
|
|||||||
package org.kde.kdeconnect.UserInterface;
|
package org.kde.kdeconnect.UserInterface;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
@@ -35,6 +38,7 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import org.kde.kdeconnect.BackgroundService;
|
import org.kde.kdeconnect.BackgroundService;
|
||||||
import org.kde.kdeconnect.Device;
|
import org.kde.kdeconnect.Device;
|
||||||
|
import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper;
|
||||||
import org.kde.kdeconnect.Plugins.Plugin;
|
import org.kde.kdeconnect.Plugins.Plugin;
|
||||||
import org.kde.kdeconnect.UserInterface.List.ButtonItem;
|
import org.kde.kdeconnect.UserInterface.List.ButtonItem;
|
||||||
import org.kde.kdeconnect.UserInterface.List.CustomItem;
|
import org.kde.kdeconnect.UserInterface.List.CustomItem;
|
||||||
@@ -185,6 +189,28 @@ public class DeviceActivity extends ActionBarActivity {
|
|||||||
return true;
|
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() {
|
menu.add(R.string.device_menu_unpair).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemClick(MenuItem menuItem) {
|
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||||
|
Reference in New Issue
Block a user