Compare commits

...

3 Commits

Author SHA1 Message Date
Matéo Duparc 19ae8c6092
Update dependencies 2022-05-16 15:07:24 +02:00
Matéo Duparc fcc7d64b9d
Hide irrelevant options when selecting sessions 2022-05-10 13:05:35 +02:00
Matéo Duparc 81dc567ff0
Spanish translation 2022-05-10 12:58:46 +02:00
11 changed files with 295 additions and 114 deletions

View File

@ -26,8 +26,8 @@ AIRA is still under developement and is not ready for production usage yet. Not
# Download # Download
AIRA releases are availables in the "Release" section. All APKs are signed with my PGP key available on keyservers. To download it: AIRA releases are availables in the "Release" section. All APKs are signed with my PGP key available on keyservers. To download it:
`gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 007F84120107191E` \ `gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys AFE384344A45E13A` \
Fingerprint: `BD56 2147 9E7B 74D3 6A40 5BE8 007F 8412 0107 191E` \ Fingerprint: `B64E FE86 CEE1 D054 F082 1711 AFE3 8434 4A45 E13A` \
Email: `Hardcore Sushi <hardcore.sushi@disroot.org>` Email: `Hardcore Sushi <hardcore.sushi@disroot.org>`
Then, verify APK: `gpg --verify AIRA.apk.asc AIRA.apk` Then, verify APK: `gpg --verify AIRA.apk.asc AIRA.apk`
@ -39,12 +39,12 @@ __Don't install the APK if the verification fails!__
AIRA android uses some code from the desktop version which is written in Rust. Therefore, you need to compile this Rust code first. AIRA android uses some code from the desktop version which is written in Rust. Therefore, you need to compile this Rust code first.
``` ```
curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs | sh curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs | sh
rustup target add aarch64-linux-android armv7-linux-androideabi rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
``` ```
### Install NDK ### Install NDK
The Rust code uses a crate called "rusqlite" to store data in SQLite databases. This crates uses the original SQLite3 library written in C. Therefore, to compile it you need the Android NDK. You can find instructions to install the NDK here: https://developer.android.com/ndk/guides We also need the Android NDK to cross-compile the rust code to Android. Currently, only versions up to __r22b__ are supported. You can find instructions to install the NDK here: https://developer.android.com/ndk/guides
Once installed, you need to define the $ANDROID_NDK_HOME environment variable (if not already set): Once installed, you need to define the `$ANDROID_NDK_HOME` environment variable (if not already set):
``` ```
export ANDROID_NDK_HOME=/home/<user>/Android/SDK/ndk/<NDK version>" export ANDROID_NDK_HOME=/home/<user>/Android/SDK/ndk/<NDK version>"
``` ```

View File

@ -4,20 +4,20 @@ plugins {
} }
android { android {
compileSdkVersion 30 compileSdkVersion 32
buildToolsVersion "30.0.3" buildToolsVersion "32.0.0"
defaultConfig { defaultConfig {
applicationId "sushi.hardcore.aira" applicationId "sushi.hardcore.aira"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 30 targetSdkVersion 32
versionCode 2 versionCode 3
versionName "0.1.0" versionName "0.1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk { ndk {
abiFilters "x86", "armeabi-v7a", "arm64-v8a" abiFilters "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
} }
} }
@ -31,7 +31,7 @@ android {
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false // curve25519-android doesn't seem to support minification
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
@ -42,19 +42,20 @@ android {
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = '1.8'
} }
namespace 'sushi.hardcore.aira'
} }
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.appcompat:appcompat:1.4.1'
implementation "androidx.fragment:fragment-ktx:1.3.6" implementation "androidx.fragment:fragment-ktx:1.4.1"
implementation "androidx.preference:preference-ktx:1.1.1" implementation "androidx.preference:preference-ktx:1.2.0"
implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.android.material:material:1.6.0'
implementation 'net.i2p.crypto:eddsa:0.3.0' implementation 'net.i2p.crypto:eddsa:0.3.0'
implementation "org.whispersystems:curve25519-android:0.5.0" implementation "org.whispersystems:curve25519-android:0.5.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.github.bumptech.glide:glide:4.12.0' implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="sushi.hardcore.aira"
android:installLocation="auto"> android:installLocation="auto">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
@ -10,7 +9,6 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/> <uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove"/>
<application <application
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"

