LG G3 (D855): How to remove custom carrier boot and shutdown animations

Tired of your carrier from dropping a custom boot and shutdown animation? Like Movistar does? Do you have an LG G3 D855 phone? Is it rooted? Then it’s just a matter of removing the following files:

adb shell
su -
rm /data/shared/cust/bootanimation.zip
rm /data/shared/cust/shutdownanimation.zip

This will, hopefully, revert to using the stock boot and shutdown animations.

Enable more locales / languages on Android phones

Some phones only offer a very limited list of locales / languages for the user to choose from. Such an example is the HTC One phone that I once bought in Switzerland. This phone only allows, by default, English, German, French, Italian and Turkish. However, thanks to MoreLocale2 it is possible to unlock other languages like Spanish (Spain).

In order to unlock more locales / languages, install MoreLocale2 from the Google Play Store, run it and follow the steps described in the application itself. It requires granting the┬áCHANGE_CONFIGURATION privilege to itself by either using the “pm grant” command from an ADB shell, or for rooted phones, the application can grant the permission by itself.

More information about this wonderful application can be found here: http://udhyantimilsina.wordpress.com/2013/08/15/how-to-unlock-developer-mode-to-set-multiple-languages-on-android-os-4-2-2/

Turn Android’s status bar opaque

Some custom Android ROMs include MODs that change the translucency of the status bar. In case you want to remove this customization and return the status bar to be completely opaque (0% translucency), you can follow these instructions that I compiled from the following resources: [MOD][ICS – LP*/CM9] Translucent status bar

Extract

First, extract the SystemUI APK file from the Android device, including required dependencies, and decompile it:

mkdir ~/works
cd ~/works
git clone https://github.com/mateor/auto-patcher.git
export PATH=$PATH:~/works/auto-patcher/patch_tools:~/works/auto-patcher/patch_tools/linux
cd ~/works/auto-patcher/patch_tools/
mkdir ~/works/auto-patcher/patch_tools/signtools
mkdir ~/works/auto-patcher/patch_tools/signed
adb pull /system/app/SystemUI.apk SystemUI.apk
adb pull /system/framework/framework-res.apk framework-res.apk
adb pull /system/framework/twframework-res.apk twframework-res.apk
java -jar apktool.jar if framework-res.apk
java -jar apktool.jar if twframework-res.apk
java -jar apktool.jar d -f SystemUI.apk

Patch

These are the differences between the original SystemUI APK file that is using transparency for the status bar, and a patches SystemUI that has an opaque status bar:

diff -ur SystemUI/res/layout/super_status_bar.xml SystemUI.new/res/layout/super_status_bar.xml
--- SystemUI/res/layout/super_status_bar.xml    2013-06-04 18:02:35.280902774 +0200
+++ SystemUI.new/res/layout/super_status_bar.xml        2013-06-04 17:48:40.430939995 +0200
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
-<com.android.systemui.statusbar.phone.StatusBarWindowView android:background="@*android:color/transparent" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
+<com.android.systemui.statusbar.phone.StatusBarWindowView android:background="#FF000000" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
     <include android:layout_width="fill_parent" android:layout_height="@*android:dimen/status_bar_height" layout="@layout/tw_status_bar" />
     <include android:layout_width="fill_parent" android:layout_height="0.0dip" layout="@layout/status_bar_expanded" />
-</com.android.systemui.statusbar.phone.StatusBarWindowView>
\ No newline at end of file
+</com.android.systemui.statusbar.phone.StatusBarWindowView>
diff -ur SystemUI/res/values/drawables.xml SystemUI.new/res/values/drawables.xml
--- SystemUI/res/values/drawables.xml   2013-06-04 18:02:37.173902690 +0200
+++ SystemUI.new/res/values/drawables.xml       2013-06-04 17:57:44.172915753 +0200
@@ -52,7 +52,7 @@
     <item type="drawable" name="APKTOOL_DUMMY_020d">false</item>
     <item type="drawable" name="notification_number_text_color">#ffffffff</item>
     <item type="drawable" name="ticker_background_color">#ff1d1d1d</item>
-    <item type="drawable" name="status_bar_background">#00000000</item>
+    <item type="drawable" name="status_bar_background">#ff000000</item>
     <item type="drawable" name="tw_status_bar_quicksetting_button_background">#ff000000</item>
     <item type="drawable" name="status_bar_recents_app_thumbnail_background">#88000000</item>
     <item type="drawable" name="status_bar_notification_row_background_color">#ff090909</item>

Rebuild

Build and sign the patched SystemUI application:

java -jar apktool.jar b -f SystemUI signtools/SystemUI.apk
java -Xmx64m -jar signapk.jar updatecert.pem updatekey.pk8 signtools/SystemUI.apk signed/SystemUI.apk

You can push this APK back to your /system/app directory and then reboot:

adb push signed/SystemUI.apk /system/app
adb reboot

Android USB Tethering and Mac OS X

I have tried several ways of tethering my Mac laptop to my Android phone, but I think that USB is the most effective one, at least from a subjective point of view: it doesn’t use as much battery as Bluetooth or WiFi tethering, it seems safer from a security point of view since it transmit the data over a cable, and it also seems safer from a health point of view as it does not rely on yet another wireless emitting point.

In order to get Mac OS X to tether with my Android phone over USB, I had to install Joshua Wise‘s HoRNDIS. It is a Mac OS X package that implements a kext RNDIS driver. The beauty of it all: it is open source and straightforward to set up and use: download the package, install it, connect your Android phone to your laptop using an USB cable, enable USB tethering and it should work automatically, without having to do anything. Magic!

PS: A copy of the HoRNDIS release 4 package can be found here.

OpenPDroid

One of the things that I really miss in Android is the ability to selectively disable certain permissions for applications. And this is the main reason why I refuse to install some applications, like WhatsApp: I don’t want to have a spy in my pocket which can record voice, read my mails, my SMS/MMS messages, access the network with no restrictions, etc. No, no and no. I do care about my privacy and the security of my data.

Today, while reading some forums, I read about OpenPDroid. OpenPDroid seems to be a collection of patches that can be applied to certain AOSP ROMs. These patches allow precisely what I’m looking for. From http://forum.xda-developers.com/showthread.php?t=2098156:

OpenPDroid is a set of modifications to the Android framework and libraries which allows fine-tuning of the data which applications are able to retrieve about your device, your account, your messages, and more. Specifically, it is a Privacy service provider (using the PDroid 1.51 interface) forked from CollegeDev’s PDroid 2.0, which is itself an extension of Syvat’s PDroid.

There’s an auto-patcher tool that takes a custom AOSP ROM in the form of a ZIP file, applies the patches to it and generates two new ZIP files (e.g. to be installed with ClockworkMod recovery): one to install OpenPDroid and another one to uninstall it.

I have built the auto-patcher from the git repository and tried to patch cm-10.1-20130131-NIGHTLY-n7100.zip:

$ git clone https://github.com/mateor/auto-patcher.git
$ cd auto-patcher
$ ./batch.sh
$ ./auto_patcher cm-10.1-20130131-NIGHTLY-n7100.zip openpdroid
...
### finished ###
flash update-cm-t03g-20130131-openpdroid.zip to install the patched files
flash restore-cm-t03g-20130131.zip to restore the original system

I haven’t flashed OpenPDroid yet. I’ll probably try on another phone first, as I saw that some patches that were applied by the auto-patcher failed entirely to get applied.