flxapps / DetoxDroid

Use your phone rather than letting your phone use you.
GNU General Public License v3.0
313 stars 16 forks source link

Removing the app #90

Closed tioui closed 11 months ago

tioui commented 11 months ago

When trying to uninstall the app that was installed using the manual instruction I have an error. Command executed:

adb shell pm uninstall com.flx_apps.digitaldetox

Error:

Failure [DELETE_FAILED_DEVICE_POLICY_MANAGER]

When trying to remove the active admin settings, I got this: Command executed:

adb shell dpm remove-active-admin com.flx_apps.digitaldetox/.system_integration.DetoxDroidDeviceAdminReceiver

Error:

Exception occurred while executing 'remove-active-admin':
java.lang.SecurityException: Attempt to remove non-test admin ComponentInfo{com.flx_apps.digitaldetox/com.flx_apps.digitaldetox.system_integration.DetoxDroidDeviceAdminReceiver} 0
    at com.android.server.devicepolicy.DevicePolicyManagerService.lambda$forceRemoveActiveAdmin$9$DevicePolicyManagerService(DevicePolicyManagerService.java:3712)
    at com.android.server.devicepolicy.DevicePolicyManagerService$$ExternalSyntheticLambda20.runOrThrow(Unknown Source:6)
    at android.os.Binder.withCleanCallingIdentity(Binder.java:390)
    at com.android.server.devicepolicy.DevicePolicyManagerService$Injector.binderWithCleanCallingIdentity(DevicePolicyManagerService.java:1554)
    at com.android.server.devicepolicy.DevicePolicyManagerService.forceRemoveActiveAdmin(DevicePolicyManagerService.java:3708)
    at com.android.server.devicepolicy.DevicePolicyManagerServiceShellCommand.runRemoveActiveAdmin(DevicePolicyManagerServiceShellCommand.java:280)
    at com.android.server.devicepolicy.DevicePolicyManagerServiceShellCommand.onCommand(DevicePolicyManagerServiceShellCommand.java:93)
    at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
    at android.os.ShellCommand.exec(ShellCommand.java:38)
    at com.android.server.devicepolicy.DevicePolicyManagerService.onShellCommand(DevicePolicyManagerService.java:9845)
    at android.os.Binder.shellCommand(Binder.java:950)
    at android.os.Binder.onTransact(Binder.java:834)
    at android.app.admin.IDevicePolicyManager$Stub.onTransact(IDevicePolicyManager.java:6984)
    at android.os.Binder.execTransactInternal(Binder.java:1184)
    at android.os.Binder.execTransact(Binder.java:1143)

It look like the "android:testOnly" setting is not enable in the Manifest. So the app cannot be removed.

tioui commented 11 months ago

Never mind. By disabling the app in the Apps settings in Android, you can then removing it.