Ver Mensaje Individual
  #114  
Viejo 27/07/16, 16:58:52
Array

[xs_avatar]
mikivila mikivila no está en línea
Usuario muy activo
 
Fecha de registro: ago 2012
Localización: viladecans
Mensajes: 3,370
Modelo de smartphone: Moto G -M- Moto x2 -M- Nexus 6
Tu operador: Orange
Crear un archivo init.d tal cual con permisos

#!/system/bin/sh

############################
# Net Speed tweaks #
############################
# UnderUtilized Networking Tweaks below as recommended by avgjoemomma (from XDA)
sysctl -w net.ipv4.tcp_congestion_control=cubic;
# Hardening the TCP/IP stack to SYN attacks
sysctl -w net.ipv4.tcp_syncookies=1;
sysctl -w net.ipv4.conf.all.rp_filter=1;
sysctl -w net.ipv4.conf.default.rp_filter=1;
sysctl -w net.ipv4.tcp_synack_retries=2;
sysctl -w net.ipv4.tcp_syn_retries=2;
sysctl -w net.ipv4.tcp_max_syn_backlog=1024;
sysctl -w net.ipv4.tcp_max_tw_buckets=16384;
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1;
sysctl -w net.ipv4.tcp_no_metrics_save=1;
sysctl -w net.ipv4.tcp_fin_timeout=15;
sysctl -w net.ipv4.tcp_keepalive_time=1800;
sysctl -w net.ipv4.ip_forward=0;
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1;
sysctl -w net.ipv4.route.flush=1;
sysctl -w net.ipv4.udp_rmem_min=6144;
sysctl -w net.ipv4.udp_wmem_min=6144;
sysctl -w net.ipv4.tcp_rfc1337=1;
sysctl -w net.ipv4.ip_no_pmtu_disc=0;
sysctl -w net.ipv4.tcp_ecn=0;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_fack=1;
# Don't accept source routing
sysctl -w net.ipv4.conf.default.accept_source_route=0 ;
sysctl -w net.ipv4.conf.all.accept_source_route=0;
# Don't accept redirects
sysctl -w net.ipv4.conf.all.accept_redirects=0;
sysctl -w net.ipv4.conf.default.accept_redirects=0;
sysctl -w net.ipv4.conf.all.secure_redirects=0;
sysctl -w net.ipv4.conf.default.secure_redirects=0;

FILL_RESOLV() {
CHANGE=0
if [ "$1" = "" ]; then
dns1=$(getprop net.dns1 2>/dev/null)
else
dns1=$1
fi
if ! BUSYBOX grep -q $dns1 /dev/resolv-local.conf 2>/dev/null; then
if [ "x0.0.0.0" != "x$dns1" ]; then
if BUSYBOX echo $dns1 | BUSYBOX grep -q "\..*\..*\..*"; then
BUSYBOX echo "nameserver $dns1" >> /dev/resolv-local.conf
CHANGE=1
fi
fi
fi

if [ "$2" = "" ]; then
dns2=$(getprop net.dns2 2>/dev/null)
else
dns2=$2
fi
if ! BUSYBOX grep -q $dns2 /dev/resolv-local.conf 2>/dev/null; then
if [ "x0.0.0.0" != "x$dns2" ]; then
if BUSYBOX echo $dns2 | BUSYBOX grep -q "\..*\..*\..*"; then
BUSYBOX echo "nameserver $dns2" >> /dev/resolv-local.conf
CHANGE=1
fi
fi
fi
if [ `BUSYBOX wc -l /dev/resolv-local.conf | BUSYBOX awk '{ print $1 }'` -gt 4 ]; then
cat /dev/resolv-local.conf
BUSYBOX grep "nameserver.*\..*\..*\..*" /dev/resolv-local.conf | BUSYBOX tail -4 > /dev/resolv-local.conf.tmp
BUSYBOX mv -f /dev/resolv-local.conf.tmp /dev/resolv-local.conf
CHANGE=1
fi

if [ $CHANGE -eq 1 ]; then
killall -HUP dnsmasq_dhcp
fi
}

SET_NET_DNS() {
count=1
while [ $count -le 5 ]; do
while [ "x$(getprop net.dns1 2>/dev/null)" != "x0.0.0.0" ]; do
FILL_RESOLV
if dnsc 0.0.0.0 >/dev/null 2>&1; then
if dnsc 127.0.0.3 www.microsoft.com 10053 >/dev/null 2>&1; then
dns1=$(getprop net.dns1 2>/dev/null)
setprop net.dns1 0.0.0.0
dns2=$(getprop net.dns2 2>/dev/null)
if [ "x0.0.0.0" != "x$dns1" ]; then
if BUSYBOX echo $dns1 | BUSYBOX grep -q "\..*\..*\..*"; then
setprop net.dns2 $dns1
fi
fi
setprop net.change net.dnschange
setprop ro.kernel.android.ndns 2
setprop net.dnschange $(($(getprop net.dnschange) + 1));
FILL_RESOLV $dns1 $dns2
count=1;
fi
fi
if [ "x$(getprop net.dns1 2>/dev/null)" != "x0.0.0.0" ]; then
count=1;
ipcount=`BUSYBOX ip route 2>/dev/null| BUSYBOX wc -l 2>/dev/null`
if [ "x$ipcount" = "x0" ]; then
setprop net.dns1 0.0.0.0
fi
fi

RUN_DNS &

if [ "$1" = "RUN" ]; then return 0; fi

SET_NET_DNS "$2"
__________________
Responder Con Cita
Gracias de parte de: