Feature: Decrypt encrypted file name (#3788)

Closes #2713
This commit is contained in:
Armin Schrenk
2025-04-10 17:44:55 +02:00
committed by GitHub
parent dcbcd692e7
commit 1d8466a9e3
16 changed files with 955 additions and 68 deletions
+174 -1
View File
@@ -16,6 +16,10 @@
src: url('opensans_bold.ttf');
}
@font-face {
src: url('firacode_regular.ttf');
}
/*******************************************************************************
* *
* Root Styling & Colors *
@@ -125,6 +129,12 @@
-fx-fill: TEXT_FILL;
}
.cryptic-text {
-fx-fill: TEXT_FILL;
-fx-font-family: 'Fira Code';
-fx-font-size: 1.1em;
}
/*******************************************************************************
* *
* Glyph Icons *
@@ -1012,4 +1022,167 @@
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL;
-fx-background-insets: 0, 1px;
-fx-background-radius: 4px;
}
}
/*******************************************************************************
* *
* Decrypt Name Window
* *
******************************************************************************/
.decrypt-name-window .button-bar {
-fx-min-height:42px;
-fx-max-height:42px;
-fx-background-color: MAIN_BG;
-fx-border-color: transparent transparent CONTROL_BORDER_NORMAL transparent;
-fx-border-width: 0 0 1px 0;
}
.decrypt-name-window .button-bar .button-right {
-fx-border-color: transparent transparent transparent CONTROL_BORDER_NORMAL;
-fx-border-width: 0 0 0 1px;
-fx-background-color: MAIN_BG;
-fx-background-radius: 0px;
-fx-min-height: 42px;
-fx-max-height: 42px;
}
.decrypt-name-window .button-bar .button-right:armed {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
}
.decrypt-name-window .table-view {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL;
-fx-background-insets: 0,1;
/* There is some oddness if padding is in em values rather than pixels,
in particular, the left border of the control doesn't show. */
-fx-padding: 1; /* 0.083333em; */
}
.table-view > .placeholder {
-fx-background-color: transparent;
-fx-background-radius: 0px;
}
.table-view > .placeholder > .button {
-fx-border-width: 0;
-fx-border-color: transparent;
-fx-background-radius: 0px;
}
.table-view:focused {
-fx-background-color: CONTROL_BORDER_FOCUSED, CONTROL_BG_NORMAL;
-fx-background-insets: 0, 1;
-fx-background-radius: 0, 0;
/* There is some oddness if padding is in em values rather than pixels,
in particular, the left border of the control doesn't show. */
-fx-padding: 1; /* 0.083333em; */
}
.table-view > .virtual-flow > .scroll-bar:vertical {
-fx-background-insets: 0, 0 0 0 1;
-fx-padding: -1 -1 -1 0;
}
.table-view > .virtual-flow > .corner {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL ;
-fx-background-insets: 0, 1 0 0 1;
}
/* Each row in the table is a table-row-cell. Inside a table-row-cell is any
number of table-cell. */
.table-row-cell {
-fx-background-color: GRAY_3, CONTROL_BG_NORMAL;
-fx-background-insets: 0, 0 0 1 0;
-fx-padding: 0.0em; /* 0 */
-fx-text-fill: TEXT_FILL;
}
.table-row-cell:odd {
-fx-background-color: GRAY_3, GRAY_1;
-fx-background-insets: 0, 0 0 1 0;
}
.table-cell {
-fx-padding: 3px 6px 3px 6px;
-fx-background-color: transparent;
-fx-border-color: transparent CONTROL_BORDER_NORMAL transparent transparent;
-fx-border-width: 1px;
-fx-cell-size: 30px;
-fx-text-fill: TEXT_FILL;
-fx-text-overrun: center-ellipsis;
}
.table-view:focused > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled:selected > .table-cell {
-fx-text-fill: TEXT_FILL;
}
/* selected, hover - not specified */
/* selected, focused, hover */
/* selected, focused */
/* selected */
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:selected,
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:selected,
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:selected:hover {
-fx-background-color: CONTROL_PRIMARY_BG_NORMAL, PRIMARY_D1;
-fx-background-insets: 0 0 0 0, 1 1 1 3;
-fx-text-fill: TEXT_FILL;
}
/* focused */
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused {
-fx-background-color: CONTROL_PRIMARY_BORDER_FOCUSED, CONTROL_PRIMARY_BG_NORMAL , CONTROL_BG_NORMAL;
-fx-background-insets: 0 1 0 0, 1 2 1 1, 2 3 2 2;
-fx-text-fill: TEXT_FILL;
}
/* focused, hover */
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:hover {
-fx-background-color: CONTROL_PRIMARY_BORDER_FOCUSED, CONTROL_PRIMARY_BG_NORMAL , PRIMARY_D2;
-fx-background-insets: 0 1 0 0, 1 2 1 1, 2 3 2 2;
-fx-text-fill: TEXT_FILL;
}
/* hover */
.table-view:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:hover {
-fx-background-color: PRIMARY_D2;
-fx-text-fill: TEXT_FILL;
-fx-background-insets: 0 0 1 0;
}
/* The column-resize-line is shown when the user is attempting to resize a column. */
.table-view .column-resize-line {
-fx-background-color: CONTROL_BG_ARMED;
-fx-padding: 0.0em 0.0416667em 0.0em 0.0416667em; /* 0 0.571429 0 0.571429 */
}
/* This is the area behind the column headers. An ideal place to specify background
and border colors for the whole area (not individual column-header's). */
.table-view .column-header-background {
-fx-background-color: GRAY_2;
-fx-padding: 0;
}
/* The column header row is made up of a number of column-header, one for each
TableColumn, and a 'filler' area that extends from the right-most column
to the edge of the tableview, or up to the 'column control' button. */
.table-view .column-header {
-fx-text-fill: TEXT_FILL;
-fx-font-size: 1.083333em; /* 13pt ; 1 more than the default font */
-fx-size: 24;
-fx-border-style: solid;
-fx-border-color:
transparent
GRAY_3
GRAY_3
transparent;
-fx-border-insets: 0 0 0 0;
-fx-border-width: 0.083333em;
}
.table-view .column-header .label {
-fx-alignment: center;
}
.table-view .empty-table {
-fx-background-color: MAIN_BG;
-fx-font-size: 1.166667em; /* 14pt - 2 more than the default font */
}
Binary file not shown.
+175 -1
View File
@@ -16,6 +16,10 @@
src: url('opensans_bold.ttf');
}
@font-face {
src: url('firacode_regular.ttf');
}
/*******************************************************************************
* *
* Root Styling & Colors *
@@ -79,6 +83,7 @@
PROGRESS_INDICATOR_END: GRAY_4;
PROGRESS_BAR_BG: GRAY_8;
-fx-background-color: MAIN_BG;
-fx-text-fill: TEXT_FILL;
-fx-font-family: 'Open Sans';
@@ -124,6 +129,12 @@
-fx-fill: TEXT_FILL;
}
.cryptic-text {
-fx-fill: TEXT_FILL;
-fx-font-family: 'Fira Code';
-fx-font-size: 1.1em;
}
/*******************************************************************************
* *
* Glyph Icons *
@@ -1011,4 +1022,167 @@
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL;
-fx-background-insets: 0, 1px;
-fx-background-radius: 4px;
}
}
/*******************************************************************************
* *
* Decrypt Name Window
* *
******************************************************************************/
.decrypt-name-window .button-bar {
-fx-min-height:42px;
-fx-max-height:42px;
-fx-background-color: MAIN_BG;
-fx-border-color: transparent transparent CONTROL_BORDER_NORMAL transparent;
-fx-border-width: 0 0 1px 0;
}
.decrypt-name-window .button-bar .button-right {
-fx-border-color: transparent transparent transparent CONTROL_BORDER_NORMAL;
-fx-border-width: 0 0 0 1px;
-fx-background-color: MAIN_BG;
-fx-background-radius: 0px;
-fx-min-height: 42px;
-fx-max-height: 42px;
}
.decrypt-name-window .button-bar .button-right:armed {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED;
}
.decrypt-name-window .table-view {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL;
-fx-background-insets: 0,1;
/* There is some oddness if padding is in em values rather than pixels,
in particular, the left border of the control doesn't show. */
-fx-padding: 1; /* 0.083333em; */
}
.table-view > .placeholder {
-fx-background-color: transparent;
-fx-background-radius: 0px;
}
.table-view > .placeholder > .button {
-fx-border-width: 0;
-fx-border-color: transparent;
-fx-background-radius: 0px;
}
.table-view:focused {
-fx-background-color: CONTROL_BORDER_FOCUSED, CONTROL_BG_NORMAL;
-fx-background-insets: 0, 1;
-fx-background-radius: 0, 0;
/* There is some oddness if padding is in em values rather than pixels,
in particular, the left border of the control doesn't show. */
-fx-padding: 1; /* 0.083333em; */
}
.table-view > .virtual-flow > .scroll-bar:vertical {
-fx-background-insets: 0, 0 0 0 1;
-fx-padding: -1 -1 -1 0;
}
.table-view > .virtual-flow > .corner {
-fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL ;
-fx-background-insets: 0, 1 0 0 1;
}
/* Each row in the table is a table-row-cell. Inside a table-row-cell is any
number of table-cell. */
.table-row-cell {
-fx-background-color: GRAY_6, CONTROL_BG_NORMAL;
-fx-background-insets: 0, 0 0 1 0;
-fx-padding: 0.0em; /* 0 */
-fx-text-fill: TEXT_FILL;
}
.table-row-cell:odd {
-fx-background-color: GRAY_6, GRAY_9;
-fx-background-insets: 0, 0 0 1 0;
}
.table-cell {
-fx-padding: 3px 6px 3px 6px;
-fx-background-color: transparent;
-fx-border-color: transparent CONTROL_BORDER_NORMAL transparent transparent;
-fx-border-width: 1px;
-fx-cell-size: 30px;
-fx-text-fill: TEXT_FILL;
-fx-text-overrun: center-ellipsis;
}
.table-view:focused > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled:selected > .table-cell {
-fx-text-fill: TEXT_FILL;
}
/* selected, hover - not specified */
/* selected, focused, hover */
/* selected, focused */
/* selected */
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:selected,
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:selected,
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:selected:hover {
-fx-background-color: CONTROL_PRIMARY_BG_NORMAL, CONTROL_BG_SELECTED;
-fx-background-insets: 0 0 0 0, 1 1 1 3;
-fx-text-fill: TEXT_FILL;
}
/* focused */
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused {
-fx-background-color: CONTROL_PRIMARY_BORDER_FOCUSED, CONTROL_PRIMARY_BG_NORMAL , CONTROL_BG_NORMAL;
-fx-background-insets: 0 1 0 0, 1 2 1 1, 2 3 2 2;
-fx-text-fill: TEXT_FILL;
}
/* focused, hover */
.table-view:focused:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:focused:hover {
-fx-background-color: CONTROL_PRIMARY_BORDER_FOCUSED, CONTROL_PRIMARY_BG_NORMAL , PRIMARY_L2;
-fx-background-insets: 0 1 0 0, 1 2 1 1, 2 3 2 2;
-fx-text-fill: TEXT_FILL;
}
/* hover */
.table-view:cell-selection > .virtual-flow > .clipped-container > .sheet > .table-row-cell:filled > .table-cell:hover {
-fx-background-color: PRIMARY_L2;
-fx-text-fill: TEXT_FILL;
-fx-background-insets: 0 0 1 0;
}
/* The column-resize-line is shown when the user is attempting to resize a column. */
.table-view .column-resize-line {
-fx-background-color: CONTROL_BG_ARMED;
-fx-padding: 0.0em 0.0416667em 0.0em 0.0416667em; /* 0 0.571429 0 0.571429 */
}
/* This is the area behind the column headers. An ideal place to specify background
and border colors for the whole area (not individual column-header's). */
.table-view .column-header-background {
-fx-background-color: GRAY_7;
-fx-padding: 0;
}
/* The column header row is made up of a number of column-header, one for each
TableColumn, and a 'filler' area that extends from the right-most column
to the edge of the tableview, or up to the 'column control' button. */
.table-view .column-header {
-fx-text-fill: TEXT_FILL;
-fx-font-size: 1.083333em; /* 13pt ; 1 more than the default font */
-fx-size: 24;
-fx-border-style: solid;
-fx-border-color:
CONTROL_BORDER_NORMAL
GRAY_5
GRAY_5
transparent;
-fx-border-insets: 0 0 0 0;
-fx-border-width: 0.083333em;
}
.table-view .column-header .label {
-fx-alignment: center;
}
.table-view .empty-table {
-fx-background-color: MAIN_BG;
-fx-font-size: 1.166667em; /* 14pt - 2 more than the default font */
}
+70
View File
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<?import org.cryptomator.ui.controls.FormattedLabel?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<VBox xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="org.cryptomator.ui.decryptname.DecryptFileNamesViewController"
styleClass="decrypt-name-window"
minWidth="400"
maxWidth="400"
minHeight="145">
<HBox styleClass="button-bar" alignment="CENTER">
<padding>
<Insets left="6"/>
</padding>
<Region HBox.hgrow="ALWAYS"/>
<Button styleClass="button-right" contentDisplay="GRAPHIC_ONLY" onAction="#copyTableToClipboard">
<graphic>
<FontAwesome5IconView glyph="CLIPBOARD" glyphSize="16"/>
</graphic>
<tooltip>
<Tooltip text="%decryptNames.copyTable.tooltip"/>
</tooltip>
</Button>
<Button styleClass="button-right" contentDisplay="GRAPHIC_ONLY" onAction="#clearTable">
<graphic>
<FontAwesome5IconView glyph="TRASH" glyphSize="16"/>
</graphic>
<tooltip>
<Tooltip text="%decryptNames.clearTable.tooltip"/>
</tooltip>
</Button>
</HBox>
<TableView fx:id="cipherToCleartextTable" VBox.vgrow="ALWAYS">
<placeholder>
<Button alignment="CENTER" onAction="#selectFiles" text="${controller.dropZoneText}" contentDisplay="TOP" maxWidth="Infinity" maxHeight="Infinity">
<graphic>
<FontAwesome5IconView glyph="${controller.dropZoneIcon}" glyphSize="16"/>
</graphic>
</Button>
</placeholder>
<columns>
<TableColumn fx:id="ciphertextColumn" prefWidth="${cipherToCleartextTable.width * 0.5}">
<graphic>
<FontAwesome5IconView glyph="LOCK"/>
</graphic>
</TableColumn>
<TableColumn fx:id="cleartextColumn" prefWidth="${cipherToCleartextTable.width * 0.5}">
<graphic>
<FontAwesome5IconView glyph="LOCK_OPEN"/>
</graphic>
</TableColumn>
</columns>
</TableView>
<HBox>
<padding>
<Insets topRightBottomLeft="6"/>
</padding>
<Region HBox.hgrow="ALWAYS"/>
<FormattedLabel styleClass="label-small" format="%decryptNames.copyHint" arg1="${controller.copyToClipboardShortcutString}"/>
</HBox>
</VBox>
@@ -1,12 +1,14 @@
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<?import org.cryptomator.ui.controls.ThroughputLabel?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.text.Text?>
<VBox xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
fx:controller="org.cryptomator.ui.mainwindow.VaultDetailUnlockedController"
@@ -44,28 +46,38 @@
<Region VBox.vgrow="ALWAYS"/>
<HBox alignment="BOTTOM_CENTER">
<HBox visible="${controller.accessibleViaPath}" managed="${controller.accessibleViaPath}">
<StackPane visible="${controller.accessibleViaPath}" managed="${controller.accessibleViaPath}">
<padding>
<Insets topRightBottomLeft="0"/>
</padding>
<Button fx:id="dropZone" styleClass="drag-n-drop" text="%main.vaultDetail.locateEncryptedFileBtn" minWidth="120" maxWidth="180" wrapText="true" textAlignment="CENTER" onAction="#chooseFileAndReveal" contentDisplay="TOP" visible="${!controller.ciphertextPathsCopied}" managed="${!controller.ciphertextPathsCopied}">
<Button fx:id="revealEncryptedDropZone" styleClass="drag-n-drop" text="%main.vaultDetail.locateEncryptedFileBtn" minWidth="120" maxWidth="180" prefHeight="72" wrapText="true" textAlignment="CENTER" onAction="#chooseDecryptedFileAndReveal" contentDisplay="TOP" visible="${!controller.ciphertextPathsCopied}" managed="${!controller.ciphertextPathsCopied}">
<graphic>
<FontAwesome5IconView glyph="FILE_DOWNLOAD" glyphSize="15"/>
<Text styleClass="cryptic-text" text="abc → 101010"/>
</graphic>
<tooltip>
<Tooltip text="%main.vaultDetail.locateEncryptedFileBtn.tooltip"/>
</tooltip>
</Button>
<Button styleClass="drag-n-drop" text="%main.vaultDetail.encryptedPathsCopied" minWidth="120" maxWidth="180" wrapText="true" textAlignment="CENTER" onAction="#chooseFileAndReveal" contentDisplay="TOP" visible="${controller.ciphertextPathsCopied}" managed="${controller.ciphertextPathsCopied}">
<!-- TODO: instead of showing a button, show on error a small dialog and if copied, show a tooltip -->
<Button styleClass="drag-n-drop" text="%main.vaultDetail.encryptedPathsCopied" minWidth="120" maxWidth="180" prefHeight="72" wrapText="true" textAlignment="CENTER" onAction="#chooseDecryptedFileAndReveal" contentDisplay="TOP" visible="${controller.ciphertextPathsCopied}" managed="${controller.ciphertextPathsCopied}">
<graphic>
<FontAwesome5IconView glyph="CHECK" glyphSize="15"/>
</graphic>
</Button>
</HBox>
</StackPane>
<!-- decrypt file name -->
<Button fx:id="decryptNameDropZone" styleClass="drag-n-drop" text="%main.vaultDetail.decryptName.buttonLabel" minWidth="120" maxWidth="180" prefHeight="72" wrapText="true" textAlignment="CENTER" onAction="#showDecryptNameWindow" contentDisplay="TOP">
<graphic>
<Text styleClass="cryptic-text" text="101010 → abc"/>
</graphic>
<tooltip>
<Tooltip text="%main.vaultDetail.decryptName.tooltip"/>
</tooltip>
</Button>
<Region HBox.hgrow="ALWAYS"/>
<Button text="%main.vaultDetail.stats" minWidth="120" onAction="#showVaultStatistics" contentDisplay="BOTTOM">
<Button text="%main.vaultDetail.stats" minWidth="120" onAction="#showVaultStatistics" contentDisplay="BOTTOM" prefHeight="72">
<graphic>
<VBox spacing="6">
<HBox alignment="CENTER_RIGHT" spacing="6">
+17 -1
View File
@@ -425,7 +425,9 @@ main.vaultDetail.stats=Vault Statistics
main.vaultDetail.locateEncryptedFileBtn=Locate Encrypted File
main.vaultDetail.locateEncryptedFileBtn.tooltip=Choose a file from your vault to locate its encrypted counterpart
main.vaultDetail.encryptedPathsCopied=Paths Copied to Clipboard!
main.vaultDetail.filePickerTitle=Select File Inside Vault
main.vaultDetail.locateEncrypted.filePickerTitle=Select File Inside Vault
main.vaultDetail.decryptName.buttonLabel=Decrypt File Name
main.vaultDetail.decryptName.tooltip=Choose an encrypted vault file to decrypt its name
### Missing
main.vaultDetail.missing.info=Cryptomator could not find a vault at this path.
main.vaultDetail.missing.recheck=Recheck
@@ -581,6 +583,20 @@ shareVault.hub.instruction.1=1. Share access of the encrypted vault folder via c
shareVault.hub.instruction.2=2. Grant access to team member in Cryptomator Hub.
shareVault.hub.openHub=Open Cryptomator Hub
# Decrypt File Names
decryptNames.title=Decrypt File Names
decryptNames.filePicker.title=Select encrypted file
decryptNames.filePicker.extensionDescription=Cryptomator encrypted file
decryptNames.copyTable.tooltip=Copy table
decryptNames.clearTable.tooltip=Clear table
decryptNames.copyHint=Copy cell content with %s
decryptNames.dropZone.message=Drop files or click to select
decryptNames.dropZone.error.vaultInternalFiles=Vault internal files with no decrypt-able name selected
decryptNames.dropZone.error.foreignFiles=Files do not belong to vault "%s"
decryptNames.dropZone.error.noDirIdBackup=Directory of selected files does not contain dirId.c9r file
decryptNames.dropZone.error.generic=Failed to decrypt file names
# Event View
eventView.title=Events
eventView.filter.allVaults=All