FORUMS

Greenify on Non root phone

3,553 posts
Thanks Meter: 679
 
Post Reply Email Thread
Hello,
Im using MIUI 10 android 9 non rooted.
When i want activate agressive doze via adb [ adb -d shell pm grant com.oasisfeng.greenify android.permission.WRITE_SECURE_SETTINGS ], i get this error message:

D:\ANDROID\TOOLS\ADB-FASTBOOT>adb -d shell pm grant com.oasisfeng.greenify android.permission.WRITE_SECURE_SETTINGS
Security exception: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.

java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
at android.app.ContextImpl.enforce(ContextImpl.java:1 822)
at android.app.ContextImpl.enforceCallingOrSelfPermis sion(ContextImpl.java:1850)
at com.android.server.pm.permission.PermissionManager Service.grantRuntimePermission(PermissionManagerSe rvice.java:1391)
at com.android.server.pm.permission.PermissionManager Service.access$900(PermissionManagerService.java:8 9)
at com.android.server.pm.permission.PermissionManager Service$PermissionManagerInternalImpl.grantRuntime Permission(PermissionManagerService.java:2118)
at com.android.server.pm.PackageManagerService.grantR untimePermission(PackageManagerService.java:5604)
at com.android.server.pm.PackageManagerShellCommand.r unGrantRevokePermission(PackageManagerShellCommand .java:1730)
at com.android.server.pm.PackageManagerShellCommand.o nCommand(PackageManagerShellCommand.java:217)
at android.os.ShellCommand.exec(ShellCommand.java:103 )
at com.android.server.pm.PackageManagerService.onShel lCommand(PackageManagerService.java:21860)
at android.os.Binder.shellCommand(Binder.java:629)
at android.os.Binder.onTransact(Binder.java:527)
at android.content.pm.IPackageManager$Stub.onTransact (IPackageManager.java:2809)
at com.android.server.pm.PackageManagerService.onTran sact(PackageManagerService.java:4014)
at android.os.Binder.execTransact(Binder.java:728)

D:\ANDROID\TOOLS\ADB-FASTBOOT>


I read tutorial here https://greenify.uservoice.com/knowl...-some-features

Any help would be appreciated
The Following User Says Thank You to exodius48 For This Useful Post: [ View ] Gift exodius48 Ad-Free
3rd May 2019, 09:20 AM |#2  
Forum Moderator
Flag Chennai
Thanks Meter: 3,097
 
More
Quote:
Originally Posted by exodius48

Hello,
Im using MIUI 10 android 9 non rooted.
When i want activate agressive doze via adb [ adb -d shell pm grant com.oasisfeng.greenify android.permission.WRITE_SECURE_SETTINGS ], i get this error message:

D:\ANDROID\TOOLS\ADB-FASTBOOT>adb -d shell pm grant com.oasisfeng.greenify android.permission.WRITE_SECURE_SETTINGS
Security exception: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.

java.lang.SecurityException: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.
at android.app.ContextImpl.enforce(ContextImpl.java:1 822)
at android.app.ContextImpl.enforceCallingOrSelfPermis sion(ContextImpl.java:1850)
at com.android.server.pm.permission.PermissionManager Service.grantRuntimePermission(PermissionManagerSe rvice.java:1391)
at com.android.server.pm.permission.PermissionManager Service.access$900(PermissionManagerService.java:8 9)
at com.android.server.pm.permission.PermissionManager Service$PermissionManagerInternalImpl.grantRuntime Permission(PermissionManagerService.java:2118)
at com.android.server.pm.PackageManagerService.grantR untimePermission(PackageManagerService.java:5604)
at com.android.server.pm.PackageManagerShellCommand.r unGrantRevokePermission(PackageManagerShellCommand .java:1730)
at com.android.server.pm.PackageManagerShellCommand.o nCommand(PackageManagerShellCommand.java:217)
at android.os.ShellCommand.exec(ShellCommand.java:103 )
at com.android.server.pm.PackageManagerService.onShel lCommand(PackageManagerService.java:21860)
at android.os.Binder.shellCommand(Binder.java:629)
at android.os.Binder.onTransact(Binder.java:527)
at android.content.pm.IPackageManager$Stub.onTransact (IPackageManager.java:2809)
at com.android.server.pm.PackageManagerService.onTran sact(PackageManagerService.java:4014)
at android.os.Binder.execTransact(Binder.java:728)

D:\ANDROID\TOOLS\ADB-FASTBOOT>


I read tutorial here https://greenify.uservoice.com/knowl...-some-features

Any help would be appreciated

Most likely your ROM is incompatible. If you are keen on Greenify, switch to a custom ROM and check.
5th May 2019, 04:13 AM |#3  
exodius48's Avatar
OP Senior Member
Flag Yori's Heart
Thanks Meter: 679
 
Donate to Me
More
Quote:
Originally Posted by tnsmani

Most likely your ROM is incompatible. If you are keen on Greenify, switch to a custom ROM and check.

Custom rom? So i need to unlock bootloader my device , install twrp etc etc.? OK thanks.
I dont want to do it, so better to uninstall greenify.
5th May 2019, 01:04 PM |#4  
DB126's Avatar
Senior Member
Thanks Meter: 9,947
 
More
Quote:
Originally Posted by exodius48

Custom rom? So i need to unlock bootloader my device , install twrp etc etc.? OK thanks.
I dont want to do it, so better to uninstall greenify.

Good plan. Greenify really isn't needed on your device/rom.
The Following User Says Thank You to DB126 For This Useful Post: [ View ] Gift DB126 Ad-Free
27th February 2020, 06:43 AM |#5  
Senior Member
Thanks Meter: 102
 
More
When you run ADB on the computer make sure the CMD (the black window) is running As Administrator.
It really is worth it to run these ADB commands on a Non-Rooted device, Greenify works great.
25th April 2020, 07:44 PM |#6  
Member
Thanks Meter: 9
 
More
I have an OPPO K5 - China domestic version. When I tried to grant permission to GSAM I also had the same long error message. Then I discovered further down the Developer Options menu, there's a tab called "Disable Permission Monitoring", I switched it on and the adb command worked without the long error message. Not sure if MIUI has a similar tab though.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes