-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make app F-Droid ready #212
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :D
cc: @hussainmohd-a
app/src/play/java/com/celzero/bravedns/RethinkDnsApplicationPlay.kt
Outdated
Show resolved
Hide resolved
app/src/play/java/com/celzero/bravedns/RethinkDnsApplicationPlay.kt
Outdated
Show resolved
Hide resolved
…tCode is not required as of now
checkForBlockListUpdate() | ||
} else { | ||
Log.i(LOG_TAG, "App update check not initiated") | ||
} | ||
} | ||
} | ||
|
||
fun checkForUpdate(userInitiation:Boolean = false) { | ||
if (persistentState.downloadSource == Constants.DOWNLOAD_SOURCE_PLAY_STORE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this stay? With this PR the G-Play update check is only done for apps installed from G-Play, other builds (F-Droid in the future, from website) won't even contain the dependency for it and always use the web updater.
Currently I left this check in here for users who use the G-Play version but did not download from G-Play.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this shared pref value or check anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ch4t4r Hussain says, this check isn't required (we won't distribute PlayStore flavoured builds from anywhere else). But... PlayStore mirrors like ApkMirror and others might distribute that flavour... In which case, we would need to fallback on the web-updater, right, and not the PlayStore update checks? Or... How is this ideally supposed to work?
Today, RethinkDNS distributed from the website and PlayStore are signed with the same keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the mirrors in mind as well. You can't know whether the play services are present on those devices in advance -- you could test at runtime though and fallback to the web updater if they aren't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I guess we need to check for presence of Play Services too (which, if absent, would skip update-checks and show an error toast on Play flavoured builds):
I couldn't find any other proprietary dependencies. I checked that it runs the web updater on The web updater works as intended (checks in the background; shows dialog when up-to-date/check failed only when user clicked on |
I'm not sure whether the prebuilt tun2socks is okay. Open-source dependencies on a private binary repository would not be okay as only a handful of repos are approved for F-Droid apps. In this case the library is included in the git repo however, which might be fine? Anyone could verify the included binary in the git repo is compiled from the commit mentioned. |
If a prebuilt tun2socks would not be okay a more complex config file would have to be created in the F-Droid RFP repo which first builts the library and then copies it over, using the prebuilt directive (something like here https://gitlab.com/fdroid/fdroiddata/blob/master/metadata/chat.rocket.android.yml#L141) |
Apart from We should ideally build |
…ure callback when it actually failed
I totally missed the guava dep. Is there any reason why it is not pulled from maven? |
May be an artifact of Intra's early beginnings: Jigsaw-Code/Intra@c20b993 May be guava can simply be fetched from maven-central without fuss and both those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, this PR is good to merge. Thanks for your time and effort, Daniel.
Note: Re: F-Droid, at least two more changes required:
- Fetch guava from maven central.
- Move
outline-go-tun2socks
in as agit submodule
.
I removed the file dependency and added the maven one. App still compiles and country flags (that is what it is used for, right?) still show properly in query log. |
Would having a monorepo (subfolder/module for tun2socks) also be fine for you? That would be simpler and we could just depend on it using pure gradle (and wouldn't have to init/pull the submodule all the time). |
Including guava along with firebase was having an known issue As we are not using any firebase dependency I think we can add as maven. |
We are going to include WireGuard in this project at some point, too: Prefer that it comes in as a git-module. I am mostly basing it off of on how Orchid handles external but critical (security sensitive) cross langauge deps: https://github.com/OrchidTechnologies/orchid/blob/master/.gitmodules I take, your concern is that gradle process won't be straight-forward? That is, Android Studio build integration would be convoluted more than necessary? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for me.
This PR aims to remove closed-source dependencies (or pre-compiled binaries from non-approved sources) to make this app ready for F-Droid.
I like to share my progress early as a PR to show progress and get feedback.
Right now this PR removes the play-services-core library from the assembled app and only includes it when an .apk file compiled from
./gradlew assemblePlayRelease
is used. For other, non-play builds it uses the server for checking for updates. This way folks at F-Droid could compile without the proprietary library bundled.Things left to do:
Compile & test appVerify both updaters are called properlyExtract other dependenciesfix copyright headerrefactor