Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable home button without rebooting device

I want that after installing my app from an OTA the home button of the device will not work at all so that user is unable to come out from the App. My digging led me to following results

A) I got a way to disable home button by a "mobileconfig" profile but it needs to restart the device and user have to open my app just after booting, i want to do this without restarting with something like Private Frameworks on non-Jail-broken devices. I want to know is that possible for non-jail-break devices?

C) If it is not possible to disable home button with Private Frameworks, then is there any way to open an app just after booting the device?, since certain jailbreak apps/ processes are loaded upon startup.

[NOTE: I don't want to submit my app to iTunes.]

like image 949
GauravSTomar Avatar asked Oct 19 '12 10:10

GauravSTomar


People also ask

How do I disable Home button on Android?

Navigate to Android > Restrictions > Basic and click on Configure. Under Allow Device Functionality, you'll have the options to disable Home/Power button. Home Button-Uncheck this option to restrict users from using the Home Button. Power Off-Uncheck this option to restrict users from turning their devices off.

How can I force my phone to turn off without the power button?

This method works on Android devices only, for this, you need your Android phone to be turned off. Simply plug in your USB cable and keep holding down the volume down/volume up button to enter the recovery mode. Here when the menus appear, simply tap exit, and reboot the device.


3 Answers

In iOS6, there's a feature called "Guided Access", which will allow device owners to lock users (like toddlers and school kids) into an app.

This explains the Guided Access for iOS 6 apps.

like image 66
Meet Avatar answered Nov 13 '22 06:11

Meet


The official answer of this question is "you can not disable home button in ios devices it is os level architecture and your are not authorized for it."

You need to dig to operating system flow to make any changes which might be quiet tough.

well, if you change you sight though it than there is one open and simple solution for this in ios 6 known as Guided Access.

like image 23
PeterParker Avatar answered Nov 13 '22 06:11

PeterParker


If you are able to jailbreak your device create a LaunchDaemon or use an existing one. The LaunchDaemon is a file in plist format that is called upon rebooting and starting your device. You will also need a file named open created by K3A

Download open from here

You will need to move open to /usr/bin/ or you can put it inside your app does not matter but set permissions to 0755 and root:wheel

Now on to the LaunchDaemons, they are stored here

/System/Library/LaunchDaemons

Here is an example. Lets say you name the LaunchDaemon

com.gauravstomar.test.plist

Where it says com.bundle.identifier put your apps identifier you may also find it in your Info.plist inside of your apps directory where it says CFBundleIdentifier

Now inside the plist insert the following information

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.gauravstomar.test</string>
    <key>ProgramArguments</key>
        <array>
          <string>open</string>
          <string>com.bundle.identifier</string>
        </array>
    <key>RunAtLoad</key>
    <true/>
        <key>StartInterval</key>
        <integer>1</integer>
</dict>
</plist>

Label has to be the same name as the LaunchDaemon.plist excluding plist extension

ProgramArguments is what calls the file open and launches the app

RunAtLoad makes this plist launch upon reboot

StartInterval will make the LaunchDaemon.plist open back up after 1 second if the user exits the app, if the user is still in the app nothing will happened

Make sure the permissions for your LaunchDaemon is set to

0644 root:wheel

You can still use your mobileconfig so that the home button is disabled. Once assessment is complete you can disable the LaunchDaemon so that the app stops relaunching itself with the following command launchctl unload/System/Library/LaunchDaemon/com.gauravstomar.plist

Let me know if you need any more help.

like image 1
Omar Avatar answered Nov 13 '22 04:11

Omar