Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/tchap_v1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
giomfo committed Dec 18, 2020
2 parents 30d4af2 + b4551ca commit 66163c5
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 1,673 deletions.
1,511 changes: 0 additions & 1,511 deletions CHANGES.rst

This file was deleted.

51 changes: 9 additions & 42 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
# Important Announcement

The core team is now working mainly on [RiotX](https://github.com/vector-im/riotX-android). New contributions (PR, issues) are still welcome, but be aware that this codebase will be replaced in the future by the RiotX implementation.

# Contributing code to Matrix

Please read https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst

Android support can be found in this [![Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riot-android:matrix.org.svg?label=%23riot-android:matrix.org)](https://matrix.to/#/#riot-android:matrix.org) room.

# Specific rules for Matrix Android projects

## Android Studio settings

Please set the "hard wrap" setting of Android Studio to 160 chars, this is the setting we use internally to format the source code (Menu `Settings/Editor/Code Style` then `Hard wrap at`).

## Compilation

Riot Android uses by default the Matrix Android SDK library (file `matrix-sdk.aar`).
tchap-android uses by default the Matrix Android SDK library (see tchap-android/vector/libs/).
At each release, this library is updated.
Between two releases, the Riot code may not compile due to evolution of the library API.
To compile against the source of the Matrix Android library, please clone the project [AndroidMatrixSdk](https://github.com/matrix-org/matrix-android-sdk)
Between two releases, the tchap-android code may not compile due to evolution of the library API.
To compile against the source of the Matrix Android library, please clone the project [matrix-android-sdk](https://github.com/matrix-org/matrix-android-sdk)
and run the following command:

> ./compile_with_sdk_project.sh
## I want to help translating Riot

If you want to fix an issue with an English string, please submit a PR.
If you want to fix an issue in other languages, or add a missing translation, or even add a new language, please use [Weblate](https://translate.riot.im/projects/riot-android/).

## I want to submit a PR to fix an issue

Please check if a corresponding issue exists. If yes, please let us know in a comment that you're working on it.
Expand All @@ -39,44 +22,28 @@ If an issue does not exist yet, it may be relevant to open a new issue and let u
Please write every new classes in Kotlin. You can also convert existing Java classes (limited to classes impacted by the PR) to Kotlin (Android Studio has a tool to do this), but if you do so, please do atomic commit of the conversion, to ensure there is no other change, it will facilitate code review.
Also please check that everything works fine after Kotlin conversion, especially regarding nullity check.

### CHANGES.rst
### TCHAP_CHANGES.rst

Please add a line to the top of the file `CHANGES.rst` describing your change.

### Code quality

Make sure the following commands execute without any error:

> ./tools/check/check_code_quality.sh
> ./gradlew lintAppRelease
### Unit tests

Make sure the following commands execute without any error:

> ./gradlew testAppReleaseUnitTest
Please add a line to the top of the file `TCHAP_CHANGES.rst` describing your change.

### Tests

Riot is currently supported on Android Jelly Bean (API 16+): please test your change on an Android device (or Android emulator) running with API 16. Many issues can happen (including crashes) on older devices.
Please test your change on an Android device (or Android emulator) running with API 21. Many issues can happen (including crashes) on older devices.
Also, if possible, please test your change on a real device. Testing on Android emulator may not be sufficient.

### Internationalisation

When adding new string resources, please only add new entries in file `value/strings.xml`. Translations will be added later by the community of translators with a specific tool named [Weblate](https://translate.riot.im/projects/riot-android/).
When adding new string resources, please only add new entries in the 2 files: `value/strings.xml` and `values-fr/strings.xml`.
Do not hesitate to use plurals when appropriate.

### Layout

When adding or editing layouts, make sure the layout will render correctly if device uses a RTL (Right To Left) language.
You can check this in the layout editor preview by selecting any RTL language (ex: Arabic).

Also please check that the colors are ok for all the current themes of Riot. Please use `?attr` instead of `@color` to reference colors in the layout. You can check this in the layout editor preview by selecting all the main themes (`AppTheme.Status`, `AppTheme.Dark`, etc.).
Also please check that the colors are ok for all the current themes of Tchap. Please use `?attr` instead of `@color` to reference colors in the layout. You can check this in the layout editor preview by selecting all the main themes (`AppTheme.Status`, `AppTheme.Dark`, etc.).

### Authors

Feel free to add an entry in file AUTHORS.rst

## Thanks

Thanks for contributing to Matrix projects!
Thanks for contributing to Tchap projects!
116 changes: 27 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,119 +1,57 @@
Riot-Android [![Buildkite](https://badge.buildkite.com/5ae4f24dd485562a5b59a9f84d866e5eed3d100223423757f2.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riot-android) [![Weblate](https://translate.riot.im/widgets/riot-android/-/svg-badge.svg)](https://translate.riot.im/engage/riot-android/?utm_source=widget) [![Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riot-android:matrix.org.svg?label=%23riot-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#riot-android:matrix.org) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riot&metric=alert_status)](https://sonarcloud.io/dashboard?id=vector.android.riot) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riot&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=vector.android.riot) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riot&metric=bugs)](https://sonarcloud.io/dashboard?id=vector.android.riot)
Tchap-Android
============

Riot is an Android Matrix client.
Tchap-Android is an Android Matrix client.

[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" alt="Get it on Google Play" height="60">](https://play.google.com/store/apps/details?id=im.vector.app)

[<img src="https://f-droid.org/badge/get-it-on.png" alt="Get it on F-Droid" height="60">](https://f-droid.org/app/im.vector.alpha)

Important Announcement
======================

The core team is now working mainly on [RiotX](https://github.com/vector-im/riotX-android). New contributions (PR, issues) are still welcome, but be aware that this codebase will be replaced in the future by the RiotX implementation.
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" alt="Get it on Google Play" height="60">](https://play.google.com/store/apps/details?id=fr.gouv.tchap.a)

Contributing
============

Please refer to [CONTRIBUTING.md](https://github.com/vector-im/riot-android/blob/develop/CONTRIBUTING.md) if you want to contribute the Matrix on Android projects!
Please refer to [CONTRIBUTING.md](https://github.com/dinsic-pim/tchap-android/blob/develop/CONTRIBUTING.md) if you want to contribute on the project!

Build instructions
==================

This client is a standard android studio project.

If you want to compile it in command line with gradle, go to the project directory:
Several [flavorDimensions](https://github.com/dinsic-pim/tchap-android/blob/develop/vector/build.gradle#L143) are defined: "base", "target", "voip", "pinning".
- The 'base' dimension permits to deal with GooglePlay/Fdroid app
- The 'target' dimension permits to specify which platform are used
- The 'voip' flavor dimension permits to include/exclude jitsi at compilation time
- The 'pinning' flavor dimension permits to enable/disable certificate pinning with fingerprint check

If you want to compile the Google Play variant in command line with gradle, go to the project directory:

Debug mode:

`./gradlew assembleDebug`
`./gradlew assembleAppAgentWithoutvoipWithpinningDebug`

Release mode:

`./gradlew assembleRelease`

And it should build the project (you need to have the right android SDKs)

Recompile the provided aar files until we have gradle
======================================================

generate olm-sdk.aar
--------------------

sh build_olm_lib.sh

generate matrix-sdk.aar
----------------------

sh build_matrix_sdk_lib.sh

generate the other aar files
----------------------

sh build_jitsi_libs.sh

compile the matrix SDK with the Riot-android project
----------------------

sh set_debug_env.sh

Make your own flavour
=====================

Let says your application is named MyRiot : You have to create your own flavour.

Modify riot-android/vector/build.gradle
---------------------------------------

In "productFlavors" section, duplicate "app" group if you plan to use FCM or "appfdroid" if don't.

for example, with FCM, it would give

```
appmyriot {
applicationId "im.myriot"
// use the version name
versionCode rootProject.ext.versionCodeProp
versionName rootProject.ext.versionNameProp
buildConfigField "boolean", "ALLOW_FCM_USE", "true"
buildConfigField "String", "SHORT_FLAVOR_DESCRIPTION", "\"F\""
buildConfigField "String", "FLAVOR_DESCRIPTION", "\"FDroid\""
}
```
`./gradlew assembleAppAgentWithoutvoipWithpinningRelease`

- if you use FCM, duplicate appImplementation at the end of this file and replace appImplementation by appmyriotImplementation.
- if you don't, update the "if (!getGradle().getStartParameter().getTaskRequests().toString().contains("fdroid"))" to include your flavor.

Create your flavour directory
-----------------------------
Matrix Android SDK
------------------

- Copy riot-android/vector/src/app or appfroid if you use FCM or you don’t.
- Rename it to appmyriot.
- If you use FCM, you will need to generate your own google-services.json.
By default the tchap-android project will build with the current version of the Matrix SDK libs (matrix-sdk.aar, matrix-sdk-core.aar and matrix-sdk-crypto.aar) available in the tchap-android/vector/libs/ directory.

Customise your flavour
----------------------
To compile the Matrix Android SDK with the tchap-android project:
- Clone the [matrix-android-sdk](https://github.com/matrix-org/matrix-android-sdk) repository in the same directory as tchap-android, and checkout the wanted branch or revision.
- Run the following script:

- Open riot-android/vector/src/appmyriot/AndroidManifest.xml
- Change the application name to myRiot with "android:label="myRiot"" and "tools:replace="label"" in the application tag.
- Any other field can be customised by adding the resources in this directory classpath.
- Open Android studio, select your flavour.
- Build and run the app : you made your first Riot app.
`sh compile_with_sdk_project.sh`

You will need to manage your own provider because "im.vector" is already used (look at VectorContentProvider to manage it).
You may compile again with the available Matrix SDK libs by running:

Customise your application settings with a custom google play link
===================================================================
`sh compile_with_sdk_lib.sh`

It is possible to set some default values to Riot with some extra parameters to the google play link.
You may update/replace the Matrix SDK libs (in tchap-android/vector/libs/ dir) thanks to the following steps:
- Clone the [matrix-android-sdk](https://github.com/matrix-org/matrix-android-sdk) repository in the same directory as tchap-android, and checkout the wanted branch or revision.
- Run the dedicated script:

- Use the https://developers.google.com/analytics/devguides/collection/android/v4/campaigns URL generator (at the bottom)
- Set "Campaign Content" with the extra parameters (e.g. is=http://my__is.org%26hs=http://my_hs.org). Please notice the usage of **%26** to escape the **&**
- Supported extra parameters:
- is : identity server URL
- hs : home server URL
- Generate the customised link
- The application may have to be installed from the Play Store website (and not from the Play Store application) for this feature to work properly.
`sh build_matrix_sdk_lib.sh`

FAQ
===
Expand All @@ -124,4 +62,4 @@ FAQ
2. Where the apk is generated?

> Riot/build/outputs/apk
> tchap-android/vector/build/outputs/apk
12 changes: 12 additions & 0 deletions TCHAP_CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changes in Tchap 1.1.1 (2020-12-18)
===================================================

Improvements:
* Enable the room access by link

Bug Fixes:
* Server notice rooms (Tchap info) are hidden in the rooms list #692

Changes in Tchap 1.1.0 (2020-11-22)
===================================================

Improvement:
* Update the version used to trigger a clear cache during the application update (PR #676)

Changes in Tchap 1.0.49 (2020-11-18)
===================================================

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ buildscript {

// global properties used in sub modules
ext {
versionCodeProp = 76
versionNameProp = "1.1.0"
versionCodeProp = 77
versionNameProp = "1.1.1"
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
buildNumberProp = "${versionBuild}"
}
Expand Down
35 changes: 9 additions & 26 deletions build_matrix_sdk_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,25 @@
# exit on any error
set -e

if [ "$#" -ne 1 ]; then
echo "Usage: $0 GIT_BRANCH" >&2
exit 1
fi

# which branch to build?
branch=$1

if [ -z "$branch" ]; then
echo "Please specify the branch to build as a parameter"
exit 1
fi

echo ${branch}

echo "Save current dir"
currentDir=`pwd`

echo "up dir"
cd ..
echo "Go to matrix-android-sdk folder"
cd ../matrix-android-sdk

echo "remove sdk folder"
rm -rf matrix-android-sdk

echo "clone the matrix-android-sdk repository, and checkout ${branch} branch"
git clone -b ${branch} https://github.com/matrix-org/matrix-android-sdk

cd matrix-android-sdk
echo "The current matrix-android-sdk branch:"
git branch --show-current

echo "Build matrix sdk from source"
./gradlew clean assembleRelease

echo "Copy freshly built matrix sdk libs to the libs folder"
cd ${currentDir}

echo "Copy freshly built matrix sdk to the libs folder"
# Ensure the lib is updated by removing the previous one
rm vector/libs/matrix-sdk.aar
rm vector/libs/matrix-sdk-core.aar
rm vector/libs/matrix-sdk-crypto.aar

cp ../matrix-android-sdk/matrix-sdk/build/outputs/aar/matrix-sdk-release-*.aar vector/libs/matrix-sdk.aar
cp ../matrix-android-sdk/matrix-sdk-core/build/outputs/aar/matrix-sdk-core-release.aar vector/libs/matrix-sdk-core.aar
cp ../matrix-android-sdk/matrix-sdk-crypto/build/outputs/aar/matrix-sdk-crypto-release.aar vector/libs/matrix-sdk-crypto.aar
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ const val ENABLE_ROOM_RETENTION = false

const val SUPPORT_KEYS_BACKUP = false

const val ENABLE_JOIN_BY_LINK = false
const val ENABLE_JOIN_BY_LINK = true
2 changes: 1 addition & 1 deletion vector/src/main/java/im/vector/util/HomeRoomsViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class HomeRoomsViewModel(private val session: MXSession) {
* Use this method when you need to get all the joined rooms
*/
fun getJoinedRooms(): List<Room> {
return favourites + directChats + lowPriorities + otherRooms
return favourites + directChats + lowPriorities + serverNotices + otherRooms
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ const val ENABLE_ROOM_RETENTION = false

const val SUPPORT_KEYS_BACKUP = false

const val ENABLE_JOIN_BY_LINK = false
const val ENABLE_JOIN_BY_LINK = true

0 comments on commit 66163c5

Please sign in to comment.