Well, today in my workplace i have been given a task. Boss handed me an android mobile, which only runs a application and nothing else. Whenever the mobile starts, it starts the application and users cant nvaigate anywhere from that application. which means the mobile is only dedicated for that application. An ex-employee did this thing.
I need to bring it to normal condition. Then do the same for another application, which is only my application will run in the mobile, as its doing for another app.
How to solve it? Can anyone please help me?
If you do not care about the data stored on that mobile then you should perform the factory reset. This will bring your mobile to the fresh state with only OEM apps installed.
To do it you need to enter the recovery mode. If your device has USB debugging mode enabled then simply connect it to the computer and type adb reboot recovery. If debugging is not enabled then you have to force the recovery mode then you should do a research on the internet how to put your device in recovery mode. For example for Samsung devices you have to turn off the device and then hold Home+VolumeUp+Power buttons.
Once you enter the recovery mode you will see few options. One of them is "wipe data/factory mode" (see example here). Use volume buttons to navigate through options and power button to accept the option (note that touchscreen is not operable in this mode). Remember that this will erase all your data and you will not be able to restore it. No turning back beyond this point.
After the reset you will have no custom apps installed so you can install whatever you want.
If you cannot do the factory reset because you do not want to lose your data then there is other, more difficult option, that requires some Android programming. You can simply write an application that would:
run at startup
get information about installed packages
find the application that has been blocking the device
send an intent that would ask the user if he wants to uninstall the app:
Uri packageURI = Uri.parse("package:"+"some.package.to.remove");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);
Related
Can I "register" a (already installed) specific app to be launched when android device get physically connected to a specific usb device ?
Eg.
I connect a keyboard (of a certain brand or with a special USBid/class) and it automatically launch a text editor app
I connect an USB soundcard and it launches an audio app.
And "better", is there an autolaunch on Android ? I plug a keyboard+storage device to my smartphone and Android will ask me if I want to install the apk from the storage (or download it from predefined url)
Obviously for security reasons I understand installing the app from the storage will need confirmation by user. But, once the app has been "registered" would it be possible to launch the app automatically without having a confirmation screen ?
I know I could get USB info with android.hardware.usb.usbdevice. My question is more about how I can tell Android to launch this app rather than another when usb device is connected.
I think you could register your app to receive a system broadcast like USB_ACCESSORY_ATTACHED and make the logic to launch your app when this happens.
Check https://developer.android.com/guide/components/broadcasts
https://developer.android.com/reference/android/hardware/usb/UsbManager.html#ACTION_USB_DEVICE_ATTACHED
My company has written an android driver app (for making deliveries) from which the driver can select a 'call' button to dial the customer they are delivering to. I know how to change the intent to auto dial the number instead of the user having to manually initiate the call but I would like to know if there is a way of somehow locking the dialler down in some way.
Best solutions would be to either a) ensure that the phone returns to the drivers app after the call hangs up, or b) disabling the number pad on the dialler so they cannot call any other numbers.
I have searched through the available dialler apps on play store to see if there was anything suitable but I could not find anything. I have searched the forums (which is how I found the ACTION.CALL intent) but not really found a solution yet.
The app is written with PHP and javascript.
Any suggestions would be very helpful.
Thanks in advance,
Ant.
Is this on their personal phone, or on a device you give them? If its a personal phone, no. If its a device you give them- what you really want is a kiosk app. You could install your own softphone that doesn't allow dialing (although you should probably add a 911 button for emergencies) and block the user from installing any other dialers via DeviceManager apis (you'd have to be the device owner, but as its a device you physically control that's no problem).
Of course doing kiosk mode is really diving through deep apis that almost nobody uses. I wouldn't recommend it without an android expert on your team.
Outisde of kiosk mode and a complete lockdown of your device- no there is no way. Because the dialer is just an app, there's no way to force it to have certain features.
I'm trying to build a kiosk app using android 5's screen pinning feature. It seems that all I need to do in the app was to call startLockTask(), but this still allows the user to leave the app by pressing the recent and back buttons.
To pin the app in a way that does not allow the user to leave it requires the app to be a device owner. Based on sites such as this one, one needs to run
adb shell dpm set-device-owner my.package.name/.MyAdminReceiver
in order to set the device owner. However, that command failed with
java.lang.IllegalStateException: Trying to set device owner but device is already provisioned.
which, I heard, is caused by the file /data/system/device_owner.xml already being present on the device.
Since the device had just been freshly factory-reset, I suspect that it had come with an app already provisioned by the manufacturer, so I rooted the device. I would rather do it without rooting (since there will be some 70 devices I have to run the procedure on) but for research purposes, it can't be helped.
After rooting the device, I tried to find the device_owner.xml file but it wasn't there. I tried creating one anyway based on this answer, but the app still shows the pinning message and the recent+back buttons still unpinned the app.
So why can't I set the device owner? is there any way around it?
While it's true that I tried dpm provisioning on a newly reset device, #basilisk's comment hinted me at the answer. The device comes loaded with bloatware that provides default accounts. Disabling these apps finally allowed me to provision the device with dpm.
I have an android application which lists installed and system applications separately. When the user tries to reboot the device from my application it will open my application instead of default home launcher.
But when the device is rebooted to 'safe mode' all logic crashes .ie, the device rebooted to my application in safe mode but it does not list any installed applications and stops its working.
Is it possible to make my application work in 'Safe mode' also?
Is there any way to prevent the device from going to 'safe mode' while running my application like using a RECEIVE_BOOT_COMPLETED broadcastreceiver?
What is device admin applications? Is it helpfull in this situation?
Is it possible to detect safe mode programmatically?
Thanks in advance
I know this question is old, but perhaps this will help someone. If your application is Device Owner or Profile Owner on the primary user, you can disable safe mode completely (it works without root):
DevicePolicyManager manager = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName admin = new ComponentName(getApplicationContext(), DeviceAdminReceiver.class);
// To disable safe boot
manager.addUserRestriction(admin, UserManager.DISALLOW_SAFE_BOOT);
// To enable safe boot again
// manager.clearUserRestriction(admin, UserManager.DISALLOW_SAFE_BOOT);
EDIT: You can set Device Owner or Profile Owner simply via ADB: https://developer.android.com/studio/command-line/adb#dpm
adb shell dpm set-device-owner com.example.deviceownerapp/.DeviceAdminReceiver
Note that you must have no accounts added when activating device owner (you don't have to do system reset though, just remove all account from settings). After device owner is set, you can add any accounts again.
If you create a shortcut of that particular app that you want to launch in safe mode, you can do so while in safe mode. But you should be in normal mode when creating the shortcut.
The only way to do this is to make the user app a system app on /system/app
But if your device is rooted there is an easy way to do this
download lucky patcher and enable root access
use the search option to find the app you want to be able to use in safe mode or just find it in the scrolling menu
click on the app, click on tools, then press move to /system/app
after the process is complete the device will have to be restarted
the user app is now able to be accessed in safe mode
Device admin apps as well dont run.
To run your app in safe mode, you need to copy your app to /system/app, for which you need root access.
So only on rooted device it is possible.
Out of safe mode,Put an installed app on Home screen. Reboot into safe mode,and the app will be on Home screen, and the app will work in safe mode!
I wish to filter the applications installed on the device so that the person, using that device can't open any app rather than few basic apps... or i wish when he/she opens any application password will be asked......
That somewhat of a more low level task. I guess you will have to either root the device, or build your own System image and install that on your device.
By reading 'Logcat' logs in the background we can detect other applications launch; as working of any lock application.