From fd3b9028b4521028a9dea5ba4331e86626fc9624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=BE=8A?= Date: Fri, 22 Oct 2021 10:41:30 +0700 Subject: [PATCH] Fix Cant Build --- bin/main.dart | 5 ++++- lib/config.dart | 2 +- lib/upload.dart | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/main.dart b/bin/main.dart index 14782b7..4a6c4e3 100644 --- a/bin/main.dart +++ b/bin/main.dart @@ -4,12 +4,15 @@ import 'package:filesize/filesize.dart'; import 'package:uup_cli/ansi_pens.dart'; import 'package:uup_cli/download.dart'; import 'package:uup_cli/upload.dart'; - +import 'dart:math'; +import 'dart:convert'; void main(List args) async { if (args.length != 2) { exitWithHelp(); } + + Codec stringToBase64 = utf8.fuse(base64); final command = args.first; diff --git a/lib/config.dart b/lib/config.dart index cbc7da2..dd2dfde 100644 --- a/lib/config.dart +++ b/lib/config.dart @@ -1,3 +1,3 @@ class API { - static String KEY = ''; + static String KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDhiQjYzRDcyQUEzNWU3N2VEMjljOWYzMzMyODlkNUU3NTMxZDQxYzIiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyOTE3MDg0NTE1MCwibmFtZSI6InNub3dmYWcifQ.R-unOCPztttV3ZqxM8zbpqR3LtaBVkJ_CNirlCZQTm8'; } diff --git a/lib/upload.dart b/lib/upload.dart index 008d2ee..12b6fbb 100644 --- a/lib/upload.dart +++ b/lib/upload.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:io'; import 'dart:convert'; +import 'dart:math'; import 'package:cryptography/cryptography.dart'; import 'package:http/http.dart' as http; @@ -11,10 +12,13 @@ import 'package:uup_cli/ansi_pens.dart'; import 'package:uup_cli/encrypt_block_stream.dart'; import 'package:uup_cli/const.dart'; + void startEncryptAndUpload( File file, ) async { + Codec stringToBase64 = utf8.fuse(base64); + // Choose the cipher final cipher = CipherWithAppendedMac(aesCtr, Hmac(sha256));