• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Wakelock+Alarm _Blocker & DozeEditor patch: Official2017 CM14(Lineage), CM13/12/11

http://forum.xda-developers.com/showpost.php?p=54219054&postcount=1287

  • Yes for an in-core-rom solution

    Votes: 7 87.5%
  • Who cares ?

    Votes: 1 12.5%

  • Total voters
    8
Search This thread

oF2pks

Senior Member
May 22, 2016
784
1,079
Wakelock+Alarm _Blocker & DozeEditor patch: Official2017 CM14(Lineage), CM13/12/11

Wakelock Blocker for Official 2016, Nightly CM11

All thanks to
@faust93 : BASE.diff http://review.cyanogenmod.org/#/c/109898/ SETTINGS.diff http://review.cyanogenmod.org/#/c/109897/ (official rejections for CM12)
@scott.hart.bti (Beanstalk_base) @Cristiano Matos (crDroid_settings) for Github sources.
If you fell donate then it should be to @maxwen, which seems to be the real ghost creator of wakelockblocker (Nov 2013) https://github.com/scotthartbti/and...mmit/2022015c1d7890873c54e7290ec0ca1391c6dc50

While mixing all this (cherry-picked from github) together, I finally succeed a 2x patch diff
to implement a working Wakelock Blocker in cm-11-2016xxx-NIGHTLY under Parameter/Performance/System.
I check the efficiency OK, on LGp880 & ASUStf700t with @chamonix' BetterBatteryStats.

The base diff includes inverted broken xposed & SELinuxModeChanger from zygote d8130142.diff http://review.cyanogenmod.org/#/c/118800/


There were 19 devices + 27 samsung on official 2016 KK nightly run, I hope some will patch theses 2 diff WITH 100% compatible:

- mar-V-in fake signature for nogapp microG https://github.com/microg/android_p...r/patches/android_frameworks_base-KK-LP.patch

That edition will keep same CVE as the official one and will stay untouched apart +3 above.
If you are baking a KK cm11-based rom , it should also be compatible. You tell me.
 

Attachments

  • settingsGitDiffHEAD.diff
    19 KB · Views: 43
  • baseGitStatus.txt
    1,004 bytes · Views: 39
  • settingsGitStatus.txt
    977 bytes · Views: 43
  • baseGitDiffHEAD.diff
    14.8 KB · Views: 63
  • d8130142.diff
    3.9 KB · Views: 40
Last edited:

oF2pks

Senior Member
May 22, 2016
784
1,079
Lineage14.1 CM13 & CM12 patches 2017

CM12.1 2016 WakelockBlocker and microG : post12 / attached .diff
*(Omni's double patch microG option-able on/off re-hunked for CM12.1.1 : post14 / attached .diff)

CM13 2017 Wakelock+Alarm _Blocker and microG : post19 / 1&2) attached .diff

CM14 DozeSettingsEditor : post19 / 3) attached .diff

Caution & Warnings*
Caution: blocking critical wakelocks can lead to bootloop; so always proceed full backup from recovery before unknown tries.
Also, be aware that if you over-flash original cm (without WakelockBlockers), your rom will work as new ota (without bootloops); but if you flash again modified cm with WakelockBlockers, you will find back your precedent settings on ticked wakelocks.

Warnings: before sharing logs with other, ensure that your log does not include some personal data under blocked wakelocks' description; ex: xxx @ gmail.com ...
Code:
packages/apps/Settings/src/com/android/settings/applications/WakeLockBlocker.java
...Log.d("maxwen", pm.getSeenWakeLocks());

(nota: there are no analytics or any network exchanges on your blocked wakelock list; conversely WakelockBlocker can definitively help to stop such intrusive behaviours.)
 

Attachments

  • x_file.jpg
    x_file.jpg
    44.8 KB · Views: 242
  • microG.png
    microG.png
    4 KB · Views: 240
Last edited:
  • Like
Reactions: ze7zez

oF2pks

Senior Member
May 22, 2016
784
1,079
wip

How does it work
How to 2x your battery
The equation is simple 2xbattery=50%=20%a+20%b+10%c:

