[APP] [MOD] [7.0+] WakeBlock: Blocking the drain before it is too late (Core v0)

Search This thread

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
GP1Q7ND.png


THIS THREAD IS NOT MONITORED, ANY HELP REQUEST/QUESTION/BUG SUBMISSION MUST BE POSTED INTO THE TELEGRAM GROUP OR THEY WILL BE IGNORED

WakeBlock is an app that, through a system modification, allows users to block or limit any system wakelock, without the need of any kind of framework.

Currently, we support all versions of Android from Nougat 7.0 to Q 10. We plan to continue the support for future Android version, while anything under Android 7.0 won't be supported. While the patch is supposedly working on ANY device, we won't know unless we try. So try this and let us know!

Recently, we updated the coremod for better compatibility and even added Dark Mode!

This modification can be applied Systemless-ly with Magisk, by creating the Magisk Module from inside the app.

The app is currently in beta stage, so is missing many features we plan to implement in future releases.

Also, beware that the current version of the app is released for free, but it may become paid/donation based in the future.

/*
* #include <disclaimer.h>
*
* Your warranty is now void.
* I'm not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed.
* Please read the FAQs before flashing it! YOU are choosing to make these modifications,
* and if you point the finger at me for messing up your device, I will laugh at you.
* Hard. Really hard.
*
*/

Google Play Store Link

Patreon Link

Telegram Group

WANT TO INTEGRATE WAKEBLOCK IN YOUR ROM? CHECK THIS POST!

*** BUG REPORTS WITHOUT A LOGCAT WILL BE IGNORED AND LAUGHED AT ***

Special Thanks
  • @DEVILOPS 007 for testing and porting the initial release to various ROMs and devices
  • @SuperSandro2000 for helping testing the mod on Samsung devices
  • @TotemFallico for helping me with the support & development

XDA:DevDB Information
WakeBlock, App for the Huawei Nexus 6P

Contributors
GioBozza, TotemFallico, SimoIanni, pioccd, CappyT

Version Information
Status: Beta

Created 2017-08-15
Last Updated 2019-11-30
 
Last edited:

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
CHANGELOG
v0.2.0 (05/01/2018)
  • WakeBlock service binds on runtime (this means that, if the core mod is already installed, you do not need to reboot after app installation/update). The service status shown in the app will automatically update on service binding.
  • Automatic uninstallation/backup restoring
  • The app can fetch the core mod version
v0.1.8 (02/01/2018)
  • Fixed core mod classes patching
v0.1.7 (31/12/2017)
  • Fixed SELinux permissions acquisition
  • Started implementation of the auto-binding process to avoid reboot on app update (not yet functional)
v0.1.6 (29/12/2017)
  • Fixed repackaging phase on deodexed devices
v0.1.5 (25/12/2017)
  • Improved patcher process
  • Updated baksmali to v2.2.2 (not yet compatible with Android 8.1)
v0.1.4 (10/09/2017)
  • Fixed bootloop on Samsung devices
  • Auto-patcher process priority raised to avoid it being killed by the OS
  • Added Simplified Chinese localization
v0.1.2 (07/09/2017)
  • Auto-patcher process priority rised to avoid it being killed by the OS
  • Added Simplified Chinese localization
v0.1.1 (21/08/2017)
  • Added application automatic backup of previously detected wakelocks
  • Added support for localization
  • Removed auto-downloader (now obsolete)
v0.1.0 (17/08/2017)
  • Initial release
 
Last edited:

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
FAQ
Here you can find the most common questions and their respective answer. Simple as that. READ THEM.

Q - How do i use wakeblock?

A - Once you have installed the app, just open it and click on "Install Core Mod", the app will create the Core Mod needed for your device (this might take a while, from 5 to 30 minutes) and then will reboot the phone to flash it. When the phone has rebooted, open the app: If the message says "Service Bound" you're all set!

Q - How can i block wakelocks?

A - From within the app, just switch to the "Wakelock" tab. Here every wakelock recorded since the first boot with the core mod installed, so give it at least 2/3 days of normal use before blocking anything. Click on the wakelock you want to block, press the "Block" button and then set for how long is the wakelock gonna be blocked!

Q - Which wakelock should i block? For how long?

A - We suggest to check out this guide on XDA to fully understand what it means to block a wakelocks and how it affects your system.

Q - I'm lazy af and i don't want to read all of that, can't you give me a short list?

A - Ok, but we don't take any responsibilities if the phone bricks or your ROM explodes. You are totally free to change the blocking time value to make it as you please but, again, we don't take any responsibilities. You can find the list here. Remember: if you don't find one of the wakelocks, just check in later. If you still don't find it, don't worry at all! Side note: the search button is not case-sensitive.

Q - Can i block the [wakelock name] wakelock?

