Coder Social home page Coder Social logo

magisk-modules-repo / energizedprotection Goto Github PK

View Code? Open in Web Editor NEW
312.0 11.0 54.0 437 KB

Energized Protection Magisk Module.

Home Page: https://energized.pro

License: MIT License

Shell 100.00%
energized protection magisk adblock privacy tracking

energizedprotection's Introduction

Cover

Energized Protection - Magisk ⚡

Version Version _time_stamp_ _time_stamp_
ad.porn.malware blocking.
This repository consolidates several reputable filters, and merges them into couple of protection packs with duplicates and dead/inactive domains removed. A variety of tailored packs are provided.

A Trio Project with ❤ from Bangladesh, India & Zanzibar.

Features

  • hosts based: based on Hosts file, all the bad stuffs blocked with 0.0.0.0
  • any device: compatible with all devices, regardless of OS.
  • blockings: strictly blocks advertisements, malwares, spams, statistics & trackers on both web browsing and applications.
  • multiple formats: different variants for different devices.
  • speed you need: reduces page loading time upto half of its actual time!
  • privacy: with all these annoyances blocking, it also increases privacy.
  • saves expense: greatly decreases data consumption saving expense.
  • clean: no extra abracadabra!

Requirements

  • Use Magisk v20.4+ for better compatibility.
  • Magisk v20.0 - 20.3 users are required to install Busybox for Android NDK module, for the module to work properly.

Run

  • First Enable Systemless Hosts in Magisk Manager
  • Open terminal then type:
su  
ep -h

or

su -c ep -h

Usage:

Script arguments

Usage: ep [options...]
 -b, --black <domain(s)> 
       >> Instantly add the domain(s) to hosts.
       > e.g., ep -b example.com new.example.com www.example.com
 -B, --blacklist 
       >> Add the domains in blacklist file to hosts.
       >> blacklist file in /sdcard/EnergizedProtection directory.
       > e.g., ep -B
 -c, --clear 
       >> Clear the hosts file and revert back to stock. 
       > e.g., ep -c
 -C, --config-file 
       >> Open and edit the config file.
       > e.g., ep -C 
 -e, --extension 
       >> Add extension pack(s) to the hosts.
       > e.g., 
         ep -e <porn-lite|pornlite>
         ep -e porn
         ep -e regional
         ep -e xtreme
         ep -e social
 -h, --help 
       >> Print help. 
 -i, --info
       >> Print all the information.
 -m, --menu 
       >> Show the full menu with more information.
       > e.g., ep -m 
 -o, --open 
       >> Open the hosts file.
       > e.g., ep -o
 -p, --pack <pack name> [-e|--extension] <extension pack name> 
       >> Download the pack and extension of your choice.
       > e.g., 
         ep -p spark
         ep -p blugo -e xtreme
         ep -p blu -e regional social  
 -r, --redirect
       >> Redirect the domains in redirectlist file to specific IPV4/V6.
       >> redirectlist file in /sdcard/EnergizedProtection directory.
       > e.g., ep -r
 -u, --update
       >> Update currently applied hosts pack and extension(s). 
       >> Also whitelist, blacklist and redirect domains to current IP.
       > e.g., ep -u
 
 -w, --white <domain(s)> 
       >> Instantly whitelist the domain(s) from hosts.
       > e.g., ep -w example.com new.example.com www.example.com
 -W, --whitelist 
       >> Whitelist the domains in whitelist file to hosts.
       >> whitelist file in /sdcard/EnergizedProtection directory.
       > e.g., ep -W 
 -bp, --backup
        >> Backup the current hosts setup.
        > e.g., ep -bp
 -ck, --check <domain>
        >> Check whether the domain is in the list.
        > e.g., ep -ck example.com
 -ip, --redirect-ip [-4|-v4|-6|-v6] <ipv4/ipv6>
        >> Change current redirection IP.
        > e.g., 
          ep -ip -4 127.0.0.1
          ep -ip -6 ::1  
 -ir, --instant-redirect [-4|-v4|-6|-v6] <domain(s)>
        >> Instantly redirect the domain(s) to specific IPV4/V6.
        > e.g., 
          ep -ir -4 127.0.0.1 example.com new.example.com
          ep -ir -6 ::1 example.com new.example.com
 -re, --restore
        >> Restore the backed up hosts setup.
        > e.g., ep -re
 -un, --uninstall
        >> Uninstall the module setup.
        > e.g., ep -un
 -v, --version
        >> Print version. 

