Android Update Automation – Density Recovery Script

I’ve created a recovery script that changes the screen density. It is simple, yet really useful if you want to automate your ROM updates.

Get it here: (this zip sets the density to 252).

Read on if you want to find out how to change the density to a different value.

So, I recently switched to the official Omni ROM nightlies on my Galaxy Note II.

I miss a few things from the custom Asylum ROM I used to run (which is now dead, unfortunately), but in return I get delta updates. I’m sure that things like Lock-screen Notifications will end up in Omni when they are stable enough anyway.

Omni’s update system has an interesting side feature called FlashAfterUpdate. This allows me to flash my own zip files after the update. Very useful when you want to use a different kernel or su binary – I use DevilKernel and superuser. The only thing I was missing to completely automate the update process was a way to change the display density.

Seems no-one else ever thought of doing this, so I made a script myself. Nothing too fancy really, the real work’s done by a single sed command.

Here’s the flash-able zip:

Doesn’t matter what your previous density was, flashing this zip will edit /system/build.prop and set the new density for you.

To change the target density

Open the zip file and edit the following file:


then find the following line:

run_program("/sbin/sh", "-c", "sed -i 's:ro.sf.lcd_density=.*:ro.sf.lcd_density=252:' /system/build.prop");

and change 252 to the density number you desire.

Save the file,
re-create the zip file if necessary (some archive tools will auto-update the zip),
push it to your device,
flash it,
profit 😉

tags: , , , , ,
posted in android, recovery by wired

Follow comments via the RSS Feed | Leave a comment | Trackback URL

One Response to “Android Update Automation – Density Recovery Script”

  1. BUSHMAN says:


Leave a Reply

Powered by Wordpress and MySQL. Original theme by - customization by me :)