A - If it is part of the list linked above, you're good to go! If not, we can't assure a thing, but if you find any safe-to-block wakelock let us know!

Q - When is the new version/fix/graphic coming?

A - Do not ask for an ETA. We do this for free, without any ads in the app nor donation packages, we don't even put a price on our app. We all have jobs, university and a private life to manage, we don't have superpowers, so managing all of this takes time. Our free time is pretty short, but we usually put at least half of it on the developing of the app. Be patient and do not harass the team nor the telegram group.

Q - Your app killed [insert any feature here] in my phone!

A - Everything is done by user input, the app by itself (even with the core mod installed) doesn't do anything but reading which wakelock the system is calling. Unless you blocked something we didn't suggest you do to this problem and our app are totally unrelated.

Q - Your app is killing my battery life! WTF!

A - By itself, the app doesn't do anything even with the core mod installed. Keep WakeBlock whitelisted in every hybernation app (like Greenify) but the basic Android Optimization. If the battery drain has increased, double check what you blocked, that might be the reason!

Q - I just updated and it doesn't see the Core Mod!

A - It's a known bug. Check if the app kept all permission (Both root privileges and Storage permission) and simply reboot your phone. It will magically start to see it again! SIDE NOTE: you don't need to reinstall the Core Mod every time you update the app!

Q - How can i uninstall the app?

A - First of all, we are sad that you want to leave us. If you didn't install the Core Mod, or it failed in any way, you just need to delete the app and everything is gone! If you did install successfully the Core Mod, check the WakeBlock backup folder (/sdcard/WakeBlock/Backups). You will find a bunch of different folders with different dates and times. Pick the most recent one and look inside. Here, you will have one of two cases:

