|
3 년 전 | |
---|---|---|
.idea | 3 년 전 | |
app | 3 년 전 | |
gradle/wrapper | 4 년 전 | |
.gitignore | 4 년 전 | |
README.md | 3 년 전 | |
README_zh.md | 3 년 전 | |
build.gradle | 4 년 전 | |
gradle.properties | 4 년 전 | |
gradlew | 4 년 전 | |
gradlew.bat | 4 년 전 | |
settings.gradle | 4 년 전 |
AILinkSecretAndroid is a Bluetooth encryption and decryption toolkit developed using java/c++ on the Android platform. The development kit can scan and connect to smart devices using AILink Bluetooth modules, and is responsible for the handshake between App and Bluetooth modules and the encryption and decryption of A7 data
1. Add the JitPack repository to your build file
Add this to the root build.gradle at the end of the repository:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
2. Add dependencies
dependencies {
...
implementation 'com.github.elinkthings:AILinkSecretAndroid:1.0.0'
}
3.Configure java1.8 in gradle
android {
...
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
repositories {
flatDir {
dirs 'libs'
}
}
}
/**
The app sends this A6 data to actively start handshake with ble, and the return byte[] needs to be sent to ble actively
*/
byte[] initHandshakeArr();
/**
If you can get BluetoothGatt, it is easier to call the sendHandshake method to send a handshake
*/
void sendHandshake(final BluetoothGatt gatt);
/**
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 and return byte[] and need to actively send it to ble
*/
byte[] initHandshakeArrPwd(byte[] hex);
/**
If you can get BluetoothGatt, it is easier to call the sendHandshakePwd method to send a handshake
*/
void sendHandshakePwd(byte[] hex);
/**
A7 data decryption method
*/
byte[] mcuDecrypt(byte[] hex, String mac);
/**
A7 data encryption method, cid is the product ID, and the ble protocol will include
*/
byte[] mcuEncrypt(int cid, String mac, byte[] payload);
/**
Broadcast data decryption method
*/
byte[] decryptBroadcast(byte[] payload);
For specific usage, please refer to AILinkSecretToolDemo