skip to main bit
a man slumped on his desk, from 'The Sleep of Reason Produces



Archive for the ‘Android’ Category


tethering the android

So it was being stuck without wifi in the Library of Congress the other week that finally made me decide to overwrite the T-Mobile firmware on my Android G1 with something with root access. I was talking with the US Copyright and Patent offices about how to improve access to copyrighted material for the reading disabled (in the hopes, partially, to encourage them to support the Treaty for the Visually Impaired at WIPO the following week).

I know some people frown on net access at such affairs, but as Cory once noted, if you think people are distracted when they have net at meetings, you should see how distracted they get when they don’t have net.  A bunch of us were scrabbling to get information in and out of the public meeting in advance of the transcript becoming available. So, for instance, I recorded my comments onto my phone, and then mailed them out to the rest of the EFF international staff to hear as they were already preparing to fly to Geneva.

The same thing happened, only more fervently at WIPO, with Jamie Love and other attendees  frantically twittering out to the wider world about the imminent attempts to kill the treaty, and thus getting the visible external support they needed to put pressure on countries to keep the Treaty alive (thanks to everyone who contacted their governments, by the way).

All of this networked analysis and activism gets much harder when you don’t have laptop connectivity. Because my G1 phone wasn’t rooted (and T-Mobile forbids tethering apps in Google’s Android app Market), I couldn’t link my computer to my phone’s 3G network. And I wasn’t quite ready to multi-task listening to my fellow panellists and attempting to re-flash firmware at the same time.

I’m glad I waited. It turns out that these days, it’s relatively easy to drop in a version of Android that gives you power over your own device. These instructions on how to root your G1 take you through the tortuous (but by now pretty foolproof) procedure.

In the end, I chose to install JesusFreke’s distribution of the Android OS, which now has a great little utility to manage who gets root on your phone (each application’s request is intercepted, and you, as user, get to allow or deny it). This tethering application is incredibly easy-to-use, and lets you share your 3G connection via wifi or bluetooth (I haven’t tried the bluetooth). You can WEP encrypt the wifi connection, or allow access to only selected users.

Of course, next time I go to the LoC, I’ll be sure to keep the wifi node open. I wouldn’t want the MPAA guys doing without!


An Army of Adas

I gave up picking just one woman in tech who has inspired me over the years. I certainly knew that I couldn’t list them all. Here’s a roughly chronological list, which breaks down at the end when I realise that there could be no end.

I worked a Saturday job as a teenager at an IBM dealership when I was around thirteen. The first professional programmer I’d ever met worked there. She was incredibly smart and calm, and I remember being very impressed that you could actually make a living wage coding, instead of having to hide away in your bedroom hacking up ZX Spectrum platform games until somebody mystically gave you a Jaguar.

To save time, I will now skip a little arbitrarily (hello, Verity Stob!) across a few decades.

Out of my entire generation of Net-inspired London geeks in the Nineties, Pouneh Mortazavi was the only with enough initiative to do what everybody else dreamed of: she upped sticks to San Francisco alone. First she worked at Wired, holding together their databases; thereafter she started the Flaming Lotus Girls. She was always like some George Washington of a self-collected militia, marshalling and deploying technology and resources, cajolling and inspiring.

My ex-wife, Quinn Norton, has a aircraft-carrier full of skills and virtues, but if I had to pick a technological trait I admire most in her, it would be her ability to see its historical context, as well as extropolate it into the far future (and also her Perl coding style, which is the weirdest damn thing I ever did see).

Leslie Harpold simultaneously drove up the standards of web design, usability, and common human decency online. She’s still missed.

Annalee Newitz and I worked at EFF, and shared a career in writing 1000 word pieces on 1000 year topics, before she finally ran off to join the io9 intergalactic circus and exploration unit. She’s the embodiment to me of the one of the sublime joys of technology: jumping into the deep-end with just a laptop and a head filled with implications, and asking smart questions until you know as much as the expert will admit.

