Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Get the light client to compile for Android #7954

Closed
tomaka opened this issue Feb 20, 2018 · 4 comments
Closed

Get the light client to compile for Android #7954

tomaka opened this issue Feb 20, 2018 · 4 comments
Assignees
Labels
F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. P7-nicetohave 🐕 Issue is worth doing eventually. Q5-substantial 📓 Can be fixed by a developer with decent experience.

Comments

@tomaka
Copy link
Contributor

tomaka commented Feb 20, 2018

So that it can later be used as a library by Android applications, or as some sort of background service (if that's possible).

@tomaka tomaka added P7-nicetohave 🐕 Issue is worth doing eventually. Q5-substantial 📓 Can be fixed by a developer with decent experience. labels Feb 20, 2018
@tomaka tomaka self-assigned this Feb 20, 2018
@rphmeier
Copy link
Contributor

#4842

@5chdn 5chdn added this to the 1.11 milestone Feb 21, 2018
@5chdn 5chdn added F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. labels Feb 21, 2018
@tomaka
Copy link
Contributor Author

tomaka commented Feb 21, 2018

Here's my WIP branch: https://github.com/paritytech/parity/compare/master...tomaka:android-build?expand=1

Notes on the various changes that were made:

  • The change to the daemonize library is non-controversial and could easily be upstreamed, however the library doesn't seem to be maintained anymore.
  • The hidapi-rs crate doesn't support Android. I disabled it entirely in order to make Parity compile, but if we want to support hardware wallets we need to make it work eventually. This is probably a lot of work.
  • The fix to ring is a small hack to make compiling the C code work ; however the change is probably quite controversial and I'm not sure that it will be upstreamable.
  • The fix to rocksdb turns fread_unlocked into fread, which does exactly the same but is slightly slower. This is fread_unlocked doesn't seem to be supported by the Android NDK. We can probably introduce this small hack in our fork.
  • There is no obvious alternative to xdg-open on Android. We could do it through the JNI but it's quite complicated. The easiest way to solve this properly is Parity-as-a-library #4842.
  • I turned get_if_addrs into a no-op in order to make it compile.

@niklasad1
Copy link
Collaborator

Cool, libusb is supported by android but might require a rooted android phone to get access to the USB interface which probably eliminates this option as well.

@tomaka
Copy link
Contributor Author

tomaka commented Feb 28, 2018

After paritytech/daemonize#1 is merged, all major issues will be fixed except for the ring library.

There is however a problem that may require attention: in order to make things compile, we need some symbols from libc.so that were only added in Android 8.0 (API version 26) which was released in August 2017 and is not available on all devices yet.

Alternatively we can apply patches to the code so that these functions are not required. We should be able to get down to API version 24 (Android 7.0, August 2016) or even 21 (Android 5.0, November 2014).

@5chdn 5chdn modified the milestones: 1.11, 1.12 Mar 1, 2018
@5chdn 5chdn modified the milestones: 1.12, 1.11 Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. P7-nicetohave 🐕 Issue is worth doing eventually. Q5-substantial 📓 Can be fixed by a developer with decent experience.
Projects
None yet
Development

No branches or pull requests

4 participants