Skip to content

Instantly share code, notes, and snippets.

@instcode
Last active March 30, 2016 15:38
Show Gist options
  • Save instcode/4957317 to your computer and use it in GitHub Desktop.
Save instcode/4957317 to your computer and use it in GitHub Desktop.
How to modify Temple Run 2 save game data
1. JSON Game Data:
var gamedata = {"hash":"52260a1b3dd69ed623b5fbb045bf2b06","data":{"version":7,"Players":[{"v":1,"pid":1,"bestScore":1981650,"bestScoreNoResurrection":456180,"bestCoinScore":3857,"bestSpecialCurrencyScore":2,"bestDistanceScore":10270,"lifetimePlays":109,"lifetimeCoins":57585,"lifetimeSpecialCurrency":23,"lifetimeDistance":224673,"coinCount":1085,"specialCurrencyCount":1,"activePlayerCharacter":0,"gameCenterNeedsUpdate":true,"artifactsPurchased":[0,1,5,6,2,3,10,25,7,4,11,8,35,36,30,26,20],"artifactsDiscovered":[],"objectives":[2,1,0,6,5,3,4,7,9,11,10,8,16,17,18,14,23,24,22,21],"powersPurchased":[0,4],"randomSeed":-1118273536,"numberResurectsUsed":0,"hashID":null,"Buffs":[],"objectivesActiveData":[{"Title":"9 Lives","IconNamePre":"","IconName":"","DescriptionPre":"Use 'Save Me' 9 times","Description":"Used 'Save Me' 9 times","Points":1,"Hidden":false,"CanEarnMoreThanOnce":false,"Difficulty":30,"T":"Resurrects","TT":"OverTime","FT":"None","SV":9,"EarnedSV":6,"PID":27,"GCID":"com.imangi.templerun2.saveme9overtime"},{"Title":"Power Collector","IconNamePre":"","IconName":"","DescriptionPre":"Unlock a 2nd powerup","Description":"Unlock a 2nd powerup","Points":0,"Hidden":false,"CanEarnMoreThanOnce":false,"Difficulty":15,"T":"UnlockPowerups","TT":"PerRun","FT":"None","SV":2,"EarnedSV":1,"PID":12,"GCID":"com.imangi.templerun2.unlockpowerup2"},{"Title":"Allergic to Gold","IconNamePre":"","IconName":"","DescriptionPre":"1,000m collecting no coins","Description":"1,000m collecting no coins","Points":1,"Hidden":false,"CanEarnMoreThanOnce":false,"Difficulty":20,"T":"Distance","TT":"PerRun","FT":"WithoutCoins","SV":1000,"EarnedSV":0,"PID":15,"GCID":"com.imangi.templerun2.distance1000nocoins"}]}],"Characters":[{"v":1,"displayname":"Guy Dangerous","cid":0,"gear":[0,-1,-1,-1],"u":true,"uc":1200,"ct":"Coin","pvi":0,"art":[-1,-1,-1],"pid":0},{"v":1,"displayname":"Scarlett Fox","cid":1,"gear":[0,-1,-1,-1],"u":false,"uc":5000,"ct":"Coin","pvi":1,"art":[-1,-1,-1],"pid":0},{"v":1,"displayname":"Barry Bones","cid":2,"gear":[0,-1,-1,-1],"u":false,"uc":15000,"ct":"Coin","pvi":2,"art":[-1,-1,-1],"pid":0},{"v":1,"displayname":"Karma Lee","cid":3,"gear":[0,-1,-1,-1],"u":false,"uc":25000,"ct":"Coin","pvi":3,"art":[-1,-1,-1],"pid":0},{"v":1,"displayname":"Montanna Smith","cid":4,"gear":[0,-1,-1,-1],"u":false,"uc":25000,"ct":"Coin","pvi":4,"art":[-1,-1,-1],"pid":0},{"v":1,"displayname":"Francisco Montoya","cid":5,"gear":[0,-1,-1,-1],"u":false,"uc":25000,"ct":"Coin","pvi":5,"art":[-1,-1,-1],"pid":0},{"v":1,"displayname":"Zack Wonder","cid":6,"gear":[0,-1,-1,-1],"u":false,"uc":25000,"ct":"Coin","pvi":6,"art":[-1,-1,-1],"pid":0}],"ShowTutorial":false,"SMT":false,"ShowFriendMarkers":false,"SoundVolume":0.5,"MusicVolume":0.5,"LikeFB":false,"LikeTw":false,"LastPromoNumber":0,"TwitterURL":"http://bit.ly/TempleRun2Android","TwitterMessage":"I got {0} points while escaping from a Giant Demon Monkey. Beat that! {1}","ReviewBegEnable":true,"HSCCI":true,"HSAS":true,"HSPS":true,"HSNAS":false,"HSNPS":true,"Q":1}}
2. How to compute hash:
hash = MD5(gamedata["data"] + "BonusItemProtoData");
3. ^_^
@singhalamitkr
Copy link

Thanks!
Genius Work!

Copy link

ghost commented Dec 19, 2013

How in the world do you use this? Does the "data" var in the hash generation include the brackets, or... what am I missing? And what is the "BonusItemProtoData"?

@roycef
Copy link

roycef commented Dec 23, 2013

This doesn't appear to be the right salt, any ideas? http://jsfiddle.net/XLYDe/

@cemaken
Copy link

cemaken commented Dec 29, 2013

which language is this?..

@yeoldeusrename
Copy link

Excellent. Works for TR:Oz as well.

For those that couldn't get it to work, try something like this:

  1. back up your current "stats.sav" file (at least that's what it's named for TR:Oz)
  2. open stats.sav using your favorite text editor
  3. copy this portion of the file to a new file to hash: {"version":.......} (do not include the very last curly brace in the file.)
  4. at the end of the file copy the text "BonusItemProtoData" (without quotes).
  5. now your hash file looks like this: {"version":.......}BonusItemProtoData
  6. make the changes you desire (i can confirm that modifying coinCount and specialCurrencyCount work for TR:Oz)
  7. save the file and hash it using md5
  8. copy your changes and the new md5 to your stats.sav file (but not the BonusItemProtoData text)
  9. save the new stats.sav file
  10. make sure that TR:Oz is killed (not running) (not 100% sure this is necessary)
  11. clear data on TR:Oz (not 100% sure this is necessary) and copy the stats.sav file to correct directory

Hopefully this helps someone.

@dvdmunckhof
Copy link

@roycef:

The way you use the gamedata variable it's an object, so you need to convert it to a string first (JSON.stringify())

This one is working: http://jsfiddle.net/XLYDe/74/
Just copy in your modified gamedata.txt content and run it!

Copy link

ghost commented Aug 31, 2014

If I would like to add coins and gems according to my requirement for e.g. 10000 coins and 2000 gems then what should I write in the hash and in the remaining coding. Please tell me..
And also what is MD5.

@akashvhoysal
Copy link

Thanks..
It Works..!

@mournmasih
Copy link

can you do something about blood brother for item value change

@olimpero84
Copy link

How i can this code work for temple run 2 v1.22.1? because the content of the file gamedata it's too different from te example, any help? please

Thanks @yeoldeusrename, i follow your guide and works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment