I have a HTC one and I need a flashlight app that has the possibility of mapping the on/off capability to the volume button
Not really an answer to your question, but perhaps a solution to your problem; have you looked into whether something like "Pressy" would work for you?
I've been using the HTC flashlight app. It has the ability to use the volume buttons to turn on/off and change the intensity of the light. Hope this helps.
http://forums.androidcentral.com/htc-one-x/206097-htc-flashlight-apk.html