tl;dr : I need experienced Android 9 devs to tell me whether or not our app can get permanent SELinux write + read privileges on a system file.
We are porting our app on a hardened Android 9 device that includes an embedded barcode scanner.
The app is to be used only by our company, and never released to the public.
While the market is dominated by Zebra and Honeywell scanners, our device is equipped with an asian barcode scanner.
The specific manufacturer does not give their API publicly, and we kind of passed on asking them : We are French, so both party has to translate to English then to the other language just to understand each other. This has proved to be too much of a hassle for us on other projects.
This kind of devices come with a preinstalled app that manages said scanner.
After a bit of research, it turns out that the conventional way of using the embedded scanner is to use the preinstalled app to either get the result as simulated keyboard inputs, or listen to their Android Intent to get the String.
My manager (20 years of experience) said he didn't like using third party tools.
I can see where he comes from : In his days, a third party tool meant freeing oneself from the responsability of the task at the expense of control, quality of service and the ability to debug.
From that point of view, it didn't look like that good of a deal.
So I was asked to research how we could bypass that third party app.
After decompiling it, it appears that triggering a scan comes from writing in a protected file.
The file requires SELinux privileges that you apparently only get from signing your app with the constructor's private key and using the package name, if I'm not mistaken.
Please correct me if I'm wrong, I'm new to Android development.
It looks like there are no online tools to reverse engineer private keys (which is a good thing).
I have also looked at tricking the OS security but decided against it. It's too hard for me anyway.
We would also like to avoid rooting our devices, if possible, because that's something I am not used to.
So, Android devs of Reddit, is there a simple way for out app to permanently get the SELinux privileges to read/write file systems ? Thank you all for the time.
submitted by /u/Gullible_Entry7212[link] [comments]