How to implement a secret menu - android

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)

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)

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.

Do you want to have the menu on your development phones only or do you want to get to the menu on any phone?
Here's 3 options I can think of.
1) You could have a file with some arbitrary string key code in it, and the existence of the file and key turns the feature on.
2) You could log screen presses, on your buttons and a combination of this launches the pass code screen.
3) If you have an options menu, with a more section you could burry the pass screen there. Or if you have an about screen, long pressing a logo could launch the pass screen.

I need a secrete menu too, Well I'm going to implement it on login screen , enter device time in EditText field and press cancel.

Related

How to launch android app in advanced or user mode; app reads variable on launch

Sorry this will be a general question as I don't even know where to start.
What I want:
I have an app on androind (bonus if solution works on iOS) where the same app can present different views depending on if you are an end user or a technician. What I need is some SIMPLE method where the app at launch can read a variable. I have read a lot about shortcuts, Quick action, Environment variables, etc. etc. but I can't find anything that doesn't require as much programming as the app itself!
I can think of two approaches…
long press on Icon which gives the option to start in "advanced mode" by passing an argument to the app
some setting that can be read by the app at launch akin to an Environment variable in other OS
Can someone please send my in the right direction. Maybe there is a standard way of doing this I'm just not aware of?
Many thanks!
You could present the user with a dialog on first start. He can indicate his "role" either by choosing one, or by entering a password or enabling code.
Or, you can default the app behaviour to "user", and offer a menu option to "enable technician mode", which could then request a password or other code to enable this option.
Or, you can default the app behaviour to "user" and if the user performs a specific magic gesture (ie: swipe right, swipe left, swipe right) then the "technician" mode is enabled.
What I wanted to do is apparently not possible, so instead I worked around it by always starting the app in user mode and having a hidden button for techs. Of course a user could find it by mistake but if security becomes an issue I will have to add a tech login. For now this solution is acceptable.
It did require some rework to get the sequence right but it turned out to be the lesser evil.

How to go through menu items and tap actions in tasker

Being an amateur user, I just stick to basic operations on tasker like creating a zooper widget and toggling settings, running ussd. But I was thinking about interacting with output of the ussd code, I don't know if it is possible but I hope someone can clarify me on this..
I run the code ##4636## very often to force WCDMA through the test menu, it takes two clicks after dialing the code, 1. Tapping "Phone information" which is the first option.
2. Scrolling down a bit and opening a list named "set preferred network type" where I can select WCDMA ONLY.
Now can this whole thing be automated.
Note: The normal system settings where simply selecting carrier mode or toggling it through tasker doesn't work as I think my phone automatically switches the network to EDGE as soon as I enter my room and I must do this toggle manually through test menu(##4636##) even if the usual system settings say it's in 3g.
Thanks in advance..
To open the hidden menu, use following intent:
action: android.intent.action.MAIN
package: com.android.settings
class: com.android.settings.TestingSettings
and for clicking items I would highly recommend using AutoInput, as it gives you far more control than built-in tasker functions. It also has a very user-friendly "Easy Setup", that basically walks you through what (and) where needs to be clicked, based on either coordinates, id, label or position :)
So in case of selecting "phone information" using AutoInput:
add new tasker action
select plug-in
select AutoInput
select AutoInput Action
select Easy Setup to be guided through, or in Manual Setup enter following
Action: click
field type: list
field position: 1
and similarly for next items :)

Any listener for system preferences in Android

I want to capture event when an user try to go into the preferences screen, so I can ask password for it. The reason why I try this, I am developing app for the disabled. I don't want them to touch system settings directly, just the permitted helper.
Is there any event listener or receiver for this?
Thanks in advance.
I don't think there is anything in the public APIs that will allow you to do this. Device Admin is probably the closest thing, but I don't think it does this exactly.
If you wish to implement this (and be certain that it will be effective) you'd have to modify the OS slightly on your devices.
One possibility that might work and is within the APIs is to create a replacement home screen that does not show the usual items in the menu. If you were to go this route you could "lock" the into your activity and simply provide them no way to go to the settings except with a password or something. This would be a lot of work though, and would require the user to set your application as their default home screen. And even with this on the newer devices you may run into the trouble because there is a settings button inside the notification pull down, which I don't think there is a way to block, even with a replacement homescreen.

Android Home button disable when Custom lock screenis ON in android

My requirement is to create Custom LockScreen, using below link http://code.google.com/p/contactowner/source/browse/#svn%2Ftrunk%2Fsrc%2Fcom%2Fappengine%2Fparanoid_android%2Flost i am able to create working Fine. But my Problem is when i press HOME button it is opening the Launcher screen. (1) How to Block home button in android ? (2)If it is not possible, How few custom lock screen .apks in the android market able to block Home button.
How can i achieve that ?
Appreciate your help...
You cannot intercept the key and do this unless you have access to the android source code and can change it. From an app's perspective, you can't do this unless you have the source either. Keep in mind that this is Frowned upon in android.
So the only thing you have available is onUserLeaveHint() which is a method from an Activity. But you still CANNOT stop a user from going home.
Ref:
http://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()
Here is proof that you cannot do it directly
public static final int KEYCODE_HOME
Since: API Level 1
Key code constant: Home key. This key is handled by the
framework and is never delivered to applications.
Constant Value: 3 (0x00000003)
actually it is possible to block the home button , as locker replacement apps do (like this one and this one) . however , they do it using a sneaky way which might not work on some devices and/or future versions of android (hint: look at the code of android OS - where and when in the entire runtime of the OS is the home button being blocked from the user?) .
that's why the best thing to do in order to do it nicely is to capture the home button by acting as a launcher . then , when it's time to unlock the locker , you call the original launcher.
another advantage of using this method is that the locker will "stay better" in the memory and will be the first one that will be launched upon bootup (no need for special permission for bootup ) .
it's possible!
use window params setType(TYPE_SYSTEM_ERROR) and you'll get what you want.
JoxTraex is probably right , you shouldn't disable HOME key, or else users will report your app in future
But there is a way to detect home button press,
Check the answer to this question

Force application to front

The question I'm about to ask may seem dangerous for the user, so here's the story before the question:
I'm working in a compagny that tries to sell Galaxy Tabs to schools (children under 10). So, I've been asked to develop an application that starts on boot showing a login screen. The child HAS to log in before he's allowed to use the tablet (just like logging in a computer).
My application starts on boot, shows the login screen, all buttons are blocked (the kid must not be able to use the tablet before the application lets him) except the home button.
fortunately, it seems impossible to block the home button.
I've been trying to rebring the application to front when onpause/onstop is called, this kind of hacks.
So my question is : Can I prevent an user to quit my application until I let him do so?
I know this sounds like a virus, I'm not really happy to be looking for this kind of solution either.
You have to build a custom Home screen, and then set it as the default Home application.
EDIT: see more on this previously asked question (at How can I create a custom home-screen replacement application for Android?). You can just make your authorization the default Home application, then when they log in it forwards to the regular Home screen. If they hit the home button your app gets called, can check if they have logged in and if they have will just send them to the regular home screen.

Categories

Resources