theblixguy / ForceDoze

Enable Doze mode immediately after screen off and turn off motion sensing to get best battery life
https://play.google.com/store/apps/details?id=com.suyashsrijan.forcedoze&hl=en
GNU General Public License v3.0
179 stars 37 forks source link

Cannot enable DUMP permission #68

Open sphh opened 6 years ago

sphh commented 6 years ago

I just installed ForceDoze the first time via F-Droid.

I have a non-rooted phone, Android 8.1.0.

When I start ForceDoze, I get the SU permission denied error. I followed the ROOT PERMISSION WORKAROUND and send this command to the (only connected) phone (after plugging the phone in with an USB cable and changing the USB mode to: Use USB to: Transfer files):

adb shell pm grant com.suyashsrijan.forcedoze android.permission.DUMP

This command runs without any visible errors.

I stopped ForceDoze and restarted it again. Still I get the SU permission denied error. I issued the adb command with ForceDoze running or closed. Same result.

If I check for the permissions for ForceDoze with

adb shell dumpsys package com.suyashsrijan.forcedoze

I get

[...]
Packages:
  Package [com.suyashsrijan.forcedoze] (94d0b9b):
    userId=10084
    pkg=Package{4395b38 com.suyashsrijan.forcedoze}
    codePath=/data/app/com.suyashsrijan.forcedoze-ufZn7ZRsxlBXk90XH4AIdw==
    resourcePath=/data/app/com.suyashsrijan.forcedoze-ufZn7ZRsxlBXk90XH4AIdw==
    legacyNativeLibraryDir=/data/app/com.suyashsrijan.forcedoze-ufZn7ZRsxlBXk90XH4AIdw==/lib
    primaryCpuAbi=null
    secondaryCpuAbi=null
    versionCode=68 minSdk=23 targetSdk=27
    versionName=1.4.0
    splits=[base]
    apkSigningVersion=1
    applicationInfo=ApplicationInfo{b871711 com.suyashsrijan.forcedoze}
    flags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
    privateFlags=[ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION ]
    dataDir=/data/user/0/com.suyashsrijan.forcedoze
    supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
    timeStamp=2018-10-29 13:11:15
    firstInstallTime=2018-10-29 13:11:16
    lastUpdateTime=2018-10-29 13:11:16
    installerPackageName=com.android.packageinstaller
    signatures=PackageSignatures{9b23076 [1a8518d6]}
    installPermissionsFixed=true installStatus=1
    pkgFlags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
    requested permissions:
      android.permission.WAKE_LOCK
      android.permission.RECEIVE_BOOT_COMPLETED
      android.permission.WRITE_SETTINGS
      android.permission.ACCESS_WIFI_STATE
      android.permission.CHANGE_WIFI_STATE
      android.permission.READ_LOGS
      android.permission.READ_PHONE_STATE
      android.permission.DUMP
      android.permission.WRITE_SECURE_SETTINGS
    install permissions:
      android.permission.RECEIVE_BOOT_COMPLETED: granted=true
      android.permission.CHANGE_WIFI_STATE: granted=true
      android.permission.ACCESS_WIFI_STATE: granted=true
      android.permission.DUMP: granted=true
      android.permission.WAKE_LOCK: granted=true
    User 0: ceDataInode=621422 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false virtual=false
    overlay paths:
      /vendor/overlay/framework-res__auto_generated_rro.apk
      lastDisabledCaller: com.android.packageinstaller
      runtime permissions:

Package Changes:
[....]

Relevant parts (I could spot) in adb logcat:

10-29 15:24:07.712  9204  9204 I ForceDoze: Check if SU is available, and request SU permission if it is
10-29 15:24:07.838  9204  9204 I ForceDoze: SU available: false
10-29 15:24:07.838  9204  9204 I ForceDoze: SU permission denied or not available

Are there any other special instructions to get ForceDoze working?

Denny197 commented 1 year ago

Have you found any solution?

sphh commented 1 year ago

Well, I re-installed ForceDoze today and issued the following commands:

adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.DUMP
adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.WRITE_SECURE_SETTINGS

The teaser says, that the second is only needed for devices running Nougat, but I did it anyway.

I now can start ForceDoze without complaining about missing permission. Still I cannot change the Light Doze tunables (I get a permission error when accessing them telling me that I cannot save the tunables).

Does that help you?

THEBOSS619 commented 1 year ago

Well, I re-installed ForceDoze today and issued the following commands:

adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.DUMP
adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.WRITE_SECURE_SETTINGS

The teaser says, that the second is only needed for devices running Nougat, but I did it anyway.

I now can start ForceDoze without complaining about missing permission. Still I cannot change the Light Doze tunables (I get a permission error when accessing them telling me that I cannot save the tunables).

Does that help you?

Look for Battery Guru app. It allows you to tune your Doze parameters and even more. Gives you a lot of options for power saving.

This ForceDoze app is outdated and too old.

@Denny197

sphh commented 1 year ago

@THEBOSS619: Which Battery Guru do you mean? There is none available on F-Droid …

THEBOSS619 commented 1 year ago

@THEBOSS619: Which Battery Guru do you mean? There is none available on F-Droid …

They have official website.That's there official website. I never mentioned finding it on F-Droid.

Official home website. https://www.paget96projects.com/battery-guru.html

To download it... that's their link. https://www.paget96projects.com/battery-guru-download.html

I have been using it for over a year, and it never disappoints. It provides full control on Doze tunables and options, including other features.

sphh commented 1 year ago

From the website you mentioned:

Battery Guru is a helpful tool that provides insights into the health of your phone's battery.

whereas

ForceDoze allows you to forcefully enable Doze right after you turn off your screen, and on top of that, it also disables motion sensors so Doze stays active even if your device is not stationary while screen off.

That's two completely different tasks! (But thanks for sharing)

THEBOSS619 commented 1 year ago

From the website you mentioned:

Battery Guru is a helpful tool that provides insights into the health of your phone's battery.

whereas

ForceDoze allows you to forcefully enable Doze right after you turn off your screen, and on top of that, it also disables motion sensors so Doze stays active even if your device is not stationary while screen off.

That's two completely different tasks! (But thanks for sharing)

No, it's not different tasks at all... it is actually much more advanced than ForceDoze and offers many more options than ForceDoze.

In their own website under Blog section. They have two versions of Battery Guru. You need to use the extended version to get advanced options.

https://www.paget96projects.com/blog/update-battery-guru-v2174

Follow-up updates and news from their own telegram channel. It's on the same link.

Let me show you the options that offers Battery Guru compared to ForceDoze.

Screenshot_20230920_121637_Battery Guru.jpg

Screenshot_20230920_121548_Battery Guru.jpg

Screenshot_20230920_121606_Battery Guru.jpg

Just wanted to you give some insights what Battery Guru offers compared to ForceDoze.

Hopefully, it shows you that Battery Guru does more than one task.. it will monitor your battery and allows you to tune Doze parameters with much more options than ForceDoze does.

sphh commented 1 year ago

Sorry, but the link from their website (https://play.google.com/store/apps/details?id=com.paget96.batteryguru) cannot be found in the Google Playstore. And as they say: Stay away from any software downloaded from outside of the playstore. So this is a strong warning: Stay away from that software Battery Guru, because it cannot be installed from the Google Play Store.

THEBOSS619 commented 1 year ago

Sorry, but the link from their website (https://play.google.com/store/apps/details?id=com.paget96.batteryguru) cannot be found in the Google Playstore. And as they say: Stay away from any software downloaded from outside of the playstore. So this is a strong warning: Stay away from that software Battery Guru, because it cannot be installed from the Google Play Store.

Sorry for the long comment. tdlr:- As you wish...

Not everything Googles say is truthful. The developer is trustworthy, and all the information that you want to know is on his website on Blog section and on his telegram channel.

I won't write here the events that Battery Guru went through. Everything is written down on their website & telegram. Again, follow his telegram channel and see by yourself how the app went through and how Google treated him badly and unfairly.

I did my best to provide every information related to his App.

ForceDoze is old and outdated. This two things causes compatibility issues and poses a Security problem too.

Denny197 commented 1 year ago

@THEBOSS619 Thanks for your kind help, will gonna use extended version of it.