Currently:
2008-11-02»
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.
Comments Off on well, that didn’t take long: basic tethering app for the G1
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/accessibility.properties
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!
2 Comments »
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.
Cheers,
Justin
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.
3 Comments »
2008-10-23»
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.freenode.net 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.
20 Comments »
2008-10-22»
uni-tasking; hats; bad writing, coming soon»
If there’s one thing in my queue that I’m absolutely dreading doing, I tend to clatter to a halt for days while I steadfastly refuse to do it. I’ve had one of those for the last few days, and finally somehow tricked my subconscious to actually finish it (which took all of five minutes).
The funny thing is that when I have a few things on the boil, this seems to happen less often. I’ve certainly noticed that since blogging dropped off my daily schedule, I’ve found it harder to get other matters done quite so punctually.
Clearly, I need more distractions. So, I’m going to start up blogging again, and then I’m going to double-down and try this year’s nanowrimo. There’s five other people in the office having a go, so we’ll have some camaraderie.
My last attempt was a terrifically gloomy science fiction novel in a future where libertarian cryptopunks (a recurring theme, no?) have suffered a catastrophic collapse in their plucky sea-based micronation, and now have to survive, gypsy/ashkenazi like in a puritanically zero-privacy secular environment.
It was fun to write, but absolutely no fun to read. I hope to reverse that equation this November, when I’ll be adopting the most potentially humiliating possible literary form ever mishandled by amateurs: the contemporary satire. Don’t ask me why. I have also been insulting petty bureacrats of late. I have been seen wearing a hat and some bright colours. My bourgeoisie instincts are failing me. I smell an imminently awful turn of events.
Comments Off on uni-tasking; hats; bad writing, coming soon
2008-10-18»
trackbacks, backtrack»
Two “productive” wastes of time that writing a blog causes you to commit: re-reading your old entries, which is mostly like re-playing funny youtube videos of people’s skateboarding accidents, and following trackbacks, which is mostly like running into the toilet after giving a talk, and then clamping your ear to the cubicle door to listen for people’s opinions. I don’t get many trackbacks, because I am now delightfully obscure and doing Alexa dead-cat bounces, which means the people who link to me are mostly old friends. It is internally flattering though it may perhaps be annoying to everyone else, like the pica-celebrity equivalent of “Christmas Book Picks” that are just people mutually puffing up their friend’s new novels. I will only, then, mention Lee who was always the secret driving force behind NTK, and asked the question that I’d want to ask Neal Stephenson, had I thought of it or ever met him:
This is arguably the first presidential election of the HDTV age. So is it more important a candidate looks good on high-def… or on YouTube?
It’s an allusion to Interface, Stephenson’s great political techno-thriller, where someone notes the difference between looking good on HD and looking good on ordinary TV, and the effect that had on politicians. Feeding a little into that, it’s definitely true that I’ve heard people say that McCain sounds better on radio, and much worse in HDTV — the makeup over his scars is really obvious, in fact evoking a weird awkwardness when he talked about “having the scars to prove it” in his last debate. The other question is: do your micro-expressions look good in Photoshop? My other thought, flicking through my own backlog, is an idea I’ve had for a few years — a site called Backtracks, where we dig up the posts that bloggers were saying five and ten years ago, and hold them to the acid-soaked cottong bud of enquiry. Easy money! Man, if only I could come up with an idea whose demographic wasn’t “people most likely to be running an ad-blocker.”
5 Comments »
2008-10-15»
the debate and the spotlight of consensus»
While the position who have particular political biases are relatively constant, it’s fascinating to watch the spotlight of what appears crazy to the general public shift around.
I first started reading Little Green Footballs during the run-up to the Iraqi invasion, because I felt that what they said there gave an insight into how decisions were being made or accepted among a large sector of the public. Steven Den Beste was required reading, because he seemed to be constructing (or interpreting) the abstract framework that best represented Bush’s foreign policy (he ended up writing a WSJ editorial spelling it out).
I didn’t agree with these people, but what they said certainly had predictive value — far more predictive value than those on most left blogs. People would say “surely Americans will see through this bullshit”, and they didn’t. Meanwhile, one of the warbloggers would say that Dean would pay for saying we weren’t safer after Saddam was captured, and lo! That’s what public opinion would reflect. The statements of the conservative bloggers matched much of public discourse (in the US, of course). I remember people like Brad deLong spending much of the first decade of this century standing with their mouths open, agape at the discrepancy between what was obvious to them and what “everyone else” appeared to see.
What’s is fascinating now is watching that spotlight move very dramatically away. The conservative bloggers confidently predict that McCain or Palin ruled the debate and … reality lurches away in the other direction. ESR talks about Obama’s campaign smelling of defeat, right as they begin their meteoric rise up the polls. None of the levers work. The die falls snakes eyes, throw after throw. You move the mouse up, and the cursor goes down. At this point, they’re convinced that the mainstream media, *and* the pollster, *and* random people in the street are just making shit up.
Again, this isn’t about right or wrong. This is about your ability to predict the general population. Just as it didn’t help to talk about dictators stealing the election when over 50% of the American population thought Bush was an allright fella, all the accusations that Obama is a marxist terrorist muslim aren’t going to help you when people are saying sure he’s a marxist terrorist muslim, but they’re going to vote for him anyway because he has a good healthcare policy. How do you compute that if you’re instapundit?
Most of all, I love watching that spotlight of opinion refocus on a point after these debates. And the focus pull in this election seems to be online videos. I thought McCain did okay in this debate, actually, but that’s not where the spotlight has fallen. It’s fallen on the reload button next to the YouTube clip of his “Zero? WTF?” moment. And he can talk about Joe the Plumber all he wants, but the more people who see Obama actually talking to Joe the Plumber (and it’s worth watching all the way through), I think the better Obama looks, not McCain.
I hope to god I’m almost done with this election. My citizen friends are voting early. As Nate Silver says, Obama is in “live boy, dead girl” territory these days. If there’s going to be a change in that, it’ll be one that no-one on either side predicts. The spotlight is steady, and for now it’s trained on the new president.
2 Comments »
2008-10-12»
politics in the city»
Walking down a Bernal Heights street, I heard a guy shouting from behind me to a woman in a garish, oversized white t-shirt with somebody’s name on it. “Hey, you guys are doing well — I see posters for Tom everywhere!”. The woman shouted back, “Thanks! Who are you walking for?” “Eric!” “Cool!”. Later, a bunch of bicyclists fly by in convoy, playing an upbeat latino tune on speakers, and waving flags for another candidate.
It’s election time in San Francisco. As well as the presidential election, there’s the usual Bible-sized selection of other plebiscites to be plebbicized, including the election of the supervisor for my local neighbourhood. You can decide whether you should vote for Eric or Tom or Eva or David or Vern or Mark or the other Eric by thumbing through the 268 page local voter guide here. I believe that’s on top of the 166 page State guide.
I was going to witter here a little about the vibrancy of American elections, and then I remembered where else I’ve lived where elections were this vivid and fun. When I was eight, I remember the cars driving around with loudspeakers balanced on top, and posters, and speechifying and lots of local excitement to a British election. I grew up in Basildon, a marginal constituency (Ohio-on-the-Thames, if you will), and ground zero for those wanting to extrapolate results from their glib little parodies of voting patterns. You had to admit though, both sides fought like prize-fighters for every voter there.
San Francisco is about as far away from a swing state as you can imagine (unless you mean between Cindy Sheehan supporters and Nancy Pelosi fans), but the internal city politics are gloriously internecine and bloody. Supervisors have a surprising amount of power: en mass they are a counterbalance to the major. One of them just pleaded guilty to take $84,000 in bribes. I admire the huge encyclopedia of political explanations that turn up on everybody’s doorsteps every election, as well as the miles of columnage in the local papers analysing the minutiae of the city’s internal politics. Even the alternative free papers here often have front covers with titles like “REVEALED: JUST WHAT THE HELL DOES DEPUTY VICE ALDERMAN DIFRAMBRIZI THINK HE IS DOING WITH THE MANHOLE COVER FINANCIAL ALLOCATION FOR FINANCIAL PERIOD 2007/2008?”. To give a less made-up example, I have just read a (genuinely fascinating, actually) three page piece expose on the fines builders have to pay for having their cones in the wrong place. It is all connected with police graft, of course.
I honestly wonder who reads all of this, and yet I love that it’s there. I was reading Linus Torvalds slightly agape bemusement at how uncivilized American elections are, and wonder: is it better that politics be such a loud carnival? Or would all this corruption go even more unnoticed if no-one was watching?
4 Comments »
2008-10-11»
python class Culture:»
Every Friday at EFF, we have a Python class, where anyone in the org (and a few friends from outside) join up to learn a little Python, talk about coding and share what they’ve learnt. There’s a good mix of seasoned python hackers, coders who don’t know much python, casual programmers, and people for whom this is their first experience of programming.
The part i enjoy the most (apart from congratulating myself for reaching a level of maturity that means I don’t go I KNOW I KNOW whenever i know the answer) is the material that isn’t about the technicalities of programming, but of the culture. We often discuss, for instance, about the most aesthetically pleasing way of writing code. Watching smart coders attempt to verbalise those instincts is fascinating, especially when the instincts begin to spread through the group.
To give an example, we’ve been coding up a Python version of Conway’s Game of Life. We all spent a fair bit of time discussing that niggling problem with counting up how many neighbours a cell has. Do you do it “manually”:
|
neighbours = cell(x-1, y-1) + cell(x, y-1) + cell(x+1, y-1) \ + cell(x-1, y) + cell(x+1, y-1) \ + cell(x-1, y+1) + cell(x, y+1) + cell(x+1, y+1) |
or iteratively:
|
for xi in [-1,0,1]: for yi in [-1,0,1]: if (xi or yi): neighbour = neighbour + cell(x+xi, y+yi) |
I think most coders would end up doing the first, but they would feel a bit dirty doing it, just as I always feel a bit dirty when I have x and y as attributes, instead of being able to treat them as different aspects of the same thing. It’s the right instinct to try and generalise, and it was fun seeing starter programmers expressing their mild discomfort.
After we’d got Life to work, Seth rewarded us by showing Golly, which is a great cross-platform Life simulator with many pre-programmed patterns. I really had no idea that they’d managed to code up a Turing machine in Life, let alone patterns that emulate a universal machine, running a program that runs the Game of Life.
5 Comments »