From 2786542ffd2a9836c640b7ccac85266d0933362d Mon Sep 17 00:00:00 2001 From: deepfal Date: Mon, 18 Aug 2025 13:33:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(totp):=20=E9=87=8D=E6=9E=84=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E4=BB=A5=E6=94=AF=E6=8C=81=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除本地账户配置文件,改为从本地存储加载账户 - 新增 interconnect 功能,实现与手机端的数据同步 - 支持从手机端接收、删除和重排序账户 - 增加删除账户和重排序的确认消息发送到手机端 - 优化 TOTP 生成算法,支持 SHA256 和 SHA512 - 调整 OTP 生成位数,支持 6 位以上 OTP --- package-lock.json | 4 +- src/common/accounts.json | 44 ---- src/manifest.json | 10 +- src/pages/index/index.ux | 433 ++++++++++++++++++++++++++++++++++++--- src/utils/totp.js | 27 ++- 5 files changed, 433 insertions(+), 85 deletions(-) delete mode 100644 src/common/accounts.json diff --git a/package-lock.json b/package-lock.json index 4bf47bf..a9fb8ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "hello", + "name": "totp", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "hello", + "name": "totp", "version": "1.0.0", "dependencies": { "crypto-js": "^4.2.0" diff --git a/src/common/accounts.json b/src/common/accounts.json deleted file mode 100644 index 4fd9aad..0000000 --- a/src/common/accounts.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "accounts": [ - { - "name": "Microsoft", - "username": "example@outlook.com", - "secret": "JBSWY3DPEHPK3PXP", - "enabled": true, - "type": "totp" - }, - { - "name": "GitHub", - "username": "myusername", - "secret": "HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", - "enabled": true, - "type": "totp" - }, - { - "name": "Steam", - "username": "steamuser", - "secret": "NBSWY3DPEHPK3PXPNBSWY3DPEHPK3PXP", - "enabled": true, - "type": "steam" - }, - { - "name": "Work Server", - "username": "employee", - "secret": "MFRGG2LTEBYGCZLSMUFA====", - "enabled": true, - "type": "totp" - }, - { - "name": "Microsoft", - "username": "user@example.com", - "secret": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", - "enabled": false, - "type": "totp" - } - ], - "settings": { - "title": "TOTP", - "refreshInterval": 20, - "maxDisplayAccounts": 10 - } -} \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index adc6501..aae51b3 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,8 +1,8 @@ { "package": "cn.deepfal.band.TOTPauthenticator", "name": "TOTP", - "versionName": "1.0.2", - "versionCode": 1, + "versionName": "1.1.0", + "versionCode": 2, "minPlatformVersion": 1000, "icon": "/common/logo.png", "deviceTypeList": [ @@ -14,6 +14,12 @@ }, { "name": "system.vibrator" + }, + { + "name": "system.interconnect" + }, + { + "name": "system.storage" } ], "config": { diff --git a/src/pages/index/index.ux b/src/pages/index/index.ux index a0623f9..48d3940 100644 --- a/src/pages/index/index.ux +++ b/src/pages/index/index.ux @@ -86,16 +86,20 @@