Cindy Cohn, legal director, and Shari Steele, executive director, of the EFF: I simply can’t list how much you owe those two people — but free crypto, and a censorship-free US Internet is probably a good start.

Suw Charman-Anderson, the creator of Ada Lovelace Day deserves a place on this list just for that, but she’s takes her place here because of her work binding technology and civil liberties together as the co-founder of the Open Rights Group.

I suspect Valerie Aurora will be on many people’s Ada Lovelace Day lists. A kernel hacker who can write, and whose writing can make me laugh out loud or smack my head in revelation.

Liz Henry wields technology as it should be: a fire to protect what’s right, and a blast of fresh air to winnow out what’s wrong. I’ve never seen any quite so able to pounce on new tech and bring it swiftly to bear on a societal problem, as well as explain its uses to those who might otherwise be bypassed by this revolution.

Becky Hogge was ORG’s second executive director, and another forger of ideas. Astoundingly good at herding other geeks, tech wonks, and MPs into spaces where they could all understand each other.

I get far too much attention for doing one single lousy talk about “life hacking”, whereas Gina Trapani deseves all of the credit for turning a dumb idea into a a brilliant, long-lived work of real usefulness — and for cranking out the code.

On the same note, butshesagirl‘s Getting Things Done application, Tracks, got me through some tough times. I admire anyone whose managed to keep an open source project on course, but I was particularly impressed by bsag’s skills. I watched and I hope learned.

And now no time to talk about the community chops of Cait Hurley, Rachel Chalmers’ piercing analysis, Rebecca Mackinnon’s work at connecting the world, Sara Winge’s genius at O’Reilly, Anno Mitchell’s sardonic Web 2.0 charisma, Strata Chalup’s sysadmin and southbay knowledge, Kass Schmitt sailor and LISPer, Silona Bonewald’s politech savvy, Sumana Harihareswara’s geek-management hybridism, Ana Marie Cox’s snark, Cherie Matrix’s cultural vortex, Elly Millican’s web aesthetic, Wendy Grossman’s sceptical optimism, Desiree Miloshevic’s globe-trotting ICANNoclasm, the piercing tech analysis of Susan Crawford (now working at the Whitehouse!), Sarah Deutsch, Kim Plowright, Paula Le Dieu, Charlie Jane Anders, Violet Berlin, Biella Coleman, Alice Taylor, Sophie Wilson who designed my entire teenage life…

These people make the world my daughter, Ada, lives in. I’m honored she has such shoulders to climb.

This was posted as part of the Ada Lovelace Day project; if you’d like to read more, I enjoyed Liz and butshesagirl‘s entries, spent a long time thinking about this sad and all too typical story, and saved the story of En-hedu-Ana, mapper of the stars, for Ada’s next storytime:

The true woman who possesses exceeding wisdom,

She consults [employs] a tablet of lapis lazuli

She gives advice to all lands…

She measures off the heavens,

She places the measuring-cords on the earth.


well, that didn’t take long: basic tethering app for the G1

The G1 can now work as a basic Web proxy, which means that a full tethering app isn’t far away. If you half-free a device, you end up just forcing users and developers to go to extraordinary lengths merely to get around your half-assed roadblocks. Users of the iPhone have to jump through similar hoops to get their own connection sharing. The sad thing is, as with breaking DRM , the impediments are really only temporary, because any tortuous set of procedures can, eventually, be replaced with a small programmed script. Nobody uses DeCSS to rip their DVDs these days: they use Handbrake, or a commercial DVD ripping program. Similarly, while you have to install the SDK and muck around with proxy settings in this iteration, by Christmas I can guarantee it’ll be one click tethering for the current Android phones.

actual android hacking

Just to show that “disappointing” in my previous posts isn’t some euphemism for “die, impure heathens!”, I’ve been continuing to hack on my G1. Honestly, even if it is an impure love, I’m loving both the phone itself and the application environment. Its integration with the Eclipse IDE even managed to draw me away from Vim. You see how its corruption burns into my soul?

