myxfit.xyz

smali/baksmali

smali/baksmali is an assembler/disassembler combo for dalvik bytecode – the bytecode format used by Android’s runtime.

Current official repository (Google’s)
Previous official repository (Mine)

.class public LHelloWorld;
.super Ljava/lang/Object;

.method public static main([Ljava/lang/String;)V
    .registers 2

    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    const-string v1, "Hello World!"

    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    return-void
.end method

Development and Background

I started developing smali in early 2009. The initial impetus for the project had to do with getting functional google apps in an open source AOSP build of Android. This was very early days of Android, and there was a bunch of Google-specific stuff directly baked into the framework, that all of the various Google apps dependended on (gmail, Play Store - or whatever it was called at the time, etc.). The goal was to be able to pull out the google-specific classes that weren’t included into AOSP, and then add them back into an AOSP build, to enable the full Google experience.

While I was in the middle of working on smali and baksmali, Google released version 1.5 of Android – the Cupcake release. As part of this release, they pulled out all of the google specific stuff into separate libraries, which rendered the initial impetus for the project moot. At this point though, I had already made good progress on the project, and I figured the tools would be more broadly useful, so I decided to continue working on them.

Eventually, I was contacted by an Android employee who knew me from my work on smali/baksmali, along with the custom rom I had developed for the g1 phone, and asked if I would be interested in applying for a job. At this point in my life, circa 2011, a job at google was essentially my dream job, so of course I said yes. Long story short, I ended up getting a job at Google working on Android, and was happily employed there for over 10 years, before I decided to leave and do my own thing (early retirement).

Current Status

After I left Google, I no longer had any motivation to work on smali/baksmali, and I talked with a couple of people at Google who agreed to take over ownership, with their fork at https://github.com/google/smali. As far as I am concerned, this should be considered the official repository for smali and baksmali at this point.