Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Implementation of Quick Access API for Windows Explorer #69

Merged
merged 49 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1d43fc8
prepare project to use ffi api in JDK 22
infeo Jun 12, 2024
4c9a6c8
add required windows c api classes
infeo Jun 12, 2024
ed0ac58
setting base for accessing registry
infeo Jun 13, 2024
37516f6
fix buffer allocation problem
infeo Jun 13, 2024
7d1c9fb
remove explicit rollback call in integration test
infeo Jun 13, 2024
cbbed9f
format code
infeo Jun 13, 2024
654f4e9
add missing assertion to integration test
infeo Jun 13, 2024
8254eb1
generalize getValue method
infeo Jun 13, 2024
20fd52e
enable setting DWORDS as data for registry key values
infeo Jun 13, 2024
badfe8e
generalize RegistryKeys setValue functions
infeo Jun 14, 2024
28ae737
allow to set expandable strings
infeo Jun 14, 2024
f52258a
implement adding explorer sidebar integration
infeo Jun 14, 2024
50755f3
add feature to delete single values from registry keys
infeo Jun 14, 2024
eff5fff
implement removal of sidebar entry
infeo Jun 14, 2024
07c6f56
add integration test for sidebar service
infeo Jun 14, 2024
2339767
add service annotations and expose service
infeo Jun 14, 2024
c854fe6
rename method
infeo Jun 17, 2024
bcbd979
Merge branch 'develop' into feature/sidebar
infeo Jun 17, 2024
1180ef8
setting IDE project JDK to 22
infeo Jun 17, 2024
81f5a8f
adding jextract-maven-plugin
infeo Jun 17, 2024
c59d5d2
add jextract-maven-plugin to pom and renamed jextract'ed classes
infeo Jun 17, 2024
16cc44c
add logging
infeo Jun 18, 2024
bf70fe9
refactor registry key to own file
infeo Jun 18, 2024
c2b909c
adjust impl to changed interface
infeo Jun 18, 2024
02d88de
add specific exception when using the Windows Api
infeo Jun 18, 2024
9638cd6
add method to ignore not-existing keys on delete
infeo Jun 18, 2024
f5237aa
adjust to new api
infeo Jun 18, 2024
7199e74
on sidebar entry removal, ignore not-existing keys (to be deleted any…
infeo Jun 18, 2024
cdb7286
more fine grained error throwing
infeo Jun 18, 2024
877665c
add method to ignore not existing values on deletion
infeo Jun 18, 2024
155a407
formatting
infeo Jun 18, 2024
0b9d198
adjust to changed API
infeo Jun 19, 2024
5a05857
renaming to quick access
infeo Jun 20, 2024
8890790
use beta1 of integrations-api
infeo Jun 27, 2024
b4d7be3
reset version to prepare PR
infeo Jun 27, 2024
4aa601e
migrate ci to use JDK 22
infeo Jun 27, 2024
6f490e8
use icon from executable if present, otherwise default to folder icon
infeo Jun 27, 2024
0ba6bd7
Apply code review notes
infeo Jul 1, 2024
d67ae9d
Don't allow actual closing of predefined reg keys
infeo Jul 1, 2024
b2856be
fix broken RegistryKey::getValue method
infeo Jul 1, 2024
4c88ab1
exclude generated code from automatic review
infeo Jul 1, 2024
35fcd77
simplify RegistryKey::getValue function and add test to set/get big v…
infeo Jul 4, 2024
7fe1522
Make api misuse resistant:
infeo Jul 5, 2024
85a8f23
add javadoc
infeo Jul 5, 2024
a74aa37
Remove unnecessary string conversions
infeo Jul 5, 2024
5413619
Rework close method of registry transaction:
infeo Jul 5, 2024
7037aad
doc doc doc
infeo Jul 5, 2024
fcd11c4
fix doc doc
infeo Jul 5, 2024
e5e4460
add DisplayName to ExplorerQuickAccessService
infeo Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coderabbit/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
path_filters:
exclude:
- src/main/java/org/cryptomator/windows/capi/**
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 22
cache: 'maven'
- name: Ensure to use tagged version
if: startsWith(github.ref, 'refs/tags/')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 22
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
runner-os: 'windows-latest'
java-distribution: 'temurin'
java-version: 17
java-version: 22
secrets:
nvd-api-key: ${{ secrets.NVD_API_KEY }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 22
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 22
cache: 'maven'
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
Expand Down
3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This project uses the following JVM properties:

This project uses JNI, hence you'll nedd Java as well as GCC build tools:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typographical error: Correct the sentence structure.

The word "hence" is an adverb and should be separated from the sentence.

-This project uses JNI, hence you'll nedd Java as well as GCC build tools:
+This project uses JNI. Hence, you'll need Java as well as GCC build tools:
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
This project uses JNI, hence you'll nedd Java as well as GCC build tools:
This project uses JNI. Hence, you'll need Java as well as GCC build tools:
Tools
LanguageTool

[typographical] ~13-~13: The word “hence” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ion api ## Building This project uses JNI, hence you'll nedd Java as well as GCC build t...

(THUS_SENTENCE)


* JDK 17
* JDK 22
* Maven
* MinGW GCC compiler (`choco install mingw --version=10.2.0`)
* Make (`choco install make`)
infeo marked this conversation as resolved.
Show resolved Hide resolved
129 changes: 127 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.jdk.version>17</project.jdk.version>
<project.jdk.version>22</project.jdk.version>

<!-- runtime dependencies -->
<api.version>1.3.1</api.version>
<api.version>1.4.0-beta2</api.version>
<slf4j.version>2.0.13</slf4j.version>
<jackson.version>2.17.1</jackson.version>

Expand All @@ -48,6 +48,11 @@
<!-- build plugin dependencies -->
<dependency-check.version>9.2.0</dependency-check.version>
<nexus-staging.version>1.7.0</nexus-staging.version>
<jextract-maven.version>0.4.1</jextract-maven.version>

<!-- jextract props -->
<win.umHeaderPath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um</win.umHeaderPath>
<jextract.executable>C:\Users\Arbeit\Programs\jextract-22\bin\jextract.bat</jextract.executable>
</properties>

<licenses>
Expand Down Expand Up @@ -391,5 +396,125 @@
</plugins>
</build>
</profile>

<profile>
<id>jextract</id>
<build>
<plugins>
<plugin>
<groupId>io.github.coffeelibs</groupId>
<artifactId>jextract-maven-plugin</artifactId>
<version>${jextract-maven.version}</version>
<configuration>
<executable>${jextract.executable}</executable>
<headerSearchPaths>${win.umHeaderPath}</headerSearchPaths>
<outputDirectory>${project.build.sourceDirectory}</outputDirectory>
<cPreprocessorMacros>
<cPreprocessorMacro>_AMD64_</cPreprocessorMacro>
<cPreprocessorMacro>UNICODE</cPreprocessorMacro>
<cPreprocessorMacro>_WIN32_WINNT=0x0A00</cPreprocessorMacro>
</cPreprocessorMacros>
</configuration>
<executions>
<execution>
<id>jextract-winreg</id>
<goals>
<goal>sources</goal>
</goals>
<configuration>
<targetPackage>org.cryptomator.windows.capi.winreg</targetPackage>
<headerFile>${win.umHeaderPath}/winreg.h</headerFile>
<headerClassName>Winreg_h</headerClassName>
<libraries>
<library>Advapi32</library>
</libraries>
<includeFunctions>
<includeFunction>RegCreateKeyTransactedW</includeFunction>
<includeFunction>RegOpenKeyTransactedW</includeFunction>
<includeFunction>RegDeleteKeyTransactedW</includeFunction>
<includeFunction>RegCloseKey</includeFunction>
<includeFunction>RegGetValueW</includeFunction>
<includeFunction>RegSetKeyValueW</includeFunction>
<includeFunction>RegDeleteKeyValueW</includeFunction>
<includeFunction>RegDeleteTreeW</includeFunction>
</includeFunctions>
<includeConstants>
<includeConstant>HKEY_CLASSES_ROOT</includeConstant>
<includeConstant>HKEY_LOCAL_MACHINE</includeConstant>
<includeConstant>HKEY_USERS</includeConstant>
<includeConstant>HKEY_CURRENT_USER</includeConstant>
<includeConstant>REG_OPTION_VOLATILE</includeConstant>
<includeConstant>REG_OPTION_NON_VOLATILE</includeConstant>
<includeConstant>KEY_READ</includeConstant>
<includeConstant>KEY_WRITE</includeConstant>
<includeConstant>REG_BINARY</includeConstant>
<includeConstant>REG_DWORD</includeConstant>
<includeConstant>REG_QWORD</includeConstant>
<includeConstant>REG_SZ</includeConstant>
<includeConstant>REG_EXPAND_SZ</includeConstant>
<includeConstant>REG_MULTI_SZ</includeConstant>
<includeConstant>RRF_RT_ANY</includeConstant>
<includeConstant>RRF_RT_REG_BINARY</includeConstant>
<includeConstant>RRF_RT_REG_DWORD</includeConstant>
<includeConstant>RRF_RT_REG_QWORD</includeConstant>
<includeConstant>RRF_RT_REG_SZ</includeConstant>
<includeConstant>RRF_RT_REG_EXPAND_SZ</includeConstant>
<includeConstant>RRF_RT_REG_MULTI_SZ</includeConstant>
<includeConstant>RRF_NOEXPAND</includeConstant>
</includeConstants>
</configuration>
</execution>
<execution>
<id>jextract-ktmw32</id>
<goals>
<goal>sources</goal>
</goals>
<configuration>
<targetPackage>org.cryptomator.windows.capi.ktmw32</targetPackage>
<headerFile>${project.basedir}/src/main/resources/ktmw32_helper.h</headerFile>
<headerClassName>Ktmw32_h</headerClassName>
<libraries>
<library>KtmW32</library>
</libraries>
<includeFunctions>
<includeFunction>CreateTransaction</includeFunction>
<includeFunction>CommitTransaction</includeFunction>
<includeFunction>RollbackTransaction</includeFunction>
</includeFunctions>
<includeConstants>
<includeConstant>INVALID_HANDLE_VALUE</includeConstant>
</includeConstants>
</configuration>
</execution>
<execution>
<id>jextract-common</id>
<goals>
<goal>sources</goal>
</goals>
<configuration>
<targetPackage>org.cryptomator.windows.capi.common</targetPackage>
<headerFile>${win.umHeaderPath}/Windows.h</headerFile>
<headerClassName>Windows_h</headerClassName>
<libraries>
<library>Kernel32</library>
</libraries>
<includeFunctions>
<includeFunction>GetLastError</includeFunction>
<includeFunction>CloseHandle</includeFunction>
</includeFunctions>
<includeConstants>
<includeConstant>ERROR_SUCCESS</includeConstant>
<includeConstant>INVALID_HANDLE_VALUE</includeConstant>
<includeConstant>ERROR_SUCCESS</includeConstant>
<includeConstant>ERROR_FILE_NOT_FOUND</includeConstant>
<includeConstant>ERROR_MORE_DATA</includeConstant>
</includeConstants>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import org.cryptomator.integrations.autostart.AutoStartProvider;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
import org.cryptomator.integrations.quickaccess.QuickAccessService;
import org.cryptomator.integrations.revealpath.RevealPathService;
import org.cryptomator.integrations.uiappearance.UiAppearanceProvider;
import org.cryptomator.windows.autostart.WindowsAutoStart;
import org.cryptomator.windows.keychain.WindowsProtectedKeychainAccess;
import org.cryptomator.windows.quickaccess.ExplorerQuickAccessService;
import org.cryptomator.windows.revealpath.ExplorerRevealPathService;
import org.cryptomator.windows.uiappearance.WinUiAppearanceProvider;

Expand All @@ -19,4 +21,5 @@
provides KeychainAccessProvider with WindowsProtectedKeychainAccess;
provides UiAppearanceProvider with WinUiAppearanceProvider;
provides RevealPathService with ExplorerRevealPathService;
provides QuickAccessService with ExplorerQuickAccessService;
}
Loading