Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android mobile control

I don't want to do advertisement but sample app for behavior of my application is ESET antivirus.

One requested feature of my application is that for uninstall is needed password. I add my app to device admin list and it is not possible to uninstall it now. But you can Deactive app as admin device. Whan you go to Settings > Location & security > Select device administrators and you try to deactive ESET Security it starts the activity (I guess from DeviceAdminReceiver.onDisableRequested()) which is waiting for password and your mobile is locked. Home button, back button and even SwitchOff button doesn't react=>

How it is possible that Home,Back,SwitchOff and Camera button doesn't react?

EDIT - second question removed (After I took out battery from my phone - ESET wasn't device admin too)

Thank you for ideas.

like image 373
vlkpo Avatar asked Aug 14 '12 12:08

vlkpo


People also ask

Can I remotely control an Android phone?

TeamViewer lets you control Android phones remotely from another device seamlessly. It has chat support, screen sharing, intuitive touch and control gestures, HD videos, and sound transmission. To use it, simply download TeamViewer on both devices and connect them using a unique ID.

How can I control another Android phone secretly?

If you'd like to control your devices from another android device, then download and install the AirMirror android remote access app. On your controlled/server/host device (devices), download and install the AirDroid Personal app.

Can I control someones phone with my phone?

Yes, it is possible to remotely control another phone using a PC or a smartphone, provided they have given you access to their phone, and you are doing it with consent. If the phone you want to be controlled has apps like AirDroid Personal installed, then you can use this app to control another phone remotely.


1 Answers

Ok, sorry ESET but this feature looks very interesting so I took a look at decompiled sources :)

The basic workflow is the following:

  • com.eset.ems.antitheft.receiver.AdminReceiver subclass of DeviceAdminReceiver is registered for broadcast actions DEVICE_ADMIN_ENABLED and DEVICE_ADMIN_DISABLED
  • When device admin is disabled com.eset.ems.antitheft.receiver.AdminReceiver.onDisabled() is called
  • com.eset.ems.antitheft.LockActivity is started from the AdminReceiver.onDisabled()
  • LockActivity shows com.eset.ems.antitheft.LockingDialog where the most blocking magic happens

As for the Home and other button block antivirus do the following trick - it uses ActivityManagerNative from Android internals. To keep LockActivity at the top of all other activities it starts a thread which contsantly calls ActivityManagerNative.moveTaskToFront() with LockActivity task ID. Prior to API level 10 reflection is used to access hidden moveTaskToFront() from ActivityManager class and after API 10 it just uses ActivityManagerNative code from Android codebase to access it. Also both LockActivity and LockingDialog call ActivityManagerNative.closeSystemDialogs() method many times. Probably this is done in order to cancel system dialog which arises after power button long press.

As for the stopping execution of DeviceAdminReceiver.onDisableRequested actually I didn't notice anything special about it in the code. It only starts the activity after device admin is disabled and that's all. And on my phone device admin was disabled after I took the battery out.

like image 63
Andrei Mankevich Avatar answered Oct 01 '22 00:10

Andrei Mankevich