I\'m attempting to read files off of a USB drive for an Android Things app on a Raspberry Pi. I\'m able to scan the list of mounted devices like so:
<
Working and discarded options
1. Use ADB (working)
As answerer by Onik in this post
2. Use USB API (working)
As Android API for USB allows bulkTransfer, you can code SCSI compatible commands.
You can also try existing libraries such as libaums, posted by Phaestion in response to this similar question
3. Inject shell commands at init.rc at boot.img (NOT working)
Shell commands can be injected to the init.rc file inside the boot.img (not the init.rc file that you can find in the /root directory). However, given the A-B boot nature of the AndroidThings compilation, I have been unable to make it work.
4. Add advanced app permissions (NOT working)
The following permissions seem promising to execute root commands from the app. However, permission denied error continues to block the root command execution.
I even tried to compile an AndroidThings distribution with an app with such permissions but the Android Things console does NOT allow to include the app to the compilation
5. White list the app (NOT working)
There is a white list for priviledged apps. However, this white list is placed in a priviledged directory and cannot be overwritten even from the shell command with root user
6. Install the app at a priviledged location (NOT working) Apps installed in priviledged directories can execute root commands. However, AndroidThings does NOT allow to install apps at such locations (even from the shell with root user)