use hashed password in json

pull/2/head
axtlos 3 years ago
parent ad6669ac35
commit 1fbab90868
No known key found for this signature in database
GPG Key ID: A468AFD71DD51D4A

@ -5,7 +5,7 @@ pkgrel=1
pkgdesc="Flutter GUI for installing crystal" pkgdesc="Flutter GUI for installing crystal"
arch=('any') arch=('any')
url="https://git.tar.black/crystal/programs/jade_gui" 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') makedepends=('clang' 'ninja' 'cmake' 'git' 'unzip' 'flutter' 'flutter-group-pacman-hook')
source=("gui::git+${url}.git") source=("gui::git+${url}.git")

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:io';
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
RegExp userRegex = RegExp(r'^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$'); RegExp userRegex = RegExp(r'^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$');
@ -7,7 +8,7 @@ Widget users(
enableSudo, enableSudo,
setPass, setPass,
setConfirmPass, setConfirmPass,
password, clearPass,
confirmPassword, confirmPassword,
setUsername, setUsername,
username, username,
@ -151,7 +152,7 @@ Widget users(
setConfirmPass(value); setConfirmPass(value);
}, },
validator: (String? value) { validator: (String? value) {
return (value != password) return (value != clearPass)
? 'Password does not match' ? 'Password does not match'
: null; : null;
}, },

@ -27,6 +27,8 @@ Future<void> checkIsEfi(setState) async {
setState(isEfi); setState(isEfi);
} }
void writeToLog() {}
void main() => runApp( void main() => runApp(
const MaterialApp( const MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
@ -34,6 +36,16 @@ void main() => runApp(
), ),
); );
Future<void> 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 { class Jadegui extends StatefulWidget {
const Jadegui({Key? key}) : super(key: key); const Jadegui({Key? key}) : super(key: key);
@ -51,6 +63,7 @@ class _JadeguiState extends State<Jadegui> {
bool ipv6 = false; bool ipv6 = false;
bool enableTimeshift = true; bool enableTimeshift = true;
bool running = false; bool running = false;
String clearPass = "";
String password = ""; String password = "";
String confirmPassword = ""; String confirmPassword = "";
String username = ""; String username = "";
@ -315,7 +328,12 @@ class _JadeguiState extends State<Jadegui> {
(String? value) { (String? value) {
setState(() { setState(() {
if (value != null) { if (value != null) {
password = value; setPassword(value, (String encPass) {
setState(() {
password = encPass;
clearPass = value;
});
});
} }
}); });
}, },
@ -324,7 +342,7 @@ class _JadeguiState extends State<Jadegui> {
confirmPassword = value; confirmPassword = value;
}); });
}, },
password, clearPass,
confirmPassword, confirmPassword,
(value) { (value) {
setState(() { setState(() {
@ -360,6 +378,7 @@ class _JadeguiState extends State<Jadegui> {
); );
break; break;
case 4: case 4:
debugPrint(password);
widget = desktopView( widget = desktopView(
currDesktop, currDesktop,
(selectedDesktop) { (selectedDesktop) {

@ -0,0 +1 @@
#

@ -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!");
});
}
Loading…
Cancel
Save