Anyway, for your delectation for Hello, World style programming, and also because Liz wanted it, here’s an Android application I threw together that displays an arrow that (should) always point north (it’s not very accurate, but what do you expect from a $200 compass?) (Source etc for Android Compass.)

Things I like about the SDK: it’s well-documented, and when it isn’t, you have all the source to read. I can’t overemphasise how much of a relief this is. I haven’t coded in Java in literally decades, but with enough code examples I got into the swing (ha, ancient java funny) of it fairly quickly, and also I suspect picked up bits of the Android house style.

The community is a little big fractured — I sense there was a lot of early excitement when the first SDK came out, but a lot of those developers wandered off leaving too many ghost sites). Still, there is now a lot of Android hacking going on in public, and the IRC channel remains very informative (when I wandered off into implementing something with SurfaceView instead of just plain View and then wondered why my onDraw method didn’t work, they quickly put me to rights: you don’t use onDraw with SurfaceView, and you probably don’t need SurfaceView to begin with.)

The tools to interact with the phone seem very mature to my have-not-worked-with-embedded-systems-for-a-decade eyes. I found logs where I wanted to find them (in the IDE, and by typing adb logcat). I didn’t get the sense that Linux was a stepsister to the Windows and MacOS dev environment (and I hope that they do okay by comparison also). The emulator is a godsend, and well-integrated: when I didn’t have the phone plugged in, my code ran in the emulator. When I did, it ran on my phone. Things worked first time. I had fun, and had something to show off on my phone in an evening.