Energized, energized, Ep, ep & epro would also work, as symlink.

  • Then follow the on screen prompts.

Config Setup

Only use true/false to enable/disable features.

# Check for hosts update on startup
checkHostsUpdate=true

Note. More options will be available shortly.

Uninstall

  • Run Uninstall option via main menu un or ep -un

Changelog

v.1.3.6

  • Added support for Magisk 24.x! (+ basic support for Canary versions)

v.1.3.5

  • Added support for Magisk 23.x!

v.1.3.4

  • Added support for Magisk 22.x!

v.1.3.3

  • Added support for Android 11 and Magisk 21.x!
  • Updated user-agent for downloading hosts.
  • The hitWeb function shouldn't make you wait for long now.

v.1.3.2

  • Added missing cut alias. (Which was breaking domain verifying functions.)
  • Fixed missing systemless hosts print.

v.1.3.0

  • Added back Magisk v20.0 - 20.3 support.

*Magisk v20.4+ users won't require separate busybox module.

*Magisk v20.0-20.3 users will have to install Busybox for Android NDK module.

v.1.2.5

  • Added CLI Flag support.
  • No more separate busybox required for Magisk v20.4+. Magisk Busybox will be used by default.
  • Updated Magisk Template to v20.0+. No more support for Magisk <v20.0.
  • Added user config support.
  • Improved blacklist, whitelist and redirectlist functions.
  • Improved instant blacklist, whitelist and redirectlist functions.
  • Updated download links.
  • Improved current pack, extension and IP detection.
  • Added intelligent domain and IPV4 detection support.
  • Updated Redirection IP function.
  • Added more functions. Use ep -h or ep --help for more info.
  • Updated H&WB function to support automatic extension and current IP detection.
  • Improved and updated almost all of the functions to match new changes.
  • Fixed domain counting awk segmentation fault error.
  • UI revamped. A lot of things have been updated.
  • Beautify the module scripts.
  • Updated sleep parameters.
  • Script was re-written and lot of new patches have been applied.
  • Fixed new change related issues so far.
  • Script improvement and fix patches applied.

*Previous Changes | **Beta Builds and Changes

Check Energized


Check whether Energized Protection is working or not! Check via our checking page here.

Support


Maintaining a quality blocking project takes a lot of time. Energized Protection is completely independently funded. We fight for our users. This does mean however that we also have to spend our owns to pay the bills. This is where you can help: by chipping in you can ensure more time is spent improving Energized rather than dealing with distractions.

This donation is for our services, not for any pack, resource or any other mean. Your support will help us keep the project running and provide you quality service.

Disclaimer


Energized Protection Block Lists are basically blacklists files to block access to domains. If you don't know how it works, then please try this at your own risk. I won't be responsible for any damage or loss. Never forget to make backup.

License


The content of this project itself is licensed under the MIT license, and the underlying source code used to format and display that content is licensed under the CC BY-NC-SA 4.0 license.


Let's make an annoyance free better open internet, altogether!

A project by Ador with ❤

energizedprotection's People

Contributors

adroitadorkhan avatar avinashreddy3108 avatar power78 avatar programminghoch10 avatar xerta555 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

energizedprotection's Issues

Not Working With Magisk 20.3

Magisk Fully Updated and Working

photo_2020-02-23_18-12-32

Energized Loads Fine at First

photo_2020-02-23_18-12-26

Fails & Hangs

photo_2020-02-23_18-12-29

Magisk binary is com.txQQ345io4oFgPML which is randomized. Was working fine before, but maybe now it's not?

Does not work with Magisk 21.

I have installed latest Magisk stable (v21) installed onAndroid 10, however Energized Protection refuses to run. Output below:

` # ep -m

Version: 21.0 - not supported.
Exiting...

`
Any hope that a fix for using on Android 10 with Magisk stable will arrive?

Version not supported

Hello! I'm using Magisk Canary, and as of Magisk 24 the module seems to be broken because it doesn't think it's supported.

This is the error I'm getting:

>Version: 32fc34f9 - not supported.
> Exiting...

You run this terminal in sh mode.

This message shows up in terminal at below , and i don't know why

:/ # su
:/ # energized

You run this terminal in sh mode.

=> You must run in sh mode.

  • Energized is only compatible with sh.

Some issue didnt work