CASE 1: FILES = services.odex & and services.vdex | ODEXED ROM
In this case, boot into your custom recovery of choice (TWRP for example, you can't do it from a root explorer) and mount your /system partition. Now check both /system/framework/oat/arm and /system/framework/oat/arm64 for a service.odex and a service.vdex. Here, COPY (and DO NOT MOVE) the files from the backup and paste them to replace the files in your system (one of the two folders above). Now delete the app and you're now WakeBlock-free!

CASE 2: FILE = services.jar | DEODEXED ROM
In this case, boot into your custom recovery of choice (TWRP for example, you can't do it from a root explorer) and mount your /system partition. Here, COPY (and DO NOT MOVE) the file from the backup and paste it to replace the file in your system (in this case /system/framework). Now delete the app and you're now WakeBlock-free!

Q - YOUR APP DOESN'T WORK, WHY?

A - It works. We tested it (and we keep testing it) many times before committing an update! Double check permissons and give it a reboot, usually fixes most of the "doesn't work" problems.

Q - I found a bug! How can i report it?

A - First of all, check on the Telegram Group if anyone else had your problem, both by first searching and then asking directly. If no one can help you on the spot, send a ticket on the @wakeBlockSupportBot. It will ask for a logcat, so make sure you make one while you encounter the problem. DO NOT CONTACT ANYONE OF THE TEAM UNLESS EXPLICITLY ASKED TO.

Q - How do i take a logcat?

A - First of all, make sure that you have the needed Platform Tools. Due to the fact that the app reboots, it's better if you take it with a pc rathern than with an app. Plug the phone into your PC, you start the cmd.exe as administrator (or, if you use Linux, you need to open the terminal with root privileges) and run the command "adb shell", now the console will show the internal console of the phone. From there, run "su", a prompt will appear to your phone to ask for root permission. Approve it, then run "cd /sdcard/Download". Afterwards, run "logcat >> log.txt" (Nothing will appear on screen because it's redirecting every output to the log file). Now start the patch. When it gives the error (or after it reboots), close the app, click "Ctrl + C" to stop the logcat. Then, from the phone, send us the log.txt (you will find it in your Download folder).

Q - Wow! You guys are awesome!

A - Thank you!

TO-DO LIST
- Alarms. Yeah.
- Fixing problems related to some Samsung devices and Pixel devices
- Import/Export system for the blocked Wakelock
- Inserting the FAQ and the suggested wakelock-to-block list into the actual app
- Adding the feature to change the block time without unblocking the wakelock
- Various fixes and improvements
 
Last edited:

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
WANT TO INTEGRATE WAKEBLOCK IN YOUR ROM?

We decided to release the core part of the mod to let ROM developers integrate it in their own source code.

Here is the patch for you to simply drag on whichever version of android (should work on 7.x (maybe 6.x?)) and whichever device/ROM you want.

The only things we ask for are (that's not a legal license, but it can make us REALLY upset if you don't do that) :
- You shall credit @GioBozza for the mod by linking this thread in your ROM post (c'mon, don't write it in the bottom of the post, with size 1!)
- You may include this code to any non-commercial work (you can still get donations, we're cool with those!)
- You can not sell this code or get donations by the code of this mod alone
- You may include the free version of the apk in your ROM (in the future we may release a paid version or an unlock app. Of course, that can not be included.)
- You should redirect users here for support about the mod or the app itself
- You should have fun and save your battery
- You may need to drink some fruit juice afterwards - have that ready!


WHOOP, WHOOP - DOWNLOAD:
v0 Templates - platform/frameworks/base repository.
https://github.com/GiovanniBozzano/wakeblock

REMEMBER: the app takes no privileges at all to manage wakelocks. The ROM can even be without root!

Take note that we will update the "core" (android framework) part of the mod, from time to time. It is versioned, so you can keep track of what happened.

Cheers!
 
Last edited:
I tried flashing again and installing the app but it still says unbound. Do I need to edit anything like build or host files?

Are you on rooted stock 7.1.1? We tested on that, and well... it works. Just needs a reboot after app install and it will continue to work across reboots.
 
  • Like
Reactions: SimoIanni
I tried flashing again and installing the app but it still says unbound. Do I need to edit anything like build or host files?

*** HAVE A BACKUP READY FIRST ****

Try this:
- Download the odex file here (it's the same that you find in the archive, if you want to save data, extract the flashable archive)
- Move the file (with any file browser with root support) to /system/framework/oat/arm64 and replace if asked
- The phone (could) instantly reboot. If not, check if the permissions are rw-r--r-- (644)
- Reboot
 

DEVILOPS 007

Senior Member
May 24, 2016
3,866
1,668
Colchester
It says unbound after I rebooted

---------- Post added at 11:29 PM ---------- Previous post was at 11:27 PM ----------

Try this:
- Download the odex file here (it's the same that you find in the archive, if you want to save data, extract the flashable archive)
- Move the file (with any file browser with root support) to /system/framework/oat/arm64 and replace if asked
- The phone (could) instantly reboot. If not, check if the permissions are rw-r--r-- (644)
- Reboot
Okay about to try, I really appreciate the help BTW you're a very nice person. Whether this works or not thank you.

---------- Post added at 11:32 PM ---------- Previous post was at 11:29 PM ----------

There are no folders in the system framework folder. Only files.

---------- Post added at 11:32 PM ---------- Previous post was at 11:32 PM ----------

Should I add the folders?
 
It says unbound after I rebooted

---------- Post added at 11:29 PM ---------- Previous post was at 11:27 PM ----------


Okay about to try, I really appreciate the help BTW you're a very nice person. Whether this works or not thank you.

---------- Post added at 11:32 PM ---------- Previous post was at 11:29 PM ----------

There are no folders in the system framework folder. Only files.

---------- Post added at 11:32 PM ---------- Previous post was at 11:32 PM ----------

Should I add the folders?

Well. It means your rom is not odexed.
You can try by creating those folders and put that file there. Can't guarantee btw
 

SimoIanni

Senior Member
Jun 16, 2016
58
37
Leghorn
OnePlus 6T
It says unbound after I rebooted

---------- Post added at 11:29 PM ---------- Previous post was at 11:27 PM ----------


Okay about to try, I really appreciate the help BTW you're a very nice person. Whether this works or not thank you.

---------- Post added at 11:32 PM ---------- Previous post was at 11:29 PM ----------

There are no folders in the system framework folder. Only files.

---------- Post added at 11:32 PM ---------- Previous post was at 11:32 PM ----------

Should I add the folders?

Maybe I found a solution for you, I'm trying on my phone right now, I'll let yow know if it works ASAP
--------
Edit: It didn't work, still searching
 
Last edited:

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
Hopefully you find something. Is it because some roms are aosp and some are odex or something? I'm confused about what the difference is and why it makes this mod not work.
Odexing is the way Android now uses to optimize code and generate .oat or .odex machine code files from .dex smali files.
Some ROMs are deodexed: this means all applications run on .dex files and sometimes even system modules (and that's your case).

Currently the mod is tied to the .odex file, but I'm going to support the deodexed version as well.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 145
    GP1Q7ND.png


    THIS THREAD IS NOT MONITORED, ANY HELP REQUEST/QUESTION/BUG SUBMISSION MUST BE POSTED INTO THE TELEGRAM GROUP OR THEY WILL BE IGNORED

    WakeBlock is an app that, through a system modification, allows users to block or limit any system wakelock, without the need of any kind of framework.

    Currently, we support all versions of Android from Nougat 7.0 to Q 10. We plan to continue the support for future Android version, while anything under Android 7.0 won't be supported. While the patch is supposedly working on ANY device, we won't know unless we try. So try this and let us know!

    Recently, we updated the coremod for better compatibility and even added Dark Mode!

    This modification can be applied Systemless-ly with Magisk, by creating the Magisk Module from inside the app.

    The app is currently in beta stage, so is missing many features we plan to implement in future releases.

    Also, beware that the current version of the app is released for free, but it may become paid/donation based in the future.

    /*
    * #include <disclaimer.h>
    *
    * Your warranty is now void.
    * I'm not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed.
    * Please read the FAQs before flashing it! YOU are choosing to make these modifications,
    * and if you point the finger at me for messing up your device, I will laugh at you.
    * Hard. Really hard.
    *
    */

    Google Play Store Link

    Patreon Link

    Telegram Group

    WANT TO INTEGRATE WAKEBLOCK IN YOUR ROM? CHECK THIS POST!

    *** BUG REPORTS WITHOUT A LOGCAT WILL BE IGNORED AND LAUGHED AT ***

    Special Thanks
    • @DEVILOPS 007 for testing and porting the initial release to various ROMs and devices
    • @SuperSandro2000 for helping testing the mod on Samsung devices
    • @TotemFallico for helping me with the support & development

    XDA:DevDB Information
    WakeBlock, App for the Huawei Nexus 6P

    Contributors
    GioBozza, TotemFallico, SimoIanni, pioccd, CappyT

    Version Information
    Status: Beta

    Created 2017-08-15
    Last Updated 2019-11-30
    36
    WANT TO INTEGRATE WAKEBLOCK IN YOUR ROM?

    We decided to release the core part of the mod to let ROM developers integrate it in their own source code.

    Here is the patch for you to simply drag on whichever version of android (should work on 7.x (maybe 6.x?)) and whichever device/ROM you want.

    The only things we ask for are (that's not a legal license, but it can make us REALLY upset if you don't do that) :
    - You shall credit @GioBozza for the mod by linking this thread in your ROM post (c'mon, don't write it in the bottom of the post, with size 1!)
    - You may include this code to any non-commercial work (you can still get donations, we're cool with those!)
    - You can not sell this code or get donations by the code of this mod alone
    - You may include the free version of the apk in your ROM (in the future we may release a paid version or an unlock app. Of course, that can not be included.)
    - You should redirect users here for support about the mod or the app itself
    - You should have fun and save your battery
    - You may need to drink some fruit juice afterwards - have that ready!


    WHOOP, WHOOP - DOWNLOAD:
    v0 Templates - platform/frameworks/base repository.
    https://github.com/GiovanniBozzano/wakeblock

    REMEMBER: the app takes no privileges at all to manage wakelocks. The ROM can even be without root!

    Take note that we will update the "core" (android framework) part of the mod, from time to time. It is versioned, so you can keep track of what happened.

    Cheers!
    22
    Just a quick update: I am currently working on the smali autopatcher and got the easier parts done.

    When this is done, you should be able to apply the core mod on every device and ROM, if they are not too different from the original source (this should not happen).
    15
    CHANGELOG
    v0.2.0 (05/01/2018)
    • WakeBlock service binds on runtime (this means that, if the core mod is already installed, you do not need to reboot after app installation/update). The service status shown in the app will automatically update on service binding.
    • Automatic uninstallation/backup restoring
    • The app can fetch the core mod version
    v0.1.8 (02/01/2018)
    • Fixed core mod classes patching
    v0.1.7 (31/12/2017)
    • Fixed SELinux permissions acquisition
    • Started implementation of the auto-binding process to avoid reboot on app update (not yet functional)
    v0.1.6 (29/12/2017)
    • Fixed repackaging phase on deodexed devices
    v0.1.5 (25/12/2017)
    • Improved patcher process
    • Updated baksmali to v2.2.2 (not yet compatible with Android 8.1)
    v0.1.4 (10/09/2017)
    • Fixed bootloop on Samsung devices
    • Auto-patcher process priority raised to avoid it being killed by the OS
    • Added Simplified Chinese localization
    v0.1.2 (07/09/2017)
    • Auto-patcher process priority rised to avoid it being killed by the OS
    • Added Simplified Chinese localization
    v0.1.1 (21/08/2017)
    • Added application automatic backup of previously detected wakelocks
    • Added support for localization
    • Removed auto-downloader (now obsolete)
    v0.1.0 (17/08/2017)
    • Initial release
    11
    *** UPDATE [AUTO-PATCHER] ***

    The latest version of the app allows you to automatically patch your system framework, whatever your device, ROM and version is.

    This feature is currently under testing and available only for odexed ROMs. If the process gives "Unsupported Framework", please report it here with device and ROM information.

    As soon as I have enough proofs that the patcher is stable, I will ask to move this topic in a general category.

    NOTES:
    • Backups are always found in /sdcard/WakeBlock/Backups/
    • The patching will take some minutes.
    • The device will reboot when the process is finished.