How to Disable Safe Mode using Android app? - android

I'd like to know if there's a way to disable going into safe mode on Android.
As an example, on a Samsung Galaxy S21, Google's Family Link app (used for parental supervision) does exactly this - when the app is running a user can no longer hold down on the power button in the UI to reboot in safe mode.
I have experience writing in Xamarin, and would appreciate any guidance - haven't been able to find anything on this yet!
Thanks!

Related

Is it possible to completely disable the Doze mode and Standby mode?

I have a requirement to create an app that should run 24/7. I don't care about battery drain, becoz app will not be submitted to PlayStore and its only for the selected user.I also understand app will only last for one day, that is acceptable in my case.
The application functionality mainly dependent on network and Bluetooth functionality and the most of the code written in pre marshmallow and changing the whole implementation is not a right option for me now.
So is there any way to create the app without any restriction? Also, As observed some of the Device manufacturers put an extra layer of battery optimization to make this worse.
I tried to create a dummy foreground service with partial wakelock, but this not seems to be working. and even whitelisting the app didn't solve the issue.
There is no proper documentation from Google about what are the functionalities will be affected from doze/standby. According to Google doc the background task will not be suspended, it only deferred until the next maintenance window. If that is the case, App should be able to print all the app that is missed during doze period. But as observed app will print the log only during the maintenance window. The is will break the expected behavior.
Whitelisting is a good option but app will be still be affected by the doze mode. What is the reason to restrict the app behavior even when the user explicitly chose not to? It very frustrating when the app behaves differently in different device OS, Manufacturer etc.
Sorry for the story. I would like to understand is there any way to completely disable Doze and standby mode without changing the existing implementation? I have gone through the various document, but there is NO WAY to achieve this 100%. Please share your thoughts
I have a requirement to create an app that should run 24/7
Write a program for a desktop operating system. Or, perhaps find a mobile device that runs Linux and write a program for it. Or, create a custom version of Android that disables Doze/app standby. Or, see if there is some Android hardware that meets your requirements and does not apply Doze/app standby (e.g., devices that naturally are always plugged in, such as Android TV or a Chromebox).
So is there any way to create the app without any restriction?
No, sorry.
I would like to understand is there any way to completely disable Doze and standby mode without changing the existing implementation?
No, sorry.

Run launcher app in safe mode of android

I had implemented one launcher app for tab. This app is working good in normal mode but issue in safe mode. I am not able to set my app as launcher app in safe mode. Can anyone tell me how i can run my app as launcher app in safe mode.
Possible solutions is
Run my app as Launcher app.
Disable safe mode feature of android.
If device will go in safe mode, then ask password first to open this device.
If anyone knows better solution from above,please mention in comment. but i need this launcher app to be run in safe mode.
Thanks in advance.
Basically, you can't. The safe mode is designed to load built-in apps only
Only system apps run in safe mode. All the apps installed by the user doest not work..and there is a reason for that.
I think your ultimate goal is to create a kiosk mode. Where you want to restrict the user. You can two things:
If you are providing the mobile device you can use COSU from android 6.0 and above where there are APIs to disable safe mode. To access these apis your app needs to be the device owner.
You can access APIs to read UI contents of other apps and enforce clicks on them. To read other apps and enforce click you need to get special permission(Accessibility). Using this you can auto install apps, disable dialogs..

Android: Prevent regular users from accessing safe-mode?

I'm planning to deploy an app on my android smartphone which is supposed to be used by multiple other persons. Now of course I do not want them to do things with the device they are not supposed to do so I informed myself about several different ways to make it as safe as possible (Lock-down apps, Kiosk mode, Mobile-device-management, Code-tweaks and so on).
I found some solutions that look really promising but they all share the same problem that a user could just restart the device and boot it in safe-mode where those helpful apps won't be started. However, there is one exception: I've installed a MDM app called maas360 which somehow manages to apply the restrictions that I defined even in safe-mode, for example by blocking access to the menu settings. How is that even possible? The thing is just that this is not a free app and it offers a huge variety of functions - overall it seems to be a bit excessive for my goals.
So my general question would be: is it somehow possible to restrict access to the safe-mode somehow? Maybe like a password? From what I understand it is not even possible to set a system password for Android devices that you'd have to enter once it boots (except if you set up a password for unlocking the screen first which would then be the same one... very redundant).
Disabling physical switch of volume down (in case of samsung devices) will stop access to safe mode on device. I dont find any other way to do so.

Disable all keys

I'm making an app for my school. This app needs to disable the phone for a certain amount of time (one hour). This means that I have to disable all hardware keys.
It only has to be able to run on one phone, which is running on android Jelly Bean. After some research, I found out that it I'm unable to accomplish this without making a Home Screen app. But I was wondering if it is able to accomplish this with root? I have rooted my device. If yes, how am I able to do this?
Thanks in advance.
Well you need to study about Kiosk Mode. Kiosk mode applications are applications that lock the device and do not allow the user to run any other application other than the kiosk application.

Is it possible to create an android app to make the phone run in sort of a kiosk mode?

I'm wondering if it's possible to develop an android app that will be run in sort of a kiosk mode. The idea is that the user should only be able to interact with the phone through this app.
I understand that an app can be auto-restarted, and things like avoiding incoming calls, could be implemented via a service that would subscribe to the telephony events and would hang up when an incoming call is received. The downside of this is that the usual "answer call screen" would pop up for a short period. The reason behind this is that the stock android app that receives the incoming calls will still be there.
I also understand that, by design, this custom app could be killed at any time by the OS if memory usage gets too low. Although this should only happen if there's a memory leak in any of the running apps.
I'm not sure either if it would be possible to disable the behavior of the physical buttons to access home or settings screens.
I understand that rooting the device and/or creating a custom ROM with modifications would be a safer approach, but also more complex. I'm wondering if a good-enough kiosk mode could be implemented with an android app.
P.S: I'm sorry for reposting these questions, but answers to similar questions are not clear enough.
Make your application be a home screen. That can still be bypassed unless you make your own custom firmware where your application is the system default home screen. We cannot tell you whether being a home screen alone is "a good-enough kiosk mode".
I've been searching for this for days now, nearly every answer is not a complete solution at all (and it's doing my head in)
This link though has the best answer so far
http://thebitplague.wordpress.com/2013/04/05/kiosk-mode-on-the-nexus-7/

Categories

Resources