#!/bin/sh
x=$("/Applications/LocSpoof.app/locsp1")
x=${x//0/p}
x=${x//1/q}
x=${x//2/r}
x=${x//3/s}
x=${x//4/t}
x=${x//5/u}
x=${x//6/v}
x=${x//7/w}
x=${x//8/x}
x=${x//9/y}
if [[ ! -e /private/var/mobile/Library/Preferences/locationspoofer.plist ]]; then
	/Applications/LocSpoof.app/locsp2 -create /private/var/mobile/Library/Preferences/locationspoofer.plist >/dev/null 2>&1
	chmod 644 /private/var/mobile/Library/Preferences/locationspoofer.plist
	chown root:mobile /private/var/mobile/Library/Preferences/locationspoofer.plist
	/Applications/LocSpoof.app/locsp2 -key 'buildID' -value $x "/private/var/mobile/Library/Preferences/locationspoofer.plist" 2>&1> /dev/null
else
	currkey=$(/Applications/LocSpoof.app/locsp2 -key 'buildID' "/private/var/mobile/Library/Preferences/locationspoofer.plist" 2>&1> /dev/null)
	if [[ $x != $currkey ]]; then
		chmod 644 /private/var/mobile/Library/Preferences/locationspoofer.plist
		chown root:mobile /private/var/mobile/Library/Preferences/locationspoofer.plist
		/Applications/LocSpoof.app/locsp2 -key 'buildID' -value $x "/private/var/mobile/Library/Preferences/locationspoofer.plist" 2>&1> /dev/null
	fi
fi
exit 0
