fix(api): 解密密码并移除不必要的登录方法

- 在SixClient中使用AES解密applePwd字段,提高密码处理安全性
- 从SixClient中移除login_remote_apple_account方法,简化代码结构
- 在MasterNodeService中去除对密码的AES解密,改为直接使用密码数据
- 确保返回数据中密码字段保持一致,避免冗余处理
This commit is contained in:
danial
2025-11-14 17:54:31 +08:00
parent 13165430dd
commit dd85ec855f
2 changed files with 10 additions and 23 deletions

View File

@@ -20,6 +20,7 @@ from src.integrations.june.models.login import (
)
from src.integrations.june.models.redeem import AuthenticateModel
from src.integrations.june.utils.utils import ShareCodeUtils, decode_and_decompress
from src.utils.crypto import AESKey, decrypt_with_aes
class SixClient:
@@ -116,23 +117,6 @@ class SixClient:
return True
return False
def login_remote_apple_account(
self, account: AppleAccountModel
) -> AppleSixResponseModel[dict]:
response = self._do_post(
{
"token": Config.user_info.token,
"account": account.account,
"pwd": account.password,
"isStore": 2,
"guid": "",
"serviceIpIndex": -1,
},
"ApiItunesLogin",
)
response.Data = json.loads(response.Data)
return AppleSixResponseModel[dict].model_validate(response.model_dump())
def get_sign_sap_setup(
self, reties: int = 3
) -> AppleSixResponseModel[LoginSignatureModel] | None:
@@ -181,7 +165,13 @@ class SixClient:
),
"appleId": account.account,
"guid": "",
"applePwd": account.password,
"applePwd": decrypt_with_aes(
account.password,
AESKey.load_from_base64(
"P0x6Gy6dXIpPbhE7PHxaHbfZHhsbT2qNPlx3qbHTP1o="
),
AESKey.load_from_base64("nywao1XkDXeYwbPeWh+SxA=="),
),
"intptr_": sign.Data.adder1,
"intPtr": sign.Data.adder2,
"idType": 1,
@@ -217,3 +207,4 @@ class SixClient:
response.Data.guid = parse.unquote_plus(response.Data.guid)
response.Data.post = parse.unquote_plus(response.Data.post)
return response
ƒ

View File

@@ -79,11 +79,7 @@ class MasterNodeService:
return RechargeQueryModel()
self.__account = result.data.account
self.__password = decrypt_with_aes(
result.data.password,
AESKey.load_from_base64("P0x6Gy6dXIpPbhE7PHxaHbfZHhsbT2qNPlx3qbHTP1o="),
AESKey.load_from_base64("nywao1XkDXeYwbPeWh+SxA=="),
)
self.__password = result.data.password
result.data.password = self.__password
return result.data