- C++ 71.5%
- QML 27.5%
- QMake 0.7%
- Scheme 0.2%
| .gitlab/issue_templates | ||
| app | ||
| configurations | ||
| cpp | ||
| docs/assets | ||
| lib | ||
| package | ||
| qml | ||
| resources | ||
| vendor | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .gitmodules | ||
| CHANGELOG.md | ||
| COPYING | ||
| manifest.scm | ||
| MatrixClientApp.pro | ||
| MatrixClientLib.pro | ||
| QtAndroidEnvironment.md | ||
| README.md | ||
Matrix Client
Desktop and Mobile client for Matrix, based on Nheko.
Develop
On Guix
# Channel: PantherX
guix shell -m manifest.scm
eval $(./vendor/set_qt_env_variables.sh)
Build and run:
./vendor/pop.sh
./build/matrix-client
Dependencies
json-modern-cxxcurlcoeurllmdblmdbxxlibolmmatrix-client-librarymtxclientqtbase5.15.2qtquickcontrols25.15.2qtdeclarative5.15.2qtsvg5.15.2spdlog-shared-lib
Not necessarily up to date.
Build 3rd party libraries
Android
in order to build third-party libraries for Android, following dependencies need to be prepared:
-
Follow the instruction to qt android environment preparing here.
-
Android SDK and NDK
after installing the Android SDK and NDK in order to have the command line access following variables need to be added to environment:
export ANDROID_HOME=$HOME/Android/Sdk export ANDROID_SDK_ROOT=$HOME/Android/Sdk export ANDROID_AVD_HOME=$HOME/.android/avd export ANDROID_NDK=$ANDROID_HOME/ndk/23.1.7779620/ export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools export PATH=$PATH:$ANDROID_NDK -
Preparing the dependencies you need to run following command to build vendor libraries:
./vendor/build-android.sh all
iOS
- build openssl library:
./vendor/build-ios.sh openssl - build all other dependencies:
./vendor/build-ios all
Note: in order ro build 3rd-parties individually, we can use: ./vendor/build-ios.sh LIB_NAME which the LIB_NAME points to the function in build-ios.sh: BUILD_LIB_NAME.
Build for Android
since third-party libraries are not compatible with default NDK installed bt QtCreator, we need to setup custom Kit for our application. following steps describe how we can setup required configurations.
Setup NDK
install NDK v23.23.1.7779620 using the SDK manager:
Tools > Options > Devices > Android > SDK Manager > Tools
Note: be aware the use same NDK version both for the application and third-party libraries.
Prepare Compiler
installing the NDK, we need to add it manually to the list of compilers:
- go to
Tools>Options>Kits>Compilers - Clone default Clang C compiler:
Android Clang (C, arm, NDK 21.x.xxxxx)and change it to the matching one for our installed NDK - Clone default Clang C++ compiler:
Android Clang (C++, arm, NDK 21.x.xxxxx)and change it to the matching one for our installed NDK
**Build it just for arm64-v8a: QtCreator > Projects > Build & Run > Build > Build Steps > ABIs > Disable all platforms except arm64-v8a.
Setup Kit
in order to setup Kit:
- go to
Tools>Options>Kits>Kits - Clone default Android
5.15.xKit:Android Qt %{Qt:Version} Clang Multi-Abi - Set C and C++ compilers to the ones you created before
Build for Linux
- Building the Application:
mkdir build
cd build
qmake ../MatrixClientApp.pro
make
- Building the Library:
mkdir build
cd build
qmake ../MatrixClientLib.pro
make
Version release flow
%%{init: { 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'master'}} }%%
gitGraph
commit
branch development order: 3
checkout development
commit
branch feature1 order: 4
checkout feature1
commit
checkout development
merge feature1 tag: "v0.0.1"
branch mr-v0.0.1 order: 1
checkout mr-v0.0.1
commit
commit
checkout master
merge mr-v0.0.1
checkout development
merge mr-v0.0.1
branch feature2 order: 5
checkout feature2
commit
checkout development
merge feature2 tag: "v0.0.2"
branch mr-v0.0.2 order: 2
commit
commit
checkout master
merge mr-v0.0.2
checkout development
merge mr-v0.0.2
in order to release new versions for the MatrixClient we follow below steps:
- implement features in
featurebranches - submit merge requests to the
developmentbranch - after merge request approval, we need to update the mobile version before providing new tags:
- Update
VERSION_APPLICATIONincpp/Application.h. - for Android we need to modify
configurations/android/AndroidManifest.xmlfile, updating theandroid:versionNameandandroid:versionCode.android:versionCodeis an integer which should be incrementally increased for each releaseandroid:versionNameis the string value shows to the users. we need to set it to match with the tag we want to set
- for iOS we need to modify
MatrixClientApp.profile, update theVERSION. - it's also recommended to update the
CHANGELOG.mdmentioning the changes applied on current version
- Update
- committing the version related changes, now we can set the regarding tag on
developmentbranch. - in order to release new mobile APK:
- create a branch from the
tagwe want to release APK based on, calledmr-vx.x.x - submit a merge request from this branch to the
master - test the changes on mobile, apply fixes on mentioned branch
- merge changes to
masterafter we created the APK successfully - submit a merge-request to the
developmentbranch, to test new changes on desktop and make them available on future releases
- create a branch from the
- Note 1: If we have a recent change in the vendor dependencies like updating the library version, we need to both mention in the submitted merge request and apply the related change in the
vendor/build-android.shfile.
Android bundle release steps
in order to publish new signed bundle for android:
- open project in Qt Creator
- in
Projects>Build>Build Steps>Build Android APK- select proper keystore file to sign the APK with
- provide the password for the keystore
- select the
Build Android App bundle (*.aab)option
- Note: release the bundle file, we need to increment the application version code, otherwise Google rejects the submitted bundle with the following message:
Version code XX has already been used. Try another version code.
following the above steps, we have the signed APK and bundle files. however since we updated the ANDROID_TARGET_SDK_VERSION to 30, we need to sign them manually with newer version of the signature schema than what supports by Qt Creator ( reference ).
- firt we need to adjust the archive file using the
zipaligntool$ zipalign -v 4 "${file_path}" "${output_file}" - then we sign the APK with a new version of signature schema using the
apksigner$ apksigner sign --ks "${keystore_file}" --ks-key-alias "${keystore_alias}" --ks-pass "pass:${keystore_password}" --key-pass "pass:${key_password}" --verbose "${file_path}" - later we can check the signature status using the following comand
$ apksign verify --verbose "${file_path}" Verifies Verified using v1 scheme (JAR signing): true Verified using v2 scheme (APK Signature Scheme v2): true Verified using v3 scheme (APK Signature Scheme v3): true Verified using v4 scheme (APK Signature Scheme v4): false Verified for SourceStamp: false Number of signers: 1 - for the bundle file we use the
jarsignertool as bellow:$ jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore "${keystore_file}" "${file_path}" "${keystore_alias}" -storepass "${keystore_password}" -keypass "${key_password}" - we can also strip the .aab signing if you want to replace it:
$ zip -d "${file_path}" META-INF/\*
more info over here: https://source.android.com/security/apksigning