Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a secret menu

For the sake of testing a feature that I don't want to release yet to the general public, I would like to implement a "secret" menu or menu item.

By "secret" I don't mean truly secret but more of a hidden or invisible menu, accessible to the developer (me) only, by entering a code or some other mechanism.

It's not the end of the world if an end-user finds about it and attempts to use it ("They made it idiot proof, but I found a workaround."). I just don't want to fail the unsuspecting innocent lay end-user, by providing a feature that isn't fully tested yet.

Any suggestions on how to go about this? (Android 2.2 and up only)

like image 649
Bill The Ape Avatar asked Apr 27 '12 17:04

Bill The Ape


2 Answers

  • compare e.g. the Android Id of the device and if it matches your dev phone unlock the menu

  • let your app check if another app (some empty dummy) is installed and unlock the menu based on that info.

  • you can add an Activity to your code / manifest that is not triggered by any code. You can still start it via adb shell am start -n com.your.package/.SecretThing (that activity could simply set a shared preference that unlocks the menu)

  • you could trigger a menu if you listen to some secret broadcast you send with adb shell am broadcast -a your.secret.broacast.ACTION_SECRET

  • if you have a device that has a keyboard implement a key listener that only triggers the menu if you enter some secret word (still forward key events to the system)

  • if your app has access to location then hide the menu if your are e.g. not at home.

  • add some always visible menu item that triggers a password protected screen (not a good idea but it works)

like image 97
zapl Avatar answered Sep 28 '22 08:09

zapl


One approach I've used a couple of times is to pop up a PIN entry form when the user triple-taps a particular part of the screen. You enter the PIN, you get through to the developer screen.

like image 33
Jim Avatar answered Sep 28 '22 09:09

Jim