utool for android: run a script once you insert a flash.

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.
Done.


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.

2 thoughts on “utool for android: run a script once you insert a flash.

  1. Hello Necromant,

    I just saw your app here and please forgive me I know nothing about Android programing and making apps.

    Just recently I found out I may be able to connect a 4G USB Modem to my Acer Tab A500. I needed to root the tablet so I struggled and three days later I had it rooted and installed a custom Rom (Jelly Time) a Jelly Bean off shoot. And by invoking commands in a terminal emulator I was able to get the FreedomPop Bolt PXU 1964 4G USB Modem working. Since then I have been trying to find away to automate the process which requires Super User access.

    So I was referred by a friend to your App. It sounds like it may do what I need but I don’t understand how to incorporate what I input via the terminal into your app and make it work.

    I looked over the information you put here and went to GitHub and reviewed what you have there and I am no closer to understanding how to implement it.

    Can you point me to more detail of something that would provide more detailed instruction?

    Thanx in advance,

    – Phil
    PS – I documented how I got the USB Stick Modem to work in the entry on this site: http://forum.xda-developers.com/showthread.php?t=1921928

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.