mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-20 02:58:45 +00:00
Page:
How to build Signal from the sources
Pages
Code Style Guidelines
Configuring Android Studio
Data loss when using an SD Card formatted as internal memory
Donating
F Droid
Home
How to build Signal from the sources
Pairing Your Android Virtual Device With The Desktop Version
Protocol
Publicity material
Reproducible Builds
Submitting useful bug reports
Translation workflow
Welcome to the Signal Community
Clone
12
How to build Signal from the sources
Andrew Emil edited this page 2021-08-11 09:55:08 -04:00
See also https://github.com/signalapp/Signal-Android/tree/master/reproducible-builds
The following information concentrates on compiling on LINUX, OS X or Windows machines. If you can and want to contribute information how to compile on other platforms: you are welcome to add such infos.
Prerequisites
- "Android SDK manager"
- "Android Support Repository" - this need to be installed via the Android SDK manager
- "Java Development Kit (JDK)" compiler for example openjdk-devel - JRE alone is not enough. Use Java 8, as defined in the Gradle config.
- "Git for Windows" - If you are running Windows, you will need git (https://git-scm.com/download/win) installed for this tutorial.
LINUX or OS X
Build Signal (for experts who have all the prerequisites)
# assuming your working directory is /work
cd /work
git clone https://github.com/signalapp/Signal-Android.git Signal-Android
cd Signal-Android
# execute Gradle
./gradlew build
# If you see "BUILD SUCCESSFUL" then fetch and install your apk
/work/Signal-Android/build/outputs/apk/Signal-Android-debug-unaligned.apk
# cleaning up
./gradlew clean
Build Signal (detailed, for newbies)
# assuming the project working directory is /work
cd /work
git clone https://github.com/signalapp/Signal-Android.git Signal-Android
# as a developer
# you would clone using the git protocol and your username
# git clone git@github.com:Username/Signal-Android.git Signal-Android
cd Signal-Android
# install Gradle (if is not installed yet) and then execute Gradle
./gradlew build
# if you see an error message
#
# "SDK location not found. Define location with sdk.dir in the local.properties file
# or with an ANDROID_HOME environment variable" ...
#
# ... then download and unzip the Android "ADT Bundle" or "SDK Tools only"
# from http://developer.android.com/sdk/index.html
#
# ... create a file /work/Signal-Android/local.properties which points to the sdk subdirectory
# which you unzipped in the previous step
# sdk.dir=<path-to-your>/sdk
# retry the build
./gradlew build
# when you see "Could not find com.android.support:support-v" ...
# ... you have also forgotten to install the support library
# see http://developer.android.com/tools/support-library/setup.html for different methods to install
# that library, for example you can run "<path-to-your>/sdk/tools/android sdk"
# retry the build
./gradlew build
# when you see "Cannot find System Java Compiler ...." ...
# ... you have also forgotten to install an JAVA compiler (a Java Runtime Environment JRE is not enough)
# then install openjdk-devel for your distribution
# retry the build
./gradlew build
# when you see "Could not resolve all dependencies for configuration ':_debugCompile'.
# > Could not find com.android.support:support-v4:19.0.1."
# ... you have the wrong Android SDK Build Tools installed.
# see http://developer.android.com/tools/support-library/setup.html for different methods to install
# that library, for example you can run "<path-to-your>/sdk/tools/android sdk"
# and add the version mentioned in the error message, here: 19.0.1
# retry the build
./gradlew build
# If you see "You have not accepted the license agreements of the following SDK components:" ...
# ... you do not have the proper Android Build Tools installed. Look for the version number it needs
# (it should say right under that last error line) and install the build-tools version corresponding
# to that number.
# retry the build
./gradlew build
# If you see "BUILD SUCCESSFUL" then locate your apks as
/work/Signal-Android/build/outputs/apk/Signal-Android-debug-unaligned.apk and
/work/Signal-Android/build/outputs/apk/Signal-Android-release-unsigned.apk
# If you wish to install the release build, it needs to be signed: https://developer.android.com/tools/publishing/app-signing.html
# A quick and dirty method is:
cd build/outputs/apk
keytool -genkey -v -keystore example.keystore -alias SomeAlias -keyalg RSA -keysize 4096
jarsigner -verbose -keystore example.keystore Signal-Android-release-unsigned.apk SomeAlias
# You can now use 'Signal-Android-release-unsigned.apk' and/or rename it to what you like.
# cleaning up
./gradlew clean
WINDOWS
Build Signal (for experts who have all the prerequisites)
# assuming your working directory is c:\work
cd c:\work
git clone https://github.com/WhisperSystems/Signal-Android.git Signal-Android
cd Signal-Android
# execute Gradle
gradlew.bat build
# If you see "BUILD SUCCESSFUL" then fetch and install your apk
c:\work\Signal-Android\build\outputs\apk\Signal-website-debug-*.apk
# cleaning up
gradlew.bat clean