Add auth protection for ssh key export

We use a builtin keyguard for ssh key export protection on Android.

This protection works only if some protection is set on the phone.

https://developer.android.com/reference/android/app/KeyguardManager#isDeviceSecure()
This commit is contained in:
Mykola Baibuz 2022-09-19 12:27:33 +03:00
parent 5fff65db5a
commit d93be76505
3 changed files with 88 additions and 0 deletions

View file

@ -3,6 +3,10 @@
#include "PageLogicBase.h"
#if defined(Q_OS_ANDROID)
#include <QAndroidActivityResultReceiver>
#endif
class UiLogic;
class ServerSettingsLogic : public PageLogicBase
@ -34,4 +38,25 @@ public:
~ServerSettingsLogic() = default;
};
#if defined(Q_OS_ANDROID)
/* Auth result handler for Android */
class authResultReceiver final : public PageLogicBase, public QAndroidActivityResultReceiver
{
Q_OBJECT
public:
authResultReceiver(UiLogic *uiLogic, int serverIndex , QObject *parent = nullptr) : PageLogicBase(uiLogic, parent) {
m_serverIndex = serverIndex;
}
~authResultReceiver() {}
public:
void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data) override;
private:
int m_serverIndex;
};
#endif
#endif // SERVER_SETTINGS_LOGIC_H