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

Search This thread

mystique47

Senior Member
Jul 7, 2013
161
51
Monza
mytrustedphysicians.com
using in Nexus 5 CAF Dark rom. It works for a while, but when the app is no more in ram (I guess, because of multi tasking) it loses service bounding and stop working. After rebooting it will be again bound, until exits from ram again. Force stopping app can reproduce the problem. Maybe it is an app-related bug
 

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
using in Nexus 5 CAF Dark rom. It works for a while, but when the app is no more in ram (I guess, because of multi tasking) it loses service bounding and stop working. After rebooting it will be again bound, until exits from ram again. Force stopping app can reproduce the problem. Maybe it is an app-related bug

Did you install some process killer app? The WakeBlock app service should never stop naturally. You can check if it's still on in developer settings, running services.

Unfortunately, if it gets somehow killed, the only way to rebind it is to restart the device, so clearly it shouldn't happen.
 

mystique47

Senior Member
Jul 7, 2013
161
51
Monza
mytrustedphysicians.com
Did you install some process killer app? The WakeBlock app service should never stop naturally. You can check if it's still on in developer settings, running services.

Unfortunately, if it gets somehow killed, the only way to rebind it is to restart the device, so clearly it shouldn't happen.

Thank you for answer. No I haven't any app killer. mmm I don't find its service in running services section (while is running and working correctly). I'll try to understand something more in next hours-days
 

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
Thank you for answer. No I haven't any app killer. mmm I don't find its service in running services section (while is running and working correctly). I'll try to understand something more in next hours-days

You could try to put it in battery optimization exceptions and check if that helps, even though it shouldn't​ be the problem, as it's not normally needed.
 
Last edited:

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
I updated the app yesterday. There was a little bit which was silently causing the service to crash.

EDIT: Nevermind, another one came up. This is going on because I can't test it with my device right now, I will fix it ASAP.

EDIT 2: Updated again. It should be up soon...
 
Last edited:

AlemanSantos

Senior Member
Mar 25, 2016
208
86
39
Temperley
OnePlus 7
I updated the app yesterday. There was a little bit which was silently causing the service to crash.

EDIT: Nevermind, another one came up. This is going on because I can't test it with my device right now, I will fix it ASAP.

EDIT 2: Updated again. It should be up soon...

This update is the one for all the ROMs without source code? I'm still getting unssuported device on OP3 Phoenix ROM

edit: just realize this is in Nexus 6P forum lol, I don´t know how I end here xD sorry

Sent from my OnePlus 3 using XDA Labs
 
Last edited:

manalicream

Senior Member
Mar 19, 2012
133
14
I updated the app yesterday. There was a little bit which was silently causing the service to crash.

EDIT: Nevermind, another one came up. This is going on because I can't test it with my device right now, I will fix it ASAP.

EDIT 2: Updated again. It should be up soon...

Have updated but now service is continually unbound
 

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
*** UPDATE [CORE-MOD TEMPLATES V2.0] ***

- Core mod code has been refactored to allow easier and cleaner implementation.
- It is now possible (with some smali knowledge) to port the core mod without the ROM source code. Smali templates are available in WakeBlock GitHub repository (https://github.com/GiovanniBozzano/wakeblock). Please make sure you know what you are doing before trying to mess with smali.
 

DEVILOPS 007

Senior Member
May 24, 2016
3,866
1,668
Colchester
*** UPDATE [CORE-MOD TEMPLATES V2.0] ***

- Core mod code has been refactored to allow easier and cleaner implementation.
- It is now possible (with some smali knowledge) to port the core mod without the ROM source code. Smali templates are available in WakeBlock GitHub repository (https://github.com/GiovanniBozzano/wakeblock). Please make sure you know what you are doing before trying to mess with smali.
Hi, just had a look at the templates and it seems great! I understand smali and baksmali a bit and know how to use it to deodex and odex files but was wondering if you could possibly give me a couple of tips in porting the core mod with small and no source code. Any help would be appreciated like what needs to be deodexed and edited. Thanks a lot, also I just wanted to say that when on the templates it takes a while for ctrl+f to find wakeblock so if there any possible way to Optimize this or maybe cut out parts that aren't necessary in the template? Have a good day?

---------- Post added at 05:58 PM ---------- Previous post was at 05:40 PM ----------

*** UPDATE [CORE-MOD TEMPLATES V2.0] ***

- Core mod code has been refactored to allow easier and cleaner implementation.
- It is now possible (with some smali knowledge) to port the core mod without the ROM source code. Smali templates are available in WakeBlock GitHub repository (https://github.com/GiovanniBozzano/wakeblock). Please make sure you know what you are doing before trying to mess with smali.
Did you remove the wakeblock code from the template for PackageManagerService.java? I can't find any code in that template for that file.
 

GioBozza

Senior Member
Nov 19, 2015
198
399
28
Milan
Hi, just had a look at the templates and it seems great! I understand smali and baksmali a bit and know how to use it to deodex and odex files but was wondering if you could possibly give me a couple of tips in porting the core mod with small and no source code. Any help would be appreciated like what needs to be deodexed and edited. Thanks a lot, also I just wanted to say that when on the templates it takes a while for ctrl+f to find wakeblock so if there any possible way to Optimize this or maybe cut out parts that aren't necessary in the template? Have a good day

---------- Post added at 05:58 PM ---------- Previous post was at 05:40 PM ----------


Did you remove the wakeblock code from the template for PackageManagerService.java? I can't find any code in that template for that file.

It might be difficult to help because in smali, every ROM and version is very different.

The template should be fixed now, GitHub was cutting it. Right now I think it may be better to have the full one instead of a cut source file.
I'm also planning to implement an auto smali editing feature in the app, to make the core mod universally available, but that will take a lot of time.
 

DEVILOPS 007

Senior Member
May 24, 2016
3,866
1,668
Colchester
It might be difficult to help because in smali, every ROM and version is very different.

The template should be fixed now, GitHub was cutting it. Right now I think it may be better to have the full one instead of a cut source file.
I'm also planning to implement an auto smali editing feature in the app, to make the core mod universally available, but that will take a lot of time.
Okay thanks. I just checked the template for PackageManagerService.java and there still doesn't seem to be any code that says @ Wakeblock. Also it said it was updated 2 hours ago.
 

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.