- An older fork of Signal-Android that works with my fork of Signal-Server
- Running the newest version of signalapp's Android app with my fork of Signal-Server should be fine, but this repository is here as a redundancy
-
Android Studio
- If you are on Linux and Android Studio is buggy, try the flatpak
Clone this repo with:
git clone https://github.com/jtof-dev/Signal-Android
Open Android Studio and hit Open
in the new project prompt or in the top left go to File
> Open Folder
> select Signal-Android
Let Gradle sync
Set up an Android emulator
-
Either under
Tools
>Device Manager
or the small phone icon near the top right of the screen. HitCreate Device
-
Select any new-ish phone (Pixel 4XL for example)
-
Select a new-ish system image - one might get automatically highlighted, if so install that one - just avoid the latest one (currently
API 34
)
This guide by Madeindra is still almost entierly up-to-date and I will be adapting basically word-for-word from here
- On line 181, update the url with your url (make sure to keep the trailing slash):
buildConfigField "String", "SIGNAL_URL", "\"https://chat.your.domain\""
-
This is the only url related to messaging - if you want to set up another section, good luck!
-
On line 211, update with your
Public key
generated bycertificate -ca
fromSignal-Server
:
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"your-public-key\""
- On lines 218-219, you need to enter your own
hcaptcha
webpage (signal's won't work) - the nginx-certbot docker image should bundle it atchat.your.domain/signalcatpchas
, or else you can check out the source at jtof-dev/signalcaptchas
buildConfigField "String", "SIGNAL_CAPTCHA_URL", "\"https://signalcaptchas.org/registration/generate.html\""
buildConfigField "String", "RECAPTCHA_PROOF_URL", "\"https://signalcaptchas.org/challenge/generate.html\""
-
Update the trusted server certificate in
app/src/main/res/raw/whisper.store
-
docker exec
into your nginx-certbot docker container, and copyfullchain.pem
andprivkey.pem
out of the instance:
docker exec -it nginx-container bash
cd /etc/letsencrypt/live/test-name/
cat fullchain.pem
cat privkey.pem
And paste the outputs into local fullchain.pem
and privkey.pem
, and generate a keystore.pcks12
:
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
openssl
will ask for you to set a password - I didwhisper
for consistency
Open the app/src/main/res/raw/whisper.store
in KeyStore Explorer - the password is whisper
-
Hit the
Import Key Pair
button (along the row of png buttons - it looks like two gold keys side-by-side) -
Select
PKCS#12
>OK
> enter the password you set, and select yourkeystore.pcks12
(you might need to look for all file types if it doesn't show up in the file explorer) -
Import
> Exit, which will prompt you to save
Download the google-services.json
and from Firebase
> your project > the settings cog wheel in the top left > Project settings
> Your apps
section > google-services.json
and place it inside Signal-Android/app
Try to update app/src/main/res/values/firebase_messaging.xml
with the new values from your google-services.json
, but you won't be able to fill out all sections
You need to replace every instance of org.thoughtcrime.securesms
with the package name your created for your Firebase app
Start off by finding and replacing the following:
-
org.thoughtcrime.securesms
withyour.app.name
-
org.thoughtcrime
withyour.app
-
org_thoughtcrime_securesms
withyour_app_name
-
org/thoughtcrime/securesms
withyour/app/name
-
I used VSCode and maxed out the find and replace at 20000 hits - after it finished I had to run it again to catch another ~1000
Next, rename these files the same way:
-
app/jni/utils/org_thoughtcrime_securesms_util_FileUtils.cpp
-
app/jni/utils/org_thoughtcrime_securesms_util_FileUtils.h
Finally, find and rename all folders named org
, thoughtcrime
, and securesms
with your app name
-
I couldn't find an easy way to do this manually, so I ended up using
locate org/thoughtcrime/securesms
andlocate org/thoughtcrime
etc- If you need to install it, the package name will most likely be
mlocate
, and don't forget to runsudo updatedb
regardless before searching for folders to rename
- If you need to install it, the package name will most likely be
Now run ndk-build
to rebuild some machine-generated config files
-
To install
ndk
, go toAndroid Studio
>File
>Settings
>Languages & Frameworks
>Android SDK
>SDK Tools
tab > hit the checkmarks onNDK (Side by Side)
,Android SDK Command-line Tools
, andCMake
>Apply
-
ndk-build
probably hasn't been added to your path, so you will need to call it with an absolute path like this:~/Android/Sdk/ndk/<version>/build/ndk-build
-
You will also need to set a variable pointing
ndk-build
to the project directory
export NDK_PROJECT_PATH=/path/to/Signal-Android/app
- Then run
~/Android/Sdk/ndk/<version>/build/ndk-build
Lastly, update the package name in app/src/main/res/values/strings.xml
to anything else
<string name="app_name" translatable="false">your name</string>
Then sync and build in Android Studio
Start Signal-Server
and registration-service
in EC2
Select Signal-Android
and an emulator (or deploy onto your phone) from the dropdown near the top right and hit the green run button
Go to Build
> Build Bundle(s) / APK(s)
> Build APK(s)
- This will recompile and build everything (usually anything unchanged is cached), and outputs the apk into
Signal-Android/app/build/outputs/apk/playProd/debug/
-
Find out if this step from Madeindra's guide is required:
- Update
ATTACHMENT_DOWNLOAD_PATH
andATTACHMENT_UPLOAD_PATH
inlibsignal/service/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java
by deletingattachments/
so attachment will be uploaded in root (/
). If you don't want the attachments to be uploaded to root bucket, check the FAQ part of this guide.
- Update