Hi after clean install OS I have installed magisk and the first module was energized it has enabled when I go to terminal and activated it says it has enabled the extension and in list energized not activated.
Screenshot_20200425-145539_Terminal
Screenshot_20200425-145551_Terminal
Screenshot_20200425-145518_Terminal

Config file: Update disabled in config. its configured!

Added the config file as described in docs.

ep.conf in sdcard/EnergizedProtection

contains: checkHostsUpdate=true

But ep -C or ep --config-file commands does nothing.
Also at initializing: Update: Disabled in config.

Version: 6.32.0810.22.02.055.00
Build Version: 22.02.055.00
Build Date: Thu, 24 Feb 22 00:18:24 +06
Version Code: 0550018
screen-20220223-214831.mp4

#32

Packs download return 404

Impossible to apply any pack as they all return a 404 error now.
Will there be an update of the module?

Thanks.

[Bug] Doesn't work with Magisk 23.0

I updated Magisk to the latest beta yesterday.
It broke the energized protection module.

Some info:
ROM: Stock Android 5.1 with Magisk patched boot.img
Magisk version: 23.0 (23000)
Systemless hosts is already enabled.

Here's the screenshot:
Screenshot_2021-05-13-12-00-06

How to set checkHostsUpdate

When using energized -C the file does not open and with energized -C checkHostsUpdate=true it seems that is not added to the file since energized -C displays nothing.

[REMINDER] Update to the new module installer!

Just in case if you are not aware, a completely new Magisk Module Installer replaces the old Magisk module template. This new format decouples ALL installation logic from modules, and encourages developers to use the provided API for installation. This new format is ENFORCED, meaning all existing modules should upgrade ASAP, and new modules are REQUIRED to follow the rules.

Carefully read through the updated docs!

Warning: All existing modules that does not use the new module format will be automatically removed on May 1st, 2019. Module devs: upgrade your existing modules ASAP!

P.S. This issue is just a kind reminder, you can close it after reading this message :)

/sdcard does not exist

Yesterday I stumbled upon a problem with a tablet, which did not have the folder sdcard in the root directory.

When executing any of the EnergizedProtection commands like ep -p blu or ep -m
the first 3 lines consist of mkdir failed for /sdcard/, Read-only file system.

root@tablet:/ # ep -p blu
mkdir failed for /sdcard/, Read-only file system
mkdir failed for /sdcard/, Read-only file system
mkdir failed for /sdcard/, Read-only file system

[|] Pack: Downloadingwget: can't open '/sdcard/EnergizedProtection/hosts.gz': No such file or directory
[/] Pack: Downloadinggzip: can't gzopen /sdcard/EnergizedProtection/hosts.gz
[✓] Pack: Blu Protection
[*] No extension applied.
ls: Unknown option '-h'. Aborting.
[+] Size:
[\] Filter: Updatingwget: can't open '/sdcard/EnergizedProtection/cache/version.md': No such file or directory
cp: /sdcard/EnergizedProtection/cache/version.md: No such file or directory
/system/bin/ep[2133]: can't create /sdcard/EnergizedProtection/cache/filter: No such file or directory
[✓] Filter: Updated

-------------------------------------------------
[+] If you loved our work, consider donating.
  > PayPal: paypal.me/shadmansaleh
  > Support: energized.pro/support
-------------------------------------------------

The Download and apply obviously fail as well.

Side Note: The script still ticks it as updated. Does it always tick it? Does the script even check if the apply worked?

Device Info:
Chipset: Rockchip RK3128
Android: 5.1.1
uname -a: Linux localhost 3.10.0 #309 SMP PREEMPT Tue Oct 18 16:49:27 CST 2016 armv7l Android
Magisk: 20.3
Energized Version: 1.3.2
Busybox: v1.31.1-osm0sis

Side Note: I know 20.4 is the newest Magisk version, but due to Rockchips own "KRNL" boot image format, which Magisk does not support, I had to patch the boot image myself. I wont update Magisk if not needed as this is a hell of time waste to do so. I do think though that the Magisk version does not matter in this case.

Here are some commands I've tried in order to understand why the script doesn't work.

ls -la /

