diff --git a/PKGBUILD b/PKGBUILD index 3ead2d7..75faa3c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ pkgrel=1 pkgdesc="Flutter GUI for installing crystal" arch=('any') url="https://git.tar.black/crystal/programs/jade_gui" -depends=('gtk3' 'jade') +depends=('gtk3' 'jade' 'openssl') makedepends=('clang' 'ninja' 'cmake' 'git' 'unzip' 'flutter' 'flutter-group-pacman-hook') source=("gui::git+${url}.git") diff --git a/lib/functions/users.dart b/lib/functions/users.dart index d9682af..7b56e50 100644 --- a/lib/functions/users.dart +++ b/lib/functions/users.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'dart:io'; final _formKey = GlobalKey(); RegExp userRegex = RegExp(r'^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$'); @@ -7,7 +8,7 @@ Widget users( enableSudo, setPass, setConfirmPass, - password, + clearPass, confirmPassword, setUsername, username, @@ -151,7 +152,7 @@ Widget users( setConfirmPass(value); }, validator: (String? value) { - return (value != password) + return (value != clearPass) ? 'Password does not match' : null; }, diff --git a/lib/main.dart b/lib/main.dart index b81a775..9f58084 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,6 +27,8 @@ Future checkIsEfi(setState) async { setState(isEfi); } +void writeToLog() {} + void main() => runApp( const MaterialApp( debugShowCheckedModeBanner: false, @@ -34,6 +36,16 @@ void main() => runApp( ), ); +Future setPassword(clearPass, setState) async { + final String password = + await Process.run("openssl", ["passwd", "-1", clearPass]) + .then((ProcessResult result) { + return result.stdout; + }); + debugPrint(password); + setState(password); +} + class Jadegui extends StatefulWidget { const Jadegui({Key? key}) : super(key: key); @@ -51,6 +63,7 @@ class _JadeguiState extends State { bool ipv6 = false; bool enableTimeshift = true; bool running = false; + String clearPass = ""; String password = ""; String confirmPassword = ""; String username = ""; @@ -315,7 +328,12 @@ class _JadeguiState extends State { (String? value) { setState(() { if (value != null) { - password = value; + setPassword(value, (String encPass) { + setState(() { + password = encPass; + clearPass = value; + }); + }); } }); }, @@ -324,7 +342,7 @@ class _JadeguiState extends State { confirmPassword = value; }); }, - password, + clearPass, confirmPassword, (value) { setState(() { @@ -360,6 +378,7 @@ class _JadeguiState extends State { ); break; case 4: + debugPrint(password); widget = desktopView( currDesktop, (selectedDesktop) { diff --git a/test.py b/test.py new file mode 100644 index 0000000..4e768b5 --- /dev/null +++ b/test.py @@ -0,0 +1 @@ +# \ No newline at end of file diff --git a/test.rs b/test.rs new file mode 100644 index 0000000..993103f --- /dev/null +++ b/test.rs @@ -0,0 +1,8 @@ +fn main() { + // generate task scheduler + let mut sched = TaskScheduler::new(); + // create a task + let task = sched.create_task(|| { + println!("Hello, world!"); + }); +} \ No newline at end of file