Repository navigation
Backlog
Labels
Description
Have you checked if an issue already exists for this feature request?
- Nobody else has requested this feature before
What feature would you like added?
App version: 4.7.1-foss
Device: OnePlus Ace 5 Ultra (PLC110), ColorOS 16 (China), Android 16
I enabled Expert Mode (Shizuku) for a side button remap. It silently made Key Mapper the Device Owner — no warning this is persistent. After a reboot it broke my launcher layout.
Confirmed state:
dpm list-owners → io.github.sds100.keymapper/.system.DeviceAdmin (DeviceOwner, Affiliated)
Nothing I tried works:
dpm remove-active-admin ...→ SecurityException: Attempt to remove non-test adminpm disable-user ...→ SecurityException: Cannot disable a protected packagepm uninstall --user 0 ...→ blocked while Device Owner- Settings → Device admin apps: row shows "Activated", not clickable
- The app has no option to clear Device Owner itself
- Now I can't uninstall Key Mapper at all without a factory reset
Please add either:
- A "Clear device owner" option in Settings (calls clearDeviceOwnerApp internally — an owner can clear itself), or
- Automatically call clearDeviceOwnerApp() when Expert Mode is toggled off, or
- At minimum, warn that Expert Mode makes the app a persistent Device Owner before enabling it.
Tested removal paths on Android 16 (ColorOS 16 CN): shell dpm remove → blocked; safe mode → same; reinstall → same. Factory reset is the only working method, which is unacceptable for a button remapper.
App version
4.7.1-FOSS
Device model and manufacturer
OnePlus
Extra info
- My device is rooted
Activity
sds100 commentedon Nov 24, 2026
Hi, I'm not sure how device owner was turned on. Expert Mode doesn't do that and we haven't had any reports about this before. Which actions are you using? Are you sure Expert Mode caused the problem? Are you using standard Shizuku or some fork? What adb commands have you run recently?
I don't want to deny that what you're seeing happened, but it's very unlikely or impossible any code in Key Mapper did this directly.
judas-priest commentedon Nov 24, 2026
Thanks for the reply. Honest status: I did NOT run
dpm set-device-ownerorset-profile-ownermanually — so I can't tell you exactly which mechanism assigned it, and I won't claim to know. I can only give you suspects:Expert Mode (Shizuku) was enabled around the time this happened. Its start script is documented in Oculus Quest(and perhaps other devices) adb commands to fix KeyMapper in v40+ #1020 to run
dpm set-active-admin --user current io.github.sds100.keymapper/.system.DeviceAdmin. I don't know whether some auto-start flow escalates further to set-device-owner on OEM builds like ColorOS 16 CN — but the end state here is DeviceOwner + Affiliated, not just admin.Around the same time I also tried activating Dhizuku (com.rosan.dhizuku). Its Shizuku-based activation failed for me with an error, but How do I activate Dhizuku iamr0s/Dhizuku#19 documents a path where the activation helper runs
dpm set-active-admin+dpm set-profile-owner. Dhizuku is currently uninstalled.Technical facts from my device (OnePlus Ace 5 Ultra, PLC110, ColorOS 16 CN, Android 16):
$ dpm list-owners
1 owner:
User 0: admin=io.github.sds100.keymapper/.system.DeviceAdmin,DeviceOwner,Affiliated
$ dpm remove-active-admin io.github.sds100.keymapper/.system.DeviceAdmin
java.lang.SecurityException: Attempt to remove non-test admin
$ pm disable-user io.github.sds100.keymapper
java.lang.SecurityException: Cannot disable a protected package
$ pm uninstall --user 0 io.github.sds100.keymapper
blocked while Device Owner
What I'd love:
A factory reset is the only working removal path right now, and losing everything to a button remapper is painful. Thanks for looking into it!
sds100 commentedon Nov 24, 2026
Maybe this was caused by Dhizuku? It could have left some daemon running with Shell permissions even after you uninstalled it. Expert Mode does not enable device owner, there is nothing in Key Mapper that runs the
dpmcommand.The only feature that does use Device Owner is the "Secure lock device" action. I think almost no one uses that feature though. I will consider adding a warning at the top of Key Mapper settings that device owner is enabled.
judas-priest commentedon Nov 24, 2026
dpm list-owners shows the owner IS Key Mapper itself (io.github.sds100.keymapper), not Dhizuku. Dhizuku is uninstalled. I never used the "Secure lock device" action.
Question: since Key Mapper is the owner, how do I remove it? Is there a clearDeviceOwner option, or should I check my keymaps for a "Secure lock device" action?
sds100 commentedon Nov 24, 2026
I really don't know how this happened to you, sorry. You're sure Dhizuku didn't make Key Mapper the owner? You're using official Key Mapper right, not some fork? This device owner feature may be different to Device Admin actually, not sure. Device Admin is a standard GUI setting in Android settings.
You can't use ADB to turn off device owner for Key Mapper?
judas-priest commentedon Nov 24, 2026
Yes — ADB cannot remove it. Tested:
$ adb shell dpm remove-active-admin io.github.sds100.keymapper/.system.DeviceAdmin
java.lang.SecurityException: Attempt to remove non-test admin
Shell (uid 2000) is only allowed to forceRemoveActiveAdmin for testOnly admins. Key Mapper is a non-test admin + DeviceOwner, so shell gets rejected. That's the documented Android behavior for non-testOnly device owners: only the owner app itself (clearDeviceOwnerApp) or a factory reset can remove it.
Shizuku is the official RikkaApps build, not a fork. I never enabled the "Secure lock device" action, so I'm not sure how Key Mapper became the owner — maybe the Expert Mode System Bridge startup (start.sh) calls dpm set-active-admin/set-device-owner on some OEM builds? (see #1020 where set-active-admin is documented)
Feature request: please add a "Clear device owner" button in Key Mapper settings — since the app is the owner, it can call clearDeviceOwnerApp() on itself.
Device info: OnePlus Ace 5 Ultra (PLC110), ColorOS 16 CN (16.0.10.500), Android 16. Not rooted, bootloader locked, Shizuku is the official RikkaApps build.