Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan de Reuver <[email protected]>
  • Loading branch information
JSCU-CNI and Horofic authored Sep 19, 2024
1 parent 95a0d05 commit d509f5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions dissect/target/plugins/os/unix/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ class UnixApplicationsPlugin(Plugin):
".local/share/applications/",
]

SYSTEM_APPS = [
"org.gnome.",
]
SYSTEM_APPS = ("org.gnome.",)

def __init__(self, target: Target):
super().__init__(target)
Expand Down Expand Up @@ -64,6 +62,6 @@ def applications(self) -> Iterator[UnixApplicationRecord]:
name=config.get("Name"),
version=config.get("Version"),
path=config.get("Exec"),
type="system" if config.get("Icon", "")[0:10] in self.SYSTEM_APPS else "user",
type="system" if config.get("Icon", "").startswith(self.SYSTEM_APPS) else "user",
_target=self.target,
)
4 changes: 1 addition & 3 deletions dissect/target/plugins/os/windows/regf/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
class WindowsApplicationsPlugin(Plugin):
"""Windows Applications plugin."""

KEY = "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"

def __init__(self, target: Target):
super().__init__(target)
self.keys = list(self.target.registry.keys(self.KEY))
self.keys = list(self.target.registry.keys("HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"))

def check_compatible(self) -> None:
if not self.target.has_function("registry"):
Expand Down
2 changes: 2 additions & 0 deletions tests/plugins/os/unix/linux/debian/test_snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def test_snap_packages(target_unix_users: Target, fs_unix: VirtualFilesystem) ->
target_unix_users.add_plugin(UnixPlugin)
target_unix_users.add_plugin(SnapPlugin)

assert target_unix_users.has_function("snap")

results = list(target_unix_users.snaps())
assert len(results) == 2

Expand Down

0 comments on commit d509f5c

Please sign in to comment.