root@tablet:/ # ls -la /
drwxr-xr-x root     root              2020-07-27 15:12 acct
lrwxrwxrwx root     root              2020-07-27 15:12 bcm4329_cybertan.hcd -> /etc/bluez/bcm432x/BCM4329B1_002.002.023.0389.0000_Cybertan-Foxconn_Cls2_extLNA_EDRmaxInputLev+PeakDEVM_NT.hcd
lrwxrwxrwx root     root              2020-07-27 15:12 bcm4329_samsung.hcd -> /etc/bluez/bcm432x/BCM4329B1_TestOnly_0237_26MHz_SEMCO_B23.hcd
lrwxrwxrwx root     root              2020-07-27 15:12 bcm4329_usi.hcd -> /etc/bluez/bcm432x/BCM4329B1_USI_WM-BN-BM-01.hcd
drwxrwx--- system   cache             2020-07-27 15:12 cache
lrwxrwxrwx root     root              1970-01-01 01:00 charger -> /sbin/healthd
dr-x------ root     root              2020-07-27 15:12 config
lrwxrwxrwx root     root              2020-07-27 15:12 d -> /sys/kernel/debug
drwxrwx--x system   system            2020-02-21 23:18 data
-rw-r--r-- root     root          312 1970-01-01 01:00 default.prop
drwxr-xr-x root     root              2020-07-27 15:12 dev
-rw-r--r-- root     root        11924 1970-01-01 01:00 drmboot.ko
lrwxrwxrwx root     root              2020-07-27 15:12 etc -> /system/etc
-rw-r--r-- root     root        16959 1970-01-01 01:00 file_contexts
lrwxrwxrwx root     root              2020-07-27 15:12 fstab.rk30board -> /fstab.rk30board.bootmode.emmc
-rw-r----- root     root         1965 1970-01-01 01:00 fstab.rk30board.bootmode.emmc
-rw-r----- root     root         2143 1970-01-01 01:00 fstab.rk30board.bootmode.unknown
-rwxr-x--- root     root       305584 1970-01-01 01:00 init
-rwxr-x--- root     root         6449 1970-01-01 01:00 init.connectivity.rc
-rwxr-x--- root     root          980 1970-01-01 01:00 init.environ.rc
-rwxr-x--- root     root        22242 2020-07-27 15:12 init.rc
-rwxr-x--- root     root          803 1970-01-01 01:00 init.rk30board.bootmode.emmc.rc
-rwxr-x--- root     root          895 1970-01-01 01:00 init.rk30board.bootmode.unknown.rc
-rwxr-x--- root     root          220 1970-01-01 01:00 init.rk30board.environment.rc
-rwxr-x--- root     root         5962 1970-01-01 01:00 init.rk30board.rc
-rwxr-x--- root     root         6333 1970-01-01 01:00 init.rk30board.usb.rc
-rwxr-x--- root     root         7596 1970-01-01 01:00 init.rockchip.rc
-rwxr-x--- root     root         1927 1970-01-01 01:00 init.trace.rc
-rwxr-x--- root     root         3885 1970-01-01 01:00 init.usb.rc
-rwxr-x--- root     root          301 1970-01-01 01:00 init.zygote32.rc
drwxr-xr-x root     root              1970-01-01 01:00 metadata
drwxrwxr-x root     system            2020-07-27 15:12 mnt
dr-xr-xr-x root     root              1970-01-01 01:00 proc
-rw-r--r-- root     root         2771 1970-01-01 01:00 property_contexts
drwxr-xr-x root     root              1970-01-01 01:00 res
-rw-r--r-- root     root       145508 1970-01-01 01:00 rk30xxnand_ko.ko.3.10.0
drwxr-x--- root     root              2020-07-27 15:12 root
drwxr-xr-x root     root              2020-07-27 15:12 sbin
-rw-r--r-- root     root          550 1970-01-01 01:00 seapp_contexts
-rw-r--r-- root     root           79 1970-01-01 01:00 selinux_version
-rw-r--r-- root     root       650639 2020-07-27 15:12 sepolicy
-rw-r--r-- root     root         9718 1970-01-01 01:00 service_contexts
drwxr-x--x root     sdcard_r          2020-07-27 15:12 storage
dr-xr-xr-x root     root              2020-07-27 15:12 sys
drwxr-xr-x root     root              1970-01-01 01:00 system
-rw-r--r-- root     root         4464 1970-01-01 01:00 ueventd.rc
-rw-r--r-- root     root         4430 1970-01-01 01:00 ueventd.rk30board.rc
lrwxrwxrwx root     root              2020-07-27 15:12 vendor -> /system/vendor

Notice how there is no /sdcard present in this list.
The script complains about it being a "read-only" file system,
as it also wants to create /sdcard,
but the rootfs is read-only.

mount -o rw,remount rootfs /

