A easy way to store secret string value data in .so file by adding plugin
Using the plugin , We can add C++ code into module build file, so that we can build it
1、 Add the following code into your project build.gradle
because Jcenter will stop the service on May 1st
This project release plugin on jitpack.io
//your root project build.gradle
buildscript {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
classpath "com.github.ShowMeThe.Orca:plugin:2.3.6"
}
2、Add plguin into app or module build.gradle
plugins {
id 'com.android.application'
id 'Orca'
}
💥💥💥For Kotlin project please add the Orca.So before kotlin-android ❗
For Kotlin Project:
plugins {
id 'com.android.application'
id 'Orca'
id 'kotlin-android'
}
Using Orca-compile:
:app or :library
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'Orca'
id 'Orca-compiler'
}
dependencies{
implementation("com.github.ShowMeThe.Orca:orca-annotation:2.3.5")
}
and setting project.root build.gradle
buildscript{
dependencies {
classpath("com.github.ShowMeThe.Orca:plugin:2.3.6")
classpath("com.github.ShowMeThe.Orca:orca-compiler:2.3.6")
}
}
using Compiler example
object XXXClass{
@CoreDecryption("data") // The key name
var data = ""
}
In your app or library module build.gradle, add the follow-like configs to save key-values.
Orca.go{
storeSet{
"data"{
value "123456"
}
}
isBuildKotlin = true // if true it will build kotlin class , else it builds Java class
encryptMode = "AES" or "DES" //choose a different encryptMode , ignore case
isDebug = true // when isDebug is true , signature can be set as an empty string value. Default value is false
signature = "your .jks signature"
secretKey = "FTat46cvyia6758@243lid66wxzvwe23dgfhcfg76wsd@5as431aq1256dsaa211" //This is the default key , you must replace it
}
The name of "XXXX" in class name "XXXXCore" depends on what name you've set in project. Your projct name with first character upper case and plus 'Core' will be the final class name. Such as, the project name is :app and the class name will be 'AppCore'
val data = XXXXCore.getData()