Recursive Penguin

Modifying Amazon's Kindle app to hide soft keys on Ice Cream Sandwich

Ice Cream Sandwich introduced soft buttons to Android phones, and Google had forethought enough to allow applications to dim these buttons so that they don't distract from content like text and video. Sadly Amazon has yet to update their Kindle application to support this feature. Luckily we can take advantage of APK Multi-tool to de-compile, modify, and re-compile and resign applications. Below is a screen shot of how the app should look before and after the modifications.

Normal
Low Profile

First we need to create a temporary application so that we can get the Dalvik code that we want to inject into the Kindle application.

Create a test project in eclipse to get the dalvik code and put this into the onCreate method after setting the content.

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);

We can use baksmali that comes with APK Multi-tool to de-compile this new app and find code similar to this:

invoke-virtual {p0}, Lcom/amazon/kcp/reader/ReaderActivity;->getWindow()Landroid/view/Window;
move-result-object v2
invoke-virtual {v2}, Landroid/view/Window;->getDecorView()Landroid/view/View;
move-result-object v2
const/4 v1, 0x1
invoke-virtual {v2, v1}, Landroid/view/View;->setSystemUiVisibility(I)V

Next we need to de-compile the Kindle app.

We want to change the code located in:

com/amazon/kcp/reader/ReaderActivity.smali

Now the code that was generated earlier can be inserted into the Reader activity after line 2027 which should look like this

invoke-virtual {p0, v0}, Lcom/amazon/kcp/reader/ReaderActivity;->setContentView(I)V

Once that is complete smali include with APK Multi-tool can be use to re-compile the modified app. The output can be pushed to an android device with adb and the soft buttons should now auto hide.