|
3 lat temu | |
---|---|---|
AILinkSecretTool.framework | 3 lat temu | |
AILinkSecretToolDemo | 3 lat temu | |
ReadMe.md | 3 lat temu |
AILinkSecretTool.framework is a Bluetooth encryption and decryption toolkit developed using ObjectiveC on the iOS platform. The development toolkit can scan and connect to smart devices using AILink Bluetooth module, and is responsible for the handshake between App and Bluetooth module and the encryption and decryption of A7 data. .
@interface ELEncryptTool: NSObject
/**
The app sends this A6 data to actively start a handshake with ble
*/
+(NSData *)handshake;
/**
This method encrypts the A6 data of the ble test app and sends the app to the device, otherwise the device will disconnect the app
*/
+(NSData *)blueToothHandshakeWithData:(NSData *)receiveData;
/**
A7 data encryption/decryption method
*/
+ (NSData *)encryptXOR:(NSData *)macXOR deviceTypeXOR:(NSData *)deviceTypeXOR withXORData:(NSData *)dataXOR;
/// AILink broadcast equipment (eg:broadcast body fat scale, broadcast nutrition scale) decryption method
/// @param encryptData
+ (NSData *)broadcastDecryptTEA:(NSData * _Nonnull)encryptData cid:(Byte)cid vid:(Byte)vid pid:(Byte)pid;
@end
For specific usage, please refer to AILinkSecretToolDemo
AILinkSecretTool.framework是在iOS平台使用ObjectiveC开发的蓝牙加解密工具包,该开发工具包能够扫描、连接使用AILink蓝牙模组的智能设备,负责App与蓝牙模组之间的握手与A7数据的加解密。
@interface ELEncryptTool : NSObject
/**
app发送此A6数据主动开始与ble进行握手
*/
+(NSData *)handshake;
/**
此方法将ble检验app的A6数据进行加密,app发给设备,否则设备将断开app
*/
+(NSData *)blueToothHandshakeWithData:(NSData *)receiveData;
/**
A7数据加/解密方法
*/
+ (NSData *)encryptXOR:(NSData *)macXOR deviceTypeXOR:(NSData *)deviceTypeXOR withXORData:(NSData *)dataXOR;
/// AILink广播设备(广播体脂秤、广播营养秤)解密方法
/// @param encryptData 广播数据中加密数据
+ (NSData *)broadcastDecryptTEA:(NSData * _Nonnull)encryptData cid:(Byte)cid vid:(Byte)vid pid:(Byte)pid;
@end
具体用法详见AILinkSecretToolDemo