Crypto is a SAMPLE Rust Crate that showcases cross-platform compilation for different projects and environments. In terms of functinality and for LEARNING PURPOSE, it simulates 'encryption/decryption' by using base64 encoding/decoding
.
In order to fully understand the purpose of this repo, please refer to the follwing blog posts:
- Rust cross-platform... The Android part....
- TODO: Blog Post two
- TODO: Blog Post three
cargo build
-> builds the entire project.cargo test
-> run all the tests.
The Crypto Library is composed by a Rust Workspace containing a set of crates.
It is the core domain library, which contains the main logic for encryption/decryption.
$ cargo build // build the debug version of the project.
$ cargo build --release // build the release version of the project.
$ cargo test // run all the tests.
This crate fully depends on the crypto
crate and its main purpose is to act as a proxy between Rust and Android (Java/Kotlin) via JNI.
- Install the Android SDK and Android NDK.
- Make sure your
$ANDROID_HOME
is pointing to your SDK location. Mine:/home/fernando/Android/Sdk
. - Check that your
Android NDK
version matches the one inside the jni_crypto build.rs file.- In my case
$ANDROID_HOME/ndk/25.2.9519653
matches withANDROID_NDK_VERSION = "25.2.9519653"
insidebuild.rs
file.
- In my case
$ cargo build // build the debug version of the project.
$ cargo run --bin release // build the release version of the project for all android targets.
$ cargo run --bin publish // copy all the released libraries/crates inside the android project.
$ cargo test // run all the tests.
- Still a TODO
- Still a TODO