From 42cbedbdaf1737a54fe63e8268e60fcbbd877df7 Mon Sep 17 00:00:00 2001 From: Vitaliy Zarubin Date: Sat, 26 Oct 2024 13:36:29 +0300 Subject: [PATCH] [feature] Increasing the level of security. --- README.md | 2 +- data/ui/dialogs/AboutDialog.ui | 2 +- docs/install.md | 2 +- meson.build | 2 +- po/ru.po | 2 +- scripts/deb.sh | 6 +++--- src/base/connectors/ShellExec.js | 14 +++++++++++++- src/base/constants/AppConstants.js | 2 +- 8 files changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 05f0e44..c5290c6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Subscribe and like! -[![Version](https://img.shields.io/badge/deb_package-0.0.4-blue)](https://github.com/keygenqt/aurora-toolbox/releases) +[![Version](https://img.shields.io/badge/deb_package-0.0.5-blue)](https://github.com/keygenqt/aurora-toolbox/releases) ![Preview](https://raw.githubusercontent.com/keygenqt/aurora-toolbox/refs/heads/main/files/images/preview.png) diff --git a/data/ui/dialogs/AboutDialog.ui b/data/ui/dialogs/AboutDialog.ui index 7bc348a..9b0be62 100644 --- a/data/ui/dialogs/AboutDialog.ui +++ b/data/ui/dialogs/AboutDialog.ui @@ -4,7 +4,7 @@ floating com.keygenqt.aurora-toolbox Aurora Toolbox - 0.0.4 + 0.0.5 © 2024 KeyGenQt https://github.com/keygenqt/aurora-toolbox/issues Vitaliy Zarubin diff --git a/docs/install.md b/docs/install.md index 431aabf..0411ce4 100644 --- a/docs/install.md +++ b/docs/install.md @@ -13,7 +13,7 @@ hide: #### Install ```shell -sudo dpkg -i aurora-toolbox_0.0.4-1_amd64.deb +sudo dpkg -i aurora-toolbox_0.0.5-1_amd64.deb ``` #### Install dependency diff --git a/meson.build b/meson.build index bfa25ee..5b313da 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # Define our project project( 'aurora-toolbox', - version: '0.0.4', + version: '0.0.5', license: ['Apache 2.0'], meson_version: '>= 0.59.0', default_options: ['cpp_std=c++17', 'cpp_rtti=false', 'cpp_eh=none', diff --git a/po/ru.po b/po/ru.po index 4aa52c8..52fa847 100644 --- a/po/ru.po +++ b/po/ru.po @@ -278,7 +278,7 @@ msgstr "Взаимодействие с Platform SDK." #: data/ui/pages/psdk/PsdkPage.ui:71 msgid "Re-sign the package" -msgstr "Пере-подпишите пакет" +msgstr "Переподписать пакет" #: data/ui/pages/psdk/PsdkPage.ui:84 msgid "Add Sudoers" diff --git a/scripts/deb.sh b/scripts/deb.sh index 94d8c46..748e585 100755 --- a/scripts/deb.sh +++ b/scripts/deb.sh @@ -4,7 +4,7 @@ ## Build and creae deb package ############################## -read -p "You change '// @todo debug' code? (y/n)? " choice +read -p "You change '@todo debug' code? (y/n)? " choice case "$choice" in y|Y ) echo "yes";; n|N ) exit 0;; @@ -78,5 +78,5 @@ rm -rf $DEB_FOLDER dpkg -x $FOLDER/$DEB_FOLDER.deb $FOLDER/$DEB_FOLDER # Install / Remove -# sudo dpkg -r com.keygenqt.aurora-toolbox -# sudo dpkg -i release/aurora-toolbox_0.0.4-1_amd64.deb +sudo dpkg -r com.keygenqt.aurora-toolbox +sudo dpkg -i release/aurora-toolbox_0.0.5-1_amd64.deb diff --git a/src/base/connectors/ShellExec.js b/src/base/connectors/ShellExec.js index 22f07ca..a3396c6 100644 --- a/src/base/connectors/ShellExec.js +++ b/src/base/connectors/ShellExec.js @@ -14,6 +14,7 @@ * limitations under the License. */ import Gio from 'gi://Gio'; +import GLib from 'gi://GLib'; import { Log } from '../utils/Log.js'; @@ -78,10 +79,21 @@ export const ShellExec = { * @returns Promise */ communicateAsync(query = []) { - Log.debug(query); return new Promise((resolve, _) => { try { const arg = Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE; + + if (query[query.length-1].includes('password')) { + // Get password + const password = query[query.length-1].split('?')[1].split('&').filter((e) => e.includes('password'))[0].split('=')[1]; + // Remove password from query + query[query.length-1] = query[query.length-1] + .replace(`&password=${password}`, '') + .replace(`?password=${password}`, '') + // Set env + GLib.setenv('cli_password', password, true); + } + const subProcess = Gio.Subprocess.new(query, arg); subProcess.communicate_utf8_async(null, null, (proc, res) => { let [success, stdout, stderr] = proc?.communicate_utf8_finish(res); diff --git a/src/base/constants/AppConstants.js b/src/base/constants/AppConstants.js index 0f1b920..497073b 100644 --- a/src/base/constants/AppConstants.js +++ b/src/base/constants/AppConstants.js @@ -34,7 +34,7 @@ export const AppConstants = Object.freeze({ `${GLib.getenv('HOME')}/.local/bin/aurora-cli`, // @todo debug // 'python3', - // '/home/keygenqt/Documents/Home/Projects/aurora-cli/builds/aurora-cli-3.0.7.pyz' + // '/home/keygenqt/Documents/Home/Projects/aurora-cli/builds/aurora-cli-3.0.9.pyz' ], Language: { 'ru': 'ru_RU.utf-8',