@@ -12,6 +12,7 @@ static Optional<KeePassXCType> determineType() {
12
12
var processHandle = ProcessHandle .allProcesses ()
13
13
.filter (ph -> ph .info ().command ().isPresent () && ph .info ().command ().get ().contains ("KeePassXC" ))
14
14
.findFirst ();
15
+
15
16
if (processHandle .isPresent () && processHandle .get ().info ().command ().get ().contains ("AppImage" )) {
16
17
LOG .debug ("Found running KeePassXC AppImage" );
17
18
return Optional .of (KeePassXCType .AppImage );
@@ -20,24 +21,22 @@ static Optional<KeePassXCType> determineType() {
20
21
processHandle = ProcessHandle .allProcesses ()
21
22
.filter (ph -> ph .info ().commandLine ().isPresent () && ph .info ().commandLine ().get ().contains ("keepassxc" ))
22
23
.findFirst ();
23
- if (processHandle .isPresent ()) {
24
- LOG .debug ("Found running KeePassXC installed from repository" );
25
- return Optional .of (KeePassXCType .Repo );
26
- }
27
24
28
- processHandle = ProcessHandle .allProcesses ()
29
- .filter (ph -> ph .info ().command ().isPresent () && ph .info ().command ().get ().contains ("keepassxc" ))
30
- .findFirst ();
31
- if (processHandle .isPresent () && processHandle .get ().info ().command ().get ().contains ("app" )) {
25
+ if (processHandle .isPresent () && processHandle .get ().info ().commandLine ().get ().contains ("bwrap" )) {
32
26
LOG .debug ("Found running KeePassXC installed via Flatpak" );
33
27
return Optional .of (KeePassXCType .Flatpak );
34
28
}
35
29
36
- if (processHandle .isPresent () && processHandle .get ().info ().command ().get ().contains ("snap" )) {
30
+ if (processHandle .isPresent () && processHandle .get ().info ().commandLine ().get ().contains ("snap" )) {
37
31
LOG .debug ("Found running KeePassXC installed via Snap" );
38
32
return Optional .of (KeePassXCType .Snap );
39
33
}
40
34
35
+ if (processHandle .isPresent () && processHandle .get ().info ().commandLine ().get ().contains ("bin" )) {
36
+ LOG .debug ("Found running KeePassXC installed from repository" );
37
+ return Optional .of (KeePassXCType .Repo );
38
+ }
39
+
41
40
LOG .debug ("Could not find running KeePassXC application" );
42
41
return Optional .empty ();
43
42
}
0 commit comments