├── .gitattributes ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── Update.json ├── customize.sh ├── module.prop ├── post-fs-data.sh └── service.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Declare files that will always have LF line endings on checkout. 2 | META-INF/** text eol=lf 3 | *.prop text eol=lf 4 | *.sh text eol=lf 5 | *.md text eol=lf 6 | 7 | # Denote all files that are truly binary and should not be modified. 8 | system/** binary 9 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # Global vars 10 | TMPDIR=/dev/tmp 11 | PERSISTDIR=/sbin/.magisk/mirror/persist 12 | 13 | rm -rf $TMPDIR 2>/dev/null 14 | mkdir -p $TMPDIR 15 | 16 | # echo before loading util_functions 17 | ui_print() { echo "$1"; } 18 | 19 | require_new_magisk() { 20 | ui_print "*******************************" 21 | ui_print " Please install Magisk v19.0+! " 22 | ui_print "*******************************" 23 | exit 1 24 | } 25 | 26 | is_legacy_script() { 27 | unzip -l "$ZIPFILE" install.sh | grep -q install.sh 28 | return $? 29 | } 30 | 31 | print_modname() { 32 | local len 33 | len=`echo -n $MODNAME | wc -c` 34 | len=$((len + 2)) 35 | local pounds=`printf "%${len}s" | tr ' ' '*'` 36 | ui_print "$pounds" 37 | ui_print " $MODNAME " 38 | ui_print "$pounds" 39 | ui_print "*******************" 40 | ui_print " Powered by Magisk " 41 | ui_print "*******************" 42 | } 43 | 44 | ############## 45 | # Environment 46 | ############## 47 | 48 | OUTFD=$2 49 | ZIPFILE=$3 50 | 51 | mount /data 2>/dev/null 52 | 53 | # Load utility functions 54 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 55 | . /data/adb/magisk/util_functions.sh 56 | [ $MAGISK_VER_CODE -gt 18100 ] || require_new_magisk 57 | 58 | # Preperation for flashable zips 59 | setup_flashable 60 | 61 | # Mount partitions 62 | mount_partitions 63 | 64 | # Detect version and architecture 65 | api_level_arch_detect 66 | 67 | # Setup busybox and binaries 68 | $BOOTMODE && boot_actions || recovery_actions 69 | 70 | ############## 71 | # Preparation 72 | ############## 73 | 74 | # Extract prop file 75 | unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2 76 | [ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!" 77 | 78 | $BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules 79 | MODULEROOT=$NVBASE/$MODDIRNAME 80 | MODID=`grep_prop id $TMPDIR/module.prop` 81 | MODPATH=$MODULEROOT/$MODID 82 | MODNAME=`grep_prop name $TMPDIR/module.prop` 83 | 84 | # Create mod paths 85 | rm -rf $MODPATH 2>/dev/null 86 | mkdir -p $MODPATH 87 | 88 | ########## 89 | # Install 90 | ########## 91 | 92 | if is_legacy_script; then 93 | unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2 94 | 95 | # Load install script 96 | . $TMPDIR/install.sh 97 | 98 | # Callbacks 99 | print_modname 100 | on_install 101 | 102 | # Custom uninstaller 103 | [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh 104 | 105 | # Skip mount 106 | $SKIPMOUNT && touch $MODPATH/skip_mount 107 | 108 | # prop file 109 | $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop 110 | 111 | # Module info 112 | cp -af $TMPDIR/module.prop $MODPATH/module.prop 113 | 114 | # post-fs-data scripts 115 | $POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh 116 | 117 | # service scripts 118 | $LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh 119 | 120 | ui_print "- Setting permissions" 121 | set_permissions 122 | else 123 | print_modname 124 | 125 | unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2 126 | 127 | if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then 128 | ui_print "- Extracting module files" 129 | unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2 130 | 131 | # Default permissions 132 | set_perm_recursive $MODPATH 0 0 0755 0644 133 | fi 134 | 135 | # Load customization script 136 | [ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh 137 | fi 138 | 139 | # Handle replace folders 140 | for TARGET in $REPLACE; do 141 | ui_print "- Replace target: $TARGET" 142 | mktouch $MODPATH$TARGET/.replace 143 | done 144 | 145 | if $BOOTMODE; then 146 | # Update info for Magisk Manager 147 | mktouch $NVBASE/modules/$MODID/update 148 | cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop 149 | fi 150 | 151 | # Copy over custom sepolicy rules 152 | if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then 153 | ui_print "- Installing custom sepolicy patch" 154 | PERSISTMOD=$PERSISTDIR/magisk/$MODID 155 | mkdir -p $PERSISTMOD 156 | cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule 157 | fi 158 | 159 | # Remove stuffs that don't belong to modules 160 | rm -rf \ 161 | $MODPATH/system/placeholder $MODPATH/customize.sh \ 162 | $MODPATH/README.md $MODPATH/.git* 2>/dev/null 163 | 164 | ############## 165 | # Finalizing 166 | ############## 167 | 168 | cd / 169 | $BOOTMODE || recovery_cleanup 170 | rm -rf $TMPDIR 171 | 172 | ui_print "- Done" 173 | exit 0 174 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |
4 |
_time_stamp_ 5 | 6 | 7 | Hello, 8 | 9 | 10 | ### As John Graham-Cumming announced, Cloudflare now offers its own DNS service. 11 | ### And surprise of the Boss if we believe his words: your history of browsing isn't saved on their servers ! 12 | 13 | ### DNS ?? Gne ?? What's this ? 14 | 15 | To make it short: a DNS server listen and give you the corresponding IP address of your website request, and its domain name (forum.xda-developers.com for example). 16 | 17 | For the long version a little reading is necessary: https://en.wikipedia.org/wiki/Domain_Name_System 18 | 19 | ### The purpose of this module? 20 | Forward all mobile data via their servers. 21 | 22 | 23 | #### Warning: 24 | 25 | Please note that your web provider can purely block all requests if you use customs DNS servers address. I can't do anything for that. 26 | 27 | ### Requirements: 28 | - An android device (something tells me if you're here it's because you have one..) 29 | - Magisk installed (v17+ at least) 30 | - five minutes of your free-times (and a little piece of your brain (just in case)) 31 | 32 | 33 | 34 | If you trust them, so you can install the module properly, restart and enjoy! 35 | 36 | 37 | #### Speedtest with CF DNS servers: 38 | 39 | ![alt text](https://image.ibb.co/mkEg1c/Screenshot_20180404_161654.png "speedtestscr1") 40 | 41 | 42 | #### nslookup check: 43 | 44 | ![alt text](https://image.ibb.co/eLGTgc/Screenshot_20180404_161711.png "speedtestscr2") 45 | ![alt text](https://image.ibb.co/cmpdWc/Screenshot_20180404_191656.png "speedtestscr3") 46 | ![alt text](https://image.ibb.co/eXPUBc/Screenshot_20180407_202353.png "speedtestscr4") 47 | 48 | ### If you trust them, so install this module, restart and enjoy ! :) 49 | -------------------------------------------------------------------------------- /Update.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2.6, 3 | "versionCode": 26, 4 | "zipUrl": https://github.com/xerta555/CloudflareDNS4Magisk-IPv6/releases/download/2.6/CloudflareDNS4Magisk-IPv6-2.6.zip, 5 | "changelog": Update for Magisk v24 6 | } 7 | -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | if [ -a /system/etc/resolv.conf ]; then 2 | mkdir -p $MODPATH/system/etc/ 3 | printf "nameserver 1.1.1.1\nnameserver 1.0.0.1" >> $MODPATH/system/etc/resolv.conf 4 | touch $MODPATH/auto_mount 5 | fi 6 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=CloudflareDNS4Magisk 2 | name=CloudflareDNS4Magisk 3 | version=v2.7 4 | versionCode=27 5 | author=Rom 6 | description=Using the Cloudflare DNS system-lessly! As simple as that. 7 | updateJson=https://raw.githubusercontent.com/xerta555/CloudflareDNS4Magisk-IPv6/master/Update.json 8 | support=https://forum.xda-developers.com/t/module-cloudflaredns4magisk.3772375/ 9 | donate=https://www.paypal.com/paypalme/romfr 10 | -------------------------------------------------------------------------------- /post-fs-data.sh: -------------------------------------------------------------------------------- 1 | # This file will be read by resetprop 2 | # Example: Change dpi 3 | # ro.sf.lcd_density=320 4 | 5 | resetprop -n net.eth0.dns1=2606:4700:4700::1111 6 | resetprop -n net.eth0.dns2=2606:4700:4700::1001 7 | 8 | resetprop -n net.dns1=2606:4700:4700::1111 9 | resetprop -n net.dns2=2606:4700:4700::1001 10 | 11 | resetprop -n net.ppp0.dns1=2606:4700:4700::1111 12 | resetprop -n net.ppp0.dns2=2606:4700:4700::1001 13 | 14 | resetprop -n net.rmnet0.dns1=2606:4700:4700::1111 15 | resetprop -n net.rmnet0.dns2=2606:4700:4700::1001 16 | 17 | resetprop -n net.rmnet1.dns1=2606:4700:4700::1111 18 | resetprop -n net.rmnet1.dns2=2606:4700:4700::1001 19 | 20 | resetprop -n net.pdpbr1.dns1=2606:4700:4700::1111 21 | resetprop -n net.pdpbr1.dns2=2606:4700:4700::1001 22 | -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Do NOT assume where your module will be located. 3 | # ALWAYS use $MODDIR if you need to know where this script 4 | # and module is placed. 5 | # This will make sure your module will still work 6 | # if Magisk change its mount point in the future 7 | MODDIR=${0%/*} 8 | 9 | # This script will be executed in late_start service mode 10 | 11 | iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 2606:4700:4700::1111 12 | iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 2606:4700:4700::1001 13 | iptables -t nat -I OUTPUT -p tcp --dport 53 -j DNAT --to-destination 2606:4700:4700::1111 14 | iptables -t nat -I OUTPUT -p udp --dport 53 -j DNAT --to-destination 2606:4700:4700::1001 15 | --------------------------------------------------------------------------------