From f9d024e971a918394808378b064cba01e029f8df Mon Sep 17 00:00:00 2001 From: dijunkun Date: Tue, 12 Nov 2024 17:30:28 +0800 Subject: [PATCH] [feat] use AES to encrypt image names --- fonts/OPPOSans_Regular.h | 375 ++++++++++-------- src/localization/localization.h | 3 + .../connection_status_window.cpp | 13 + src/single_window/main_window.cpp | 9 +- src/single_window/render.cpp | 5 +- src/single_window/render.h | 1 + src/single_window/thumbnail.cpp | 155 +++++++- src/single_window/thumbnail.h | 13 +- xmake.lua | 3 +- 9 files changed, 379 insertions(+), 198 deletions(-) diff --git a/fonts/OPPOSans_Regular.h b/fonts/OPPOSans_Regular.h index 7792399..c0973a8 100644 --- a/fonts/OPPOSans_Regular.h +++ b/fonts/OPPOSans_Regular.h @@ -1,6 +1,6 @@ /* * @Author: DI JUNKUN - * @Date: 2024-07-18 + * @Date: 2024-11-12 * Copyright (c) 2024 by DI JUNKUN, All Rights Reserved. */ @@ -10,31 +10,31 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x80, 0x00, 0x03, 0x00, 0x50, 0x4f, 0x53, 0x2f, 0x32, 0xef, 0x60, 0x17, 0xf2, 0x00, 0x00, 0x01, 0x58, - 0x00, 0x00, 0x00, 0x60, 0x63, 0x6d, 0x61, 0x70, 0x3e, 0x68, 0xb6, 0xdc, - 0x00, 0x00, 0x04, 0x0c, 0x00, 0x00, 0x02, 0xe6, 0x67, 0x61, 0x73, 0x70, - 0x00, 0x18, 0x00, 0x27, 0x00, 0x00, 0x62, 0x6c, 0x00, 0x00, 0x00, 0x10, - 0x67, 0x6c, 0x79, 0x66, 0x72, 0xea, 0x72, 0x34, 0x00, 0x00, 0x09, 0x54, - 0x00, 0x00, 0x52, 0xd4, 0x68, 0x65, 0x61, 0x64, 0x27, 0x1e, 0xbe, 0xce, + 0x00, 0x00, 0x00, 0x60, 0x63, 0x6d, 0x61, 0x70, 0xea, 0xf4, 0x97, 0x01, + 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x02, 0xee, 0x67, 0x61, 0x73, 0x70, + 0x00, 0x18, 0x00, 0x27, 0x00, 0x00, 0x63, 0xdc, 0x00, 0x00, 0x00, 0x10, + 0x67, 0x6c, 0x79, 0x66, 0x34, 0xa6, 0xdf, 0x92, 0x00, 0x00, 0x09, 0x6c, + 0x00, 0x00, 0x54, 0x18, 0x68, 0x65, 0x61, 0x64, 0x27, 0x1e, 0xbe, 0xce, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x36, 0x68, 0x68, 0x65, 0x61, - 0x09, 0x9e, 0x02, 0x05, 0x00, 0x00, 0x01, 0x14, 0x00, 0x00, 0x00, 0x24, - 0x68, 0x6d, 0x74, 0x78, 0xc5, 0x49, 0x15, 0x49, 0x00, 0x00, 0x01, 0xb8, - 0x00, 0x00, 0x02, 0x54, 0x6c, 0x6f, 0x63, 0x61, 0x00, 0x14, 0x4f, 0x30, - 0x00, 0x00, 0x06, 0xfc, 0x00, 0x00, 0x02, 0x58, 0x6d, 0x61, 0x78, 0x70, - 0x02, 0x2a, 0x02, 0x37, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00, 0x00, 0x20, - 0x6e, 0x61, 0x6d, 0x65, 0x90, 0x1a, 0x92, 0xad, 0x00, 0x00, 0x5c, 0x28, - 0x00, 0x00, 0x02, 0x6f, 0x70, 0x6f, 0x73, 0x74, 0xdf, 0x22, 0x6f, 0xdb, - 0x00, 0x00, 0x5e, 0x98, 0x00, 0x00, 0x03, 0xd4, 0x70, 0x72, 0x65, 0x70, - 0x70, 0x02, 0x04, 0x12, 0x00, 0x00, 0x06, 0xf4, 0x00, 0x00, 0x00, 0x08, - 0x76, 0x68, 0x65, 0x61, 0x04, 0xf4, 0x01, 0x85, 0x00, 0x00, 0x62, 0x7c, + 0x09, 0x9e, 0x02, 0x07, 0x00, 0x00, 0x01, 0x14, 0x00, 0x00, 0x00, 0x24, + 0x68, 0x6d, 0x74, 0x78, 0xcc, 0xc5, 0x15, 0x8d, 0x00, 0x00, 0x01, 0xb8, + 0x00, 0x00, 0x02, 0x5c, 0x6c, 0x6f, 0x63, 0x61, 0x00, 0x14, 0xe8, 0x30, + 0x00, 0x00, 0x07, 0x0c, 0x00, 0x00, 0x02, 0x60, 0x6d, 0x61, 0x78, 0x70, + 0x02, 0x2c, 0x02, 0x37, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00, 0x00, 0x20, + 0x6e, 0x61, 0x6d, 0x65, 0x90, 0x1a, 0x92, 0xad, 0x00, 0x00, 0x5d, 0x84, + 0x00, 0x00, 0x02, 0x6f, 0x70, 0x6f, 0x73, 0x74, 0x5b, 0xea, 0xc4, 0x77, + 0x00, 0x00, 0x5f, 0xf4, 0x00, 0x00, 0x03, 0xe8, 0x70, 0x72, 0x65, 0x70, + 0x70, 0x02, 0x04, 0x12, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x08, + 0x76, 0x68, 0x65, 0x61, 0x04, 0xf4, 0x01, 0x85, 0x00, 0x00, 0x63, 0xec, 0x00, 0x00, 0x00, 0x24, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0a, 0x3d, - 0x34, 0x6e, 0x3e, 0xef, 0x5f, 0x0f, 0x3c, 0xf5, 0x00, 0x03, 0x03, 0xe8, + 0x41, 0xdf, 0x03, 0x8a, 0x5f, 0x0f, 0x3c, 0xf5, 0x00, 0x03, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdf, 0xc1, 0x3d, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x84, 0xae, 0xc7, 0xfe, 0x5e, 0xfe, 0xfa, 0x07, 0x43, 0x04, 0xae, 0x00, 0x00, 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0xfa, 0xff, 0x06, 0x00, 0x00, 0x03, 0xf7, 0xfe, 0x5e, 0xfe, 0x72, 0x07, 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x95, 0x01, 0x54, 0x00, 0x2a, 0x00, 0x58, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x97, 0x01, 0x54, 0x00, 0x2a, 0x00, 0x58, 0x00, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0x20, 0x00, 0x60, 0x00, 0x60, 0x01, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04, 0x03, 0xb0, 0x01, 0x90, 0x00, 0x05, 0x00, 0x08, 0x02, 0x8a, 0x02, 0x58, 0x00, 0x00, @@ -64,83 +64,84 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x01, 0xff, 0x00, 0x0b, 0x03, 0x1b, 0x00, 0x15, 0x01, 0xdd, 0xff, 0xf8, 0x02, 0x00, 0x00, 0x0b, 0x01, 0xd6, 0x00, 0x16, 0x03, 0xbe, 0x00, 0x1c, 0x03, 0xbe, 0x00, 0x68, 0x03, 0xbe, 0x00, 0x35, 0x03, 0xbe, 0x00, 0x15, - 0x03, 0xbe, 0x00, 0x12, 0x03, 0xbe, 0x00, 0x13, 0x03, 0xbe, 0x00, 0x1e, - 0x03, 0xbe, 0x00, 0x37, 0x03, 0xbe, 0x00, 0x2d, 0x03, 0xbe, 0x00, 0x20, - 0x03, 0xbe, 0x00, 0x26, 0x03, 0xbe, 0x00, 0x35, 0x03, 0xbe, 0x00, 0x3a, - 0x03, 0xbe, 0x00, 0x27, 0x03, 0xbe, 0x00, 0x24, 0x03, 0xbe, 0x00, 0x16, - 0x03, 0xbe, 0x00, 0x24, 0x03, 0xbe, 0x00, 0x11, 0x03, 0xbe, 0x00, 0x23, - 0x03, 0xbe, 0x00, 0x31, 0x03, 0xbe, 0x00, 0x3c, 0x03, 0xbe, 0x00, 0x37, - 0x03, 0xbe, 0x00, 0x29, 0x03, 0xbe, 0x00, 0x18, 0x03, 0xbe, 0x00, 0x68, - 0x03, 0xbe, 0x00, 0x14, 0x03, 0xbe, 0x00, 0x2e, 0x03, 0xbe, 0x00, 0x26, - 0x03, 0xbe, 0x00, 0x20, 0x03, 0xbe, 0x00, 0x26, 0x03, 0xbe, 0x00, 0x1b, - 0x03, 0xbe, 0x00, 0x2e, 0x03, 0xbe, 0x00, 0x30, 0x03, 0xbe, 0x00, 0x1c, - 0x03, 0xbe, 0x00, 0x29, 0x03, 0xbe, 0x00, 0x24, 0x03, 0xbe, 0x00, 0x19, - 0x03, 0xbe, 0x00, 0x15, 0x03, 0xbe, 0x00, 0x17, 0x03, 0xbe, 0x00, 0x14, - 0x03, 0xbe, 0x00, 0x25, 0x03, 0xbe, 0x00, 0x2e, 0x03, 0xbe, 0x00, 0x2b, - 0x03, 0xbe, 0x00, 0x27, 0x03, 0xbe, 0x00, 0x1d, 0x03, 0xbe, 0x00, 0x23, - 0x03, 0xbe, 0x00, 0x11, 0x03, 0xbe, 0x00, 0x16, 0x03, 0xbe, 0x00, 0x17, - 0x03, 0xbe, 0x00, 0x20, 0x03, 0xbe, 0x00, 0x3c, 0x03, 0xbe, 0x00, 0x1c, - 0x03, 0xbe, 0x00, 0x1e, 0x03, 0xbe, 0x00, 0x2c, 0x03, 0xbe, 0x00, 0x26, - 0x03, 0xbe, 0x00, 0x29, 0x03, 0xbe, 0x00, 0x35, 0x03, 0xbe, 0x00, 0x2d, - 0x03, 0xbe, 0x00, 0x0c, 0x03, 0xbe, 0x00, 0x1a, 0x03, 0xbe, 0x00, 0x30, - 0x03, 0xbe, 0x00, 0x30, 0x03, 0xbe, 0x00, 0x2d, 0x03, 0xbe, 0x00, 0x2c, - 0x03, 0xbe, 0x00, 0x2c, 0x03, 0xbe, 0x00, 0x2f, 0x03, 0xbe, 0x00, 0x1c, - 0x03, 0xbe, 0x00, 0x20, 0x03, 0xbe, 0x00, 0x21, 0x03, 0xbe, 0x00, 0x23, - 0x03, 0xbe, 0x00, 0x24, 0x03, 0xbe, 0x00, 0x1f, 0x03, 0xbe, 0x00, 0x25, - 0x03, 0xbe, 0x00, 0x30, 0x03, 0xbe, 0x00, 0x30, 0x03, 0xbe, 0x00, 0x5f, - 0x03, 0xbe, 0x00, 0x5a, 0x03, 0xbe, 0x00, 0x3c, 0x03, 0xbe, 0x00, 0x1b, - 0x03, 0xbe, 0x00, 0x21, 0x03, 0xbe, 0x00, 0x39, 0x02, 0x6f, 0x00, 0x1e, - 0x01, 0x8b, 0x00, 0x17, 0x02, 0x4d, 0x00, 0x21, 0x02, 0x3d, 0x00, 0x14, - 0x02, 0x62, 0x00, 0x1b, 0x02, 0x42, 0x00, 0x16, 0x02, 0x55, 0x00, 0x20, - 0x01, 0xff, 0x00, 0x09, 0x02, 0x60, 0x00, 0x21, 0x02, 0x56, 0x00, 0x15, - 0x00, 0xc4, 0x00, 0x20, 0x00, 0xe5, 0x00, 0x2f, 0x01, 0xb3, 0x00, 0x20, - 0x01, 0x63, 0x00, 0x28, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x0c, 0x00, 0x04, 0x02, 0xda, 0x00, 0x00, 0x00, 0xac, - 0x00, 0x80, 0x00, 0x06, 0x00, 0x2c, 0x00, 0x20, 0x00, 0x2a, 0x00, 0x2e, - 0x00, 0x3a, 0x00, 0x5a, 0x00, 0x7a, 0x4e, 0x2a, 0x4e, 0x2d, 0x4e, 0x8e, - 0x4e, 0xf6, 0x4f, 0x4e, 0x51, 0x65, 0x51, 0x6d, 0x51, 0x73, 0x52, 0x20, - 0x52, 0x30, 0x52, 0x36, 0x52, 0x6a, 0x52, 0xa1, 0x53, 0xd6, 0x54, 0x2f, - 0x56, 0x68, 0x57, 0x28, 0x59, 0x0d, 0x59, 0x27, 0x59, 0x31, 0x5b, 0x57, - 0x5b, 0xc6, 0x5b, 0xf9, 0x5d, 0xf2, 0x5e, 0xfa, 0x5f, 0x0f, 0x63, 0xa5, - 0x63, 0xa7, 0x65, 0x87, 0x65, 0xb0, 0x65, 0xe0, 0x67, 0x00, 0x67, 0x0d, - 0x67, 0x1f, 0x67, 0x2a, 0x67, 0x2c, 0x67, 0x3a, 0x67, 0x7f, 0x68, 0x3c, - 0x68, 0x4c, 0x6b, 0x64, 0x6d, 0x88, 0x72, 0x48, 0x75, 0x28, 0x78, 0x01, - 0x78, 0x6c, 0x78, 0x6e, 0x7a, 0x0b, 0x7a, 0xcb, 0x7a, 0xef, 0x7b, 0x26, - 0x7b, 0x49, 0x7e, 0xe7, 0x7f, 0x16, 0x7f, 0x6e, 0x82, 0xf1, 0x89, 0xc6, - 0x89, 0xe3, 0x8a, 0x00, 0x8b, 0xa4, 0x8b, 0xbe, 0x8b, 0xc1, 0x8b, 0xed, - 0x8b, 0xf7, 0x8d, 0x25, 0x8d, 0x28, 0x8d, 0x34, 0x8f, 0x93, 0x8f, 0xd1, - 0x8f, 0xdc, 0x8f, 0xde, 0x91, 0xcd, 0x91, 0xcf, 0x95, 0xed, 0x96, 0x64, - 0x97, 0x62, 0x98, 0x91, 0x9a, 0x8c, 0x9a, 0xd8, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x2a, 0x00, 0x2d, 0x00, 0x30, 0x00, 0x41, 0x00, 0x61, - 0x4e, 0x2a, 0x4e, 0x2d, 0x4e, 0x8e, 0x4e, 0xf6, 0x4f, 0x4d, 0x51, 0x65, - 0x51, 0x6d, 0x51, 0x73, 0x52, 0x20, 0x52, 0x30, 0x52, 0x36, 0x52, 0x6a, - 0x52, 0xa1, 0x53, 0xd6, 0x54, 0x2f, 0x56, 0x68, 0x57, 0x28, 0x59, 0x0d, - 0x59, 0x27, 0x59, 0x31, 0x5b, 0x57, 0x5b, 0xc6, 0x5b, 0xf9, 0x5d, 0xf2, - 0x5e, 0xfa, 0x5f, 0x0f, 0x63, 0xa5, 0x63, 0xa7, 0x65, 0x87, 0x65, 0xb0, - 0x65, 0xe0, 0x67, 0x00, 0x67, 0x0d, 0x67, 0x1f, 0x67, 0x2a, 0x67, 0x2c, - 0x67, 0x3a, 0x67, 0x7f, 0x68, 0x3c, 0x68, 0x4c, 0x6b, 0x63, 0x6d, 0x88, - 0x72, 0x48, 0x75, 0x28, 0x78, 0x01, 0x78, 0x6c, 0x78, 0x6e, 0x7a, 0x0b, - 0x7a, 0xcb, 0x7a, 0xef, 0x7b, 0x26, 0x7b, 0x49, 0x7e, 0xe7, 0x7f, 0x16, - 0x7f, 0x6e, 0x82, 0xf1, 0x89, 0xc6, 0x89, 0xe3, 0x8a, 0x00, 0x8b, 0xa4, + 0x03, 0xbe, 0x00, 0x12, 0x03, 0xbe, 0x00, 0x13, 0x03, 0xbe, 0x00, 0x11, + 0x03, 0xbe, 0x00, 0x1e, 0x03, 0xbe, 0x00, 0x37, 0x03, 0xbe, 0x00, 0x2d, + 0x03, 0xbe, 0x00, 0x20, 0x03, 0xbe, 0x00, 0x26, 0x03, 0xbe, 0x00, 0x35, + 0x03, 0xbe, 0x00, 0x3a, 0x03, 0xbe, 0x00, 0x27, 0x03, 0xbe, 0x00, 0x24, + 0x03, 0xbe, 0x00, 0x16, 0x03, 0xbe, 0x00, 0x24, 0x03, 0xbe, 0x00, 0x11, + 0x03, 0xbe, 0x00, 0x23, 0x03, 0xbe, 0x00, 0x31, 0x03, 0xbe, 0x00, 0x3c, + 0x03, 0xbe, 0x00, 0x37, 0x03, 0xbe, 0x00, 0x29, 0x03, 0xbe, 0x00, 0x18, + 0x03, 0xbe, 0x00, 0x68, 0x03, 0xbe, 0x00, 0x14, 0x03, 0xbe, 0x00, 0x2e, + 0x03, 0xbe, 0x00, 0x26, 0x03, 0xbe, 0x00, 0x20, 0x03, 0xbe, 0x00, 0x26, + 0x03, 0xbe, 0x00, 0x1b, 0x03, 0xbe, 0x00, 0x2e, 0x03, 0xbe, 0x00, 0x30, + 0x03, 0xbe, 0x00, 0x1c, 0x03, 0xbe, 0x00, 0x29, 0x03, 0xbe, 0x00, 0x24, + 0x03, 0xbe, 0x00, 0x19, 0x03, 0xbe, 0x00, 0x15, 0x03, 0xbe, 0x00, 0x17, + 0x03, 0xbe, 0x00, 0x14, 0x03, 0xbe, 0x00, 0x25, 0x03, 0xbe, 0x00, 0x2e, + 0x03, 0xbe, 0x00, 0x2b, 0x03, 0xbe, 0x00, 0x27, 0x03, 0xbe, 0x00, 0x1d, + 0x03, 0xbe, 0x00, 0x23, 0x03, 0xbe, 0x00, 0x11, 0x03, 0xbe, 0x00, 0x16, + 0x03, 0xbe, 0x00, 0x17, 0x03, 0xbe, 0x00, 0x20, 0x03, 0xbe, 0x00, 0x3c, + 0x03, 0xbe, 0x00, 0x1c, 0x03, 0xbe, 0x00, 0x1e, 0x03, 0xbe, 0x00, 0x2c, + 0x03, 0xbe, 0x00, 0x26, 0x03, 0xbe, 0x00, 0x29, 0x03, 0xbe, 0x00, 0x35, + 0x03, 0xbe, 0x00, 0x2d, 0x03, 0xbe, 0x00, 0x0c, 0x03, 0xbe, 0x00, 0x1a, + 0x03, 0xbe, 0x00, 0x30, 0x03, 0xbe, 0x00, 0x30, 0x03, 0xbe, 0x00, 0x33, + 0x03, 0xbe, 0x00, 0x2d, 0x03, 0xbe, 0x00, 0x2c, 0x03, 0xbe, 0x00, 0x2c, + 0x03, 0xbe, 0x00, 0x2f, 0x03, 0xbe, 0x00, 0x1c, 0x03, 0xbe, 0x00, 0x20, + 0x03, 0xbe, 0x00, 0x21, 0x03, 0xbe, 0x00, 0x23, 0x03, 0xbe, 0x00, 0x24, + 0x03, 0xbe, 0x00, 0x1f, 0x03, 0xbe, 0x00, 0x25, 0x03, 0xbe, 0x00, 0x30, + 0x03, 0xbe, 0x00, 0x30, 0x03, 0xbe, 0x00, 0x5f, 0x03, 0xbe, 0x00, 0x5a, + 0x03, 0xbe, 0x00, 0x3c, 0x03, 0xbe, 0x00, 0x1b, 0x03, 0xbe, 0x00, 0x21, + 0x03, 0xbe, 0x00, 0x39, 0x02, 0x6f, 0x00, 0x1e, 0x01, 0x8b, 0x00, 0x17, + 0x02, 0x4d, 0x00, 0x21, 0x02, 0x3d, 0x00, 0x14, 0x02, 0x62, 0x00, 0x1b, + 0x02, 0x42, 0x00, 0x16, 0x02, 0x55, 0x00, 0x20, 0x01, 0xff, 0x00, 0x09, + 0x02, 0x60, 0x00, 0x21, 0x02, 0x56, 0x00, 0x15, 0x00, 0xc4, 0x00, 0x20, + 0x00, 0xe5, 0x00, 0x2f, 0x01, 0xb3, 0x00, 0x20, 0x01, 0x63, 0x00, 0x28, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, + 0x00, 0x04, 0x02, 0xe2, 0x00, 0x00, 0x00, 0xae, 0x00, 0x80, 0x00, 0x06, + 0x00, 0x2e, 0x00, 0x20, 0x00, 0x2a, 0x00, 0x2e, 0x00, 0x3a, 0x00, 0x5a, + 0x00, 0x7a, 0x4e, 0x2a, 0x4e, 0x2d, 0x4e, 0x8e, 0x4e, 0xf6, 0x4f, 0x4f, + 0x51, 0x65, 0x51, 0x6d, 0x51, 0x73, 0x52, 0x20, 0x52, 0x30, 0x52, 0x36, + 0x52, 0x6a, 0x52, 0xa1, 0x53, 0xd6, 0x54, 0x2f, 0x56, 0x68, 0x57, 0x28, + 0x59, 0x0d, 0x59, 0x27, 0x59, 0x31, 0x5b, 0x57, 0x5b, 0xc6, 0x5b, 0xf9, + 0x5d, 0xf2, 0x5e, 0xfa, 0x5f, 0x0f, 0x63, 0xa5, 0x63, 0xa7, 0x65, 0x87, + 0x65, 0xb0, 0x65, 0xe0, 0x67, 0x00, 0x67, 0x0d, 0x67, 0x1f, 0x67, 0x2a, + 0x67, 0x2c, 0x67, 0x3a, 0x67, 0x7f, 0x68, 0x3c, 0x68, 0x4c, 0x6b, 0x64, + 0x6d, 0x88, 0x72, 0x48, 0x75, 0x28, 0x78, 0x01, 0x78, 0x6c, 0x78, 0x6e, + 0x7a, 0x0b, 0x7a, 0xcb, 0x7a, 0xef, 0x7b, 0x26, 0x7b, 0x49, 0x7e, 0xe7, + 0x7f, 0x16, 0x7f, 0x6e, 0x82, 0xf1, 0x89, 0xc6, 0x89, 0xe3, 0x8a, 0x00, + 0x8b, 0xa4, 0x8b, 0xb0, 0x8b, 0xbe, 0x8b, 0xc1, 0x8b, 0xed, 0x8b, 0xf7, + 0x8d, 0x25, 0x8d, 0x28, 0x8d, 0x34, 0x8f, 0x93, 0x8f, 0xd1, 0x8f, 0xdc, + 0x8f, 0xde, 0x91, 0xcd, 0x91, 0xcf, 0x95, 0xed, 0x96, 0x64, 0x97, 0x62, + 0x98, 0x91, 0x9a, 0x8c, 0x9a, 0xd8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x2a, 0x00, 0x2d, 0x00, 0x30, 0x00, 0x41, 0x00, 0x61, 0x4e, 0x2a, + 0x4e, 0x2d, 0x4e, 0x8e, 0x4e, 0xf6, 0x4f, 0x4d, 0x51, 0x65, 0x51, 0x6d, + 0x51, 0x73, 0x52, 0x20, 0x52, 0x30, 0x52, 0x36, 0x52, 0x6a, 0x52, 0xa1, + 0x53, 0xd6, 0x54, 0x2f, 0x56, 0x68, 0x57, 0x28, 0x59, 0x0d, 0x59, 0x27, + 0x59, 0x31, 0x5b, 0x57, 0x5b, 0xc6, 0x5b, 0xf9, 0x5d, 0xf2, 0x5e, 0xfa, + 0x5f, 0x0f, 0x63, 0xa5, 0x63, 0xa7, 0x65, 0x87, 0x65, 0xb0, 0x65, 0xe0, + 0x67, 0x00, 0x67, 0x0d, 0x67, 0x1f, 0x67, 0x2a, 0x67, 0x2c, 0x67, 0x3a, + 0x67, 0x7f, 0x68, 0x3c, 0x68, 0x4c, 0x6b, 0x63, 0x6d, 0x88, 0x72, 0x48, + 0x75, 0x28, 0x78, 0x01, 0x78, 0x6c, 0x78, 0x6e, 0x7a, 0x0b, 0x7a, 0xcb, + 0x7a, 0xef, 0x7b, 0x26, 0x7b, 0x49, 0x7e, 0xe7, 0x7f, 0x16, 0x7f, 0x6e, + 0x82, 0xf1, 0x89, 0xc6, 0x89, 0xe3, 0x8a, 0x00, 0x8b, 0xa4, 0x8b, 0xb0, 0x8b, 0xbe, 0x8b, 0xc1, 0x8b, 0xed, 0x8b, 0xf7, 0x8d, 0x25, 0x8d, 0x28, 0x8d, 0x34, 0x8f, 0x93, 0x8f, 0xd1, 0x8f, 0xdc, 0x8f, 0xde, 0x91, 0xcd, 0x91, 0xcf, 0x95, 0xed, 0x96, 0x64, 0x97, 0x62, 0x98, 0x91, 0x9a, 0x8c, - 0x9a, 0xd8, 0xff, 0xff, 0xff, 0xe1, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00, + 0x9a, 0xd8, 0xff, 0xff, 0xff, 0xe1, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc1, 0xff, 0xbb, 0xb2, 0x0c, 0xb2, 0x0a, 0xb1, 0xaa, 0xb1, 0x43, - 0xb0, 0xed, 0xae, 0xd7, 0xae, 0xd0, 0xae, 0xcb, 0xae, 0x1f, 0xae, 0x10, - 0xae, 0x0b, 0xad, 0xd8, 0xad, 0xa2, 0xac, 0x6e, 0xac, 0x16, 0xa9, 0xde, - 0xa9, 0x1f, 0xa7, 0x3b, 0xa7, 0x22, 0xa7, 0x19, 0xa4, 0xf4, 0xa4, 0x86, - 0xa4, 0x54, 0xa2, 0x5c, 0xa1, 0x55, 0xa1, 0x41, 0x9c, 0xac, 0x9c, 0xab, - 0x9a, 0xcc, 0x9a, 0xa4, 0x9a, 0x75, 0x99, 0x56, 0x99, 0x4a, 0x99, 0x39, - 0x99, 0x2f, 0x99, 0x2e, 0x99, 0x21, 0x98, 0xdd, 0x98, 0x21, 0x98, 0x12, - 0x94, 0xfc, 0x92, 0xd9, 0x8e, 0x1a, 0x8b, 0x3b, 0x88, 0x63, 0x87, 0xf9, - 0x87, 0xf8, 0x86, 0x5c, 0x85, 0x9d, 0x85, 0x7a, 0x85, 0x44, 0x85, 0x22, - 0x81, 0x85, 0x81, 0x57, 0x81, 0x00, 0x7d, 0x7e, 0x76, 0xaa, 0x76, 0x8e, - 0x76, 0x72, 0x74, 0xcf, 0x74, 0xb6, 0x74, 0xb4, 0x74, 0x89, 0x74, 0x80, - 0x73, 0x53, 0x73, 0x51, 0x73, 0x46, 0x70, 0xe8, 0x70, 0xab, 0x70, 0xa1, - 0x70, 0xa0, 0x6e, 0xb2, 0x6e, 0xb1, 0x6a, 0x94, 0x6a, 0x1e, 0x69, 0x21, - 0x67, 0xf3, 0x65, 0xf9, 0x65, 0xae, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xa8, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb0, 0xed, 0xae, 0xd8, 0xae, 0xd1, 0xae, 0xcc, 0xae, 0x20, 0xae, 0x11, + 0xae, 0x0c, 0xad, 0xd9, 0xad, 0xa3, 0xac, 0x6f, 0xac, 0x17, 0xa9, 0xdf, + 0xa9, 0x20, 0xa7, 0x3c, 0xa7, 0x23, 0xa7, 0x1a, 0xa4, 0xf5, 0xa4, 0x87, + 0xa4, 0x55, 0xa2, 0x5d, 0xa1, 0x56, 0xa1, 0x42, 0x9c, 0xad, 0x9c, 0xac, + 0x9a, 0xcd, 0x9a, 0xa5, 0x9a, 0x76, 0x99, 0x57, 0x99, 0x4b, 0x99, 0x3a, + 0x99, 0x30, 0x99, 0x2f, 0x99, 0x22, 0x98, 0xde, 0x98, 0x22, 0x98, 0x13, + 0x94, 0xfd, 0x92, 0xda, 0x8e, 0x1b, 0x8b, 0x3c, 0x88, 0x64, 0x87, 0xfa, + 0x87, 0xf9, 0x86, 0x5d, 0x85, 0x9e, 0x85, 0x7b, 0x85, 0x45, 0x85, 0x23, + 0x81, 0x86, 0x81, 0x58, 0x81, 0x01, 0x7d, 0x7f, 0x76, 0xab, 0x76, 0x8f, + 0x76, 0x73, 0x74, 0xd0, 0x74, 0xc5, 0x74, 0xb8, 0x74, 0xb6, 0x74, 0x8b, + 0x74, 0x82, 0x73, 0x55, 0x73, 0x53, 0x73, 0x48, 0x70, 0xea, 0x70, 0xad, + 0x70, 0xa3, 0x70, 0xa2, 0x6e, 0xb4, 0x6e, 0xb3, 0x6a, 0x96, 0x6a, 0x20, + 0x69, 0x23, 0x67, 0xf5, 0x65, 0xfb, 0x65, 0xb0, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xaa, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -154,59 +155,60 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x94, 0x00, 0x91, 0x00, 0x87, 0x00, 0x88, 0x00, 0x89, 0x00, 0x8a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x93, 0x00, 0x89, 0x00, 0x8a, 0x00, 0x8b, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8e, 0x00, 0x8f, 0x00, 0x90, - 0x00, 0x92, 0x00, 0x00, 0xb8, 0x01, 0xff, 0x85, 0xb8, 0x00, 0x04, 0x8d, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2c, - 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x01, 0x28, - 0x00, 0x00, 0x01, 0x70, 0x00, 0x00, 0x01, 0xa4, 0x00, 0x00, 0x01, 0xd0, - 0x00, 0x00, 0x02, 0x38, 0x00, 0x00, 0x02, 0x68, 0x00, 0x00, 0x02, 0x80, - 0x00, 0x00, 0x02, 0xb8, 0x00, 0x00, 0x02, 0xec, 0x00, 0x00, 0x03, 0x0c, - 0x00, 0x00, 0x03, 0x44, 0x00, 0x00, 0x03, 0x74, 0x00, 0x00, 0x03, 0xcc, - 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x04, 0xe0, - 0x00, 0x00, 0x05, 0x60, 0x00, 0x00, 0x05, 0x84, 0x00, 0x00, 0x05, 0xc0, - 0x00, 0x00, 0x05, 0xe8, 0x00, 0x00, 0x06, 0x20, 0x00, 0x00, 0x06, 0x58, - 0x00, 0x00, 0x06, 0x88, 0x00, 0x00, 0x06, 0xb8, 0x00, 0x00, 0x07, 0x48, - 0x00, 0x00, 0x07, 0xa8, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x60, - 0x00, 0x00, 0x08, 0xc4, 0x00, 0x00, 0x09, 0x08, 0x00, 0x00, 0x09, 0x88, - 0x00, 0x00, 0x09, 0xd4, 0x00, 0x00, 0x0a, 0x0c, 0x00, 0x00, 0x0a, 0x60, - 0x00, 0x00, 0x0a, 0x90, 0x00, 0x00, 0x0a, 0xa8, 0x00, 0x00, 0x0b, 0x18, - 0x00, 0x00, 0x0b, 0x60, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0c, 0x18, - 0x00, 0x00, 0x0c, 0x78, 0x00, 0x00, 0x0c, 0xb4, 0x00, 0x00, 0x0d, 0x30, - 0x00, 0x00, 0x0d, 0x74, 0x00, 0x00, 0x0d, 0xbc, 0x00, 0x00, 0x0d, 0xe0, - 0x00, 0x00, 0x0e, 0x18, 0x00, 0x00, 0x0e, 0x4c, 0x00, 0x00, 0x0e, 0x8c, - 0x00, 0x00, 0x0e, 0xbc, 0x00, 0x00, 0x0f, 0x10, 0x00, 0x00, 0x0f, 0x58, - 0x00, 0x00, 0x0f, 0xb8, 0x00, 0x00, 0x10, 0x34, 0x00, 0x00, 0x10, 0xdc, - 0x00, 0x00, 0x11, 0xcc, 0x00, 0x00, 0x12, 0x3c, 0x00, 0x00, 0x12, 0xbc, - 0x00, 0x00, 0x13, 0x5c, 0x00, 0x00, 0x14, 0x68, 0x00, 0x00, 0x15, 0x40, - 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x38, 0x00, 0x00, 0x18, 0x18, - 0x00, 0x00, 0x18, 0xe4, 0x00, 0x00, 0x19, 0x5c, 0x00, 0x00, 0x1a, 0x38, - 0x00, 0x00, 0x1a, 0xb4, 0x00, 0x00, 0x1b, 0x78, 0x00, 0x00, 0x1b, 0xd4, - 0x00, 0x00, 0x1c, 0x5c, 0x00, 0x00, 0x1c, 0xf4, 0x00, 0x00, 0x1e, 0x30, - 0x00, 0x00, 0x1e, 0xe8, 0x00, 0x00, 0x1f, 0x64, 0x00, 0x00, 0x20, 0x64, - 0x00, 0x00, 0x21, 0x30, 0x00, 0x00, 0x22, 0x78, 0x00, 0x00, 0x23, 0x74, - 0x00, 0x00, 0x23, 0xf0, 0x00, 0x00, 0x25, 0x3c, 0x00, 0x00, 0x25, 0xf0, - 0x00, 0x00, 0x26, 0xd8, 0x00, 0x00, 0x27, 0xd8, 0x00, 0x00, 0x28, 0xe4, - 0x00, 0x00, 0x29, 0x5c, 0x00, 0x00, 0x29, 0xd4, 0x00, 0x00, 0x2a, 0xbc, - 0x00, 0x00, 0x2b, 0x9c, 0x00, 0x00, 0x2c, 0x7c, 0x00, 0x00, 0x2d, 0x18, - 0x00, 0x00, 0x2d, 0x5c, 0x00, 0x00, 0x2e, 0x0c, 0x00, 0x00, 0x2f, 0x18, - 0x00, 0x00, 0x2f, 0xf0, 0x00, 0x00, 0x30, 0x88, 0x00, 0x00, 0x31, 0x40, - 0x00, 0x00, 0x32, 0x20, 0x00, 0x00, 0x33, 0x20, 0x00, 0x00, 0x33, 0xdc, - 0x00, 0x00, 0x34, 0x58, 0x00, 0x00, 0x35, 0x74, 0x00, 0x00, 0x36, 0x78, - 0x00, 0x00, 0x37, 0x80, 0x00, 0x00, 0x38, 0xbc, 0x00, 0x00, 0x3a, 0x0c, - 0x00, 0x00, 0x3a, 0xb4, 0x00, 0x00, 0x3b, 0x58, 0x00, 0x00, 0x3c, 0x60, - 0x00, 0x00, 0x3d, 0xb8, 0x00, 0x00, 0x3e, 0x24, 0x00, 0x00, 0x3e, 0xc8, - 0x00, 0x00, 0x3f, 0xb0, 0x00, 0x00, 0x40, 0x3c, 0x00, 0x00, 0x40, 0xfc, - 0x00, 0x00, 0x41, 0xe0, 0x00, 0x00, 0x42, 0xac, 0x00, 0x00, 0x43, 0x7c, - 0x00, 0x00, 0x44, 0x18, 0x00, 0x00, 0x45, 0x5c, 0x00, 0x00, 0x46, 0x18, - 0x00, 0x00, 0x47, 0x14, 0x00, 0x00, 0x47, 0xe0, 0x00, 0x00, 0x48, 0x98, - 0x00, 0x00, 0x49, 0x44, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x1c, - 0x00, 0x00, 0x4b, 0x9c, 0x00, 0x00, 0x4c, 0x94, 0x00, 0x00, 0x4d, 0xcc, - 0x00, 0x00, 0x4e, 0x70, 0x00, 0x00, 0x4e, 0xbc, 0x00, 0x00, 0x4e, 0xe8, - 0x00, 0x00, 0x4f, 0x54, 0x00, 0x00, 0x4f, 0xb0, 0x00, 0x00, 0x4f, 0xf0, - 0x00, 0x00, 0x50, 0x54, 0x00, 0x00, 0x50, 0xc8, 0x00, 0x00, 0x50, 0xf8, - 0x00, 0x00, 0x51, 0x90, 0x00, 0x00, 0x52, 0x04, 0x00, 0x00, 0x52, 0x30, - 0x00, 0x00, 0x52, 0x7c, 0x00, 0x00, 0x52, 0xb8, 0x00, 0x00, 0x52, 0xd4, + 0x00, 0x91, 0x00, 0x92, 0x00, 0x94, 0x00, 0x00, 0xb8, 0x01, 0xff, 0x85, + 0xb8, 0x00, 0x04, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, + 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xd0, + 0x00, 0x00, 0x01, 0x28, 0x00, 0x00, 0x01, 0x70, 0x00, 0x00, 0x01, 0xa4, + 0x00, 0x00, 0x01, 0xd0, 0x00, 0x00, 0x02, 0x38, 0x00, 0x00, 0x02, 0x68, + 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0xb8, 0x00, 0x00, 0x02, 0xec, + 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x03, 0x44, 0x00, 0x00, 0x03, 0x74, + 0x00, 0x00, 0x03, 0xcc, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x04, 0x80, + 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x05, 0x60, 0x00, 0x00, 0x05, 0x84, + 0x00, 0x00, 0x05, 0xc0, 0x00, 0x00, 0x05, 0xe8, 0x00, 0x00, 0x06, 0x20, + 0x00, 0x00, 0x06, 0x58, 0x00, 0x00, 0x06, 0x88, 0x00, 0x00, 0x06, 0xb8, + 0x00, 0x00, 0x07, 0x48, 0x00, 0x00, 0x07, 0xa8, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x08, 0x60, 0x00, 0x00, 0x08, 0xc4, 0x00, 0x00, 0x09, 0x08, + 0x00, 0x00, 0x09, 0x88, 0x00, 0x00, 0x09, 0xd4, 0x00, 0x00, 0x0a, 0x0c, + 0x00, 0x00, 0x0a, 0x60, 0x00, 0x00, 0x0a, 0x90, 0x00, 0x00, 0x0a, 0xa8, + 0x00, 0x00, 0x0b, 0x18, 0x00, 0x00, 0x0b, 0x60, 0x00, 0x00, 0x0b, 0xb8, + 0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x0c, 0x78, 0x00, 0x00, 0x0c, 0xb4, + 0x00, 0x00, 0x0d, 0x30, 0x00, 0x00, 0x0d, 0x74, 0x00, 0x00, 0x0d, 0xbc, + 0x00, 0x00, 0x0d, 0xe0, 0x00, 0x00, 0x0e, 0x18, 0x00, 0x00, 0x0e, 0x4c, + 0x00, 0x00, 0x0e, 0x8c, 0x00, 0x00, 0x0e, 0xbc, 0x00, 0x00, 0x0f, 0x10, + 0x00, 0x00, 0x0f, 0x58, 0x00, 0x00, 0x0f, 0xb8, 0x00, 0x00, 0x10, 0x34, + 0x00, 0x00, 0x10, 0xdc, 0x00, 0x00, 0x11, 0xcc, 0x00, 0x00, 0x12, 0x50, + 0x00, 0x00, 0x12, 0xc0, 0x00, 0x00, 0x13, 0x40, 0x00, 0x00, 0x13, 0xe0, + 0x00, 0x00, 0x14, 0xec, 0x00, 0x00, 0x15, 0xc4, 0x00, 0x00, 0x16, 0x84, + 0x00, 0x00, 0x17, 0xbc, 0x00, 0x00, 0x18, 0x9c, 0x00, 0x00, 0x19, 0x68, + 0x00, 0x00, 0x19, 0xe0, 0x00, 0x00, 0x1a, 0xbc, 0x00, 0x00, 0x1b, 0x38, + 0x00, 0x00, 0x1b, 0xfc, 0x00, 0x00, 0x1c, 0x58, 0x00, 0x00, 0x1c, 0xe0, + 0x00, 0x00, 0x1d, 0x78, 0x00, 0x00, 0x1e, 0xb4, 0x00, 0x00, 0x1f, 0x6c, + 0x00, 0x00, 0x1f, 0xe8, 0x00, 0x00, 0x20, 0xe8, 0x00, 0x00, 0x21, 0xb4, + 0x00, 0x00, 0x22, 0xfc, 0x00, 0x00, 0x23, 0xf8, 0x00, 0x00, 0x24, 0x74, + 0x00, 0x00, 0x25, 0xc0, 0x00, 0x00, 0x26, 0x74, 0x00, 0x00, 0x27, 0x5c, + 0x00, 0x00, 0x28, 0x5c, 0x00, 0x00, 0x29, 0x68, 0x00, 0x00, 0x29, 0xe0, + 0x00, 0x00, 0x2a, 0x58, 0x00, 0x00, 0x2b, 0x40, 0x00, 0x00, 0x2c, 0x20, + 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x2d, 0x9c, 0x00, 0x00, 0x2d, 0xe0, + 0x00, 0x00, 0x2e, 0x90, 0x00, 0x00, 0x2f, 0x9c, 0x00, 0x00, 0x30, 0x74, + 0x00, 0x00, 0x31, 0x0c, 0x00, 0x00, 0x31, 0xc4, 0x00, 0x00, 0x32, 0xa4, + 0x00, 0x00, 0x33, 0xa4, 0x00, 0x00, 0x34, 0x60, 0x00, 0x00, 0x34, 0xdc, + 0x00, 0x00, 0x35, 0xf8, 0x00, 0x00, 0x36, 0xfc, 0x00, 0x00, 0x38, 0x04, + 0x00, 0x00, 0x39, 0x40, 0x00, 0x00, 0x3a, 0x90, 0x00, 0x00, 0x3b, 0x38, + 0x00, 0x00, 0x3b, 0xdc, 0x00, 0x00, 0x3c, 0xe4, 0x00, 0x00, 0x3e, 0x3c, + 0x00, 0x00, 0x3e, 0xa8, 0x00, 0x00, 0x3f, 0x4c, 0x00, 0x00, 0x40, 0x0c, + 0x00, 0x00, 0x40, 0xf4, 0x00, 0x00, 0x41, 0x80, 0x00, 0x00, 0x42, 0x40, + 0x00, 0x00, 0x43, 0x24, 0x00, 0x00, 0x43, 0xf0, 0x00, 0x00, 0x44, 0xc0, + 0x00, 0x00, 0x45, 0x5c, 0x00, 0x00, 0x46, 0xa0, 0x00, 0x00, 0x47, 0x5c, + 0x00, 0x00, 0x48, 0x58, 0x00, 0x00, 0x49, 0x24, 0x00, 0x00, 0x49, 0xdc, + 0x00, 0x00, 0x4a, 0x88, 0x00, 0x00, 0x4b, 0x44, 0x00, 0x00, 0x4c, 0x60, + 0x00, 0x00, 0x4c, 0xe0, 0x00, 0x00, 0x4d, 0xd8, 0x00, 0x00, 0x4f, 0x10, + 0x00, 0x00, 0x4f, 0xb4, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, 0x2c, + 0x00, 0x00, 0x50, 0x98, 0x00, 0x00, 0x50, 0xf4, 0x00, 0x00, 0x51, 0x34, + 0x00, 0x00, 0x51, 0x98, 0x00, 0x00, 0x52, 0x0c, 0x00, 0x00, 0x52, 0x3c, + 0x00, 0x00, 0x52, 0xd4, 0x00, 0x00, 0x53, 0x48, 0x00, 0x00, 0x53, 0x74, + 0x00, 0x00, 0x53, 0xc0, 0x00, 0x00, 0x53, 0xfc, 0x00, 0x00, 0x54, 0x18, 0x00, 0x02, 0x00, 0x5c, 0xff, 0x7d, 0x01, 0xfa, 0x03, 0x60, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x13, 0x21, 0x11, 0x21, 0x25, 0x11, 0x21, 0x11, 0x5c, 0x01, 0x9e, 0xfe, 0x62, 0x01, 0x88, 0xfe, 0x8e, 0x03, 0x60, 0xfc, @@ -586,7 +588,18 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x19, 0x1e, 0x17, 0x1a, 0x26, 0x26, 0x21, 0x43, 0x2d, 0x53, 0x01, 0x8c, 0x78, 0xb7, 0xfe, 0xf5, 0x34, 0x41, 0x50, 0x56, 0x54, 0x41, 0x01, 0xa2, 0x52, 0x74, 0x0d, 0x04, 0xb5, 0xfe, 0x82, 0x15, 0x23, 0x23, 0x1c, 0x2f, - 0x1c, 0x16, 0x13, 0x24, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1e, + 0x1c, 0x16, 0x13, 0x24, 0x12, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, + 0xff, 0xdf, 0x03, 0x88, 0x03, 0x60, 0x00, 0x1d, 0x00, 0x2a, 0x00, 0x00, + 0x25, 0x35, 0x23, 0x35, 0x33, 0x35, 0x23, 0x35, 0x21, 0x27, 0x26, 0x27, + 0x37, 0x16, 0x17, 0x16, 0x17, 0x07, 0x21, 0x15, 0x23, 0x15, 0x33, 0x15, + 0x23, 0x15, 0x21, 0x15, 0x21, 0x35, 0x02, 0x37, 0x36, 0x37, 0x17, 0x06, + 0x07, 0x11, 0x23, 0x11, 0x06, 0x07, 0x27, 0x02, 0x23, 0xd9, 0xd9, 0xf0, + 0x01, 0x12, 0x1e, 0x0c, 0x19, 0x4d, 0x12, 0x16, 0x1a, 0x0a, 0x37, 0x01, + 0x0e, 0xf8, 0xd8, 0xd8, 0x01, 0x0e, 0xfd, 0x95, 0xc4, 0x2f, 0x3b, 0x26, + 0x58, 0x2b, 0x26, 0x54, 0x1e, 0x24, 0x49, 0x54, 0xf1, 0x55, 0xc8, 0x53, + 0x41, 0x1b, 0x30, 0x1f, 0x1e, 0x2c, 0x33, 0x1c, 0x12, 0x53, 0xc8, 0x55, + 0xf1, 0x53, 0x53, 0x01, 0xa0, 0x65, 0x7c, 0x78, 0x16, 0x7d, 0x57, 0xfd, + 0x7c, 0x01, 0xda, 0x36, 0x37, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1e, 0xff, 0xde, 0x03, 0x95, 0x03, 0x5a, 0x00, 0x1f, 0x00, 0x00, 0x3e, 0x01, 0x37, 0x36, 0x37, 0x26, 0x27, 0x26, 0x27, 0x37, 0x16, 0x17, 0x1e, 0x01, 0x17, 0x16, 0x17, 0x1e, 0x01, 0x17, 0x07, 0x2e, 0x01, 0x27, 0x26, 0x27, @@ -1546,7 +1559,23 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x94, 0xb1, 0x3a, 0x40, 0x39, 0x28, 0x57, 0xb4, 0x57, 0x43, 0x02, 0x0b, 0xfe, 0x90, 0x34, 0x3d, 0x4f, 0x30, 0x64, 0x25, 0x3a, 0x0d, 0x19, 0x19, 0x01, 0x37, 0x01, 0x7d, 0x20, 0x37, 0x35, 0x28, 0x3b, 0x29, 0x36, 0x3c, - 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x2d, 0xff, 0xcd, 0x03, 0x93, + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x33, 0xff, 0xed, 0x03, 0x85, + 0x03, 0x45, 0x00, 0x0d, 0x00, 0x17, 0x00, 0x3c, 0x00, 0x00, 0x13, 0x11, + 0x36, 0x37, 0x17, 0x06, 0x07, 0x27, 0x3e, 0x01, 0x35, 0x11, 0x23, 0x35, + 0x13, 0x16, 0x17, 0x16, 0x17, 0x07, 0x26, 0x27, 0x26, 0x27, 0x25, 0x21, + 0x11, 0x21, 0x11, 0x14, 0x1e, 0x01, 0x17, 0x16, 0x33, 0x32, 0x37, 0x3e, + 0x02, 0x3f, 0x01, 0x17, 0x06, 0x07, 0x0e, 0x02, 0x07, 0x06, 0x23, 0x22, + 0x27, 0x2e, 0x02, 0x35, 0x11, 0x21, 0x35, 0x21, 0xff, 0x32, 0x38, 0x1d, + 0x4d, 0x7f, 0x2d, 0x10, 0x0b, 0x75, 0x7a, 0x18, 0x32, 0x2a, 0x19, 0x46, + 0x1c, 0x27, 0x2a, 0x1f, 0x01, 0x14, 0x01, 0xce, 0xfe, 0x9b, 0x0a, 0x1b, + 0x21, 0x1e, 0x49, 0x38, 0x14, 0x1f, 0x1a, 0x0b, 0x03, 0x09, 0x57, 0x01, + 0x0a, 0x08, 0x19, 0x32, 0x33, 0x12, 0x76, 0x4e, 0x0e, 0x35, 0x35, 0x16, + 0x01, 0x63, 0xfe, 0x89, 0x02, 0x24, 0xfe, 0x60, 0x24, 0x3f, 0x5b, 0x47, + 0x52, 0x41, 0x0c, 0x17, 0x16, 0x01, 0x61, 0x56, 0x01, 0x21, 0x19, 0x3e, + 0x34, 0x26, 0x3b, 0x2d, 0x30, 0x38, 0x21, 0x0c, 0xfe, 0x80, 0xfe, 0xe2, + 0x19, 0x15, 0x07, 0x01, 0x02, 0x01, 0x01, 0x07, 0x15, 0x19, 0x6e, 0x1a, + 0x14, 0x52, 0x33, 0x32, 0x14, 0x03, 0x01, 0x01, 0x03, 0x16, 0x37, 0x38, + 0x01, 0x7b, 0xd2, 0x00, 0x00, 0x05, 0x00, 0x2d, 0xff, 0xcd, 0x03, 0x93, 0x03, 0x49, 0x00, 0x0d, 0x00, 0x17, 0x00, 0x29, 0x00, 0x44, 0x00, 0x49, 0x00, 0x00, 0x13, 0x11, 0x36, 0x37, 0x17, 0x06, 0x07, 0x27, 0x3e, 0x01, 0x35, 0x11, 0x23, 0x35, 0x13, 0x16, 0x17, 0x16, 0x17, 0x07, 0x26, 0x27, @@ -2028,7 +2057,7 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x69, 0x00, 0x67, 0x00, 0x6e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x03, 0x00, 0x24, 0x00, 0x25, 0x00, 0x26, 0x00, 0x27, 0x00, 0x28, 0x00, 0x29, 0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0x00, 0x2d, 0x00, 0x2e, 0x00, 0x2f, 0x00, 0x30, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, @@ -2051,13 +2080,14 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x01, 0x3f, 0x01, 0x40, 0x01, 0x41, 0x01, 0x42, 0x01, 0x43, 0x01, 0x44, 0x01, 0x45, 0x01, 0x46, 0x01, 0x47, 0x01, 0x48, 0x01, 0x49, 0x01, 0x4a, 0x01, 0x4b, 0x01, 0x4c, 0x01, 0x4d, 0x01, 0x4e, 0x01, 0x4f, 0x01, 0x50, - 0x01, 0x51, 0x01, 0x52, 0x00, 0x13, 0x00, 0x14, 0x00, 0x15, 0x00, 0x16, - 0x00, 0x17, 0x00, 0x18, 0x00, 0x19, 0x00, 0x1a, 0x00, 0x1b, 0x00, 0x1c, - 0x00, 0x11, 0x00, 0x1d, 0x00, 0x0d, 0x00, 0x10, 0x07, 0x75, 0x6e, 0x69, - 0x34, 0x45, 0x32, 0x41, 0x07, 0x75, 0x6e, 0x69, 0x34, 0x45, 0x32, 0x44, - 0x07, 0x75, 0x6e, 0x69, 0x34, 0x45, 0x38, 0x45, 0x07, 0x75, 0x6e, 0x69, - 0x34, 0x45, 0x46, 0x36, 0x07, 0x75, 0x6e, 0x69, 0x34, 0x46, 0x34, 0x44, - 0x07, 0x75, 0x6e, 0x69, 0x34, 0x46, 0x34, 0x45, 0x07, 0x75, 0x6e, 0x69, + 0x01, 0x51, 0x01, 0x52, 0x01, 0x53, 0x01, 0x54, 0x00, 0x13, 0x00, 0x14, + 0x00, 0x15, 0x00, 0x16, 0x00, 0x17, 0x00, 0x18, 0x00, 0x19, 0x00, 0x1a, + 0x00, 0x1b, 0x00, 0x1c, 0x00, 0x11, 0x00, 0x1d, 0x00, 0x0d, 0x00, 0x10, + 0x07, 0x75, 0x6e, 0x69, 0x34, 0x45, 0x32, 0x41, 0x07, 0x75, 0x6e, 0x69, + 0x34, 0x45, 0x32, 0x44, 0x07, 0x75, 0x6e, 0x69, 0x34, 0x45, 0x38, 0x45, + 0x07, 0x75, 0x6e, 0x69, 0x34, 0x45, 0x46, 0x36, 0x07, 0x75, 0x6e, 0x69, + 0x34, 0x46, 0x34, 0x44, 0x07, 0x75, 0x6e, 0x69, 0x34, 0x46, 0x34, 0x45, + 0x07, 0x75, 0x6e, 0x69, 0x34, 0x46, 0x34, 0x46, 0x07, 0x75, 0x6e, 0x69, 0x35, 0x31, 0x36, 0x35, 0x07, 0x75, 0x6e, 0x69, 0x35, 0x31, 0x36, 0x44, 0x07, 0x75, 0x6e, 0x69, 0x35, 0x31, 0x37, 0x33, 0x07, 0x75, 0x6e, 0x69, 0x35, 0x32, 0x32, 0x30, 0x07, 0x75, 0x6e, 0x69, 0x35, 0x32, 0x33, 0x30, @@ -2095,23 +2125,24 @@ unsigned char OPPOSans_Regular_ttf[] = { 0x38, 0x32, 0x46, 0x31, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x39, 0x43, 0x36, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x39, 0x45, 0x33, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x41, 0x30, 0x30, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x42, 0x41, 0x34, - 0x07, 0x75, 0x6e, 0x69, 0x38, 0x42, 0x42, 0x45, 0x07, 0x75, 0x6e, 0x69, - 0x38, 0x42, 0x43, 0x31, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x42, 0x45, 0x44, - 0x07, 0x75, 0x6e, 0x69, 0x38, 0x42, 0x46, 0x37, 0x07, 0x75, 0x6e, 0x69, - 0x38, 0x44, 0x32, 0x35, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x44, 0x32, 0x38, - 0x07, 0x75, 0x6e, 0x69, 0x38, 0x44, 0x33, 0x34, 0x07, 0x75, 0x6e, 0x69, - 0x38, 0x46, 0x39, 0x33, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x46, 0x44, 0x31, - 0x07, 0x75, 0x6e, 0x69, 0x38, 0x46, 0x44, 0x43, 0x07, 0x75, 0x6e, 0x69, - 0x38, 0x46, 0x44, 0x45, 0x07, 0x75, 0x6e, 0x69, 0x39, 0x31, 0x43, 0x44, - 0x07, 0x75, 0x6e, 0x69, 0x39, 0x31, 0x43, 0x46, 0x07, 0x75, 0x6e, 0x69, - 0x39, 0x35, 0x45, 0x44, 0x07, 0x75, 0x6e, 0x69, 0x39, 0x36, 0x36, 0x34, - 0x07, 0x75, 0x6e, 0x69, 0x39, 0x37, 0x36, 0x32, 0x07, 0x75, 0x6e, 0x69, - 0x39, 0x38, 0x39, 0x31, 0x07, 0x75, 0x6e, 0x69, 0x39, 0x41, 0x38, 0x43, - 0x07, 0x75, 0x6e, 0x69, 0x39, 0x41, 0x44, 0x38, 0x00, 0x01, 0x00, 0x03, - 0x00, 0x08, 0x00, 0x0e, 0x00, 0x10, 0x00, 0x07, 0xff, 0xff, 0x00, 0x0f, - 0x00, 0x01, 0x00, 0x00, 0x01, 0xf4, 0xfe, 0x0c, 0x00, 0x00, 0x03, 0xe8, - 0xfe, 0xa4, 0xff, 0x90, 0x04, 0x58, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; -unsigned int OPPOSans_Regular_ttf_len = 25248; + 0x07, 0x75, 0x6e, 0x69, 0x38, 0x42, 0x42, 0x30, 0x07, 0x75, 0x6e, 0x69, + 0x38, 0x42, 0x42, 0x45, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x42, 0x43, 0x31, + 0x07, 0x75, 0x6e, 0x69, 0x38, 0x42, 0x45, 0x44, 0x07, 0x75, 0x6e, 0x69, + 0x38, 0x42, 0x46, 0x37, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x44, 0x32, 0x35, + 0x07, 0x75, 0x6e, 0x69, 0x38, 0x44, 0x32, 0x38, 0x07, 0x75, 0x6e, 0x69, + 0x38, 0x44, 0x33, 0x34, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x46, 0x39, 0x33, + 0x07, 0x75, 0x6e, 0x69, 0x38, 0x46, 0x44, 0x31, 0x07, 0x75, 0x6e, 0x69, + 0x38, 0x46, 0x44, 0x43, 0x07, 0x75, 0x6e, 0x69, 0x38, 0x46, 0x44, 0x45, + 0x07, 0x75, 0x6e, 0x69, 0x39, 0x31, 0x43, 0x44, 0x07, 0x75, 0x6e, 0x69, + 0x39, 0x31, 0x43, 0x46, 0x07, 0x75, 0x6e, 0x69, 0x39, 0x35, 0x45, 0x44, + 0x07, 0x75, 0x6e, 0x69, 0x39, 0x36, 0x36, 0x34, 0x07, 0x75, 0x6e, 0x69, + 0x39, 0x37, 0x36, 0x32, 0x07, 0x75, 0x6e, 0x69, 0x39, 0x38, 0x39, 0x31, + 0x07, 0x75, 0x6e, 0x69, 0x39, 0x41, 0x38, 0x43, 0x07, 0x75, 0x6e, 0x69, + 0x39, 0x41, 0x44, 0x38, 0x00, 0x01, 0x00, 0x03, 0x00, 0x08, 0x00, 0x0e, + 0x00, 0x10, 0x00, 0x07, 0xff, 0xff, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, + 0x01, 0xf4, 0xfe, 0x0c, 0x00, 0x00, 0x03, 0xe8, 0xfe, 0xa4, 0xff, 0x90, + 0x04, 0x58, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; +unsigned int OPPOSans_Regular_ttf_len = 25616; #endif \ No newline at end of file diff --git a/src/localization/localization.h b/src/localization/localization.h index e3d7176..764efb8 100644 --- a/src/localization/localization.h +++ b/src/localization/localization.h @@ -63,6 +63,9 @@ static std::vector validate_password = {u8"验证密码中...", static std::vector reinput_password = { u8"请重新输入密码", "Please input password again"}; +static std::vector remember_password = {u8"记住密码", + "Remember password"}; + static std::vector signal_connected = {u8"已连接服务器", "Connected"}; static std::vector signal_disconnected = {u8"未连接服务器", diff --git a/src/single_window/connection_status_window.cpp b/src/single_window/connection_status_window.cpp index 2d6bfb5..2d0b784 100644 --- a/src/single_window/connection_status_window.cpp +++ b/src/single_window/connection_status_window.cpp @@ -88,6 +88,7 @@ int Render::ConnectionStatusWindow() { } else { text = localization::reinput_password[localization_language_index_]; } + auto window_width = ImGui::GetWindowSize().x; auto window_height = ImGui::GetWindowSize().y; ImGui::SetCursorPosX((window_width - IPUT_WINDOW_WIDTH / 2) * 0.5f); @@ -100,10 +101,22 @@ int Render::ConnectionStatusWindow() { ImGui::SetKeyboardFocusHere(); focus_on_input_widget_ = false; } + ImGui::InputText("##password", remote_password_, IM_ARRAYSIZE(remote_password_), ImGuiInputTextFlags_CharsNoBlank); + ImGui::SetWindowFontScale(0.4f); + + ImVec2 text_size = ImGui::CalcTextSize( + localization::remember_password[localization_language_index_] + .c_str()); + ImGui::SetCursorPosX((window_width - text_size.x) * 0.5f - 13.0f); + ImGui::Checkbox( + localization::remember_password[localization_language_index_] + .c_str(), + &remember_password_); + ImGui::SetWindowFontScale(0.5f); ImGui::PopStyleVar(); ImGui::SetCursorPosX(window_width * 0.315f); diff --git a/src/single_window/main_window.cpp b/src/single_window/main_window.cpp index ee5ba5b..a41722c 100644 --- a/src/single_window/main_window.cpp +++ b/src/single_window/main_window.cpp @@ -102,9 +102,16 @@ int Render::ShowRecentConnections() { ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoScrollbar); - size_t pos1 = it->first.find('\\') + 1; + // size_t pos1 = it->first.find('\\') + 1; + // size_t pos2 = it->first.rfind('@'); + // std::string host_name = it->first.substr(pos1, pos2 - pos1); + + size_t pos1 = it->first.find('@') + 1; size_t pos2 = it->first.rfind('@'); + std::string password = it->first.substr(0, pos1); std::string host_name = it->first.substr(pos1, pos2 - pos1); + std::string remote_id = it->first.substr(pos2 + 1); + ImGui::SetWindowFontScale(0.4f); ImVec2 window_size = ImGui::GetWindowSize(); ImVec2 text_size = ImGui::CalcTextSize(host_name.c_str()); diff --git a/src/single_window/render.cpp b/src/single_window/render.cpp index 6ac408d..581b5a0 100644 --- a/src/single_window/render.cpp +++ b/src/single_window/render.cpp @@ -802,8 +802,9 @@ int Render::Run() { DestroyStreamWindowContext(); if (dst_buffer_) { - thumbnail_.SaveToThumbnail((char*)dst_buffer_, video_width_, - video_height_, host_name_, remote_id_); + thumbnail_.SaveToThumbnail( + (char*)dst_buffer_, video_width_, video_height_, host_name_, + remote_id_, remember_password_ ? remote_password_ : ""); recent_connection_image_save_time_ = SDL_GetTicks(); } diff --git a/src/single_window/render.h b/src/single_window/render.h index a25d22b..8a3e72b 100644 --- a/src/single_window/render.h +++ b/src/single_window/render.h @@ -279,6 +279,7 @@ class Render { bool hostname_sent_ = false; bool show_confirm_delete_connection_ = false; bool delete_connection_ = false; + bool remember_password_ = false; double copy_start_time_ = 0; double regenerate_password_start_time_ = 0; diff --git a/src/single_window/thumbnail.cpp b/src/single_window/thumbnail.cpp index 483ea31..a341ae5 100644 --- a/src/single_window/thumbnail.cpp +++ b/src/single_window/thumbnail.cpp @@ -1,8 +1,15 @@ #include "thumbnail.h" +#include +#include + #include #include +#include +#include #include +#include +#include #include "libyuv.h" #include "rd_log.h" @@ -12,6 +19,8 @@ #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" +static std::string test; + void ScaleYUV420pToABGR(char* dst_buffer_, int video_width_, int video_height_, int scaled_video_width_, int scaled_video_height_, char* rgba_buffer_) { @@ -64,7 +73,8 @@ Thumbnail::~Thumbnail() { int Thumbnail::SaveToThumbnail(const char* yuv420p, int width, int height, const std::string& host_name, - const std::string& remote_id) { + const std::string& remote_id, + const std::string& password) { if (!rgba_buffer_) { rgba_buffer_ = new char[thumbnail_width_ * thumbnail_height_ * 4]; } @@ -72,9 +82,13 @@ int Thumbnail::SaveToThumbnail(const char* yuv420p, int width, int height, if (yuv420p) { ScaleYUV420pToABGR((char*)yuv420p, width, height, thumbnail_width_, thumbnail_height_, rgba_buffer_); - std::string image_name = - image_path_ + "/" + host_name + "@" + remote_id + ".png"; - stbi_write_png(image_name.data(), thumbnail_width_, thumbnail_height_, 4, + + std::string image_name = password + "@" + host_name + "@" + remote_id; + LOG_ERROR("1 Save thumbnail: {}", image_name); + std::string cipher_image_name = AES_encrypt(key_, image_name); + LOG_ERROR("2 Save thumbnail: {}", cipher_image_name); + std::string save_path = image_path_ + cipher_image_name; + stbi_write_png(save_path.data(), thumbnail_width_, thumbnail_height_, 4, rgba_buffer_, thumbnail_width_ * 4); } return 0; @@ -141,7 +155,7 @@ bool LoadTextureFromFile(const char* file_name, SDL_Renderer* renderer, std::vector Thumbnail::FindThumbnailPath( const std::filesystem::path& directory) { std::vector thumbnails_path; - std::string image_extensions = ".png"; + // std::string image_extensions = ".png"; if (!std::filesystem::is_directory(directory)) { LOG_ERROR("No such directory [{}]", directory.string()); @@ -158,9 +172,9 @@ std::vector Thumbnail::FindThumbnailPath( std::filesystem::file_time_type::clock::now() + std::chrono::system_clock::now())); - if (entry.path().extension() == image_extensions) { - thumbnails_sorted_by_write_time_[last_write_time] = entry.path(); - } + // if (entry.path().extension() == image_extensions) { + thumbnails_sorted_by_write_time_[last_write_time] = entry.path(); + // } } } @@ -176,21 +190,30 @@ int Thumbnail::LoadThumbnail(SDL_Renderer* renderer, std::map& textures, int* width, int* height) { textures.clear(); - std::vector image_path = + std::vector image_paths = FindThumbnailPath(image_path_); - if (image_path.size() == 0) { + if (image_paths.size() == 0) { return -1; } else { - for (int i = 0; i < image_path.size(); i++) { - // size_t pos1 = image_path[i].string().find('\\') + 1; - // size_t pos2 = image_path[i].string().rfind('@'); - // std::string host_name = image_path[i].string().substr(pos1, pos2 - - // pos1); - std::string image_p = image_path[i].string(); - textures[image_p] = nullptr; - LoadTextureFromFile(image_path[i].string().c_str(), renderer, - &(textures[image_p]), width, height); + for (int i = 0; i < image_paths.size(); i++) { + size_t pos1 = image_paths[i].string().find('/') + 1; + std::string cipher_image_name = image_paths[i].string().substr(pos1); + LOG_ERROR("cipher_image_name: {}", cipher_image_name); + std::string original_image_name = AES_decrypt(key_, cipher_image_name); + std::string image_path = image_path_ + original_image_name; + LOG_ERROR("image_path: {}", image_path); + // size_t pos1 = original_image_name[i].string().find('@') + 1; + // size_t pos2 = original_image_name[i].string().rfind('@'); + // std::string password = original_image_name[i].string().substr(0, pos1); + // std::string host_name = + // original_image_name[i].string().substr(pos1, pos2 - pos1); + // std::string remote_id = original_image_name[i].string().substr(pos2 + + // 1); + + textures[original_image_name] = nullptr; + LoadTextureFromFile(image_path.c_str(), renderer, + &(textures[original_image_name]), width, height); } return 0; } @@ -206,4 +229,96 @@ int Thumbnail::DeleteThumbnail(const std::string& file_path) { LOG_ERROR("File [{}] does not exist", file_path); return -1; } -} \ No newline at end of file +} + +// 将std::string转换为unsigned char向量 +std::vector string_to_uchar_vector(const std::string& str) { + return std::vector(str.begin(), str.end()); +} + +// 将unsigned char向量转换为std::string +std::string uchar_vector_to_string(const std::vector& vec) { + return std::string(vec.begin(), vec.end()); +} + +// PKCS#7 填充 +void pkcs7_pad(std::vector& data) { + size_t pad_length = AES_BLOCK_SIZE - (data.size() % AES_BLOCK_SIZE); + data.insert(data.end(), pad_length, static_cast(pad_length)); +} + +// PKCS#7 去除填充 +void pkcs7_unpad(std::vector& data) { + if (!data.empty()) { + size_t pad_length = data.back(); + data.resize(data.size() - pad_length); + } +} + +std::string Thumbnail::AES_encrypt(const std::string& key, + const std::string& plaintext) { + std::vector key_vec = string_to_uchar_vector(key); + std::vector iv(AES_BLOCK_SIZE); + RAND_bytes(iv.data(), AES_BLOCK_SIZE); // 随机生成IV + + std::vector plaintext_vec = string_to_uchar_vector(plaintext); + pkcs7_pad(plaintext_vec); // 填充明文 + + std::vector ciphertext(plaintext_vec.size()); + AES_KEY encryptKey; + AES_set_encrypt_key(key_vec.data(), 128, &encryptKey); + + AES_cbc_encrypt(plaintext_vec.data(), ciphertext.data(), plaintext_vec.size(), + &encryptKey, iv.data(), AES_ENCRYPT); + + // 将IV和密文拼接,方便解密时取出IV + ciphertext.insert(ciphertext.begin(), iv.begin(), iv.end()); + + // return uchar_vector_to_string(ciphertext); + + std::string encrypted = uchar_vector_to_string(ciphertext); + + std::string original_image_name = + AES_decrypt(key_, uchar_vector_to_string(ciphertext)); + LOG_ERROR("!!!!!!!!!!!!!!! src = [{}]", original_image_name); + + // 转换成十六进制字符串 + std::ostringstream encrypted_oss; + for (unsigned char c : encrypted) { + encrypted_oss << std::hex << std::setw(2) << std::setfill('0') << (int)c; + } + return encrypted_oss.str(); +} + +std::string Thumbnail::AES_decrypt(const std::string& key, + const std::string& ciphertext) { + // // 将十六进制字符串转换回原始二进制密文 + std::string original_ciphertext = ciphertext; + // for (size_t i = 0; i < ciphertext.size(); i += 2) { + // std::string byte_str = ciphertext.substr(i, 2); + // unsigned char byte = + // static_cast(std::stoi(byte_str, nullptr, 16)); + // original_ciphertext.push_back(byte); + // } + + std::vector key_vec = string_to_uchar_vector(key); + std::vector ciphertext_vec = + string_to_uchar_vector(ciphertext); + + // 提取IV + std::vector iv(ciphertext_vec.begin(), + ciphertext_vec.begin() + AES_BLOCK_SIZE); + ciphertext_vec.erase(ciphertext_vec.begin(), + ciphertext_vec.begin() + AES_BLOCK_SIZE); + + std::vector plaintext(ciphertext_vec.size()); + AES_KEY decryptKey; + AES_set_decrypt_key(key_vec.data(), 128, &decryptKey); + + AES_cbc_encrypt(ciphertext_vec.data(), plaintext.data(), + ciphertext_vec.size(), &decryptKey, iv.data(), AES_DECRYPT); + + pkcs7_unpad(plaintext); // 去除填充 + + return uchar_vector_to_string(plaintext); +} diff --git a/src/single_window/thumbnail.h b/src/single_window/thumbnail.h index 48d35b4..00e0017 100644 --- a/src/single_window/thumbnail.h +++ b/src/single_window/thumbnail.h @@ -20,7 +20,8 @@ class Thumbnail { public: int SaveToThumbnail(const char* yuv420p, int width, int height, const std::string& host_name, - const std::string& remote_id); + const std::string& remote_id, + const std::string& password); int LoadThumbnail(SDL_Renderer* renderer, std::map& textures, int* width, @@ -32,12 +33,20 @@ class Thumbnail { std::vector FindThumbnailPath( const std::filesystem::path& directory); + std::string AES_encrypt(const std::string& key, const std::string& plaintext); + + std::string AES_decrypt(const std::string& key, + const std::string& ciphertext); + private: int thumbnail_width_ = 160; int thumbnail_height_ = 90; char* rgba_buffer_ = nullptr; - std::string image_path_ = "thumbnails"; + std::string image_path_ = "thumbnails/"; std::map thumbnails_sorted_by_write_time_; + + std::string key_ = "1234567890123456"; + std::string iv_ = "1234567890123456"; }; #endif \ No newline at end of file diff --git a/xmake.lua b/xmake.lua index ba814ad..78ebd7f 100644 --- a/xmake.lua +++ b/xmake.lua @@ -19,6 +19,7 @@ end add_requires("spdlog 1.14.1", {system = false}) add_requires("imgui v1.91.4-docking", {configs = {sdl2 = true, sdl2_renderer = true}}) add_requires("miniaudio 0.11.21") +add_requires("openssl 1.1.1-w", {system = false}) if is_os("windows") then add_requires("libyuv") @@ -124,7 +125,7 @@ target("localization") target("single_window") set_kind("object") - add_packages("libyuv") + add_packages("libyuv", "openssl") add_deps("rd_log", "common", "localization", "config_center", "projectx", "screen_capturer", "speaker_capturer", "device_controller") if is_os("macosx") then add_packages("ffmpeg")