
rm -rf /data/*/com.tencent.tmgp.codev/files/ano_tmp
            rm -rf /data/*/*/com.tencent.tmgp.codev/files/ano_tmp
            
    

echo "执行初始化IP..."
    INTERFACE="wlan0"
    IP=$(ip addr show $INTERFACE | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d/ -f1)
    IP_PREFIX=$(echo $IP | cut -d. -f1-3)
    NEW_IP_LAST_PART1=$(($RANDOM % 254 + 1))
    NEW_IP_LAST_PART2=$(($RANDOM % 254 + 1))
    NEW_IP1="${IP_PREFIX}.${NEW_IP_LAST_PART1}"
    NEW_IP2="${IP_PREFIX}.${NEW_IP_LAST_PART2}"
    ip addr add $NEW_IP1/24 dev $INTERFACE
    ip addr add $NEW_IP2/24 dev $INTERFACE
    
    echo "原始网络IP地址是: $IP"
             
    settings put global airplane_mode_on 1
    am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true         
    prog_name="/data/temp"
    name=$(tr -dc \'1-9\' < /dev/urandom | head -c 8)
    while echo "$name" | grep -q "'"
    do
    name=$(tr -dc \'1-9\' < /dev/urandom | head -c 8)
    done 
    yy=$(getprop ro.serialno)
    resetprop ro.serialno $name
    echo 
    yy=$(getprop ro.serialno)
    settings put global airplane_mode_on 0
    am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
    echo "改变IP完毕"            

	clear
	Pf_R() { sleep 0.$RANDOM ;echo "\a\033[5m\033[31m[-]$@" ;sleep 0.$RANDOM ;echo "\033[1A\033[2K\r\a\033[33m[\\]$@\033[K" ;}
	Pf_A() { sleep 0.$RANDOM ;echo "\033[1A\033[2K\r\a\033[32m[+]$*\033[K" ;echo ;}
	Id_Path=/data/system/users/0
	rm -rf $Id_Path/registered_services $Id_Path/app_idle_stats.xml
	Id_File=$Id_Path/settings_ssaid.xml
	abx2xml -i $Id_File
	View_id() { grep $1 $Id_File | awk -F '"' '{print $6}' ;}
	Random_Id_1() { cat /proc/sys/kernel/random/uuid ;}
	Amend_Id() { sed -i "s#$1#$2#g" $Id_File ;}
	Userkey_Uid=`View_id userkey`
	Pf_R 系统UUID：$Userkey_Uid
	Amend_Id $Userkey_Uid $(echo `Random_Id_1``Random_Id_1` | tr -d - | tr a-z A-Z)
	printf "\033[1A\033[2K"
	printf "\033[1A\033[2K"
	Pf_A 系统UUID：`View_id userkey`

	xml2abx -i $Id_File
	Random_Id_2() {
		Min=$1
		Max=$(($2 - $Min + 1))
		Num=`cat /dev/urandom | head | cksum | awk -F ' ' '{print $1}'`
		echo $(($Num % $Max + $Min))
	}
	Serial_Id=/sys/devices/soc0/serial_number
	Pf_R 主板ID：`cat $Serial_Id`
	Tmp=/sys/devices/virtual/kgsl/kgsl/full_cache_threshold
	Random_Id_2 1100000000 2000000000 > $Tmp
	mount | grep -q $Serial_Id && umount $Serial_Id
	mount --bind $Tmp $Serial_Id
	Pf_A 主板ID：`cat $Serial_Id`
	IFS=$'\n'
	for i in `getprop | grep imei | awk -F '[][]' '{print $2}'`
	do
		Imei=`getprop $i`
		[ `echo $Imei | wc -c` -lt 16 ] && continue
		let a++
		printf "\r\033[31m[-]IMEI：$Imei\033[K"
		printf "\r\033[33m[\\]IMEI：$Imei\033[K"
		resetprop $i `echo $((RANDOM % 80000 + 8610000))00000000`
		printf "\r\033[32m[+]IMEI：`getprop $i`\033[K"
	done
	sleep 0.88s
	printf "\r[+]IMEI：Reset $a⁺\033[K"
	echo \\n
	Oa_Id=/data/system/oaid_persistence_0
	Pf_R OAID：`cat $Oa_Id`
	printf `Random_Id_1 | tr -d - | head -c 16` > $Oa_Id
	Pf_A OAID：`cat $Oa_Id`
	Va_Id=/data/system/vaid_persistence_platform
	Pf_R VAID：`cat $Va_Id`
	printf `Random_Id_1 | tr -d - | head -c 16` > $Va_Id
	Pf_A VAID：`cat $Va_Id`
	Pf_R 序列号：`getprop ro.serialno`
	resetprop ro.serialno `Random_Id_1 | head -c 8`
	Pf_A 序列号：`getprop ro.serialno`
	Pf_R 设备ID：`settings get secure android_id`
	settings put secure android_id `Random_Id_1 | tr -d - | head -c 16`
	Pf_A 设备ID：`settings get secure android_id`
	Pf_R 版本ID：`getprop ro.build.id`
	resetprop ro.build.id UKQ1.$((RANDOM % 20000 + 30000)).001
	Pf_A 版本ID：`getprop ro.build.id`
	Pf_R CPU_ID：`getprop ro.boot.cpuid`
	resetprop ro.boot.cpuid 0x00000`Random_Id_1 | tr -d - | head -c 11`
	Pf_A CPU_ID：`getprop ro.boot.cpuid`
	Pf_R OEM_ID：`getprop ro.ril.oem.meid`
	resetprop ro.ril.oem.meid 9900$((RANDOM % 8000000000 + 1000000000))
	Pf_A OEM_ID：`getprop ro.ril.oem.meid`
	Pf_R 广告ID：`settings get global ad_aaid`
	settings put global ad_aaid `Random_Id_1`
	Pf_A 广告ID：`settings get global ad_aaid`
	Pf_R UUID：`settings get global extm_uuid`
	settings put global extm_uuid `Random_Id_1`
	Pf_A UUID：`settings get global extm_uuid`
	Pf_R 指纹UUID：`settings get system key_mqs_uuid`
	settings put system key_mqs_uuid `Random_Id_1`
	Pf_A 指纹UUID：`settings get system key_mqs_uuid`
	Sum=$(getprop ro.build.fingerprint)
	sleep 0.$RANDOM
	echo "\a\033[5m\033[31m[-]指纹密钥：$Sum"
	sleep 0.$RANDOM
	printf "\033[1A\033[2K"
	echo "\033[1A\033[2K\a\033[5m\033[33m[\\]指纹密钥：$Sum"
	sleep 0.$RANDOM
	printf "\033[1A\033[2K"
	for i in $(seq 1 $(echo "$Sum" | grep -o [0-9] | wc -l))
	do
		Sum=$(echo "$Sum" | sed "s/[0-9]/$(($RANDOM % 10))/$i")
	done
	resetprop ro.build.fingerprint "$Sum"
	echo "\033[1A\033[2K\a\033[5m\033[32m[+]指纹密钥：$(getprop ro.build.fingerprint)\n"
	Pf_R GC驱动器ID：`settings get global gcbooster_uuid`
	settings put global gcbooster_uuid `Random_Id_1`
	Pf_A GC驱动器ID：`settings get global gcbooster_uuid`
	Pf_R IP地址：`curl -s ipinfo.io/ip`
	svc data disable
	svc wifi disable
	sleep 5
	svc data enable
	svc wifi enable
	until ping -c 1 223.5.5.5 &>/dev/null
	do
		sleep 1
	done
	Pf_A IP地址：`curl -s ipinfo.io/ip`
	IFS=$'\n'
	Mac_File=/sys/class/net/wlan0/address
	Pf_R Wifi_Mac地址：`cat $Mac_File`
	mount | grep -q $Mac_File && umount $Mac_File
	svc wifi disable
	ifconfig wlan0 down
	sleep 1
	Mac=`Random_Id_1 | sed 's/-//g ;s/../&:/g' | head -c 17`
	ifconfig wlan0 hw ether $Mac
	for Wlan_Path in `find /sys/devices -name wlan0`
	do
		[ -f "$Wlan_Path/address" ] && {
			chmod 644 "$Wlan_Path/address"
			echo $Mac > "$Wlan_Path/address"
		}
	done
	chmod 0755 $Mac_File
	echo $Mac > $Mac_File
	for Wlan_Path in `find /sys/devices -name '*,wcnss-wlan'`
	do
		[ -f "$Wlan_Path/wcnss_mac_addr" ] && {
			chmod 644 "$Wlan_Path/wcnss_mac_addr"
			echo $Mac > "$Wlan_Path/wcnss_mac_addr"
		}
	done
	Tmp=/data/local/tmp/Mac_File
	echo $Mac > $Tmp
	mount --bind $Tmp $Mac_File
	ifconfig wlan0 up
	svc wifi enable
	sleep 1
	Pf_A Wifi_Mac地址：`cat $Mac_File`
	echo \\033[38m已完成，建议先卸载游戏在清理效果更好，请重启手机	
} 2>/dev/null