Now this is where it gets interesting.
Just for fun I tried remounting the entire root filesystem as read-write.
This changes the script output:

root@tablet:/ # mount -o rw,remount rootfs /
root@tablet:/ # ep -p blu

[✓] Pack: Blu Protection
[*] No extension applied.
ls: Unknown option '-h'. Aborting.
[+] Size:
[✓] Filter: Updated

-------------------------------------------------
[+] If you loved our work, consider donating.
  > PayPal: paypal.me/shadmansaleh
  > Support: energized.pro/support
-------------------------------------------------

It seems like the script is now able to create the folder.

directory variable

Now for an actual purposeful attempt to make the script work.
A similar result shows up when I set the path in the directory variable to /data/media/0/EnergizedProtection,
as this path definitively exists.
The /sdcard error disappears, but there seem to be some more problems:

root@tablet:/ # ep -p blu

[✓] Pack: Blu Protection
[*] No extension applied.
ls: Unknown option '-h'. Aborting.
[+] Size:
[✓] Filter: Updated

-------------------------------------------------
[+] If you loved our work, consider donating.
  > PayPal: paypal.me/shadmansaleh
  > Support: energized.pro/support
-------------------------------------------------
root@tablet:/ # ep -i
-------------------------------------------------
ϟ C O M P A T I B I L I T Y  I N F O -
-------------------------------------------------
[✓] Shell: sh supported.
[✓] Magisk: 20.3 supported.
[✓] Root: Permission granted.
[✓] Busybox: v1.31.1-osm0sis supported.
[✓] Adblocker App: No confliction.
[✓] Directory: Setup properly.
[✓] Update: Already latest.

-------------------------------------------------
ϟ P A C K  I N F O -
-------------------------------------------------
[+] Pack: Blu Protection
[+] Domains: -
ls: Unknown option '-h'. Aborting.
[+] Size:
[+] Current IP:
date: invalid option -- r
date: invalid option -r
[+] Updated:

-------------------------------------------------
[+] If you loved our work, consider donating.
  > PayPal: paypal.me/shadmansaleh
  > Support: energized.pro/support
-------------------------------------------------

These errors are about ls and date. What can be done about those?

CLI Flags

I really hate watching all of the credits that take almost a full minute to initialize the application just to update definitions.

Accepting CLI flags would give users the ability to do certain tasks with automation and without having to wait. E.g.

energized --update

can be used to update blocking definitions in unison with init.d on device boot up or every x hours, etc.

Empty domains included for every domain added when adding blacklist

abcd.com
abcde.com
abcdef.com

This is an example of the domains i put in the blacklist file in 'sdcard/EnergizedProtection/',
when I run hosts script and choose blacklist 'b' option, restart, then I checks my host file, the result of the domains added was like:

0.0.0.0 abcd.com
0.0.0.0
0.0.0.0 abcde.com
0.0.0.0
0.0.0.0 abcdef.com

Android version : 10
Magisk version : 20.2
Module version : éclairs

Module not working with Magisk 20.4 (stable)

This was already mentioned in #16 but it was closed by the OP who believed that it is a won't fix.

When I try to run the module from Termux, execution stops at this screen:

image

This module has been very useful. I believe the developers are rewriting this module completely. Till the new version is available, this issue could be kept open.

Can't enable EP - "Read-only file system" with Magisk and Systemless hosts module enabled

Device: Huawei Mediapad M3 8.4
Android Version: 7.0 Emui 5.0
Magisk Version: Canary 831a398b(25206)

When i try to download a package and enable the protection, it say
can't create /data/adb/modules/hosts/system/etc/hosts: Read-only file system
that with Magisk is obvious, but i've enabled the Systemless hosts module (i've already rebooted the device).
Any help?

Screenshot_20230112-172505
Screenshot_20230112-172555
Screenshot_20230112-154940
Screenshot_20230112-172517

Not compatible with Android 11

Android 11 got rid of sbin completely and so magisk now uses /dev/randomstring/.magisk

The random string changes each boot so you need to use the

magisk --path

Command each time the script is run to get the proper path. I forget when this functionality was added though (some point early this year) so it'd probably be best to use sbin if it exists, the path command otherwise

[MODERATION] Issue Detected

The moderation server has detected an issue of your repo:

TypeError: Cannot read property 'code' of undefined

Important: Please fix this issue within 14 days, and CLOSE this issue.
Failure to comply will result in removal of your repo from Magisk-Modules-Repo!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.