feat: 更新项目配置和功能模块
- 修改Package.swift以支持iOS 15和macOS 12。 - 更新swift-tca-architecture-guidelines.mdc中的alwaysApply设置为false。 - 注释掉AppDelegate中的NIMSDK导入,移除不再使用的NIMConfigurationManager和NIMSessionManager文件。 - 添加新的API相关文件,包括EMailLoginFeature、IDLoginFeature和相关视图,增强登录功能。 - 更新APIConstants和APIEndpoints以反映新的API路径。 - 添加本地化支持文件,包含英文和中文简体的本地化字符串。 - 新增字体管理和安全工具类,支持AES和DES加密。 - 更新Xcode项目配置,调整版本号和启动画面设置。
This commit is contained in:
51
yana/Utils/Security/DESEncryptOCTest.swift
Normal file
51
yana/Utils/Security/DESEncryptOCTest.swift
Normal file
@@ -0,0 +1,51 @@
|
||||
import Foundation
|
||||
|
||||
/// OC版本DES加密测试
|
||||
struct DESEncryptOCTest {
|
||||
|
||||
/// 测试 OC 版本的 DES 加密功能
|
||||
static func testOCDESEncryption() {
|
||||
print("🧪 开始测试 OC 版本的 DES 加密...")
|
||||
print(String(repeating: "=", count: 50))
|
||||
|
||||
let key = "1ea53d260ecf11e7b56e00163e046a26"
|
||||
let testCases = [
|
||||
"test123",
|
||||
"hello world",
|
||||
"password123",
|
||||
"sample_data",
|
||||
"encrypt_test"
|
||||
]
|
||||
|
||||
for testCase in testCases {
|
||||
if let encrypted = DESEncrypt.encryptUseDES(testCase, key: key) {
|
||||
print("✅ 加密成功:")
|
||||
print(" 原文: \"\(testCase)\"")
|
||||
print(" 密文: \(encrypted)")
|
||||
|
||||
// 测试解密
|
||||
if let decrypted = DESEncrypt.decryptUseDES(encrypted, key: key) {
|
||||
let isMatch = decrypted == testCase
|
||||
print(" 解密: \"\(decrypted)\" \(isMatch ? "✅" : "❌")")
|
||||
} else {
|
||||
print(" 解密: 失败 ❌")
|
||||
}
|
||||
} else {
|
||||
print("❌ 加密失败: \"\(testCase)\"")
|
||||
}
|
||||
print()
|
||||
}
|
||||
|
||||
print(String(repeating: "=", count: 50))
|
||||
print("🏁 OC版本DES加密测试完成")
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
extension DESEncryptOCTest {
|
||||
/// 在 AppDelegate 中调用此方法进行测试
|
||||
static func runInAppDelegate() {
|
||||
DESEncryptOCTest.testOCDESEncryption()
|
||||
}
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user