#!/system/bin/sh
# Market country change script by rac (http://2030.tk/android)
# based on reverse engineering from Tim (http://strazzere.com/blog) 
# and Andrea (http://www.androidiani.com)
# this script has to be started as root
case $1 in
	ch.sunrise)
		setprop gsm.sim.operator.numeric 22802
		setprop gsm.operator.numeric 22802
		setprop gsm.sim.operator.iso-country ch
		setprop gsm.operator.iso-country ch
		setprop gsm.operator.alpha sunrise
		setprop gsm.sim.operator.alpha sunrise
		kill $(ps | grep vending | tr -s ' ' | cut -d ' ' -f2)
		rm -rf /data/data/com.android.vending/cache/* 
		sh $0 actual;;
	de.o2)
		setprop gsm.sim.operator.numeric 26207
		setprop gsm.operator.numeric 26207
		setprop gsm.sim.operator.iso-country de
		setprop gsm.operator.iso-country de
		setprop gsm.operator.alpha "o2 - de"
		setprop gsm.sim.operator.alpha "o2 - de"
		kill $(ps | grep vending | tr -s ' ' | cut -d ' ' -f2)
		rm -rf /data/data/com.android.vending/cache/* 
		sh $0 actual;;
	de.simyo)
		setprop gsm.sim.operator.numeric 26203
		setprop gsm.operator.numeric 26203
		setprop gsm.sim.operator.iso-country de
		setprop gsm.operator.iso-country de
		setprop gsm.operator.alpha "E-Plus"
		setprop gsm.sim.operator.alpha "simyo"
		kill $(ps | grep vending | tr -s ' ' | cut -d ' ' -f2)
		rm -rf /data/data/com.android.vending/cache/* 
		sh $0 actual;;
	us.tmo)
		setprop gsm.sim.operator.numeric 31026
		setprop gsm.operator.numeric 31026
		setprop gsm.sim.operator.iso-country us
		setprop gsm.operator.iso-country us
		setprop gsm.operator.alpha T-Mobile
		setprop gsm.sim.operator.alpha T-Mobile
		kill $(ps | grep vending | tr -s ' ' | cut -d ' ' -f2)
		rm -rf /data/data/com.android.vending/cache/* 
		sh $0 actual;;
	actual)
		getprop|grep gsm.sim.operator.numeric
		getprop|grep gsm.operator.numeric
		getprop|grep gsm.sim.operator.iso-country
		getprop|grep gsm.operator.iso-country
		getprop|grep gsm.operator.alpha
		getprop|grep gsm.sim.operator.alpha;;
	*)
		echo "Usage:"
		echo "   $0 ch.sunrise"
		echo "   $0 de.02"
		echo "   $0 de.simyo"
		echo "   $0 us.tmo"
		echo "   $0 actual";;
esac

