Looks like I’ve been kind of productive these days, making the third app this week. This time it’s a very weird one.
It is a small android app that allows you to run a custom script, once a device with a special markerfile in its root dir is mounted by the system.
That’s it. Too bad we don’t have anything similar to udev here, otherwise we’d only need to write one rule.
Create the script file with whatever you want to, place it somewhere in the device, create an .IOMARKER file in the root of the flash jump drive, or microsd (or change the filename in settings), fill in the path to the script, pick if you want to run as root.
It also broadcasts 3 actions:
org.ncrmnt.utool.actions.FLASH_DETECTED – once a tagged media is detected for the first time
org.ncrmnt.utool.actions.USCRIPT_DONE – once a script is done working
org.ncrmnt.utool.actions.FLASH_REMOVED – once the tagged flash is removed from the system
So you can pick those up in your own apps to provide the UI feedback.
Only one marker tagged flash at the same time is supported.
It is a quick hack for my ‘internal use’ in the terminal made out of a flytouch 2 tablet (I’ll document that hack once it’s done) , so it’s somewhat feature limited. If you want to extend it or have a questing – drop me a mail.
Sourcecode and apk can be found at my github page, as usual.