Skip to content

Instantly share code, notes, and snippets.

@cji
Created January 5, 2013 01:42
Show Gist options
  • Select an option

  • Save cji/4459104 to your computer and use it in GitHub Desktop.

Select an option

Save cji/4459104 to your computer and use it in GitHub Desktop.

Revisions

  1. cji created this gist Jan 5, 2013.
    31 changes: 31 additions & 0 deletions unfairway.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/usr/bin/env python

    # unfairway.py
    # expects the file from the app's Documents directory to be in the same path as the script
    # transfer the profile_1.json.a and .md5 files back to the device and re-run the app

    import hashlib
    import json


    profile = open("profile_1.json.a")
    profile_dict = json.loads(profile.read())
    profile.close()

    profile_dict[u'playerData'][u'clubsInBag'] = [99, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    profile_dict[u'playerData'][u'clubsInStorage'] = [1, 1, 1, 1, 1, 1, 1, 1, 1]
    profile_dict[u'playerData'][u'golfBucks'] = 999999
    profile_dict[u'playerData'][u'purchases'] = {u'POWER_UP_IN_A_ROW_MACHINE': 2, u'POWER_UP_DRAW_COUNTER': 2, u'POWER_UP_ACME_SCORE_DROPPER': 2, u'POWER_UP_EYE_CANT_MISS_GLASSES': 2, u'POWER_UP_UTILI_FIND': 2, u'POWER_UP_HEAD_START': 2, u'POWER_UP_IRON_DETECTOR': 2, u'POWER_UP_X_RAY_GLASSES': 2, u'POWER_UP_MULLIGAN_CERTIFICATE': 2, u'POWER_UP_RABBITS_FOOT': 2, u'POWER_UP_WEED_EATER': 2, u'POWER_UP_WATER_HAZARD_DIURETIC': 2, u'POWER_UP_HEAD_DOWN_TRAINER': 2, u'POWER_UP_SAND_BLASTER': 2, u'POWER_UP_FIND_TIME_WATCH': 2, u'POWER_UP_GOPHER_ROOTER': 2, u'POWER_UP_FLOWER_POWER_DRINK': 2}
    profile_dict[u'playerData'][u'midasTouch'] = 90

    profile = open("profile_1.json.a", "w")
    json.dump(profile_dict, profile)
    profile.close()

    profile = open("profile_1.json.a")
    m = hashlib.md5()
    m.update(profile.read())
    o = open("profile_1.json.a.md5", "w+")
    o.write(m.digest())
    profile.close()
    o.close()