This project mainly does the following things:
- Integrate the java and so files generated by Bangcle WhiteCrypto System
- Generate the
CryptoUtils.java
andKeys.java
files automatically- The
CryptoUtils.java
is a simplified wrapper of Bangcle's crypto tools - The
Keys.java
contains the encrypted keys which are encrypted at build time
- The
After you clone this repostory, you need to copy the java and so files generated by Bangcle WhiteCrypto System into the corresponding directory in lib-exported
module. And then you need to configure the generator-plugin in the lib-exported/build.gradle
.
apply plugin: 'bangcle'
bangcle {
aesKeyHex = ... // Hex string of your AES key
ivHex = ... // Hex string of your AES iv
bangcleKey1 = ... // WhiteCrypto encryption key
bangcleKey2 = ... // WhiteCrypto decryption key
genPackage = ... // Target package of the generated java files
keys {
// key ConstantFiledName, SecretKeyValue
key ..., ...
}
}
Note that the generator-plugin will use AES/ECB/PKCS5Padding
encryption algorithm to encrypt the keys if you don't provide the ivHex
. Otherwise will use AES/CBC/PKCS5Padding
encryption algorithm. You can generate random AES keys and ivs at https://asecuritysite.com/encryption/keygen.