Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
陈福行 f6263f266f 更新广播数据解析错误的问题 il y a 1 an
.idea 更新广播数据解析错误的问题 il y a 1 an
app 更新广播数据解析错误的问题 il y a 1 an
gradle/wrapper 更新广播数据解析错误的问题 il y a 1 an
.gitignore first commit il y a 4 ans
README.md 更新 'README.md' il y a 2 ans
README_zh.md 更新 'README_zh.md' il y a 2 ans
build.gradle 更新广播数据解析错误的问题 il y a 1 an
gradle.properties first commit il y a 4 ans
gradlew first commit il y a 4 ans
gradlew.bat first commit il y a 4 ans
settings.gradle first commit il y a 4 ans

README.md

AILinkSecretToolDemo_Android

中文

1、Usage description

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

2、Necessary condition

  • 1. Acquired AILink Bluetooth communication protocol
  • 2. Have smart devices that support AILink Bluetooth module
  • 3. Have knowledge of Android native development and debugging

3、Applicable conditions

  • 1. Develop your own native platform app
  • 2. Use RN, Uniapp, Flutter and other cross-platform technologies to develop apps

四、Import SDK

	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:2.0.0'

        }
    3.Configure java1.8 in gradle
        android {
            ...
            compileOptions {
                sourceCompatibility 1.8
                targetCompatibility 1.8
            }
            repositories {
                flatDir {
                    dirs 'libs'
                }
            }
        }

4、SDK provides method classes AnalyticalDataUtil.java




/**
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);

5、How to use

For specific usage, please refer to AILinkSecretToolDemo