View File

@ -188,7 +188,10 @@ class MainActivity : ServiceBoundActivity() {
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.main_activity, menu) menuInflater.inflate(R.menu.main_activity, menu)
menu.findItem(R.id.remove_contact).isVisible = isSelecting() val isSelecting = isSelecting()
menu.findItem(R.id.settings).isVisible = !isSelecting
menu.findItem(R.id.close).isVisible = !isSelecting
menu.findItem(R.id.remove_contact).isVisible = isSelecting
return true return true
} }

View File

@ -18,8 +18,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99446914425f48a667458b33c7fb920e24cf9e7c149a072a9fc420731b353835" checksum = "99446914425f48a667458b33c7fb920e24cf9e7c149a072a9fc420731b353835"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cipher", "cipher 0.3.0",
"cpufeatures", "cpufeatures 0.1.0",
"opaque-debug", "opaque-debug",
] ]
@ -31,7 +31,7 @@ checksum = "614d3cc56d7840c3dba6ea1c1754afd3d0aa244c4902776b8d109a7be764f31f"
dependencies = [ dependencies = [
"aead", "aead",
"aes", "aes",
"cipher", "cipher 0.3.0",
"ctr", "ctr",
"ghash", "ghash",
"subtle", "subtle",
@ -45,7 +45,7 @@ checksum = "5e28b4604398f52cd06867fe0531b62b35f0edddb561e806945cbab9af7fe6a8"
dependencies = [ dependencies = [
"aead", "aead",
"aes", "aes",
"cipher", "cipher 0.3.0",
"ctr", "ctr",
"polyval", "polyval",
"subtle", "subtle",
@ -54,9 +54,14 @@ dependencies = [
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.4.7" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98"
dependencies = [
"getrandom 0.2.2",
"once_cell",
"version_check",
]
[[package]] [[package]]
name = "aira" name = "aira"
@ -76,10 +81,9 @@ dependencies = [
"rand 0.8.3", "rand 0.8.3",
"rusqlite", "rusqlite",
"scrypt", "scrypt",
"sha2", "sha2 0.10.2",
"strum_macros", "strum_macros",
"uuid", "uuid",
"x25519-dalek",
"zeroize", "zeroize",
] ]
@ -123,6 +127,15 @@ dependencies = [
"generic-array", "generic-array",
] ]
[[package]]
name = "block-buffer"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
dependencies = [
"generic-array",
]
[[package]] [[package]]
name = "byteorder" name = "byteorder"
version = "1.4.2" version = "1.4.2"
@ -162,6 +175,16 @@ dependencies = [
"generic-array", "generic-array",
] ]
[[package]]
name = "cipher"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e"
dependencies = [
"crypto-common",
"inout",
]
[[package]] [[package]]
name = "combine" name = "combine"
version = "4.5.2" version = "4.5.2"
@ -178,6 +201,15 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cd5a7748210e7ec1a9696610b1015e6e31fbf58f77a160801f124bd1c36592a" checksum = "5cd5a7748210e7ec1a9696610b1015e6e31fbf58f77a160801f124bd1c36592a"
[[package]]
name = "cpufeatures"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "cpuid-bool" name = "cpuid-bool"
version = "0.1.2" version = "0.1.2"
@ -185,13 +217,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
[[package]] [[package]]
name = "crypto-mac" name = "crypto-common"
version = "0.11.0" version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8"
dependencies = [ dependencies = [
"generic-array", "generic-array",
"subtle", "typenum",
] ]
[[package]] [[package]]
@ -200,7 +232,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481"
dependencies = [ dependencies = [
"cipher", "cipher 0.3.0",
] ]
[[package]] [[package]]
@ -210,7 +242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"digest", "digest 0.9.0",
"rand_core 0.5.1", "rand_core 0.5.1",
"subtle", "subtle",
"zeroize", "zeroize",
@ -225,6 +257,17 @@ dependencies = [
"generic-array", "generic-array",
] ]
[[package]]
name = "digest"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
dependencies = [
"block-buffer 0.10.2",
"crypto-common",
"subtle",
]
[[package]] [[package]]
name = "ed25519" name = "ed25519"
version = "1.0.3" version = "1.0.3"
@ -244,7 +287,7 @@ dependencies = [
"ed25519", "ed25519",
"rand 0.7.3", "rand 0.7.3",
"serde", "serde",
"sha2", "sha2 0.9.3",
"zeroize", "zeroize",
] ]
@ -304,30 +347,27 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.9.1" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [ dependencies = [
"ahash", "ahash",
] ]
[[package]] [[package]]
name = "hashlink" name = "hashlink"
version = "0.6.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d99cf782f0dc4372d26846bec3de7804ceb5df083c2d4462c0b8d2330e894fa8" checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf"
dependencies = [ dependencies = [
"hashbrown", "hashbrown",
] ]
[[package]] [[package]]
name = "heck" name = "heck"
version = "0.3.2" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
dependencies = [
"unicode-segmentation",
]
[[package]] [[package]]
name = "hex" name = "hex"
@ -337,22 +377,29 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]] [[package]]
name = "hkdf" name = "hkdf"
version = "0.11.0" version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01706d578d5c281058480e673ae4086a9f4710d8df1ad80a5b03e39ece5f886b" checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437"
dependencies = [ dependencies = [
"digest",
"hmac", "hmac",
] ]
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.11.0" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
dependencies = [ dependencies = [
"crypto-mac", "digest 0.10.3",
"digest", ]
[[package]]
name = "inout"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
dependencies = [
"generic-array",
] ]
[[package]] [[package]]
@ -389,9 +436,9 @@ checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929"
[[package]] [[package]]
name = "libsqlite3-sys" name = "libsqlite3-sys"
version = "0.22.1" version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19cb1effde5f834799ac5e5ef0e40d45027cd74f271b1de786ba8abb30e2164d" checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14"
dependencies = [ dependencies = [
"cc", "cc",
"pkg-config", "pkg-config",
@ -422,6 +469,12 @@ version = "2.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
[[package]]
name = "once_cell"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
[[package]] [[package]]
name = "opaque-debug" name = "opaque-debug"
version = "0.3.0" version = "0.3.0"
@ -430,9 +483,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]] [[package]]
name = "password-hash" name = "password-hash"
version = "0.3.0" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ad7268ef9bc463fddde8361d358fbfae1aeeb1fb62eca111cd8c763bf1c5891" checksum = "e029e94abc8fb0065241c308f1ac6bc8d20f450e8f7c5f0b25cd9b8d526ba294"
dependencies = [ dependencies = [
"base64ct", "base64ct",
"rand_core 0.6.2", "rand_core 0.6.2",
@ -441,11 +494,11 @@ dependencies = [
[[package]] [[package]]
name = "pbkdf2" name = "pbkdf2"
version = "0.9.0" version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
dependencies = [ dependencies = [
"crypto-mac", "digest 0.10.3",
] ]
[[package]] [[package]]
@ -460,7 +513,7 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "864231b0b86ce05168a8e6da0fea2e67275dacf25f75b00a62cfd341aab904a9" checksum = "864231b0b86ce05168a8e6da0fea2e67275dacf25f75b00a62cfd341aab904a9"
dependencies = [ dependencies = [
"cpufeatures", "cpufeatures 0.1.0",
"opaque-debug", "opaque-debug",
"universal-hash", "universal-hash",
] ]
@ -572,9 +625,9 @@ dependencies = [
[[package]] [[package]]
name = "rusqlite" name = "rusqlite"
version = "0.25.1" version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbc783b7ddae608338003bac1fa00b6786a75a9675fbd8e87243ecfdea3f6ed2" checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"fallible-iterator", "fallible-iterator",
@ -586,12 +639,18 @@ dependencies = [
] ]
[[package]] [[package]]
name = "salsa20" name = "rustversion"
version = "0.8.0" version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c7c5f10864beba947e1a1b43f3ef46c8cc58d1c2ae549fa471713e8ff60787a" checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
[[package]]
name = "salsa20"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
dependencies = [ dependencies = [
"cipher", "cipher 0.4.3",
] ]
[[package]] [[package]]
@ -605,15 +664,15 @@ dependencies = [
[[package]] [[package]]
name = "scrypt" name = "scrypt"
version = "0.8.0" version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f2cc535b6997b0c755bf9344e71ca0e1be070d07ff792f1fcd31e7b90e07d5f" checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d"
dependencies = [ dependencies = [
"hmac", "hmac",
"password-hash", "password-hash",
"pbkdf2", "pbkdf2",
"salsa20", "salsa20",
"sha2", "sha2 0.10.2",
] ]
[[package]] [[package]]
@ -628,13 +687,24 @@ version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de"
dependencies = [ dependencies = [
"block-buffer", "block-buffer 0.9.0",
"cfg-if", "cfg-if",
"cpuid-bool", "cpuid-bool",
"digest", "digest 0.9.0",
"opaque-debug", "opaque-debug",
] ]
[[package]]
name = "sha2"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676"
dependencies = [
"cfg-if",
"cpufeatures 0.2.2",
"digest 0.10.3",
]
[[package]] [[package]]
name = "signature" name = "signature"
version = "1.3.0" version = "1.3.0"
@ -649,13 +719,14 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
[[package]] [[package]]
name = "strum_macros" name = "strum_macros"
version = "0.21.1" version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion",
"syn", "syn",
] ]
@ -710,15 +781,9 @@ dependencies = [
[[package]] [[package]]
name = "typenum" name = "typenum"
version = "1.12.0" version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]]
name = "unicode-segmentation"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
[[package]] [[package]]
name = "unicode-xid" name = "unicode-xid"
@ -738,9 +803,9 @@ dependencies = [
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "0.8.2" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" checksum = "8cfcd319456c4d6ea10087ed423473267e1a071f3bc0aa89f80d60997843c6f0"
dependencies = [ dependencies = [
"getrandom 0.2.2", "getrandom 0.2.2",
] ]
@ -811,22 +876,11 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "x25519-dalek"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088"
dependencies = [
"curve25519-dalek",
"rand_core 0.5.1",
"zeroize",
]
[[package]] [[package]]
name = "zeroize" name = "zeroize"
version = "1.4.1" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "377db0846015f7ae377174787dd452e1c5f5a9050bc6f954911d01f116daa0cd" checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd"
dependencies = [ dependencies = [
"zeroize_derive", "zeroize_derive",
] ]

View File

@ -14,18 +14,17 @@ crate-type = ["dylib"]
rand = "0.8" rand = "0.8"
rand-7 = {package = "rand", version = "0.7"} rand-7 = {package = "rand", version = "0.7"}
lazy_static = "1.4" lazy_static = "1.4"
rusqlite = { version = "0.25", features = ["bundled"] } rusqlite = { version = "0.27", features = ["bundled"] }
ed25519-dalek = "1" #for singing ed25519-dalek = "1" #for singing
x25519-dalek = "1.1" #for shared secret sha2 = "0.10"
sha2 = "0.9" hkdf = "0.12"
hkdf = "0.11"
aes-gcm = "0.9" #PSEC aes-gcm = "0.9" #PSEC
aes-gcm-siv = "0.10" #Database aes-gcm-siv = "0.10" #Database
hmac = "0.11" hmac = "0.12"
hex = "0.4" hex = "0.4"
strum_macros = "0.21" #display enums strum_macros = "0.24" #display enums
uuid = { version = "0.8", features = ["v4"] } uuid = { version = "1.0", features = ["v4"] }
scrypt = "0.8" scrypt = "0.10"
zeroize = "1.4" zeroize = "1.3"
log = "0.4" log = "0.4"
android_log = "0.1" android_log = "0.1"

View File

@ -4,10 +4,15 @@ if [ -z ${ANDROID_NDK_HOME+x} ]; then
echo "Error: \$ANDROID_NDK_HOME is not defined." echo "Error: \$ANDROID_NDK_HOME is not defined."
else else
export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH
declare -a androidABIs=("arm64-v8a" "armeabi-v7a" "x86") export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang
declare -a targets=("aarch64-linux-android" "armv7-linux-androideabi" "i686-linux-android") export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang
export CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android21-clang
export CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android21-clang
declare -a androidABIs=("arm64-v8a" "armeabi-v7a" "x86_64" "x86")
declare -a targets=("aarch64-linux-android" "armv7-linux-androideabi" "x86_64-linux-android" "i686-linux-android")
for (( i=0; i < ${#targets[@]}; i++ )) do for (( i=0; i < ${#targets[@]}; i++ )) do
cargo build --target ${targets[i]} --release cargo build --target ${targets[i]} --release || exit 1
cp target/${targets[i]}/release/libaira.so ../jniLibs/${androidABIs[i]}/ TARGET_DIR=../jniLibs/${androidABIs[i]}
mkdir -p $TARGET_DIR && cp target/${targets[i]}/release/libaira.so $TARGET_DIR
done done
fi fi

View File

@ -1,7 +1,7 @@
use std::{convert::TryInto, fmt::Display}; use std::{convert::TryInto, fmt::Display};
use hkdf::Hkdf; use hkdf::Hkdf;
use sha2::Sha384; use sha2::Sha384;
use hmac::{Hmac, NewMac, Mac}; use hmac::{Hmac, Mac};
use scrypt::{scrypt, Params}; use scrypt::{scrypt, Params};
use rand::{RngCore, rngs::OsRng}; use rand::{RngCore, rngs::OsRng};
use aes_gcm::{aead::Aead, NewAead, Nonce}; use aes_gcm::{aead::Aead, NewAead, Nonce};
@ -148,7 +148,7 @@ pub fn verify_handshake_finished(peer_handshake_finished: [u8; HASH_OUTPUT_LEN],
hkdf_expand_label(&peer_handshake_traffic_secret, "finished", None, &mut peer_finished_key); hkdf_expand_label(&peer_handshake_traffic_secret, "finished", None, &mut peer_finished_key);
let mut hmac = Hmac::<Sha384>::new_from_slice(&peer_finished_key).unwrap(); let mut hmac = Hmac::<Sha384>::new_from_slice(&peer_finished_key).unwrap();
hmac.update(&handshake_hash); hmac.update(&handshake_hash);
hmac.verify(&peer_handshake_finished).is_ok() hmac.verify_slice(&peer_handshake_finished).is_ok()
} }

View File

@ -0,0 +1,121 @@
<resources>
<string name="app_name">AIRA</string>
<string name="create_identity_test">Crear una nueva identidad:</string>
<string name="identity_name">Nombre de la identidad</string>
<string name="password_hint">Contraseña</string>
<string name="password_confirm_hint">Contraseña (confirmación)</string>
<string name="create">Crear</string>
<string name="password_mismatch">¡Las contraseñas no coinciden!</string>
<string name="online_peers">Pares en línea:</string>
<string name="offline_contacts">Contactos desconectados:</string>
<string name="identity_create_failed">Fallo al crear la identidad</string>
<string name="identity_load_failed">Fallo al cargar la identidad. Por favor, verifica tu contraseña</string>
<string name="service_name">Servicio en segundo plano de AIRA</string>
<string name="login">Acceder</string>
<string name="add_peer_ip">Añadir pares por IP</string>
<string name="unknown">Desconocido</string>
<string name="file_saved">Archivo guardado en %s !</string>
<string name="enter_password">Ingresa tu contraseña:</string>
<string name="yes"></string>
<string name="no">No</string>
<string name="warning">¡Advertencia!</string>
<string name="ask_log_out">¿En verdad quieres cerrar sesión? (No recibirás nuevos mensajes hasta que accedas nuevamente)</string>
<string name="cancel">Cancelar</string>
<string name="background_service">Servicio en segundo plano</string>
<string name="verifying_contact">Verificación del contacto</string>
<string name="fingerprints_instructions">Compara las siguientes huellas digitales por un modo de comunicación seguro (como en persona) y asegurate de que coinciden..</string>
<string name="local_fingerprint">Huellas digital local:</string>
<string name="peer_fingerprint">Huellas digital del par:</string>
<string name="summary_name">El nombre de tu identiad. Se muestra a todas las sesiones activas.</string>
<string name="delete_identity">Eliminar identidad</string>
<string name="summary_delete_identity">Eliminar todos tus datos. Ya no podrás ser reconocido por tus contactos.</string>
<string name="preference_password">Contraseña de identidad</string>
<string name="summary_password">Sin esta contraseña no puedes acceder a tus datos ni ser reconocido por tus contactos.</string>
<string name="change_password">Cambiar contraseña:</string>
<string name="ok">De acuerdo</string>
<string name="change_password_failed">Operación fallida. Por favor, compruebe su antigua contraseña.</string>
<string name="error">Error</string>
<string name="current_password">Contraseña actual</string>
<string name="new_password">Nueva contraseña (vacío para no usar contraseña)</string>
<string name="new_password_confirm">Nueva contraseña (confirmación)</string>
<string name="confirm_delete">¿Estás seguro de que quieres eliminar todas tus conversaciones (mensajes y archivos), todos tus contactos y tu clave privada?</string>
<string name="they_match">Coinciden</string>
<string name="ask_delete_conversation">Borrar una conversación sólo te afecta a ti. Tu contacto seguirá teniendo una copia de esta conversación si no la borra también. ¿Realmente quieres borrar toda esta conversación (mensajes y archivos)?</string>
<string name="delete">Eliminar</string>
<string name="ask_remove_contact">Al borrar el contacto se eliminará su clave de identidad y su conversación (mensajes y archivos). Ya no podrás reconocerlo. Esta acción sólo te afecta a ti. ¿Realmente quieres eliminar este contacto?</string>
<string name="ask_remove_contacts">Al borrar los contactos se eliminarán sus claves de identidad y sus conversaciones (mensajes y archivos). Ya no podrás reconocerlos. Esta acción sólo te afecta a ti. ¿Realmente quieres eliminar estos contactos?</string>
<string name="enable_password">Encriptar con contraseña</string>
<string name="msg_notification_channel_name">Nuevos mensajes</string>
<string name="mark_read">Marcar como leído</string>
<string name="ask_file_notification_channel">Solicitudes de descarga de archivos</string>
<string name="db_mkdir_failed">Fallo en la creación del directorio de bases de datos</string>
<string name="want_to_send_files">%s quiere enviarte algunos archivos</string>
<string name="download_file_request">Solicitud de descarga de archivos</string>
<string name="download">Descargar</string>
<string name="refuse">Rechazar</string>
<string name="file_transfers">Transferencias de archivos</string>
<string name="transfer_aborted">Transferencia abortada</string>
<string name="transfer_completed">Transferencia completa</string>
<string name="reply">Responder</string>
<string name="open_uri_failed">Fallo en la apertura de la URI</string>
<string name="ask_send_single_file">¿Enviar %s (%s) a %s ?</string>
<string name="ask_send_multiple_files">¿Enviar %d archivos a %s?</string>
<string name="share_label">Enviar con AIRA</string>
<string name="identity_fingerprint">La huella digital de tu identidad:</string>
<string name="fingerprint">Huella digital:</string>
<string name="peer_ip">IP de par:</string>
<string name="connection">Conexión:</string>
<string name="outgoing">Saliente</string>
<string name="incoming">Entrante</string>
<string name="delete_conversation">Eliminar la convesación</string>
<string name="verify">Verificando</string>
<string name="add_contact">Añadir contacto</string>
<string name="remove_contact">Eliminar contacto</string>
<string name="details">Detalles</string>
<string name="your_addresses">Tu dirección IP:</string>
<string name="file_transfer_already_in_progress">Ya está en marcha otra transferencia de archivos</string>
<string name="settings">Configuraciones</string>
<string name="log_out">Cerrar sesión</string>
<string name="copied">¡Copiado al portapapeles!</string>
<string name="identity">Identidad</string>
<string name="about">Acerca de</string>
<string name="version">Versión de AIRA</string>
<string name="refresh_profile">Actualizar perfil</string>
<string name="security">Seguridad</string>
<string name="use_psec_padding">Usar PSEC padding</string>
<string name="psec_padding_summary">PSEC padding ofusca la longitud de sus mensajes pero utiliza más ancho de banda de la red.</string>
<string name="is_contact">Es un contacto:</string>
<string name="is_verified">Está verificado:</string>
<string name="avatar_too_large">El avatar no puede ser mayor de 10MB.</string>
<string name="your_avatar">Tu avatar:</string>
<string name="set_a_new_one">Establecer uno nuevo</string>
<string name="remove">Eliminar</string>
<string name="choose_avatar">Seleccionar avatar</string>
<string name="message_hint">Enviar un mensaje…</string>
<string name="no_name_error">¡Esta sesión no tiene nombre!</string>
<string name="invalid_ip">Dirección IP inválida</string>
<string name="unable_to_connect_to">No se puede conectar con %s</string>
<string name="github">GitHub</string>
<string name="github_summary">Repositorio AIRA-android en GitHub.</string>
<string name="gitea">Gitea</string>
<string name="gitea_summary">Repositorio AIRA-android en la instancia Gitea del proyecto Chapril. A diferencia de GitHub, Gitea es un software totalmente libre y autoalojado.</string>
<string name="offline_warning_title">Su contacto parece estar desconectado.</string>
<string name="offline_warning_msg">Los mensajes enviados se almacenarán hasta que se establezca la conexión.</string>
<string name="pending_messages">Mensajes pendientes:</string>
<string name="sending_pending_messages">Enviando de mensajes pendientes…</string>
<string name="stop">Detener</string>
<string name="app">Aplicación</string>
<string name="start_at_boot">Iniciar el servicio AIRA en el arranque</string>
<string name="start_at_boot_summary">Si se desactiva, no recibirás mensajes hasta que abras la aplicación manualmente.</string>
<string name="start_at_boot_summary_identity_protected">Sólo está disponible si la identidad no está protegida por una contraseña.</string>
<!--accessibility strings-->
<string name="send_file">Enviar archivo</string>
<string name="trust_level_indicator">Indicador del nivel de confianza</string>
<string name="send_message">Envíar mensaje</string>
<string name="show_your_ips">Muestra tus IPs</string>
<string name="clickable_indicator">Indicador de clicks</string>
<string name="avatar">Avatar</string>
<string name="name">Nombre</string>
<string name="warning_desc">Icono de advertencia</string>
</resources>

View File

@ -1,11 +1,11 @@
buildscript { buildscript {
ext.kotlin_version = "1.5.21" ext.kotlin_version = "1.6.21"
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.2' classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }

View File

@ -1,6 +1,6 @@
#Thu Sep 02 16:55:14 UTC 2021 #Thu Sep 02 16:55:14 UTC 2021
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME