[MOD][APP][XPOSED][4.1+] Power Nap for Xposed - Sony's Stamina Mode for all devices!

Search This thread

waylaidwanderer

Senior Member
Feb 19, 2012
189
799
Introduction

As the owner of an Xperia Z3, I found myself missing Stamina Mode after flashing a CM12 ROM. None of the battery apps in the Play Store worked the same way - most of the ones I found merely disabled Wi-Fi/data while the screen was off, along with managing auto-sync, but I still wanted whitelisted apps to be able to access the internet.

I spent a good 12 hours straight working to replicate the basic features of Stamina Mode, and now here we are: Power Nap for Xposed!

Images

Imgur album link for easier viewing: http://imgur.com/a/JvSD8

7VtGH1q.png

Cy1bh4t.png

gysUudu.png

CF7vaJQ.png

Czq2RUf.png



Description

Compatible with any Android device running 4.1+, with root and Xposed.

Power Nap for Xposed is the best app for saving battery. When your screen is off, Power Nap maximizes your device's deep sleep time by stopping services, alarms and wakelocks from waking the device when the screen is off. This means you can leave Wi-Fi/data on and still get the notifications from apps you have whitelisted, while all others are unable to wake up your device, leading to an increase in your battery life.

Power Nap for Xposed also has a Low Battery Mode, where you can selectively functions to save power when battery level is low.

Power Nap for Xposed is inspired by Sony's Stamina Mode, but accessible for all Android devices 4.1 and higher. This app requires root and Xposed.

Be sure to whitelist any third-party alarm clock app you are using, or it will be prevented from waking up your device!

Permissions

android.permission.INTERNET: this is for Crashlytics only, which will automatically send me stack trace logs if the app crashes due to something non-Xposed related. No other information is being sent.
android.permission.WRITE_SETTINGS: For Low Battery Mode, to change screen brightness and screen display timeout
android.permission.READ_SYNC_SETTINGS: For Low Battery Mode, to check if auto-sync is on/off
android.permission.WRITE_SYNC_SETTINGS: For Low Battery Mode, to turn on/off auto-sync
android.permission.ACCESS_WIFI_STATE: For Low Battery Mode, to check if Wi-Fi is on/off
android.permission.CHANGE_WIFI_STATE: For Low Battery Mode, to turn on/off Wi-Fi
android.permission.ACCESS_NETWORK_STATE: For Low Battery Mode, to check if mobile data is on/off
android.permission.BLUETOOTH: For Low Battery Mode, to check if Bluetooth is on/off
android.permission.BLUETOOTH_ADMIN: For Low Battery Mode, to turn on/off Bluetooth
android.permission.RECEIVE_BOOT_COMPLETED: For Low Battery Mode, to start a service that monitors the current battery level (if LBM is enabled), when the device is finished booting

Installation Instructions

To get the app, you can either opt-in for testing on Google Play (and/or join the G+ Alpha testing community if you're interested in helping out by reporting bugs and sharing your experiences), or simply download it directly from the Xposed Module Repository. You may need to change "Versions to be shown" to "Experimental" in the Xposed Installer's Settings to be able to download it using the app.

The latest APK version is also attached to the "Download" tab of this thread, but you will not receive updates using this method.

Final Thoughts

By using Power Nap, you can expect to see as little as 0.2% battery drain per hour (if you don't have many apps whitelisted) during standby. Results may vary by device and depending on which apps have been whitelisted.

Since it's in Alpha mode, please feel free to leave feedback and report bugs. If you need any clarifications on any aspect of the app, please leave a comment!

NEW ISSUE TRACKER - POST ISSUES HERE

XDA:DevDB Information
Power Nap for Xposed, Xposed for all devices (see above for details)

Contributors
waylaidwanderer
Xposed Package Name: net.jzhang.powernap

Version Information
Status: Alpha
Current Beta Version: 0.8a
Beta Release Date: 2015-04-09

Created 2015-04-09
Last Updated 2016-10-22
 
Last edited:

kanadali

Member
Mar 17, 2017
31
6
This module keep working after years.. and keep being great =d

Im using this module (because really work...) on Android Pie (9). Just need set chmod 777 /data/data/net.jzhang.powernap/shared_prefs/*.xml for see the statistics.

The latest version is 0.8.1 alpha.

can you please guide us how to get this app work properly ?
i mostly get blackscreen during incoming calls. power nap does not let the system wakes up so.
thanks in advance

---------- Post added at 12:50 AM ---------- Previous post was at 12:48 AM ----------

found this on github -*-*

perhaps also worth mentioning, in my search to find this problem, I created a file to run at startup which sets selinux to permissive and chmods the xml files for powernap to global read write (i don't care :p)

/system/su.d/permissive.sh

#!/system/bin/sh
setenforce 0
chmod 777 /data/data/net.jzhang.powernap/shared_prefs/*.xml

--*

i think the edit_check talking about this.
 

AnonVendetta

Senior Member
Apr 29, 2016
1,702
618
I haven't used this module for a long time. On Marshmallow+, you don't need it, because Doze mode is built into Android. But on anything up to Lollipop, PowerNap is still beneficial. Having SELinux in permissive mode makes this module work fine. If you're on Marshmallow+, check out ForceDoze/NapTime/Greenify/Doze Settings Editor. Out of those 4, I personally prefer ForceDoze, but they're all good. These apps let you fine-tune Doze mode. The best thing about these apps is that they don't require Xposed, you can use them with root. In some cases (like ForceDoze) you can set it up with ADB instead of root, which lets you reap the benefits without rooting. In terms of Doze mode vs PowerNap, I would say doze saves more battery overall. You can use both, but it's pointless, and your battery life savings will be minimal at best.
 
Last edited:

Ultimous

Senior Member
Apr 1, 2015
178
40
Man ..
I spent the whole week looking for something like this .. thinking like I was thinking before I knew about #xprivacy ; there has to be someone thinking the same way am thinking with the knowledge to actually create it ..

Thank you
 

dels07

Senior Member
Nov 1, 2012
422
153
Jakarta
never use sony devices before, let's say if I add whatsapp/bbm/snapchat to app whitelist I still could get notification or chat while the data will mostly turned off?
isn't deep sleep battery saver works with turning off data/wifi and turn on again for specific minute in time interval?
 

waylaidwanderer

Senior Member
Feb 19, 2012
189
799
Will it work on android 5.1?
It should work, as long as you get Xposed working!
It's been confirmed that it DOES NOT WORK with 5.1 due to ART changes.

never use sony devices before, let's say if I add whatsapp/bbm/snapchat to app whitelist I still could get notification or chat while the data will mostly turned off?
isn't deep sleep battery saver works with turning off data/wifi and turn on again for specific minute in time interval?
Yep, Power Nap will let your whatsapp/bbm/snapchat receive notifications while all the other ones will be prevented from waking the phone.

Are you planning to bring JellyBean support?
Yes, I can theoretically support all the way down to Gingerbread, but I wanted to start off with a smaller audience because I can't test with any older devices yet. But I'll definitely be adding Jellybean support soon!
 
Last edited:

JustinSang

Senior Member
Sep 27, 2014
125
43
Hey guy . It looks great ! But I can't find and download it . I joined your community and become a tester . But Google says : " We're sorry, the requested URL was not found on this server. " :confused:
 

TNSMANI

Senior Moderator / RC-RT Committee
Staff member
Jan 8, 2014
7,643
5
14,173
Chennai
OnePlus 9 Pro
I am not discouraging your work but isn't it quite similar to Amplify?
It may be similar, yes but Amplify works differently. In Amplify, you choose to disable/control things and in the hands of noobs, it can lead to bootloops. Here, the Dev chooses the things that can be stopped and being a Dev, he is experienced and knows what he is doing. In addition, Amplify works 24/7 whereas this app will work only when screen is off.
Plus this has a white list which will help you to decide what to allow.
I like the concept and would like to try it if the Dev offers another method of downloading the app.
 
Last edited:

SyCoREAPER

Retired Forum Moderator
no totally different... stamina mode on sony stock roms it's more similar to leandroid or Deep Sleep Battery Saver app (screen goes off and traffic and other process go sleep)... but without loosing any notification of whitelisted apps...

Which leads into the next question, can this be safely used alongside Greenify or is it redundant?
 

waylaidwanderer

Senior Member
Feb 19, 2012
189
799
I am not discouraging your work but isn't it quite similar to Amplify?

Amplify allows wakelocks/alarms on a schedule (every 5 minutes while the screen is off), and uses a blacklist as opposed to a whitelist. Power Nap stops the wakelock/service/alarm from waking up the phone at all. I'm not sure if you can blacklist a specific app with Amplify, but with Power Nap you're able to control which apps are whitelisted, and any service/wakelock/alarm belonging to a non-whitelisted app will be blocked.

Plus I'll be adding more features to make it a general power-saving app as well, so look out for that soon!
 

waylaidwanderer

Senior Member
Feb 19, 2012
189
799
Which leads into the next question, can this be safely used alongside Greenify or is it redundant?

Greenify hibernates apps while the screen is off, but I believe with Greenify you can hibernate apps while the screen is on as well(aka phone is in use). Power Nap only "hibernates" when the screen is off. So depending on what you use it for, you can either get rid of Greenify or keep it. But even if you use it alongside each other, it shouldn't have any ill effects.

Can you give another method for downloading the app since I am allergic to Google+?

The only reason I'm using G+ is because the app is in very early alpha (while it works, it's not pretty and Endurance Mode is the only feature right now). By joining the community and then downloading the app through the Play Store, I'll be able to get basic statistics (no GAnalytics yet) and crash reports.

Hey guy . It looks great ! But I can't find and download it . I joined your community and become a tester . But Google says : " We're sorry, the requested URL was not found on this server. " :confused:

It might take a while for it to show up for you. It did the same to me when I tried to view it in the Play Store at first!
 
Last edited:

GadgetAvi

Senior Member
Jan 16, 2012
235
31
Tel Aviv
Some modules do work over 5.1 with the Xposed SUPER ALPHA, does this one works? if someone tried, plz share with us :good:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 506
    Introduction

    As the owner of an Xperia Z3, I found myself missing Stamina Mode after flashing a CM12 ROM. None of the battery apps in the Play Store worked the same way - most of the ones I found merely disabled Wi-Fi/data while the screen was off, along with managing auto-sync, but I still wanted whitelisted apps to be able to access the internet.

    I spent a good 12 hours straight working to replicate the basic features of Stamina Mode, and now here we are: Power Nap for Xposed!

    Images

    Imgur album link for easier viewing: http://imgur.com/a/JvSD8

    7VtGH1q.png

    Cy1bh4t.png

    gysUudu.png

    CF7vaJQ.png

    Czq2RUf.png



    Description

    Compatible with any Android device running 4.1+, with root and Xposed.

    Power Nap for Xposed is the best app for saving battery. When your screen is off, Power Nap maximizes your device's deep sleep time by stopping services, alarms and wakelocks from waking the device when the screen is off. This means you can leave Wi-Fi/data on and still get the notifications from apps you have whitelisted, while all others are unable to wake up your device, leading to an increase in your battery life.

    Power Nap for Xposed also has a Low Battery Mode, where you can selectively functions to save power when battery level is low.

    Power Nap for Xposed is inspired by Sony's Stamina Mode, but accessible for all Android devices 4.1 and higher. This app requires root and Xposed.

    Be sure to whitelist any third-party alarm clock app you are using, or it will be prevented from waking up your device!

    Permissions

    android.permission.INTERNET: this is for Crashlytics only, which will automatically send me stack trace logs if the app crashes due to something non-Xposed related. No other information is being sent.
    android.permission.WRITE_SETTINGS: For Low Battery Mode, to change screen brightness and screen display timeout
    android.permission.READ_SYNC_SETTINGS: For Low Battery Mode, to check if auto-sync is on/off
    android.permission.WRITE_SYNC_SETTINGS: For Low Battery Mode, to turn on/off auto-sync
    android.permission.ACCESS_WIFI_STATE: For Low Battery Mode, to check if Wi-Fi is on/off
    android.permission.CHANGE_WIFI_STATE: For Low Battery Mode, to turn on/off Wi-Fi
    android.permission.ACCESS_NETWORK_STATE: For Low Battery Mode, to check if mobile data is on/off
    android.permission.BLUETOOTH: For Low Battery Mode, to check if Bluetooth is on/off
    android.permission.BLUETOOTH_ADMIN: For Low Battery Mode, to turn on/off Bluetooth
    android.permission.RECEIVE_BOOT_COMPLETED: For Low Battery Mode, to start a service that monitors the current battery level (if LBM is enabled), when the device is finished booting

    Installation Instructions

    To get the app, you can either opt-in for testing on Google Play (and/or join the G+ Alpha testing community if you're interested in helping out by reporting bugs and sharing your experiences), or simply download it directly from the Xposed Module Repository. You may need to change "Versions to be shown" to "Experimental" in the Xposed Installer's Settings to be able to download it using the app.

    The latest APK version is also attached to the "Download" tab of this thread, but you will not receive updates using this method.

    Final Thoughts

    By using Power Nap, you can expect to see as little as 0.2% battery drain per hour (if you don't have many apps whitelisted) during standby. Results may vary by device and depending on which apps have been whitelisted.

    Since it's in Alpha mode, please feel free to leave feedback and report bugs. If you need any clarifications on any aspect of the app, please leave a comment!

    NEW ISSUE TRACKER - POST ISSUES HERE

    XDA:DevDB Information
    Power Nap for Xposed, Xposed for all devices (see above for details)

    Contributors
    waylaidwanderer
    Xposed Package Name: net.jzhang.powernap

    Version Information
    Status: Alpha
    Current Beta Version: 0.8a
    Beta Release Date: 2015-04-09

    Created 2015-04-09
    Last Updated 2016-10-22
    38
    Hi everyone, Power Nap v0.8 Alpha is now available on the Play Store!

    Mirror: http://dl-xda.xposed.info/modules/net.jzhang.powernap_v8_e3c396.apk

    Opt-in for testing
    Google Play link

    Changelog v0.8a (October 22, 2016)

    - added App Settings (click on app in whitelist to set active hours and allow only certain wakelocks)
    - warn the user if module is not enabled
    - fixed swipe to delete not working
    - fix stats not showing up on some devices
    - only ask for root if necessary

    NEW ISSUE TRACKER
    25
    Power Nap 0.8.1a has been uploaded to the Play Store and Xposed repo. There are still lingering issues with statistics not showing up for some people, so I decided to release the fix for the bootloops first.

    Direct download link: http://dl-xda.xposed.info/modules/net.jzhang.powernap_v9_38ab23.apk

    Changelog v0.8.1a (October 26, 2016)

    - fixed bootloop on Android 5.x
    - fix module not working on some 4.x devices
    - update Crashlytics library
    - fix force close when phone reaches low battery level with LBM enabled on Android 6.x (will ask for necessary permission first)
    - some more fixes for statistics not showing up: for those still experiencing issues, post on the issue tracker @ https://github.com/waylaidwanderer/PowerNapForXposed-Development/issues/2
    24
    Power Nap for Xposed is now available for download on the Xposed Module Repository: http://repo.xposed.info/module/net.jzhang.powernap

    You may need to change "Versions to be shown" to "Experimental" in the Xposed Installer's Settings to be able to download it using the app.

    You can also find the latest APK attached to the "Download" tab of this thread.
    21
    Good news, I've discovered the cause of the bootloop issue and fixed it. Funnily enough, I never ran into the problem because it seems to affect < 6.0 devices only. The fix will be available in the next update, once I sort out a bug with statistics not displaying for some people (again).