You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
elink ed8e8f47ca 更新 'README_zh.md' 2 years ago
.idea update doc 3 years ago
app update doc 3 years ago
gradle/wrapper first commit 4 years ago
.gitignore first commit 4 years ago
README.md update doc 3 years ago
README_zh.md 更新 'README_zh.md' 2 years ago
build.gradle first commit 4 years ago
gradle.properties first commit 4 years ago
gradlew first commit 4 years ago
gradlew.bat first commit 4 years ago
settings.gradle first commit 4 years ago

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:1.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