a) 20% thank to @MaR-V-iN for microG project ie nogapps
Not only the multiple google packages are pinging together, but the worse is the auto-updating ghost process (which sometimes leads in automatic battery drain due to obligatory “linux-reboot-post-validation-like").
Also, the use of your personal data stay unclear.
Thanks to @Bonoboo there are >100 gapp_pkg in MM
With original KK (3years ago) it was >60 gapp_pkg.
Of course microG won’t bring you all the fancy and amazing usages, but it should cover all your basic exigencies with privacy.

b) 20% thank to CyanogenMod’superuser (root)
DATA/LOCAL/userinit.sh (persistent to ota):
rm /dev/log/*;
rm /data/tombstones/*;
sysctl -w vm.dirty_writeback_centisecs=2000;
sysctl -w vm.dirty_expire_centisecs=1000;
Then using Greenify + f-droid : Adaway Autostarts FasterGPS will finalize an equivalent snappy ‘interactive’ on a ‘conservative’ frugal mode (cpu scaling_governor).

c)10% miscellaneous tips
SETTINGS/WIFI/MENU/ADVANCED: switch always to never
LAUNCHER : Smart Launcher (for phones) or craziest TinyLaunch from @arpruss (for tablet)
PRIVATE BROWSING : internal cm-made
FAST BROWSING 3G : Uc browser mini
GENERAL BROWSING wifi : Dolphin + Jetpack + Companion (Jetpack will supply missing Lollipop’s live webview on KK & Companion will bring WOT and trigger to reduce freeze) with option ‘open in new Tab’ to avoid excessive back-reload pages.
Try to avoid DLNA activity in background and track, with BetterBatteryStats, unnecessary wakelocks (once done you can greenify or disable it).
For more security, cm11 is fully compatible with these xposed modules: AppSettings, DirectApkInstall, Greenify, LightningWall, XposedMediaScanner and XposedRecentTasksRAM.
What's next
Once upgraded with these 2 transparency in-core modifications: microG & WakelockBlocker, privacy setup, on cm11, is OK.

Thanks to @noname81 no one is missing pie to use a phone/tablet easily: LMT Launcher (it’s funny to see many OEM copying Huawei for the mini-screen and they will discover pie...).

But a fundamental functionality is still missing for all ROMs: a basic sound mix table per apk. I can’t believe that Google Inc. did not make that already, (they must wait for a world marketing hit).
In simple words: play music or phone with relatives while watching TV or youtube… (for real!). I guess, once again, it’s question to DRM’s duty (you watch => you listen). Maybe, one day VLC will catch this in an all-in-one solution.
Does java, using stream.hasvideo Boolean attribute, in the right place, can dress a list to duck or mute /apk ?
This is the thread’s poll, since AppSettings is too far from the android core ?
 

Attachments

  • Screenshot_2016-06-26-17-29-41.png
    Screenshot_2016-06-26-17-29-41.png
    214.8 KB · Views: 755
  • Screenshot_2016-06-26-17-32-31.png
    Screenshot_2016-06-26-17-32-31.png
    134.9 KB · Views: 720
  • Screenshot_2016-06-26-17-27-52.png
    Screenshot_2016-06-26-17-27-52.png
    235.9 KB · Views: 778
  • Screenshot_2016-06-14-00-41-42.jpg
    Screenshot_2016-06-14-00-41-42.jpg
    102.7 KB · Views: 654
Last edited:
  • Like
Reactions: ze7zez

oF2pks

Senior Member
May 22, 2016
784
1,079
If you want to get first similar rom, without unofficial build, you can follow these instructions (custom recovery is strongly recommended!):

Check whole thread http://forum.xda-developers.com/xposed/xposed-android-4-4-4-t3249895/page12 to reverse zygote(2015 Nov 8);

download Xposed version >=2.6.1. via the in-app updater or from http://dl.xposed.info/latest.apk and
http://forum.xda-developers.com/xposed/xposed-installer-versions-changelog-t2714053

Once you install/reboot the framework you should get a green 58/54 for xposed/framework.

For wakelock control, use @t2k269
http://repo.xposed.info/module/org.t2k269.perapphacking
If you block to many things and face bootloop just proceed (with caution!) :
reboot in recovery go to twrp menu/advanced/file manager /data/app and select org.t2k269.perapphacking__.apk for delete then once reboot successful finishes, re-install perapphacking and uncheck your last moves.

For @MaR-V-iN microG, use
https://github.com/thermatk/FakeGApps/releases
and enjoy FLOSS atmosphere:

http://forum.xda-developers.com/android/apps-games/app-microg-gmscore-floss-play-services-t3217616
http://forum.xda-developers.com/showthread.php?t=1715375

If you find this useful, then flash :
MapsApi https://github.com/mar-v-in/MapsAPI/releases/download/v0.5/mapsapi.flashable.zip
Freecygn http://forum.xda-developers.com/showthread.php?t=2550769

Be sure to respect modular CyanogenMod’ “alternativity”, and to understand http://www.xda-developers.com/remove-the-google-from-cyanogenmod-with-freecygn/
 

Attachments

  • Screenshot_2016-06-26-19-36-01.png
    Screenshot_2016-06-26-19-36-01.png
    151.5 KB · Views: 278
  • Screenshot_2016-06-14-00-39-08.jpg
    Screenshot_2016-06-14-00-39-08.jpg
    97.7 KB · Views: 270
Last edited:

oF2pks

Senior Member
May 22, 2016
784
1,079

Attachments

  • Screenshot_2016-06-14-00-39-08.jpg
    Screenshot_2016-06-14-00-39-08.jpg
    97.7 KB · Views: 283
  • Screenshot_2016-06-14-00-41-42.jpg
    Screenshot_2016-06-14-00-41-42.jpg
    102.7 KB · Views: 282
Last edited:

Bonoboo

Senior Member
Dec 30, 2012
2,544
3,932
Last edited:
  • Like
Reactions: oF2pks

oF2pks

Senior Member
May 22, 2016
784
1,079
Correction updated

In nature there are ~100 real apps from Google, checked by parsing script.

Post' quote updated to 100 for MM; many thanks for that evaluation. Your work help many people moving to microG.
btw: it would be amazing to automate adDetector on Google packages; actually system webview is exception to the rule: no noisy addons or permissions.
 
Last edited:
  • Like
Reactions: Bonoboo

oF2pks

Senior Member
May 22, 2016
784
1,079
2015-3636 Pingpong root

If VTS return:
2015-3636 Pingpong root
https://github.com/torvalds/linux/commit/a134f083e79fb4c3d0a925691e732c56911b4326

grab this
Code:
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 39b403f..46f8f3f 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -138,6 +138,7 @@ static void ping_v4_unhash(struct sock *sk)
 	if (sk_hashed(sk)) {
 		write_lock_bh(&ping_table.lock);
 		hlist_nulls_del(&sk->sk_nulls_node);
+		sk_nulls_node_init(&sk->sk_nulls_node);
 		sock_put(sk);
 		isk->inet_num = isk->inet_sport = 0;
 		sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
Source github
Tested-by: Linus Torvalds <[email protected]>
Reported-by: Wen Xu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

Nota: for 2014-3153 Futex looks to be hand-made/device; for 2013-6282 Aurora PM me for it(T<->TUSER).
 

Attachments

  • Screenshot_2016-06-16-18-58-45.png
    Screenshot_2016-06-16-18-58-45.png
    247.1 KB · Views: 181
  • Screenshot_2016-06-16-19-21-17.png
    Screenshot_2016-06-16-19-21-17.png
    213.6 KB · Views: 181
Last edited:

oF2pks

Senior Member
May 22, 2016
784
1,079
Common Vulnerability and Exposures (CVE) June 2016 CM11

Except the misses related to old kernels (<3.4), like 3.1.10; ALL Nexus Security Bulletins are included in latest nightly 2016-06-12.

For cve-2015-6616, since KK doesn't have decoder/ih264d_parse_headers.c, vts returns red for ANDROID-24157524 Critical 6.0 only Sep 08, 2015:
https://github.com/AndroidVTS/android-vts/issues/129
https://android.googlesource.com/platform/external/libavc/+/2ee0c1bced131ffb06d1b430b08a202cd3a52005
All other CVE-2015-6616 related bugs are patched
ANDROID-24630158 Critical 6.0 and below Google Internal
ANDROID-23882800 Critical 6.0 and below Google Internal
ANDROID-17769851 Critical 5.1 and below Google Internal
ANDROID-24441553 Critical 6.0 and below Sep 22, 2015

Many thanks to CM11' team: security with 'alternativity'....
 
Last edited:

oF2pks

Senior Member
May 22, 2016
784
1,079
Caution & Warnings

Caution: blocking critical wakelocks can lead to bootloop; so always proceed full backup from recovery before unknown tries.
Also, be aware that if you over-flash original cm (without WakelockBlockers), your rom will work as new ota (without bootloops); but if you flash again modified cm with WakelockBlockers, you will find back your precedent settings on ticked wakelocks.

Warnings: before sharing logs with other, ensure that your log does not include some personal data under blocked wakelocks' description; ex: xxx @ gmail.com ...

(nota: there are no analytics or any network exchanges on your blocked wakelock list; conversely WakelockBlocker can definitively help to stop such intrusive behaviours.)
 
Last edited:

oF2pks

Senior Member
May 22, 2016
784
1,079
CM12.1 20160710 bandwagon WakelockBlocker and microG

Attached are base.diff & settings.diff re-hunked lifted WakelockBlocker' patches for latest cm12; source:
http://review.cyanogenmod.org/#/c/109898/
http://review.cyanogenmod.org/#/c/109897/

When home-building cm12-20160710 you will probably need:
-- media/libstagefright/data/media_codecs_ffmpeg.xml
-m kernel/timeconst.pl
-- /prebuilts/gcc/linux-x86/arm/arm-eabi-4.7 symlink to arm-eabi-4.8.

I check OK mar-V-in fake signature for nogapp microG: single patch https://github.com/microg/android_p...r/patches/android_frameworks_base-KK-LP.patch

Once patched, run make update-api (following the CM's quail first build) and re-build: check attached re-hunked gitdiffHEAD_frameworks_baseCURRENTXmicroG.txt.

Hope @MaR-V-iN and @faust93 won't see offence.

WakelockBlocker's option is located in Developer Options before Process Stats.
Nota: will upload soon Omni's double patch microG option-able re-hunked for CM12.
 

Attachments

  • gitdiffHEAD_frameworks_baseWBLOCK5.diff
    10.4 KB · Views: 19
  • Symlink4.7.png
    Symlink4.7.png
    10.9 KB · Views: 221
  • gitdiffHEAD_frameworks_baseCURRENTXmicroG.txt
    6.2 KB · Views: 31
  • gitdiffHEAD_packages_apps_settingsWBLOCK5.diff
    16.6 KB · Views: 11
Last edited:

oF2pks

Senior Member
May 22, 2016
784
1,079
Omni's double patch microG option-able on/off re-hunked for CM12.1.1

CM12.1 is moving to CM12.1.1 : https://www.cmxlog.com/12.1/grouper/ (with changes to PackageManagerService.java : https://review.cyanogenmod.org/#/c/155579)

Attached are microG option-able re-hunked for CM12.1.1 (from Omnirom)
Option on/off is under Developer_options

Single original patch : https://github.com/microg/android_p...r/patches/android_frameworks_base-KK-LP.patch

Hope @MaR-V-iN won't see offence.

Nota: check post 13 for included Russian strings.
 

Attachments

  • gitdiffHEAD_frameworks_baseMICROG1211.diff
    6.3 KB · Views: 18
  • gitdiffHEAD_packages_apps_settingsMICROG.diff
    7.3 KB · Views: 13
Last edited:

oF2pks

Senior Member
May 22, 2016
784
1,079

Attachments

  • gitdiffHEAD_frameworks_baseWBLOCKcm13.diff
    12.7 KB · Views: 33
  • gitdiffHEAD_packages_apps_settings_WBLOCKcm13.diff
    16.7 KB · Views: 35

oF2pks

Senior Member
May 22, 2016
784
1,079
Any love planned for nougat?
Remember that on KK, all the app were triggering wakelocks , so it was very useful to "break" intrusive or non-frugal ones with WakelockBlocker.
On LP, only very aggressive app are intrusive (like UCbrowser or GoogleNews&Weather)
On MM&N with doze (& Greenify), WakelockBlocker is almost useless but can still prevent intrusions or infections.

So actually on Nougat(, even if this add-on gives informative true list of all wakelocks triggered once), this didn't show up yet, but Beanstalk has always been favourite for mods...
 
Last edited:
  • Like
Reactions: HaoZeke

oF2pks

Senior Member
May 22, 2016
784
1,079
CM13 Wakelock+Alarm _Blocker and microG 2017 / CM14 DozeSettingsEditor

For latest cm13, attached are base.diff & settings.diff re-hunked lifted Wakelock+Alarm _Blocker' patches, with MicroG, from
BASE :
Wakelock : https://github.com/scotthartbti/and...mmit/5fb687ae0940a12c8f7c9e457b6d5f12f028736b
Alarm https://github.com/ResurrectionRemi...mmit/0ed31d619a0ed418ba129039f65de6487e45bfc5
SETTINGS :
Wakelock https://github.com/ResurrectionRemi...mmit/6d4080e7b3477adae21c7181f0801f544cfef7de
Alarm https://github.com/ResurrectionRemi...mmit/7109caa4848f99d5a7daadad66158bd4c83da3e3

MaR-V-iN' fake signature for nogapp microG: single patch https://github.com/microg/android_p...aster/patches/android_frameworks_base-M.patch

For CM14.1 attached is settings.diff re-hunked lifted DozeSettingsEditor, from https://github.com/omnirom/android_...mmit/6206ccdfa4aee098713dd0b999f3e42b327278f2
(base.diff & settings.diff re-hunked lifted Wakelock+Alarm _Blocker' patches, with MicroG, for latest cm14.1 are coming soon with light modification for Nougat new metric logger.)
 

Attachments

  • gitdiffHEAD_frameworks_base_MicroG-WAblockCM13.diff
    24.7 KB · Views: 15
  • gitdiffHEAD_packages_apps_settings_WAblockCM13.diff
    32.9 KB · Views: 17
  • gitdiffHEAD_packages_apps_settings_DozeSettingsCM14-1.diff
    48.1 KB · Views: 29

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Wakelock+Alarm _Blocker & DozeEditor patch: Official2017 CM14(Lineage), CM13/12/11

    Wakelock Blocker for Official 2016, Nightly CM11

    All thanks to
    @faust93 : BASE.diff http://review.cyanogenmod.org/#/c/109898/ SETTINGS.diff http://review.cyanogenmod.org/#/c/109897/ (official rejections for CM12)
    @scott.hart.bti (Beanstalk_base) @Cristiano Matos (crDroid_settings) for Github sources.
    If you fell donate then it should be to @maxwen, which seems to be the real ghost creator of wakelockblocker (Nov 2013) https://github.com/scotthartbti/and...mmit/2022015c1d7890873c54e7290ec0ca1391c6dc50

    While mixing all this (cherry-picked from github) together, I finally succeed a 2x patch diff
    to implement a working Wakelock Blocker in cm-11-2016xxx-NIGHTLY under Parameter/Performance/System.
    I check the efficiency OK, on LGp880 & ASUStf700t with @chamonix' BetterBatteryStats.

    The base diff includes inverted broken xposed & SELinuxModeChanger from zygote d8130142.diff http://review.cyanogenmod.org/#/c/118800/


    There were 19 devices + 27 samsung on official 2016 KK nightly run, I hope some will patch theses 2 diff WITH 100% compatible:

    - mar-V-in fake signature for nogapp microG https://github.com/microg/android_p...r/patches/android_frameworks_base-KK-LP.patch

    That edition will keep same CVE as the official one and will stay untouched apart +3 above.
    If you are baking a KK cm11-based rom , it should also be compatible. You tell me.
    1
    Lineage14.1 CM13 & CM12 patches 2017

    CM12.1 2016 WakelockBlocker and microG : post12 / attached .diff
    *(Omni's double patch microG option-able on/off re-hunked for CM12.1.1 : post14 / attached .diff)

    CM13 2017 Wakelock+Alarm _Blocker and microG : post19 / 1&2) attached .diff

    CM14 DozeSettingsEditor : post19 / 3) attached .diff

    Caution & Warnings*
    Caution: blocking critical wakelocks can lead to bootloop; so always proceed full backup from recovery before unknown tries.
    Also, be aware that if you over-flash original cm (without WakelockBlockers), your rom will work as new ota (without bootloops); but if you flash again modified cm with WakelockBlockers, you will find back your precedent settings on ticked wakelocks.

    Warnings: before sharing logs with other, ensure that your log does not include some personal data under blocked wakelocks' description; ex: xxx @ gmail.com ...
    Code:
    packages/apps/Settings/src/com/android/settings/applications/WakeLockBlocker.java
    ...Log.d("maxwen", pm.getSeenWakeLocks());

    (nota: there are no analytics or any network exchanges on your blocked wakelock list; conversely WakelockBlocker can definitively help to stop such intrusive behaviours.)
    1
    wip

    How does it work
    How to 2x your battery
    The equation is simple 2xbattery=50%=20%a+20%b+10%c:

    a) 20% thank to @MaR-V-iN for microG project ie nogapps
    Not only the multiple google packages are pinging together, but the worse is the auto-updating ghost process (which sometimes leads in automatic battery drain due to obligatory “linux-reboot-post-validation-like").
    Also, the use of your personal data stay unclear.
    Thanks to @Bonoboo there are >100 gapp_pkg in MM
    With original KK (3years ago) it was >60 gapp_pkg.
    Of course microG won’t bring you all the fancy and amazing usages, but it should cover all your basic exigencies with privacy.

    b) 20% thank to CyanogenMod’superuser (root)
    DATA/LOCAL/userinit.sh (persistent to ota):
    rm /dev/log/*;
    rm /data/tombstones/*;
    sysctl -w vm.dirty_writeback_centisecs=2000;
    sysctl -w vm.dirty_expire_centisecs=1000;
    Then using Greenify + f-droid : Adaway Autostarts FasterGPS will finalize an equivalent snappy ‘interactive’ on a ‘conservative’ frugal mode (cpu scaling_governor).

    c)10% miscellaneous tips
    SETTINGS/WIFI/MENU/ADVANCED: switch always to never
    LAUNCHER : Smart Launcher (for phones) or craziest TinyLaunch from @arpruss (for tablet)
    PRIVATE BROWSING : internal cm-made
    FAST BROWSING 3G : Uc browser mini
    GENERAL BROWSING wifi : Dolphin + Jetpack + Companion (Jetpack will supply missing Lollipop’s live webview on KK & Companion will bring WOT and trigger to reduce freeze) with option ‘open in new Tab’ to avoid excessive back-reload pages.
    Try to avoid DLNA activity in background and track, with BetterBatteryStats, unnecessary wakelocks (once done you can greenify or disable it).
    For more security, cm11 is fully compatible with these xposed modules: AppSettings, DirectApkInstall, Greenify, LightningWall, XposedMediaScanner and XposedRecentTasksRAM.
    What's next
    Once upgraded with these 2 transparency in-core modifications: microG & WakelockBlocker, privacy setup, on cm11, is OK.

    Thanks to @noname81 no one is missing pie to use a phone/tablet easily: LMT Launcher (it’s funny to see many OEM copying Huawei for the mini-screen and they will discover pie...).

    But a fundamental functionality is still missing for all ROMs: a basic sound mix table per apk. I can’t believe that Google Inc. did not make that already, (they must wait for a world marketing hit).
    In simple words: play music or phone with relatives while watching TV or youtube… (for real!). I guess, once again, it’s question to DRM’s duty (you watch => you listen). Maybe, one day VLC will catch this in an all-in-one solution.
    Does java, using stream.hasvideo Boolean attribute, in the right place, can dress a list to duck or mute /apk ?
    This is the thread’s poll, since AppSettings is too far from the android core ?
    1
    My patches for CM11:
    1) Add fake sign functionality (from OmniROM)
    2) Add Wakelock Blocker (from this thread)
    1
    Just a note: it's not correct to count lines in my script for deleting gapps.
    It contain a lot duplicates that cover different names / locations of APK's. Plus .odex and .lib files.
    In nature there are ~100 real apps from Google, checked by parsing script.