Android Nexus S: fixing broken power button without root
I have an unrooted Nexus S and recently the power button stopped working - the only way to turn my screen on was to plug in a USB cable, the only way to turn it off to wait for the timeout to kick-in.
Apparently this is a common problem with the Nexus S range of mobiles - some people even going so far as to say it is deliberate sabotage (though it's more likeky just about cost cutting and companies caring about making products that last past their warranty period), but despite being such a frequent problem finding a solution was far more difficult than it should have been, so I'm writing this in the hope it helps other avoid wasting the time I did.
Searching for how to solve this by remapping another button to act as the on/off button, everywhere was talking about root access - or simply assuming it that it was done - and providing solutions that depend on it. I already have enough things to worry about without adding rooting my mobile device to that list.
The good news is, you do not need to root your device to get around this problem.
I found two applications that together allow me to turn the screen on and off (without plugging in the cable).
The first is Wake All, a 20k app that allows any physical button to wake up the device - for the Nexus S that means using the volume buttons to turn on the screen.
The second is Screen Off and Lock, a 492k app that has various sound/animation options I don't care about, but those can all be left alone and it can be added as a shortcut to press and turn the screen off.
These both work on Android 4.1.2 without needing a rooted device, though there is one oddity that I have noticed: after turning the device on, the slide to unlock screen works as usual, but after this the screen is unresponsive - I need to press the home button to fully wake up the device. I don't know if this is a bug with either application or with Android, but - now that I've figured this out - it's not a big deal.
Hopefully this is helpful for others in a similar situation.