Android: publish the app on F-Droid #33

Closed
opened 2020-12-28 12:46:52 +00:00 by rtsisyk · 27 comments
Owner

This OSS project should meet F-Droid guidelines.

This OSS project should meet F-Droid guidelines.
relan commented 2021-02-15 06:36:02 +00:00 (Migrated from github.com)

F-Droid maintainer here.

Kudos for starting this fork!

F-Droid main repo includes only free software. OMaps in its current shape is not free because of those Gradle plugins:

  • com.google.gms.google-services
  • com.google.firebase.crashlytics
  • com.google.firebase.appdistribution

and those libraries:

I personally would love to see all this removed and can help with F-Droid inclusion then.

F-Droid maintainer here. Kudos for starting this fork! F-Droid main repo [includes only free software](https://f-droid.org/docs/Inclusion_Policy/). OMaps in its current shape is _not free_ because of those Gradle plugins: * com.google.gms.google-services * com.google.firebase.crashlytics * com.google.firebase.appdistribution and those libraries: * all com.google.android.gms:* * all com.google.firebase:* * [com.flurry.android:analytics](https://mvnrepository.com/artifact/com.flurry.android/analytics/12.1.0) * [com.mopub:mopub-sdk-native-static](https://mvnrepository.com/artifact/com.mopub/mopub-sdk-native-static/5.10.0) * [com.appsflyer:af-android-sdk](https://mvnrepository.com/artifact/com.appsflyer/af-android-sdk/4.9.0) I personally would love to see all this removed and can help with F-Droid inclusion then.
nicolasmaia commented 2021-04-30 00:43:02 +00:00 (Migrated from github.com)

Is it possible to make a gradle flavor without these dependencies?

Is it possible to make a gradle flavor without these dependencies?
relan commented 2021-05-08 08:55:10 +00:00 (Migrated from github.com)

Just checked the snapshot tagged as 2021-05-08. The good news is that I managed to build it without proprietary dependencies in the F-Droid environment! There are still a few issues left.

A major issue: missing private.h. OMaps just crashes because of missing server URLs. You should either fill all the constants to make OMaps work out-of-the-box or allow users to configure them on start. F-Droid does not sign up for keeping any "secrets" like API keys.

And a few minor notes:

  • Versioning. The versionName and versionCode include a Git hash and the current date (see getVersion() in build.gradle). This won't work in F-Droid, versionName and versionCode must be constant across multiple gradle runs.
  • Proprietary dependencies conditions. googleFirebaseServicesEnabled and googleMobileServicesEnabled make no sense for us as we still remove references to non-free Gradle plugins and libraries to avoid their downloading and accidental use. If those conditions were added only for F-Droid, you can safely drop them to simplify build.gradle.
Just checked the snapshot tagged as 2021-05-08. The good news is that I managed to build it without proprietary dependencies in the F-Droid environment! There are still a few issues left. A major issue: missing `private.h`. OMaps just crashes because of missing server URLs. You should either fill all the constants to make OMaps work out-of-the-box or allow users to configure them on start. F-Droid does not sign up for keeping any "secrets" like API keys. And a few minor notes: * Versioning. The versionName and versionCode include a Git hash and the current date (see `getVersion()` in `build.gradle`). This won't work in F-Droid, versionName and versionCode must be constant across multiple `gradle` runs. * Proprietary dependencies conditions. `googleFirebaseServicesEnabled` and `googleMobileServicesEnabled` make no sense for us as we still remove references to non-free Gradle plugins and libraries to avoid their downloading and accidental use. If those conditions were added only for F-Droid, you can safely drop them to simplify build.gradle.
Author
Owner

Hey @relan, thank you for your work making F-Droid package real. I took a look at F-Droid scripts, but I didn't have time to finish this work.

Proprietary dependencies conditions. googleFirebaseServicesEnabled and googleMobileServicesEnabled make no sense for us as we still remove references to non-free Gradle plugins and libraries to avoid their downloading and accidental use. If those conditions were added only for F-Droid, you can safely drop them to simplify build.gradle.

You are right, googleFirebaseServicesEnabled and googleMobileServicesEnabled flags were added especially for F-Droid. Please note that these flags not only remove Google/Firebases libraries, but also override some Java sources. For example, googleMobileServicesEnabled enables enhanced implementation of LocationProvider which relies both on GPS and Google data. F-Droid users will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it is an informed choice.

Versioning. The versionName and versionCode include a Git hash and the current date (see getVersion() in build.gradle). This won't work in F-Droid, versionName and versionCode must be constant across multiple gradle runs.

Please feel free to send PRs to this repo instead of patching our build.gradle from the build scripts. You can add an optional parameter to disable automatic version generation and use this flag from F-Droid scripts.

Hey @relan, thank you for your work making F-Droid package real. I [took a look at F-Droid scripts](https://gitlab.com/rtsisyk/fdroiddata/-/tree/organicmaps), but I didn't have time to finish this work. > Proprietary dependencies conditions. googleFirebaseServicesEnabled and googleMobileServicesEnabled make no sense for us as we still remove references to non-free Gradle plugins and libraries to avoid their downloading and accidental use. If those conditions were added only for F-Droid, you can safely drop them to simplify build.gradle. You are right, `googleFirebaseServicesEnabled` and `googleMobileServicesEnabled` flags were added **especially** for F-Droid. Please note that these flags not only remove Google/Firebases libraries, but also override some Java sources. For example, `googleMobileServicesEnabled` enables enhanced implementation of LocationProvider which relies both on GPS and Google data. F-Droid users will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it is an informed choice. >Versioning. The versionName and versionCode include a Git hash and the current date (see getVersion() in build.gradle). This won't work in F-Droid, versionName and versionCode must be constant across multiple gradle runs. Please feel free to send PRs to this repo instead of patching our build.gradle from the build scripts. You can add an optional parameter to disable automatic version generation and use this flag from F-Droid scripts.
Author
Owner

@relan, it would be nice if you could combine @linsui, my and your changes into a new MR to fdroiddata. We are busy with fixing the codebase itself.

@relan, it would be nice if you could combine [@linsui](https://gitlab.com/linsui/fdroiddata/-/commits/omap), [my](https://gitlab.com/rtsisyk/fdroiddata/-/tree/organicmaps) and your changes into a new MR to [fdroiddata](https://gitlab.com/fdroid/fdroiddata). We are busy with fixing the codebase itself.
gerion0 commented 2021-05-10 13:46:21 +00:00 (Migrated from github.com)

You are right, googleFirebaseServicesEnabled and googleMobileServicesEnabled flags were added especially for F-Droid. Please note that these flags not only remove Google/Firebases libraries, but also override some Java sources. For example, googleMobileServicesEnabled enables enhanced implementation of LocationProvider which relies both on GPS and Google data. F-Droid users will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it is an informed choice.

Thank you for your work, just to clarify: With UnifiedNlp, MicroG provides a google free reimplementation to use GPS + cell/wifi data from e.g. Mozilla (well supported by F-Droid). Afaik, this can even be used on non rooted phones. Will Organicmaps use that within the F-Droid build, too? I have also installed the APK of Organicmaps from Github on a Google services free Android with UnifiedNLP and showing the current location works very well.

> You are right, `googleFirebaseServicesEnabled` and `googleMobileServicesEnabled` flags were added **especially** for F-Droid. Please note that these flags not only remove Google/Firebases libraries, but also override some Java sources. For example, `googleMobileServicesEnabled` enables enhanced implementation of LocationProvider which relies both on GPS and Google data. F-Droid users will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it is an informed choice. Thank you for your work, just to clarify: With [UnifiedNlp](https://github.com/microg/UnifiedNlp), MicroG provides a google free reimplementation to use GPS + cell/wifi data from e.g. Mozilla (well supported by F-Droid). Afaik, this can even be used on non rooted phones. Will Organicmaps use that within the F-Droid build, too? I have also installed the APK of Organicmaps from Github on a Google services free Android with UnifiedNLP and showing the current location works very well.
Author
Owner

GitHub APK HAS Google Services included.
But F-Droid wants us to remove these services for some unknown reason.
We are added to such option to meet requirements.

On Mon, May 10, 2021 at 4:46 PM Gerion Entrup @.***>
wrote:

You are right, googleFirebaseServicesEnabled and
googleMobileServicesEnabled flags were added especially for F-Droid.
Please note that these flags not only remove Google/Firebases libraries,
but also override some Java sources. For example,
googleMobileServicesEnabled enables enhanced implementation of
LocationProvider which relies both on GPS and Google data. F-Droid users
will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it
is an informed choice.

Thank you for your work, just to clarify: With UnifiedNlp
https://github.com/microg/UnifiedNlp, MicroG provides a google free
reimplementation to use GPS + cell/wifi data from e.g. Mozilla (well
supported by F-Droid). Afaik, this can even be used on non rooted phones.
Will Organicmaps use that within the F-Droid build, too? I have also
installed the APK of Organicmaps from Github on a Google services free
Android with UnifiedNLP and showing the current location works very well.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://git.omaps.dev/organicmaps/organicmaps/issues/33#issuecomment-836721216,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AANXHDWHX3CQDNE4RTBJQH3TM7PT5ANCNFSM4VL7TZPA
.

--
WBR,
Roman Tsisyk @.***>

GitHub APK *HAS* Google Services included. But F-Droid wants us to remove these services for some unknown reason. We are added to such option to meet requirements. On Mon, May 10, 2021 at 4:46 PM Gerion Entrup ***@***.***> wrote: > You are right, googleFirebaseServicesEnabled and > googleMobileServicesEnabled flags were added *especially* for F-Droid. > Please note that these flags not only remove Google/Firebases libraries, > but also override some Java sources. For example, > googleMobileServicesEnabled enables enhanced implementation of > LocationProvider which relies both on GPS and Google data. F-Droid users > will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it > is an informed choice. > > Thank you for your work, just to clarify: With UnifiedNlp > <https://github.com/microg/UnifiedNlp>, MicroG provides a google free > reimplementation to use GPS + cell/wifi data from e.g. Mozilla (well > supported by F-Droid). Afaik, this can even be used on non rooted phones. > Will Organicmaps use that within the F-Droid build, too? I have also > installed the APK of Organicmaps from Github on a Google services free > Android with UnifiedNLP and showing the current location works very well. > > — > You are receiving this because you were assigned. > Reply to this email directly, view it on GitHub > <https://git.omaps.dev/organicmaps/organicmaps/issues/33#issuecomment-836721216>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AANXHDWHX3CQDNE4RTBJQH3TM7PT5ANCNFSM4VL7TZPA> > . > -- WBR, Roman Tsisyk ***@***.***>
Victor239 commented 2021-05-10 16:49:02 +00:00 (Migrated from github.com)

GitHub APK HAS Google Services included. But F-Droid wants us to remove these services for some unknown reason. We are added to such option to meet requirements.

He was referring to microG allowing the use of generic location services via UnifiedNLP, instead of dependent on Google's specific one. This would be much faster and more accurate at obtaining location than relying on simply GPS.

> GitHub APK *HAS* Google Services included. But F-Droid wants us to remove these services for some unknown reason. We are added to such option to meet requirements. He was referring to microG allowing the use of **generic** location services via UnifiedNLP, instead of dependent on Google's specific one. This would be much faster and more accurate at obtaining location than relying on simply GPS.
relan commented 2021-05-10 18:43:05 +00:00 (Migrated from github.com)

F-Droid users will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it is an informed choice.

Sure.

You can add an optional parameter to disable automatic version generation and use this flag from F-Droid scripts.

Once you release a stable version, it'll have a fixed version name and version code, won't it?

it would be nice if you could combine @linsui, my and your changes into a new MR to fdroiddata. We are busy with fixing the codebase itself.

Sure, don't spend your time making a recipe for F-Droid, we'll do that.

But F-Droid wants us to remove these services for some unknown reason.

We keep only free software in our main repository, i.e. all parts of an app must be free. The com.google.android.gms:* libraries are proprietary, so they have to be excluded.

Could you comment about the missing private.h?

> F-Droid users will wait for location 5-10 minutes instead of 5-10 sec, but I hope that it is an informed choice. Sure. > You can add an optional parameter to disable automatic version generation and use this flag from F-Droid scripts. Once you release a stable version, it'll have a fixed version name and version code, won't it? > it would be nice if you could combine @linsui, my and your changes into a new MR to fdroiddata. We are busy with fixing the codebase itself. Sure, don't spend your time making a recipe for F-Droid, we'll do that. > But F-Droid wants us to remove these services for some unknown reason. We keep only free software in our main repository, i.e. all parts of an app must be free. The com.google.android.gms:* libraries are proprietary, so they have to be excluded. Could you comment about the missing `private.h`?
Author
Owner

Once you release a stable version, it'll have a fixed version name and version code, won't it?

We are happy with the automatic version generation. It gets the version number from the last git commit, i.e. version generation is deterministic. Do you have better ideas?

Could you comment about the missing private.h?

private.h is created by ./configure.sh or you can just copy private_default.h to private.h. The only missing part is the server address. The traffic is expensive and we did't want other forks to parasite on our infrastructure. The current plan is to create a new URL especially for F-Droid. This URL will be included to the main repository and enabled by default.

> Once you release a stable version, it'll have a fixed version name and version code, won't it? We are happy with the automatic version generation. It gets the version number from the last git commit, i.e. version generation is deterministic. Do you have better ideas? > Could you comment about the missing private.h? `private.h` is created by `./configure.sh` or you can just copy `private_default.h` to `private.h`. The only missing part is the server address. The traffic is expensive and we did't want other forks to parasite on our infrastructure. The current plan is to create a new URL especially for F-Droid. This URL will be included to the main repository and enabled by default.
relan commented 2021-05-13 06:51:29 +00:00 (Migrated from github.com)

We are happy with the automatic version generation. It gets the version number from the last git commit, i.e. version generation is deterministic. Do you have better ideas?

Fixed version name/code better fit our workflow, but it makes little sense to introduce them specifically for F-Droid. We can force any version name/code in our recipe.

The current plan is to create a new URL especially for F-Droid. This URL will be included to the main repository and enabled by default.

OK, will wait until this happens because builds without this URL are useless. Thanks!

> We are happy with the automatic version generation. It gets the version number from the last git commit, i.e. version generation is deterministic. Do you have better ideas? Fixed version name/code better fit our workflow, but it makes little sense to introduce them specifically for F-Droid. We can force any version name/code in our recipe. > The current plan is to create a new URL especially for F-Droid. This URL will be included to the main repository and enabled by default. OK, will wait until this happens because builds without this URL are useless. Thanks!
Author
Owner
https://git.omaps.dev/organicmaps/organicmaps/pulls/398
Author
Owner

@relan do you need any help with F-Droid integration? Please contact us via TG, Email or here if you have some problems.

@relan do you need any help with F-Droid integration? Please contact us via TG, Email or here if you have some problems.
relan commented 2021-05-15 06:42:30 +00:00 (Migrated from github.com)

do you need any help with F-Droid integration?

Everything's OK now, thanks a lot for your help! Here is a recipe: https://gitlab.com/relan/fdroiddata/-/blob/omaps/metadata/app.organicmaps.yml

Waiting for a stable release.

> do you need any help with F-Droid integration? Everything's OK now, thanks a lot for your help! Here is a recipe: https://gitlab.com/relan/fdroiddata/-/blob/omaps/metadata/app.organicmaps.yml Waiting for a stable release.
Author
Owner

Wre are updating applicationId to app.organicmaps. This change is already in master. A new version will be tagged after merging pending PR. Google ask us to remove mandatory location permission.

Wre are updating applicationId to app.organicmaps. This change is already in master. A new version will be tagged after merging pending PR. Google ask us to remove mandatory location permission.
Author
Owner

Hey @relan, you could start integrating 2021-05-21 into the main F-Droid repository. We will publish this release as soon as it reaches Google Play. Probably tomorrow. This release already have a new applicationId.

Hey @relan, you could start integrating 2021-05-21 into the main F-Droid repository. We will publish this release as soon as it reaches Google Play. Probably tomorrow. This release already have a new applicationId.
relan commented 2021-05-22 08:31:13 +00:00 (Migrated from github.com)

you could start integrating 2021-05-21 into the main F-Droid repository

Done: 2360a00d7a. Will be available in a few days.

> you could start integrating 2021-05-21 into the main F-Droid repository Done: https://gitlab.com/fdroid/fdroiddata/-/commit/2360a00d7ab0740ff28cc91196f7726d36878480. Will be available in a few days.
Author
Owner

We're finally there! Thanks a lot!

We're finally there! Thanks a lot!
relan commented 2021-05-26 07:40:34 +00:00 (Migrated from github.com)

Available on F-Droid now: https://f-droid.org/packages/app.organicmaps/

Note that new versions have to be added manually: automatic detection works only when version code and version name are defined as literals.

Available on F-Droid now: https://f-droid.org/packages/app.organicmaps/ Note that new versions have to be added manually: automatic detection works only when version code and version name are defined as literals.
bristow commented 2021-05-26 15:06:02 +00:00 (Migrated from github.com)

Thanks for this !!

We need a big button on website nom ;)

image

Thanks for this !! We need a big button on website nom ;) ![image](https://user-images.githubusercontent.com/1156507/119684217-9ca45100-be44-11eb-8664-4d65402578dd.png)
Author
Owner

Note that new versions have to be added manually: automatic detection works only when version code and version name are defined as literals.

@relan how to update the app? What should be done to get automatic updates? Could you please show me a script which parses build.gradle to get version?

> Note that new versions have to be added manually: automatic detection works only when version code and version name are defined as literals. @relan how to update the app? What should be done to get automatic updates? Could you please show me a script which parses build.gradle to get version?
relan commented 2021-06-05 08:15:59 +00:00 (Migrated from github.com)

how to update the app?

Through merge requests to https://gitlab.com/fdroid/fdroiddata.

What should be done to get automatic updates?

Define version name and version code as literals in build.gradle or AndroidManifest.xml:

versionName "1.2.3"
versionCode 123

That's because build.gradle is a program that can do any kind of nasty things, we cannot run it without isolation. But spawning 3161 VMs every day to check for updates is not feasible. So, we rely on static parsing only.

Could you please show me a script which parses build.gradle to get version?

The entry point is here: https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/checkupdates.py

> how to update the app? Through merge requests to https://gitlab.com/fdroid/fdroiddata. > What should be done to get automatic updates? Define version name and version code as literals in build.gradle or AndroidManifest.xml: versionName "1.2.3" versionCode 123 That's because build.gradle is a program that can do any kind of nasty things, we cannot run it without isolation. But spawning 3161 VMs every day to check for updates is not feasible. So, we rely on static parsing only. > Could you please show me a script which parses build.gradle to get version? The entry point is here: https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/checkupdates.py
biodranik commented 2021-06-05 11:03:16 +00:00 (Migrated from github.com)

Manual updates should be fine for now. Hardcoding versions into the manifest is not convenient for other stores.

Manual updates should be fine for now. Hardcoding versions into the manifest is not convenient for other stores.
Author
Owner

Through merge requests to https://gitlab.com/fdroid/fdroiddata.

OK, created https://gitlab.com/fdroid/fdroiddata/-/merge_requests/9126

Define version name and version code as literals in build.gradle or AndroidManifest.xml:

versionName "1.2.3"
versionCode 123

I think we can define a static version name and code as literals in build.gradle, but override this version later dynamically. I don't see any problems bumping version on every release (=tag), but we also want dynamic versions for every commit.

> Through merge requests to https://gitlab.com/fdroid/fdroiddata. OK, created https://gitlab.com/fdroid/fdroiddata/-/merge_requests/9126 > Define version name and version code as literals in build.gradle or AndroidManifest.xml: > > versionName "1.2.3" >versionCode 123 I think we can define a static version name and code as literals in build.gradle, but override this version later dynamically. I don't see any problems bumping version on every release (=tag), but we also want dynamic versions for every commit.
Author
Owner

This ticket is done, I'm closing it for the planning purposes, but we can continue discussion here.

This ticket is done, I'm closing it for the planning purposes, but we can continue discussion here.
rugk commented 2021-07-08 11:10:52 +00:00 (Migrated from github.com)

The update problem just came up in organicmaps/organicmaps#818 (comment). And I have to say, especially given your update schedule (quite fast), manual updates are really not a future-proof way IMHO.

For more information, see https://f-droid.org/en/docs/FAQ_-_App_Developers/#do-i-need-to-tell-you-when-i-update

AFAIK you can choose another update mode based on git tags, e.g. instead, if that better suits.

Or shall I open a new issue for that?

The update problem just came up in https://git.omaps.dev/organicmaps/organicmaps/issues/818#issuecomment-875952176. And I have to say, especially given your update schedule (quite fast), manual updates are really not a future-proof way IMHO. For more information, see https://f-droid.org/en/docs/FAQ_-_App_Developers/#do-i-need-to-tell-you-when-i-update AFAIK you can [choose another update mode](https://f-droid.org/en/docs/Build_Metadata_Reference/#UpdateCheckMode) based on git tags, e.g. instead, if that better suits. Or shall I open a new issue for that?
rugk commented 2021-07-09 12:13:03 +00:00 (Migrated from github.com)

Finally opened a new issue about automating this: organicmaps/organicmaps#825

Finally opened a new issue about automating this: https://git.omaps.dev/organicmaps/organicmaps/issues/825
This repo is archived. You cannot comment on issues.
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#33
No description provided.