(Two gotchas that I hit when trying to produce this blog entry. I installed the java6-sun packages to run Eclipse and the SDK tools, but you have to actually select it to run rather than the openjdk on my Intrepid Ubuntu setup. Use sudo update-alternatives --config java to pick between the two. Eclipse actually ran fine under the openjdk, but Android’s ddms program complained a little about a GNOME Accessibility Bridge until I switched.

If you don’t want to use Sun’s Java, commenting out the single line assistive_technologies=org.GNOME.Accessibility.JavaBridge in /etc/java-6-openjdk/ also lets you run ddms.

And when you’re signing your Android package (using these Germanic instructions), it turns out that you should sign the apk file in your bin directory, not the one that Eclipse handily offers to export for you. Thanks to toediggety for that obscure bug. You see? Fun!


confirmed by Android team: G1 only accepts firmware signed by manufacturer

It looks like trying to find exploits will be the only way hackers will be able to flash their own firmware (read: get root on their own device) on the G1. Here’s a reply I received on the Android mailing list to my question about creating my own firmware image:

The G1 is aimed at end users, not system developers. For user security
reasons the G1 will only accept properly signed system images. I’m not
sure, in this case, who ‘owns’ the key, whether it is the carrier or
the manufacturer, but one or both of them handle insuring system
images are signed.

Android Team @ Google

I’m pretty disappointed. It’s not, of course, about user security: there would have to be a disastrous, multiple-level failure of Android’s security model for an attacker to flash malicious new firmware onto another person’s phone. It’s about either HTC or T-Mobile being institutionally unable to quite countenance handing as much potential power to end users as the Android open OS model potentially offers. And what that spells is a failure of either T-Mobile or HTC to really understand the advantages having the phone’s internals really open to development would be.

I know many people think of access to the kernel as being a hypothetical need: but the two applications I’d really like to help get working on the G1 require low-level access. The G1 lacks modem tethering, and some decent bluetooth file features. Both of those would make for a great (and while not easy, not that hard, given the support in other Linux versions) G1 project — but both would need kernel level hackery. Crippled bluetooth support has historically been one of the most annoying aspects of closed phones; the Android OS held out the a possibility to escape that, but the G1 does not live up to that expectation. Modem tethering is a feature that is also traditionally something that operators attempt to strictly control, as it falls into ideas of bandwidth management.

Some have asked: what did you expect? That T-Mobile would allow users to mess with kernels on devices on their networks, willy-nilly?To which the answer is: well, what are they expecting will happen very shortly? HTC/T-Mobile have actively worked to implement a restriction on how the G1 works. Other manufacturers are now free to make Android phones without those restrictions: the Open Handset Alliance developers themselves have told me that they’d like to see some developer-friendly phones out there. When those phones come out, they’ll have all the advantages of a more open phone, and will be just as usable on T-Mobile’s network. T-Mobile won’t be able to stop people having better bluetooth than their “official” phone, and certainly won’t be able to stop modem tethering short of instituting throttling controls higher up in the network (which is also a far more comprehensive and effective solution to problems of bandwidth than simply banning the feature in their end-user devices).

They can try and hold back their more open competitors on price competition (or rather, the difference between a network-subsidised “end user” phone, and an unsupported, unsubsidized Android phone), but I suspect that, just as IBM clones ended up being more flexible and cheaper than the original IBM PCs, the price differential for basic smartphones is going to gradually be eaten away by Moore’s Law. If control of what devices run on their network is what T-Mobile wants, their end-game at this stage can only be maintaining network device blacklists, which puts it on a collision course with regulators and an angry public.

Like it or not, if networks and phone manufacturers are already buying into the idea of an open device market, they should understand — and take advantage of — the inevitable consequences.


the T-Mobile G1 — nice phone, but not totally open

So I caved and got a T-Mobile G1 phone today. I have to say, despite the reviews claiming it is not quite 1.0, I’ve been having an awful lot of fun with it. At the very least, getting it to sync with the music on my Linux machine, and then being able to set my ringtones to one of those tracks without paying through the nose was a lovely relief. For me, it’s already proven much more flexible than an iPhone could.

My hopes of managing to finally being able to own a truly open phone, as controllable and configurable as a PC, and able to run whatever code I could throw at it, have been rather dashed however. It’s absolutely true that you can run any code you’ve written to Android’s Java-like virtual machine, which is sandboxed away from the real hardware. But exploring and executing code at a lower level on the G1 isn’t currently so free and easy.

I got a chance to peer around the phone using the Android SDK’s android debugger bridge (adb) utility. It quickly became clear that even Android developers can only access a relatively restricted part of their own phone: more than given to normal Android apps, but far less than you’d expect to have as “root” on a Linux system. You can only explore or create files as the “shell” user. Much of the filesystem is owned by root, which means there’s a lot of the filing system that’s closed off from user access. There’s no official documentation on the bootloader for running your own root-level code, or flashing your own kernel.

So, as is so often the case, those who want to use their own code on their own phone will have to wait until somebody comes up with some privilege escalation flaw or undocumented flash utility to take control.

Of course, bright minds are at work on doing just that. Overheard in the excellent #android @ IRC channel:

<RyeBrye> I hacked my camera’s firmware manually by using an exploit to cause it to execute arbitrary code – and then blinking out the entire firmware in 0’s and 1’s on the autofocus LED – read in by a photo transistor attached to a sound cable plugged into my microphone port – and then put back into 0’s and 1’s…
<– jbq_ has quit (Read error: 110 (Connection timed out))
<RyeBrye> Then disassembled the ARM9 code in it and worked on porting CHDK to it…
* waldo_ is away: auto-away
<RyeBrye> I’m pretty sure having a whole OS at my disposal should make this a lot easier

I sense that the people behind Android at Google would like its flagship device to more open than it is. It’s certainly sad that for now the iPhone pwnage exploits really do give you root on your device, while Android’s official SDK offer no such thing — making the Apple’s theoretically closed phone more practically open than Google’s theoretically open game-changer.


petit disclaimer:
My employer has enough opinions of its own, without having to have mine too.