Fix QT Keychain dependencies and Appimage build.

This commit is contained in:
Julien Wadel 2022-12-19 13:07:10 +01:00
parent ca56368469
commit fd3db129a0
4 changed files with 24 additions and 5 deletions

View file

@ -30,9 +30,12 @@ FILE * gStream = NULL;
#endif
#include "components/core/CoreManager.hpp"
#include "components/vfs/VfsUtils.hpp"
#include "utils/Utils.hpp"
#ifdef ENABLE_QT_KEYCHAIN
#include "components/vfs/VfsUtils.hpp"
#endif
// =============================================================================
void cleanStream(){
@ -57,8 +60,13 @@ int main (int argc, char *argv[]) {
freopen_s(&gStream, "CONOUT$", "w", stderr);
}
#endif
#ifdef ENABLE_QT_KEYCHAIN
bool vfsEncrypted = VfsUtils::updateSDKWithKey();
#else
bool vfsEncrypted = false;
#endif
AppController controller(argc, argv);
#ifdef QT_QML_DEBUG
QQmlDebuggingEnabler enabler;

View file

@ -68,7 +68,7 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
connect(coreManager->getAccountSettingsModel(), &AccountSettingsModel::accountSettingsUpdated, this, &SettingsModel::groupChatEnabledChanged);
connect(coreManager->getAccountSettingsModel(), &AccountSettingsModel::accountSettingsUpdated, this, &SettingsModel::videoConferenceEnabledChanged);
connect(coreManager->getAccountSettingsModel(), &AccountSettingsModel::accountSettingsUpdated, this, &SettingsModel::secureChatEnabledChanged);
#ifdef ENABLE_QT_KEYCHAIN
connect(&mVfsUtils, &VfsUtils::keyRead, this, [&](const QString& key, const QString& value){
if(key == mVfsUtils.getApplicationVfsEncryptionKey()){
if(!getVfsEncrypted()){
@ -100,7 +100,7 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
connect(&mVfsUtils, &VfsUtils::error, this, [&](){
});
#endif
configureRlsUri();
}
@ -1735,6 +1735,7 @@ bool SettingsModel::getVfsEncrypted (){
}
void SettingsModel::setVfsEncrypted (bool encrypted, const bool deleteUserData){
#ifdef ENABLE_QT_KEYCHAIN
if(getVfsEncrypted() != encrypted){
if(encrypted) {
mVfsUtils.newEncryptionKey();
@ -1743,6 +1744,7 @@ void SettingsModel::setVfsEncrypted (bool encrypted, const bool deleteUserData){
mVfsUtils.deleteKey(mVfsUtils.getApplicationVfsEncryptionKey());
}
}
#endif
}
// ---------------------------------------------------------------------------

View file

@ -29,9 +29,12 @@
#include "components/core/CoreHandlers.hpp"
#include "components/contacts/ContactsImporterModel.hpp"
#include "components/vfs/VfsUtils.hpp"
#include "utils/LinphoneEnums.hpp"
#ifdef ENABLE_QT_KEYCHAIN
#include "components/vfs/VfsUtils.hpp"
#endif
// =============================================================================
class TunnelModel;
@ -815,7 +818,9 @@ private:
int mCurrentSettingsTab = 0;
MediastreamerUtils::SimpleCaptureGraph *mSimpleCaptureGraph = nullptr;
int mCaptureGraphListenerCount = 0;
#ifdef ENABLE_QT_KEYCHAIN
VfsUtils mVfsUtils;
#endif
std::shared_ptr<linphone::Config> mConfig;
};

View file

@ -49,6 +49,10 @@ cp -f "${BIN_SOURCE_DIR}/lib"/libapp-plugin* "${WORK_DIR}/AppDir/usr/lib/"
cp -f "${BIN_SOURCE_DIR}/lib64"/libsoci_sqlite3* "${WORK_DIR}/AppDir/usr/lib/"
cp -f "${BIN_SOURCE_DIR}/lib64"/libapp-plugin* "${WORK_DIR}/AppDir/usr/lib/"
cp -f "${BIN_SOURCE_DIR}/lib"/libEQt* "${WORK_DIR}/AppDir/usr/lib/"
cp -f "${BIN_SOURCE_DIR}/lib64"/libEQt* "${WORK_DIR}/AppDir/usr/lib/"
if [ -d "${BIN_SOURCE_DIR}/lib64/mediastreamer" ]; then
mkdir -p "${WORK_DIR}/AppDir/usr/plugins/"
cp -rf "${BIN_SOURCE_DIR}"/lib64/mediastreamer "${WORK_DIR}/AppDir/usr/plugins/"