Skip to content
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

Android-x86 integration #8

Open
dadreamer opened this issue Jan 29, 2018 · 10 comments
Open

Android-x86 integration #8

dadreamer opened this issue Jan 29, 2018 · 10 comments

Comments

@dadreamer
Copy link

Hello, Thomas!

Have you tried to integrate External NFC Reader Service into any Android-x86 build to get NFC working "out-of-box"? I have ACR1281U-C1 reader and I'd like to use it under VirtualBox guest w/ all the capabilities including HCE. Do you have some guide or instructions for how anyone could build Android-x86 from the sources along with your service? Or maybe you're planning to release one?

@dadreamer
Copy link
Author

I think, I could donate for this project to start up working on it. And if you're interested in it, ofc.

@skjolber
Copy link
Owner

skjolber commented Apr 6, 2018

I've not tried Android-x86 so far. You want an app / service which provides native NFC Android-x86?

@dadreamer
Copy link
Author

dadreamer commented Apr 7, 2018

You want an app / service which provides native NFC Android-x86?

Yes, I imagined External NFC Reader Service running on Android-x86 instead of a built-in Nfcservice (NfcNci) and capable to process NFC-related requests from any third party app, that could be installed onto Android-x86 system. As I'm working in VirtualBox, I can pass-through an external USB reader from the host into Android-x86 guest. It's working pretty well and I'm able to use your tools to configure the reader and test it out. But when I run some app, that requires NFC or HCE, it states that NFC service is disabled and refuses to work. When I activate Nfcservice in a custom build, the app says that NFC reader is turned off. My plan was to "redirect" those requests into your service somehow or replace Nfcservice with External NFC Reader Service completely. That leads to complete or partial rewrite of Nfcservice code and maybe to tweaking your service as you said earlier. If you're going to take a closer look at it, here's the thread on Android-x86 forums with some info about the native service activation.

@skjolber
Copy link
Owner

skjolber commented Apr 9, 2018

Yeah the main problem is the native NFC service, one needs root permission to replace it. This line on NfcAdapter.getDefaultAdapter():

NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);

must result in our service somehow. I guess the best would be to support multiple implementations, i.e. making the service lookup above configurable at build- or runtime; perhaps per application even.

@dadreamer
Copy link
Author

dadreamer commented Apr 10, 2018

one needs root permission to replace it

AFAIK, a year ago or so a common Android-x86 target was not rooted "out-of-box". I don't know, how it goes now, but you may switch to CM targets, which should be pre-rooted. Well, there are various workarounds to root an already built images, e.g. this one, but I think, we don't need it. Of course, you may add Superuser/SuperSU support to the build specs and make the rooted build. But try CM first. There's Bliss-x86 also, which is 100% rooted, has GApps support etc. I tried to build it in the past and it works just fine. When building, select -eng or -userdebug variant (eng is even better, because it is an engineering build and has all the debugging tools to see the most logs about errors and warnings).

I guess the best would be to support multiple implementations, i.e. making the service lookup above configurable at build- or runtime; perhaps per application even.

I'm unsure for how to "replace" native NFC service with External NFC Reader Service at the run-time (even with root rights). But when you make a custom build, you're able to alter any files there, so that should not be a big problem. And it might be accomplished in a number of ways: as a tweaked service + custom system image (iso) or maybe as an app package (like The Open GApps Project) + instructions for the end users for how to include it in the build or something else. (I don't know, which way is prefferable here, given that your service is paid-based, so the resulting iso should be also.)

@dadreamer
Copy link
Author

Just had some free time and tried both android-x86_64-7.1-r1.iso and cm-x86_64-13.0-r1.iso. It appears, that superuser access and GApps are built-in now. That's awesome, I think. In CM you need to activate Developer Settings to reach to root access settings, but in common Android even this is not necessary.
Still don't know how it goes when speaking about custom builds, but try to check that later.

@dadreamer
Copy link
Author

dadreamer commented Apr 30, 2018

Tonight I've got my custom build done (it took several days 'cause I was using VM to compile). I chose Oreo 64-bit branch as it's the recent version. Now I see that Superuser app and its binaries are already integrated into the build, so any app can gain root access. GApps are not integrated though, so it has to be done by the maker.

Can I help with this somehow else?..

@skjolber
Copy link
Owner

skjolber commented Oct 3, 2019

@dadreamer I guess now you have some more to go on, I've open-sourced the rest of the project.

@dadreamer
Copy link
Author

Thanks! Although I have these sources for a while and still work on the task from time to time. Does that also mean that the GPlay apps will be free-of-charge?
I expect some more developers would participate into this adaptation now.

@skjolber
Copy link
Owner

skjolber commented Oct 4, 2019

@dadreamer well yes, its all open source - apache 2.0. The play store app itself is among the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants