diff --git a/.github/workflows/elementr.yml b/.github/workflows/elementr.yml
new file mode 100644
index 0000000000..b539044f30
--- /dev/null
+++ b/.github/workflows/elementr.yml
@@ -0,0 +1,37 @@
+name: ER APK Build
+
+on:
+ pull_request: { }
+ push:
+ branches: [ develop ]
+
+# Enrich gradle.properties for CI/CD
+env:
+ GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
+ CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon
+
+jobs:
+ debug:
+ name: Build debug APKs ER
+ runs-on: ubuntu-latest
+ if: github.ref != 'refs/heads/main'
+ strategy:
+ fail-fast: false
+ matrix:
+ target: [ Gplay, Fdroid ]
+ # Allow all jobs on develop. Just one per PR.
+ concurrency:
+ group: ${{ github.ref == 'refs/heads/develop' && format('integration-tests-develop-{0}-{1}', matrix.target, github.sha) || format('build-debug-{0}-{1}', matrix.target, github.ref) }}
+ cancel-in-progress: true
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/cache@v3
+ with:
+ path: |
+ ~/.gradle/caches
+ ~/.gradle/wrapper
+ key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
+ restore-keys: |
+ ${{ runner.os }}-gradle-
+ - name: Assemble ${{ matrix.target }} debug apk
+ run: ./gradlew assemble${{ matrix.target }}RustCryptoDebug $CI_GRADLE_ARG_PROPERTIES
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 51c1b32e82..fb06a2f647 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -38,7 +38,7 @@ jobs:
yes n | towncrier build --version nightly
- name: Build and upload Gplay Nightly APK
run: |
- ./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES
+ ./gradlew assembleGplayKotlinCryptoNightly appDistributionUploadGplayKotlinCryptoNightly $CI_GRADLE_ARG_PROPERTIES
env:
ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }}
ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }}
diff --git a/.github/workflows/nightly_er.yml b/.github/workflows/nightly_er.yml
new file mode 100644
index 0000000000..dd6cead1f8
--- /dev/null
+++ b/.github/workflows/nightly_er.yml
@@ -0,0 +1,46 @@
+name: Build and release Element R nightly APK
+
+on:
+ schedule:
+ # Every nights at 4
+ - cron: "0 4 * * *"
+
+env:
+ GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
+ CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon
+
+jobs:
+ nightly:
+ name: Build and publish ER nightly Gplay APK to Firebase
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python 3.8
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.8
+ - uses: actions/cache@v3
+ with:
+ path: |
+ ~/.gradle/caches
+ ~/.gradle/wrapper
+ key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
+ restore-keys: |
+ ${{ runner.os }}-gradle-
+ - name: Install towncrier
+ run: |
+ python3 -m pip install towncrier
+ - name: Prepare changelog file
+ run: |
+ mv towncrier.toml towncrier.toml.bak
+ sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml
+ rm towncrier.toml.bak
+ yes n | towncrier build --version nightly
+ - name: Build and upload Gplay Nightly APK
+ run: |
+ ./gradlew assembleGplayRustCryptoNightly appDistributionUploadGplayRustCryptoNightly $CI_GRADLE_ARG_PROPERTIES
+ env:
+ ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }}
+ ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }}
+ ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD }}
+ FIREBASE_TOKEN: ${{ secrets.ELEMENT_R_NIGHTLY_FIREBASE_TOKEN }}
diff --git a/docs/nightly_build.md b/docs/nightly_build.md
index 77cc676c7f..223fe14824 100644
--- a/docs/nightly_build.md
+++ b/docs/nightly_build.md
@@ -48,7 +48,7 @@ mv towncrier.toml towncrier.toml.bak
sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml
rm towncrier.toml.bak
yes n | towncrier build --version nightly
-./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES
+./gradlew assembleGplayKotlinCryptoNightly appDistributionUploadGplayKotlinCryptoNightly $CI_GRADLE_ARG_PROPERTIES
```
Then you can reset the change on the codebase.
diff --git a/library/rustCrypto/build.gradle b/library/rustCrypto/build.gradle
new file mode 100644
index 0000000000..8e92527ce1
--- /dev/null
+++ b/library/rustCrypto/build.gradle
@@ -0,0 +1,2 @@
+configurations.maybeCreate("default")
+artifacts.add("default", file('matrix-rust-sdk-crypto.aar'))
diff --git a/library/rustCrypto/matrix-rust-sdk-crypto.aar b/library/rustCrypto/matrix-rust-sdk-crypto.aar
new file mode 100644
index 0000000000..df5576f692
Binary files /dev/null and b/library/rustCrypto/matrix-rust-sdk-crypto.aar differ
diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle
index 92d1c067f3..88df357b19 100644
--- a/matrix-sdk-android/build.gradle
+++ b/matrix-sdk-android/build.gradle
@@ -236,7 +236,8 @@ dependencies {
implementation libs.google.phonenumber
// rustCryptoImplementation 'org.matrix.rustcomponents:crypto-android:0.2.1-SNAPSHOT'
- rustCryptoImplementation files('libs/matrix-rust-sdk-crypto.aar')
+// rustCryptoImplementation files('libs/matrix-rust-sdk-crypto.aar')
+ rustCryptoApi project(":library:rustCrypto")
testImplementation libs.tests.junit
// Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281
diff --git a/settings.gradle b/settings.gradle
index d35476f769..ea20f12175 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -12,5 +12,6 @@ include ':library:external:jsonviewer'
include ':library:external:diff-match-patch'
include ':library:external:dialpad'
+include ':library:rustCrypto'
include ':matrix-sdk-android'
include ':matrix-sdk-android-flow'
diff --git a/vector-app/build.gradle b/vector-app/build.gradle
index 35db6d12a4..30b48ed8ab 100644
--- a/vector-app/build.gradle
+++ b/vector-app/build.gradle
@@ -65,6 +65,27 @@ def getVersionCode() {
}
}
+def getNightlyUniversalApkPath() {
+ def taskNames = gradle.getStartParameter().taskNames.toString()
+ if(taskNames.contains("RustCryptoNightly")) {
+ return "vector-app/build/outputs/apk/gplayRustCrypto/nightly/vector-gplay-rustCrypto-universal-nightly.apk"
+ } else if (taskNames.contains("KoltinCryptoNightly")) {
+ return "vector-app/build/outputs/apk/gplayKotlinCrypto/nightly/vector-gplay-kotlinCrypto-universal-nightly.apk"
+ } else {
+ return ""
+ }
+}
+
+def getFirebaseAppId() {
+ def taskNames = gradle.getStartParameter().taskNames.toString()
+ if(taskNames.contains("RustCryptoNightly")) {
+ return "1:912726360885:android:94fb99347eaa36d100427c"
+ } else if (taskNames.contains("KoltinCryptoNightly")) {
+ return "1:912726360885:android:efd8545af52a9f9300427c"
+ } else {
+ return ""
+ }
+}
static def gitRevision() {
def cmd = "git rev-parse --short=8 HEAD"
return cmd.execute().text.trim()
@@ -115,8 +136,6 @@ project.android.buildTypes.all { buildType ->
// 64 bits have greater value than 32 bits
ext.abiVersionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86": 3, "x86_64": 4].withDefault { 0 }
-apply from: '../flavor.gradle'
-
android {
namespace "im.vector.application"
// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
@@ -230,8 +249,6 @@ android {
debug {
applicationIdSuffix ".debug"
signingConfig signingConfigs.debug
- resValue "string", "app_name", "Element dbg"
- resValue "color", "launcher_background", "#0DBD8B"
if (project.hasProperty("coverage")) {
testCoverageEnabled = coverage.enableTestCoverage
@@ -239,8 +256,6 @@ android {
}
release {
- resValue "string", "app_name", "Element"
- resValue "color", "launcher_background", "#0DBD8B"
postprocessing {
removeUnusedCode true
removeUnusedResources true
@@ -257,7 +272,6 @@ android {
applicationIdSuffix ".nightly"
versionNameSuffix "-nightly"
// Just override the background color of the launcher icon for the nightly build.
- resValue "color", "launcher_background", "#07007E"
// We need to copy paste this block, this is not done automatically by `initWith release`
postprocessing {
removeUnusedCode true
@@ -274,13 +288,13 @@ android {
// We upload the universal APK to fix this error:
// "App Distribution found more than 1 output file for this variant.
// Please contact firebase-support@google.com for help using APK splits with App Distribution."
- artifactPath = "$rootDir/vector-app/build/outputs/apk/gplay/nightly/vector-gplay-universal-nightly.apk"
+ artifactPath = "$rootDir/${getNightlyUniversalApkPath()}"
// This file will be generated by the GitHub action
releaseNotesFile = "CHANGES_NIGHTLY.md"
groups = "external-testers"
// This should not be required, but if I do not add the appId, I get this error:
// "App Distribution halted because it had a problem uploading the APK: [404] Requested entity was not found."
- appId = "1:912726360885:android:efd8545af52a9f9300427c"
+ appId = "${getFirebaseAppId()}"
}
}
}
@@ -323,12 +337,26 @@ android {
}
rustCrypto {
dimension "crypto"
+ applicationIdSuffix ".corroded"
+ versionNameSuffix "-R"
+ resValue "string", "app_name", "ER"
+
// // versionName "${versionMajor}.${versionMinor}.${versionPatch}${getFdroidVersionSuffix()}"
buildConfigField "String", "CRYPTO_FLAVOR_DESCRIPTION", "\"rust-crypto\""
// buildConfigField "String", "FLAVOR_DESCRIPTION", "\"RustCrypto\""
}
}
+ variantFilter { variant ->
+ def names = variant.flavors*.name
+ def buildType = variant.buildType.name
+ // There is no nightly for fdroid
+ if (names.contains("fdroid") && buildType == "nightly") {
+ // Gradle ignores any variants that satisfy the conditions above.
+ setIgnore(true)
+ }
+ }
+
lintOptions {
lintConfig file("../tools/lint/lint.xml")
@@ -422,4 +450,3 @@ dependencies {
debugImplementation libs.androidx.fragmentTesting
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
}
-
diff --git a/vector-app/src/debug/res/values/strings.xml b/vector-app/src/debug/res/values/strings.xml
index a7b8e38634..6ec62e30c8 100644
--- a/vector-app/src/debug/res/values/strings.xml
+++ b/vector-app/src/debug/res/values/strings.xml
@@ -1,4 +1,5 @@
Rationale!
-
\ No newline at end of file
+ Element dbg
+
diff --git a/vector-app/src/fdroidRustCryptoNightly/res/values/colors.xml b/vector-app/src/fdroidRustCryptoNightly/res/values/colors.xml
new file mode 100644
index 0000000000..2ec78e4096
--- /dev/null
+++ b/vector-app/src/fdroidRustCryptoNightly/res/values/colors.xml
@@ -0,0 +1,4 @@
+
+
+ #FF5964
+
diff --git a/vector-app/src/fdroidRustCryptoNightly/res/xml/strings.xml b/vector-app/src/fdroidRustCryptoNightly/res/xml/strings.xml
new file mode 100644
index 0000000000..a32c843b46
--- /dev/null
+++ b/vector-app/src/fdroidRustCryptoNightly/res/xml/strings.xml
@@ -0,0 +1,4 @@
+
+
+ ER
+
diff --git a/vector-app/src/gplayRustCrypto/debug/google-services.json b/vector-app/src/gplayRustCrypto/debug/google-services.json
new file mode 100644
index 0000000000..cbf7387c21
--- /dev/null
+++ b/vector-app/src/gplayRustCrypto/debug/google-services.json
@@ -0,0 +1,40 @@
+{
+ "project_info": {
+ "project_number": "912726360885",
+ "firebase_url": "https://vector-alpha.firebaseio.com",
+ "project_id": "vector-alpha",
+ "storage_bucket": "vector-alpha.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:912726360885:android:94fb99347eaa36d100427c",
+ "android_client_info": {
+ "package_name": "im.vector.app.corroded.debug"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "912726360885-e87n3jva9uoj4vbidvijq78ebg02asv2.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyAFZX8IhIfgzdOZvxDP_ISO5WYoU7jmQ5c"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "912726360885-e87n3jva9uoj4vbidvijq78ebg02asv2.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
diff --git a/vector-app/src/gplayRustCrypto/nightly/google-services.json b/vector-app/src/gplayRustCrypto/nightly/google-services.json
new file mode 100644
index 0000000000..9eb7172825
--- /dev/null
+++ b/vector-app/src/gplayRustCrypto/nightly/google-services.json
@@ -0,0 +1,40 @@
+{
+ "project_info": {
+ "project_number": "912726360885",
+ "firebase_url": "https://vector-alpha.firebaseio.com",
+ "project_id": "vector-alpha",
+ "storage_bucket": "vector-alpha.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:912726360885:android:94fb99347eaa36d100427c",
+ "android_client_info": {
+ "package_name": "im.vector.app.corroded.nightly"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "912726360885-e87n3jva9uoj4vbidvijq78ebg02asv2.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyAFZX8IhIfgzdOZvxDP_ISO5WYoU7jmQ5c"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "912726360885-e87n3jva9uoj4vbidvijq78ebg02asv2.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
diff --git a/vector-app/src/gplayRustCryptoNightly/res/values/colors.xml b/vector-app/src/gplayRustCryptoNightly/res/values/colors.xml
new file mode 100644
index 0000000000..2ec78e4096
--- /dev/null
+++ b/vector-app/src/gplayRustCryptoNightly/res/values/colors.xml
@@ -0,0 +1,4 @@
+
+
+ #FF5964
+
diff --git a/vector-app/src/gplayRustCryptoNightly/res/xml/strings.xml b/vector-app/src/gplayRustCryptoNightly/res/xml/strings.xml
new file mode 100644
index 0000000000..a32c843b46
--- /dev/null
+++ b/vector-app/src/gplayRustCryptoNightly/res/xml/strings.xml
@@ -0,0 +1,4 @@
+
+
+ ER
+
diff --git a/vector-app/src/main/res/values/colors.xml b/vector-app/src/main/res/values/colors.xml
new file mode 100644
index 0000000000..7054ce2380
--- /dev/null
+++ b/vector-app/src/main/res/values/colors.xml
@@ -0,0 +1,4 @@
+
+
+ #0DBD8B
+
diff --git a/vector-app/src/nightly/res/values/colors.xml b/vector-app/src/nightly/res/values/colors.xml
new file mode 100644
index 0000000000..b486067f8d
--- /dev/null
+++ b/vector-app/src/nightly/res/values/colors.xml
@@ -0,0 +1,4 @@
+
+
+ #07007E
+
diff --git a/vector-app/src/nightly/res/xml/strings.xml b/vector-app/src/nightly/res/xml/strings.xml
new file mode 100644
index 0000000000..0fe50b273d
--- /dev/null
+++ b/vector-app/src/nightly/res/xml/strings.xml
@@ -0,0 +1,4 @@
+
+
+ Element Nightly
+
diff --git a/vector-app/src/release/res/values/strings.xml b/vector-app/src/release/res/values/strings.xml
new file mode 100644
index 0000000000..03dd833fc1
--- /dev/null
+++ b/vector-app/src/release/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+
+ Element
+