signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.62k stars 6.15k forks source link

Signal calls closed-source GMS libs for utility functions #9629

Closed tw-hx closed 4 years ago

tw-hx commented 4 years ago

Bug description

Searching through Signal's source for GMS references: https://github.com/signalapp/Signal-Android/search?p=2&q=gms.&unscoped_q=gms. shows multiple instances where Play Services code is used as intended for push messaging and map features, but also calls to generic GMS utility functions. This is holding back eventual inclusion of Signal-signed reproducible builds in F-Droid #9044.

Steps to reproduce

Actual result: Signal calls presumably closed source code for utility functions, relative to "app/src/main/java/org/thoughtcrime/securesms/" they are:

Expected result: These should be replaced by standard Java equivalents, so Signal is as open-source as possible. Ideally the website release should be able to build without any Google libs at all but this is a good first step :). Thanks!

johanw666 commented 4 years ago

That is not a bug but a feature request.

I suggest telling F-Droid people to be less fundamentalistic about what libraries are called by software in repositories, but I'm affraid that will probably have about the same chance on success as this request because it results in more battery consumption for people with Play Services on their device.

greyson-signal commented 4 years ago

Hi there, thanks for the suggestions, but we try to only use Github as a bug tracker. But feel free to discuss this on the forums. Thanks!

tw-hx commented 4 years ago

An easy fix for another proprietary GMS import (that was newly committed to Signal shortly after this issue was closed above) is in util/concurrent/SignalExecutors.java which now imports com.google.android.gms.common.util.concurrent.NumberedThreadFactory

NumberedThreadFactory is both imported at the top from GMS and declared as a class at the bottom of the file. Removing:

import com.google.android.gms.common.util.concurrent.NumberedThreadFactory;

and compiling Signal 4.60.3 works and the APK runs fine, so that line appears a superfluous import.

Here are links to other usage of GMS code not required for GCM/Maps or similar as of today:

Thanks, Greyson, if you have time to look into replacing these in the future!