From b74df09a1d528a2d441a33d6faed58e57992e730 Mon Sep 17 00:00:00 2001 From: Gabrielfsouza2002 Date: Tue, 24 Jun 2025 21:36:45 -0300 Subject: [PATCH 1/6] feat: show warning icon for apps with dangerous filesystem permissions (fixes #163) - Detect dangerous filesystem permissions (`host` or `home`) in app list - Pass this info to FlatsealApplicationRow - Display warning icon and tooltip for affected apps - Improves user awareness of security risks --- .idea/.gitignore | 10 ++++++++++ .idea/Flatseal.iml | 9 +++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ data/gschemas.compiled | Bin 0 -> 516 bytes src/widgets/applicationRow.js | 15 +++++++++++++-- src/widgets/window.js | 9 ++++++++- src/widgets/window.ui | 2 +- 9 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/Flatseal.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 data/gschemas.compiled diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..7bc07ec2 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Environment-dependent path to Maven home directory +/mavenHomeManager.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/Flatseal.iml b/.idea/Flatseal.iml new file mode 100644 index 00000000..d6ebd480 --- /dev/null +++ b/.idea/Flatseal.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..37813b7d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..47c25f7f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/data/gschemas.compiled b/data/gschemas.compiled new file mode 100644 index 0000000000000000000000000000000000000000..48ac9926e67966c369e3822f7e1971e0d611c906 GIT binary patch literal 516 zcmYLGJud}86dk;!Kqzb?3Q_JByIYV@s!%92L}}jcy@rJ+)m&GEPxjC^R*su!2 zvW56Td^0IFg+Nma2=mnM=rTTN`(+sSR+jv=M3zR$gmuCh`=kF4+c~cVSisB8*)la} zOo>CW1>Oekk59%qkJ^I22R;QJp3FS!sVCu|gD-%OX#b8r^#uGY@HH^FH#P4~egtm& z_9yG9r&0e3eh2Kg=RSSv8TemdzS*cmg{6u-Srnd*P~jNYFJu`*A_6QTs235`iwFjb z2+&>WEXpe{R=N|{|6l}7j&_?wrK9E~4u{V(M*;4Ndt!N0o64R}^^xKw5Kh}QG0v7r S;uWf!YGZVsnL1hL8~qFQEo#C5 literal 0 HcmV?d00001 diff --git a/src/widgets/applicationRow.js b/src/widgets/applicationRow.js index 84f0e639..3399f2cc 100644 --- a/src/widgets/applicationRow.js +++ b/src/widgets/applicationRow.js @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -const {GLib, GObject, Adw} = imports.gi; +const {GLib, GObject, Adw, Gtk} = imports.gi; var FlatsealApplicationRow = GObject.registerClass({ @@ -26,11 +26,22 @@ var FlatsealApplicationRow = GObject.registerClass({ Template: 'resource:///com/github/tchx84/Flatseal/widgets/applicationRow.ui', InternalChildren: ['icon'], }, class FlatsealApplicationRow extends Adw.ActionRow { - _init(appId, appName, appIconName) { + _init(appId, appName, appIconName, asDangerousFs = false) { super._init(); this._icon.set_from_icon_name(appIconName); this.set_title(GLib.markup_escape_text(appName, -1)); this.set_subtitle(appId); + + if (asDangerousFs) { + // Cria um ícone de alerta + const warningIcon = new Gtk.Image({ + icon_name: 'dialog-warning-symbolic', + pixel_size: 16, + tooltip_text: 'Este app tem acesso total ao sistema de arquivos (filesystem=host ou home). Isso pode ser um risco de segurança.' + }); + this.add_suffix(warningIcon); + } + } get appId() { diff --git a/src/widgets/window.js b/src/widgets/window.js index c4787a8c..cf294633 100644 --- a/src/widgets/window.js +++ b/src/widgets/window.js @@ -160,7 +160,14 @@ var FlatsealWindow = GObject.registerClass({ allApplications.forEach(app => { iconTheme.add_search_path(app.appThemePath); - const row = new FlatsealApplicationRow(app.appId, app.appName, app.appIconName); + + // Aqui você deve acessar as permissões do app + const allPermissions = this._permissions.getAll(); + const appPermissions = allPermissions.find(p => p.appId === app.appId); + const fsPerms = appPermissions ? appPermissions.value : []; + const hasDangerousFs = fsPerms.includes('host') || fsPerms.includes('home'); + + const row = new FlatsealApplicationRow(app.appId, app.appName, app.appIconName, hasDangerousFs); this._applicationsListBox.append(row); if (app.appId === this._settings.getSelectedAppId()) diff --git a/src/widgets/window.ui b/src/widgets/window.ui index 750d71ec..41d1f366 100644 --- a/src/widgets/window.ui +++ b/src/widgets/window.ui @@ -111,7 +111,7 @@ center - + z From 63b6a1dde7714e6f7bf61dc97554f7c4e7582665 Mon Sep 17 00:00:00 2001 From: Gabrielfsouza2002 Date: Tue, 24 Jun 2025 21:47:20 -0300 Subject: [PATCH 2/6] add .idea in gitgnore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 06fdec18..4f2134cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .flatpak-builder/ build-dir/ +.idea \ No newline at end of file From 17135d155c8514e0c043f673c214910109dc840b Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira de Souza Araujo <83650469+gabrielfsouza2002@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:28:22 -0300 Subject: [PATCH 3/6] Update applicationRow.js --- src/widgets/applicationRow.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/applicationRow.js b/src/widgets/applicationRow.js index 3399f2cc..ce142d50 100644 --- a/src/widgets/applicationRow.js +++ b/src/widgets/applicationRow.js @@ -33,11 +33,10 @@ var FlatsealApplicationRow = GObject.registerClass({ this.set_subtitle(appId); if (asDangerousFs) { - // Cria um ícone de alerta const warningIcon = new Gtk.Image({ icon_name: 'dialog-warning-symbolic', pixel_size: 16, - tooltip_text: 'Este app tem acesso total ao sistema de arquivos (filesystem=host ou home). Isso pode ser um risco de segurança.' + tooltip_text: 'This app has full access to the file system (filesystem=host or home). This may be a security risk..' }); this.add_suffix(warningIcon); } From 439a710f4c79d493dbd128594a366d7625abb232 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira de Souza Araujo <83650469+gabrielfsouza2002@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:29:23 -0300 Subject: [PATCH 4/6] Update window.js --- src/widgets/window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/window.js b/src/widgets/window.js index cf294633..a33b7e2d 100644 --- a/src/widgets/window.js +++ b/src/widgets/window.js @@ -161,7 +161,7 @@ var FlatsealWindow = GObject.registerClass({ allApplications.forEach(app => { iconTheme.add_search_path(app.appThemePath); - // Aqui você deve acessar as permissões do app + const allPermissions = this._permissions.getAll(); const appPermissions = allPermissions.find(p => p.appId === app.appId); const fsPerms = appPermissions ? appPermissions.value : []; From bce292461eb637785a08ddbc470b24508b0475c0 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira de Souza Araujo <83650469+gabrielfsouza2002@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:32:29 -0300 Subject: [PATCH 5/6] Update typo --- src/widgets/window.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/window.ui b/src/widgets/window.ui index 41d1f366..4b49baa2 100644 --- a/src/widgets/window.ui +++ b/src/widgets/window.ui @@ -111,7 +111,7 @@ center - z + @@ -134,7 +134,7 @@ withPermissionsPage - + // Aq// Aqui você deve acessar as permissões do appui você deve acessar as permissões do app From 3c3fe9a37aef521c8b8c986257929f9b7b45b655 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira de Souza Araujo <83650469+gabrielfsouza2002@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:34:09 -0300 Subject: [PATCH 6/6] remove coments