Unable to disable DEVICE LOCK CONTROLLER in Device Admin Apps - Android 12 - android

I have recently bought an android phone, and it has a Device Admin App named DEVICE LOCK CONTROLLER which is unable to disable.
I have tried to turn on the developer option, but that is also locked by that app.
How I can fix that? It's a Realme phone

Related

I have a problem with IDLE Mode on Huawei devices when screen is turned off

I am developing an application that monitors the physical activity of user (ON_BICYCLE, RUNNING, WALKING, IN_VEHICLE, STILL, ON_FOOT).
.
So far I've tested the app on Samsung (android ver 7-10), Moto (android ver 7-10) and xiaomy phones (android version 8) and it worked Ok even when the screen turns off (in the background).
I recently started testing on Huawei Y6(2018) (emui 8.0.0) and there is a problem when the phone turns off screen and is left without a WIFI network.
If the screen is OFF and phone have WIFI network - application works Ok.
If the screen is ON and phone is without WIFI network - works Ok.
But if the screen is off and the phone loses the WIFI network, application is freezes, no ActivityTransitionUpdates and no onLocationChanged. After that if screen is turned ON or phone again have WIFI network, everything is Ok.
On the phone I set 'Launch' to Manual and IgnoreBatteryOptimisation to Allow.
Has anyone encountered a similar problem?
If your users are using Huawei phones, you can prompt users to add protected applications to your settings to further reduce the probability of service killing. Go to Settings > Battery > Battery Usage > Your App, turn off Management Automatically, enable Auto-launch, Secondary launch, Run in background.
You can also integrate Push Kit, make the notification to users, and show it as foreground.

Can I launch a specific app when android device get physically connected to a specific usb device?

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

Setting Device Owner app problem "Workspace has been locked" Android Oreo 8.1

0
I've been using my app as a deviceOwner App since lollipop. I have a new device here which I want to be DeviceOwner too.
It is a Samsung galaxy Tab A 10.5(2018) SM-T590.
I am currently running this Version of the rom: T590XXU2ASC1.
I am not using NFC method. I usualy create the /data/system/device_owner.xml file by myself. But since it is not working I tryed this method:
1-Factory reset the tablet in recovery mode
2-Pass through the annoying startup menus
3-Set lock screen to none
4-Enable Usb Debugging
5-Install my app adb install MyApplicaton.apk
6-adb shell dpm set-device-owner com.example.myapplication/.MyApplicationReceiver It always says success when i execute the command.
7-Start my app, i can pin/unpin my app without problem.
8-Reboot, and then the famous message appears everytime: Workspace has been locked Unauthorized software has been installed on your device.Workspace has been locked to prevent any unauthorized access. Contact your admin.
Then if i press on the FACTORY DATA RESET button the workspace app crashes then pops back.
I tryed the kioskModeDemo app and the androidDeviceOwner sample app and they all do the same problem.
Anybody have any hints of why this is not working anymore on Android 8(oreo)?
Thanks
I found the problem: Once you oem unlock(custom os) your device on a certain samsung knox level API, you can't be device owner anymore on this device.
This is from Samsung Knox page: "Cannot create work profile" "The security policy prevents the creation of a managed device because a custom OS is or has been installed on this device". https://seap.samsung.com/forum-topic/knox-and-nfc-device-owner-provisioning
The device could be vulnerable to potential attacks with custom os.

Android set app in auto start FCM service on Asus or Huawei devices

I develop an application that needs to send a notification with FCM.
But when I installed it on the Asus device when app closed (killed) data was not received in service.
I realized Asus and Huawei and some other vendors have auto start setting to save battery and user must allow to my app that have access background service.
Is it possible to run this service without permission from the user?
Some application does this! for example, Telegram.
Unfortunately you cannot whitelist your app in Auto Start / Auto Protect for ASUS and Huawei devices without user intervention.
The best course of action is to display a dialog in case the android.os.Build.MANUFACTURER is huawei or asus and open up the Auto Start / Auto Protect page to make things easier for the user:
"Protected Apps" setting on Huawei phones, and how to handle it

How to auto launch an application on an android event

I have an application which can explore the file system of android and the devices connected to android.
I want my app to get launched automatically on an event-specifically whenever a usb storage device is connected.
I have tried giving device filter list and it does the task but the application gets launched only for devices that are mentioned in the device filter list. How can I achieve the same for all usb devices-application should launch itself automatically for every usb device connected,

Categories

Resources