forked from linuxdeepin/dde-file-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Move dfmplugin-disk-encrypt from dde-filemanager-extensions
Move dfmplugin-disk-encrypt from dde-filemanager-extensions Log:
- Loading branch information
1 parent
57ff3be
commit fc16275
Showing
143 changed files
with
69,865 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
assets/configs/org.deepin.dde.file-manager.diskencrypt.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"magic":"dsg.config.meta", | ||
"version":"1.0", | ||
"contents":{ | ||
"allowExportEncKey":{ | ||
"value": true, | ||
"serial":0, | ||
"flags":["global"], | ||
"name":"Allow export the encrypt key", | ||
"name[zh_CN]":"允许导出加密密钥", | ||
"description[zh_CN]":"用于控制是否显示加密密钥导出窗口", | ||
"description":"It's used to control whether or not the encryption key export window is displayed", | ||
"permissions":"readwrite", | ||
"visibility":"public" | ||
}, | ||
"encryptAlgorithm" : { | ||
"value": "sm4", | ||
"serial":0, | ||
"flags":["global"], | ||
"name":"Encrypt algorithm", | ||
"name[zh_CN]":"加密算法", | ||
"description[zh_CN]":"分区加密所使用的默认加密算法", | ||
"description":"It's the default algorithm for encrypting partitions", | ||
"permissions":"readwrite", | ||
"visibility":"public" | ||
}, | ||
"enableEncrypt": { | ||
"value": false, | ||
"serial":0, | ||
"flags":["global"], | ||
"name":"Enable partition encrypt", | ||
"name[zh_CN]":"启用分区加密", | ||
"description[zh_CN]":"用于控制分区加密功能是否在文管启用", | ||
"description":"It's used to control whether to enable partition encryption feature in dde-file-manager.", | ||
"permissions":"readwrite", | ||
"visibility":"public" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="org.deepin.Filemanager.DiskEncrypt"> | ||
<signal name="PrepareEncryptDiskResult"> | ||
<arg name="device" type="s" direction="out"/> | ||
<arg name="devName" type="s" direction="out"/> | ||
<arg name="jobID" type="s" direction="out"/> | ||
<arg name="errCode" type="i" direction="out"/> | ||
</signal> | ||
<signal name="EncryptDiskResult"> | ||
<arg name="device" type="s" direction="out"/> | ||
<arg name="devName" type="s" direction="out"/> | ||
<arg name="errCode" type="i" direction="out"/> | ||
<arg name="msg" type="s" direction="out"/> | ||
</signal> | ||
<signal name="DecryptDiskResult"> | ||
<arg name="device" type="s" direction="out"/> | ||
<arg name="devName" type="s" direction="out"/> | ||
<arg name="jobID" type="s" direction="out"/> | ||
<arg name="errCode" type="i" direction="out"/> | ||
</signal> | ||
<signal name="ChangePassphressResult"> | ||
<arg name="device" type="s" direction="out"/> | ||
<arg name="devName" type="s" direction="out"/> | ||
<arg name="jobID" type="s" direction="out"/> | ||
<arg name="errCode" type="i" direction="out"/> | ||
</signal> | ||
<signal name="EncryptProgress"> | ||
<arg name="device" type="s" direction="out"/> | ||
<arg name="devName" type="s" direction="out"/> | ||
<arg name="progress" type="d" direction="out"/> | ||
</signal> | ||
<signal name="DecryptProgress"> | ||
<arg name="device" type="s" direction="out"/> | ||
<arg name="devName" type="s" direction="out"/> | ||
<arg name="progress" type="d" direction="out"/> | ||
</signal> | ||
<signal name="RequestEncryptParams"> | ||
<arg name="encConfig" type="a{sv}" direction="out"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | ||
</signal> | ||
<method name="PrepareEncryptDisk"> | ||
<arg type="s" direction="out"/> | ||
<arg name="params" type="a{sv}" direction="in"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
</method> | ||
<method name="DecryptDisk"> | ||
<arg type="s" direction="out"/> | ||
<arg name="params" type="a{sv}" direction="in"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
</method> | ||
<method name="ChangeEncryptPassphress"> | ||
<arg type="s" direction="out"/> | ||
<arg name="params" type="a{sv}" direction="in"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
</method> | ||
<method name="IgnoreParamRequest"> | ||
</method> | ||
<method name="ResumeEncryption"> | ||
<arg name="device" type="s" direction="in"/> | ||
</method> | ||
<method name="SetEncryptParams"> | ||
<arg name="params" type="a{sv}" direction="in"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
</method> | ||
<method name="QueryTPMToken"> | ||
<arg type="s" direction="out"/> | ||
<arg name="device" type="s" direction="in"/> | ||
</method> | ||
<method name="EncryptStatus"> | ||
<arg type="i" direction="out"/> | ||
<arg name="device" type="s" direction="in"/> | ||
</method> | ||
<method name="HasPendingTask"> | ||
<arg type="b" direction="out"/> | ||
</method> | ||
<method name="IsWorkerRunning"> | ||
<arg type="b" direction="out"/> | ||
</method> | ||
<method name="UnfinishedDecryptJob"> | ||
<arg type="s" direction="out"/> | ||
</method> | ||
</interface> | ||
</node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
usr/lib/*/deepin-service-manager/*.so | ||
usr/share/deepin-service-manager/system/*.json | ||
usr/share/deepin-service-manager/user/*.json | ||
usr/share/deepin-service-manager/other/*.json | ||
usr/share/dbus-1/system.d/*.conf | ||
usr/share/dbus-1/system-services/*.service | ||
etc/systemd/system/[email protected]/* | ||
usr/share/dbus-1/system.d/org.deepin.filemanager.diskencrypt.conf | ||
etc/systemd/system/[email protected]/* | ||
etc/polkit-1/localauthority/10-vendor.d/99-dde-file-manager-encrypt.pkla |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
project(encryptManagerDemo) | ||
|
||
find_package(Qt5 COMPONENTS Core Widgets REQUIRED) | ||
find_package(dfm-framework REQUIRED) | ||
find_package(Dtk COMPONENTS Widget REQUIRED) | ||
|
||
file(GLOB_RECURSE SRC | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) | ||
|
||
add_executable(${PROJECT_NAME} ${SRC}) | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
Qt5::Core | ||
Qt5::Widgets | ||
${dfm-framework_LIBRARIES} | ||
${DtkWidget_LIBRARIES} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#include "mainwindow.h" | ||
|
||
#include <QApplication> | ||
#include <QDebug> | ||
|
||
#include <dfm-framework/dpf.h> | ||
|
||
inline constexpr char kPluginIID[] { "org.deepin.plugin.filemanager" }; | ||
|
||
static bool pluginsLoad() | ||
{ | ||
#ifdef QT_DEBUG | ||
QStringList pluginsDirs; | ||
pluginsDirs.push_back(PLUGIN_DIR); | ||
QStringList blackNames {}; | ||
DPF_NAMESPACE::LifeCycle::initialize({ kPluginIID }, pluginsDirs, blackNames); | ||
|
||
if (!DPF_NAMESPACE::LifeCycle::readPlugins()) | ||
return false; | ||
|
||
if (!DPF_NAMESPACE::LifeCycle::loadPlugins()) | ||
return false; | ||
|
||
return true; | ||
#else | ||
return false; | ||
#endif | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
qputenv("QT_LOGGING_RULES", "*.info=true"); | ||
|
||
QApplication a(argc, argv); | ||
|
||
if (!pluginsLoad()) { | ||
qCritical() << "Load plugin failed!"; | ||
abort(); | ||
} | ||
|
||
MainWindow window; | ||
window.show(); | ||
|
||
return a.exec(); | ||
} |
Oops, something went wrong.