1

I'm developing a kiosk application (installed on a rooted Android device) and would like to remove the access to the settings. I think this can be done by just removing the "settings.apk", am I right? If not please correct me.

The question is, what would be the side effects of removing the Settings.apk? Are there any that I should be aware off?

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
SebastianT
  • 263
  • 3
  • 14

2 Answers2

1

I think that is a bad idea. I think you need to create an application that can run over the lock screen. In you main FragmentActivity you must add the next windows flags:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_layout);

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

}

If your device has home physical button, so you need add to your AndroidManifest flags for launcher application:

<activity
    android:name="YourFragmentActivity"
    android:label="@string/app_name"
    android:theme="@style/MyTheme" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.HOME" /> 
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.MONKEY" />
    </intent-filter>
</activity>

You must add a locking method to your device (pin, pattern, etc). Then start your application, press lock button (screen will be off), press lock button newly. And your app will be over the lockscreen. (and no one can enter to settings)

To avoid the exit:

@Override
public void onBackPressed() {
    if (firstfragment.isVisible()) { //first fragment loaded in your backstack

    } else {
        super.onBackPressed();
    }
}

UPDATE

Here a video showing how work this:

http://www.youtube.com/watch?v=ZtNAAVy_nWY

PD: Sorry my english is bad.

ClarkXP
  • 1,223
  • 10
  • 23
  • Thanks for the answer. Though I don't understand what you really want to do. – SebastianT Jan 29 '14 at 10:33
  • Executing an app over lock screen avoids that the user access to setting menu. Also if you configure you app in AndroidManifest like Launcher App, when the users press the home button will open your kiosk app. Check the video to see how work this. – ClarkXP Jan 29 '14 at 14:01
  • thanks for the video. I too have the app set to work as launcher. – SebastianT Jan 30 '14 at 10:46
0

Well yes,if you remove the Settings.apk, you're breaking alot of stuff. Say, functionality in terms of new wifi connections, blue tooth pairing, sound adjusting. Also you'd be breaking references to it, like when a user would try to launch settings from the status bar drop down or the launcher, it would result in the corresponding application to crash, whether it be system or user. But why delete the apk? Ty looking for alternatives, which would simple restrict the users from accessing it. Hope I helped out.

Aashir
  • 2,621
  • 4
  • 21
  • 37
  • Yes you did. Thanks. Actually, what I need is to find a way to replace or disable that launch settings access that is on the status bar drop down. Do you know how to do it? – SebastianT Jan 28 '14 at 19:23
  • It's possible but it'll require you to edit the Android source code, alternatively you can disable the status bar expansion or pull down. Have a look at: http://stackoverflow.com/a/20008799/2558344 – Aashir Jan 28 '14 at 19:30
  • Thanks for the help. Do you know if while rooting the device, one can restrict (ask for password) certain apk? Obviously this would be for the Settings.apk – SebastianT Jan 28 '14 at 19:35
  • That can be done without rooting the device, there are many apps on the playstore that can already lock specific apps for you. Look around, you might find something which would do just the same. – Aashir Jan 28 '14 at 19:39
  • Yes I've found a few, which are quite decent, but I wanted something that didn't involve third party apps. – SebastianT Jan 28 '14 at 19:41
  • No no, not the apps. I meant their functionality, you being able to do that from your own app. – Aashir Jan 28 '14 at 19:43
  • I can't imagine that being easy. Do you have any ideas about how to do it? – SebastianT Jan 28 '14 at 19:50
  • It's not but there's always this: http://stackoverflow.com/a/7322371/2558344 – Aashir Jan 28 '14 at 19:59