Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,782,094 Members 50,548 Now Online
XDA Developers Android and Mobile Development Forum

Emoji Keyboard for Galaxy Nexus Stock..Work together!

Tip us?
Junior Member - OP
Thanks Meter 0
Posts: 2
Join Date: Feb 2014
Default Emoji Keyboard for Galaxy Nexus Stock..Work together!

Hi to all! I'm new here but I read xda forum from several months!

So.. my mission is modify a bit the new Google Keyboard KitKat Edition with Emoji and make it compatible for devices with under Android SDK.

I decompiled the APK (v 2.0.19003.893803a) and I found this class:

Then, converted in .java class and detected this code:

            if((Build.VERSION.SDK_INT > 0x12) || (Build.VERSION.CODENAME.equalsIgnoreCase("KeyLimePie")) || (Build.VERSION.CODENAME.equalsIgnoreCase("KitKat"))) {
                mCurrentCategoryId = Settings.readLastShownEmojiCategoryId(mPrefs, 0x1);
            } else {
                mCurrentCategoryId = Settings.readLastShownEmojiCategoryId(mPrefs, 0x5);
I know that new GK have 7 fragments for Emoji (checked on tablet with 4.4) and the code is pretty clear.
They make a control, if SDK>12 or the version name is "KitKat", then we hide the fragments 1,2,3,4.
As you can see on official Android Developer Page, SDK>12 is equal to say SDK>JELLY_BEAN_MR2, then starts with KITKAT (13).

Let's try to change this value? For example "10 (JELLY_BEAN, 4.1)" ?
I don't know what could be happens, but...i will have to try!

Let's go to smali file, I found my interested code:

 .line 158
    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0x12        ---> we change it with 0x10

    if-gt v1, v2, :cond_1

    sget-object v1, Landroid/os/Build$VERSION;->CODENAME:Ljava/lang/String;

    const-string v2, "KeyLimePie"

So now, i rebuild all with keytool and additionally i make a bit of modifications:
  1. Android Manifest
    <provider android:authorities="@string/authority"
    <provider android:authorities=""
  2. Renamed package name with apktool.yml

Then, opened the built APK and drop in it with WinRar original lib folder and WEB-INF from original APK.
Then, I signed APK with cmd:

C:\apk\apktool>java -jar SignApk.jar testkey.x509.pem testkey.pk8 c:\apk\apktool
\keyboard\dist\keyboard.apk keyboard_signed.apk
So now..let's try to install the update.....
New package has a different signature:

How to solve? My experience is focused to write my apps but not modifying the others..

Hope that my work helps other and please help me to fix that problem
Junior Member - OP
Thanks Meter 0
Posts: 2
Join Date: Feb 2014
is there any possibility to import the key signature from the original APK to modified APK?

I tried to create another APK, with another package name, but Android says that Dictionary Provider is actually used from the original Google Keyboard, it can't continue with installation.

I don't want to remove the original system keyboard app because i want give modified APK to community and i suppose that not all users have phone with root enabled.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes