erickok / transdroid

Manage your torrents from your Android device
GNU General Public License v3.0
1.33k stars 201 forks source link

GMS in F-Droid build #616

Closed linsui closed 11 months ago

linsui commented 2 years ago

com.evernote:android-job pulls in GMS. Could you please remove it? It's also deprecated. Thanks!

erickok commented 2 years ago

I can't just remove it because it is used for background jobs. And I didn't want to 'upgrade' it to WorkManager because that pulls in Jetpack WorkManager which is way more and still includes those Google dependencies. So happy to hear of alternatives to android-job but I don't have a good option right now that I know of.

linsui commented 2 years ago

I'm not a android dev so I can't provide a suggestion. Many other apps in F-Droid are affected so maybe we'll have a solution later. I'll come back if I have any idea. Thanks!

linsui commented 2 years ago

Most of other apps update to androidx.work:work-runtime, e.g. https://github.com/thundernest/k-9/commit/bbbec7bf3d44bf455f8a852a81c41577ef8afad8. It doesn't depend on nonfree libs.

erickok commented 2 years ago

Ok so first of all, android-job should NOT pull in GCM. In fact, I used android-job exactly because I did not want GCM. I double-checked:

\--- com.evernote:android-job:1.2.6
     \--- androidx.core:core:1.0.0 -> 1.3.1 (*)

Having said that, indeed work-manager also does not include GCM by default, it now seems, so it could indeed be used. That would be much more reliable in the future.

linsui commented 2 years ago

Ok so first of all, android-job should NOT pull in GCM. In fact, I used android-job exactly because I did not want GCM.

See https://github.com/evernote/android-job/blob/v1.4.2/library/build.gradle#L8.

erickok commented 2 years ago

That's a version Transdroid doens't use and also a compileOnly (so not included in the final build, just available as API to compile against) dependency. You can run ./gradlew app:dep on Transdroid to see all its (transitive) dependencies. play-services-gcm or indeed any Play Services is not one of them.

linsui commented 2 years ago

1.2.6 has the same dep, right? Though it's a compileOnly dep, it's still a dep and the related classes will be in the final dex file. Not sure if there is real non free bits in the final apk but the compilation requires the dep. It can't be built without that.

erickok commented 2 years ago

No the dependency (classes, bytes) do not end up in the final transdroid dex file (or othersie in the .apk/.aar). In fact, GCM is not a dependency of Transdroid in any way. It is a compile-only dependency of android-job but it is not transitive, which is why it doesn't end up in Transdroid at all.

linsui commented 2 years ago

Emmm, we found that many apps affected by android-job because we scanned the classes.dex files accross our repo. And remove the dep does make the classes.dex clean. I don't know more about the details why the classes ends up there. You can check that with dexdump. @licaon-kter We discussed about the ref classes, is this the same case?

licaon-kter commented 2 years ago

I did check mostly the compile classpah as it outputs a bigger log, will rebuild and check runtime classpath locally asap.

That being said I find it odd to say "it's only needed at compile time", if a non-FOSS is needed to build the app then it's a dependency in my book, even if it does not end up in the final APK.

erickok commented 2 years ago

@licaon-kter You could consider android-job non-FOSS if it requires non-FOSS software to be compiled, in which case you could argue that Transdroid - transitively - is non-FOSS. But that goes way too far IMHO, as to compile or run Transdroid there is no software required whatsoever that isn't open-source (and distributed under an open-source library). Again, you do not need Play Services or GCM in order to compile Transdroid or to run Transdroid and the Transdroid code does not link it. In fact even android-job without that specific android-job-gcm module doesn't require any non-FOSS software to compile or execute it.

linsui commented 2 years ago

Ah, anyway we can use wire's android-job fork without gms deps.

licaon-kter commented 2 years ago

@erickok see "Though we tried to build everyting from source,..." in https://f-droid.org/en/docs/Inclusion_Policy/

bwitt commented 1 year ago

@linsui @licaon-kter I notice the current version of transdroid (v2.5.22) seems to have been disabled in fdroid:

https://gitlab.com/fdroid/fdroiddata/-/blob/9c75727cd5ebee07881e50199e0fb7605d1180ed/metadata/org.transdroid.full.yml#L244

apparently due to this issue; what's the way forward to get this back in fdroid?

licaon-kter commented 1 year ago

@bwitt see discussion above

bwitt commented 1 year ago

from the discussion it sounds like we could switch to "wire's android-job fork without gms deps" (is that https://github.com/wireapp/android-job ?) ; what's the migration like?

When I compare that repo with the original (https://github.com/evernote/android-job) it seems identical: https://github.com/evernote/android-job/compare/master...wireapp:android-job:master

what am I missing?

licaon-kter commented 1 year ago

@bwitt branch wireapp/v1.2.6-nogms

bwitt commented 1 year ago

I created https://github.com/erickok/transdroid/pull/649 to switch to work manager; could we check that to ensure it fixes this issue? also just wanted to confirm @erickok you'd be ok with switching to work manager?

erickok commented 1 year ago

It can't hurt and will at least resolve these discussions.

licaon-kter commented 10 months ago

Missed this notification, updated now. :tada: