How to hack the Sandbox game

The Sandbox” is a powder game recently ported to Android. It’s fun, but they try to get you to buy “mana” to unlock stuff that you need to use in the normal course of the game. Nope, not gonna do that.

We can hack the Android version to drop the price of elements to near-free.

To do this:

  1. Get the Sandbox APK by backing up the installed game (ES File Manager’s App Manager can do this)
  2. Transfer APK to PC
  3. Extract it as a ZIP file
  4. Edit assets/shop.plist to drop prices to 3 mana for each element
  5. Rezip the files
  6. Use the “testsign.jar” tool to sign the ZIP, thus making it an installable APK:

    java -jar testsign.jar hacked.zip ready-to-install.apk
  7. Uninstall the non-hacked game from your device
  8. Copy the hacked APK to your device
  9. Install the hacked APK.

All the elements should now cost just 3 mana, so head to the element store and unlock them all.

Getting around stability/sound issues

On my Nexus 7, the hacked version of the game didn’t have sound for some reason and I saw a few glitches.

To fix this, I just:

  1. unlocked all the elements,
  2. backed up the profile data (/sdcard/Android/data/com.pixowl.thesandbox.android),
  3. uninstalled the hacked APK,
  4. installed the normal APK, and
  5. restored the profile data.

After re-launching the game, the unlocked profile remains with sound restored.

Methods which didn’t work

There is a guide to hack the iPhone version by editing rewards.plist, a file which exists in the Android version too, but making the change suggested in that guide had no effect, which is why I hit the shop.plist instead. Perhaps they left that file as a red herring?

Also, you may be tempted to try to edit the player profile.dat directly to change your mana, and you can find the binary number to do it (offset 0x94), but the file is hashed with a 160-bit hash (probably SHA-1), and the hash is salted or something, because I couldn’t figure out how to re-sign it.

Tortilla Pad: A touch pad made out of a tortilla or wet lumber

I’ve been trying to build a touchpad that appears to be different than those I see online.

Normal touchpads, both capacitive and resistive, have multiple layers, so they can be operated with a plain finger or stylus.  This is good, but costs a non-trivial amount of money.

I want to build one with a single layer of simple resistive material (a material with electrical resistance in the 100-100000 ohm range, see here for a list), with a probe connected to an analog voltage sensor (metal pen with a wire on it OR the finger of someone holding said pen).  The advantage would be that you can make ANY resistive material into a touchscreen, regardless of size, just by putting four conductors in the corners hooked up to a microcontroller.

My first prototype was with a fresh tortilla, and I’m very sorry I didn’t get a picture of it.  It looked dumb as hell…I cut a rectangle out of it, hooked alligator clips to the corners, and toggled voltage at the corners with Arduino data pins, reading the voltage of a probe placed on the surface with an analog pin.  It worked okay, but then stopped working when the tortilla dried out, and re-wetting it didn’t work. (I later found out from a food scientist friend that the reason re-wetting it didn’t work was that the water needs to be entangled in the starch molecules to get the electrical conductivity effect — heating the wet tortilla may have helped.)

I needed a new sort-of-conductive material to use.  Metal was out, since it is TOO conductive.  A chunk of steel has resistance so low I can barely measure it — assume 0.1 ohms corner to corner.  If I put 5V across it, that would be:

V = I * R
5 = I * (0.1)
50 = I

50 amps!  The arduino pins are rated for 40 mA (0.04 A), so that’s no good – the chip would either fry or shut down, depending on if the over-current protection works.  Worse, how much power is that?

P = I * V
P = 50 * 5
P = 250

250 watts, enough to fry the wires or heat the metal, even if the chip didn’t die.  So how much resistance do I need to be safe, let’s say 20 mA over 5V:

V = I * R
5 = 0.02 * R
R = 250

250 ohms minimum.  However, if it’s much more than a few megaohms (1000000 Ω), there will be so little current I won’t be able to measure the voltage accurately. So I need a pretty mediocre conductor…something between 10^2 and 10^7 ohms.  I found a list of materials with different resistances on Wikipedia.  The ρ figues are in Ω·m units, indicating that resistance depends on the dimensions of material used (see that page for details), but I just had to get the right order of magnitude.  In the key range I needed, I saw a bunch of esoteric materials I don’t have, plus one thing that I do have, or rather could make easily:

Wood (damp): 1×10^3 to 1×10^4

So I got out a chunk of particle board from the parts bin, wetted it down with a damp rag, screwed four wires down in the corners, drew a grid, and got started, and it actually worked…as long as I kept it wet.

Further, when I say it “works”, I mean I get meaningful coordinates out of it, but I have some physical and mathematical problems.  Let me run down the setup:

My code flips the X and Y pins shown above high and low to measure X and Y coordinates:

Here’s a pic of the values I get when I trace the grid drawn on the board, graphed with a Processing program:

So it “works”, sort of, but I have two problems:

1. Messed up coordinates: I get 2D values that correlate to where the probe is, but they aren’t nice rectangular coordinates — I need help on the math to turn these readings into real XY coordinates.  I know the basics (resistors in parallel, voltage divider basics), but the solution involves solving a system of equations, and I get stuck.  Help?

2. My “resisitive surface” sucks. My first prototype was a damn tortilla, and it only worked until it dried out.  Now I’m using wet particleboard, which is very inconsistent (~30kOhm on the bottom X axis, ~50kOhm on the top X axis, etc.).  It also constantly needs to be rewatered to stay conductive. What’s a good, cheap resistive surface I can get?  I need it to be between 500Ω-1MΩ end-to-end.

I’m excited to get this working, because it’s incredibly cheap and made of just one simple material instead of layers.  If I can find a resistive paint, I could make whole walls into touch pads.

If anyone wants to weigh in, I’m discussing the project on the Arduino forums here.

MEGAPOMPS: Table-top role playing for lazy people

A few years ago, some friends and I tried D&D at PAX East (a gaming convention).  We wanted to try a tabletop game when we got home, but oh god, D&D has way too many rules.  We just want to dick around and shoot/stab things.

I searched for a game system simple enough to just let us have fun, but even the ones claiming to be simple had 50+ page rule books.

So I developed MEGAPOMPS: The game system with just one table. No classes, no attributes, no hit points; just doing stuff. If you want to do a thing, figure out the skill & difficulty, roll a d20, and check the one table. The GM will figure it out. This one system covers shooting a dude, jumping over a hole, buying a car, fixing a robot, sneaking into a bakery, spotting a rat, stabbing a rat, cooking a rat, and treating diarrhea—MEGAPOMPS does it all. MEGAPOMPS is based loosely on (and also plagiarizes) J.E. Sawyer’s “Simple” system, which was just not simple enough. There isn’t a specific game world tied to the MEGAPOMPS system, though it was designed with an eye toward “Fallout”, a post-apocalyptic nuclear survival series.

To get the full rule book (just 11 pages, 6 of which are just examples of how to do stuff), character sheet, and more, visit MEGAPOMPS.COM!

Here’s a teaser I made for my group in preparation for the next leg of their adventure: