• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][ICS][CM9][CM7][i9023/20] Modified Mms.apk With Next Line (Enter Button) Support

Search This thread

mikko3024

Senior Member
Jul 26, 2011
85
156
Manila
Looking for a way to insert new lines in the default SMS application (through the stock keyboard), I've modified the Mms.apk to enable inserting new lines (Enter key) in an SMS.

Instructions:
1. Backup your current Mms.apk before using this one.
2. Rename the dowloaded apk file (from the link below) to Mms.apk.
3. Using Root Explorer (or any file manager of your preference) copy file to /system/app.
4. Set proper permissions (rw-r--r-- or 644).
5. Set File ownership to root:root.
6. Hit the Thanks button if you liked this one. :D

Enjoy!:cool:

Troubleshooting:
1. Missing Messaging icon in launcher:
- Verify that Mms.apk has proper permissions and ownership. (See Instructions)
- Reboot device.

2. Force closing when opening message threads:
- Are you running a non-vanilla ROM? (ie. TouchWiz ROMs)
- Samsung has a database issue with the vanilla version of the Mms.apk. You can try using this patched apk: MmsTW.patched.apk
Note: The above apk (MmsTW.patched.apk) is a patched version of the apk from https://play.google.com/store/apps/details?id=com.concentriclivers.mms.com.android.mms to support entering new lines. The base apk's credit goes to the original author. Features don't include features from the CM9 apk (ie. Emoji support, gestures, etc).
Change Log:
JB Version 1: (Mms-NextLineV1-JB.apk) 2012-07-26
- Patched Jelly Bean Mms.apk file.

ICS Version 5: (Mms-NextLineV5-ICS.apk) 2012-05-19
- Updated base Mms.apk file.
- Various fixes (Gestures, etc).

ICS Version 4: (Mms-NextLineV4-ICS.apk) 2012-05-07
- Updated base Mms.apk file.
- Emoji support.

ICS Version 3: (Mms-NextLineV3-ICS.apk) 2012-04-01
- Updated base Mms.apk file from ICS 4.0.4. (From fipsib)

ICS Version 2: (Mms-NextLineV2-ICS.apk) 2012-03-02
- Updated base Mms.apk file. (With contact images in notifications from fipsib)
- Fixed FC when attaching images/multimedia.

ICS Version 1: (Mms-NextLine-ICS.apk) 2012-01-21
- Ported patch to ICS Mms.apk
- Initial ICS release.

CM7 Version: (Mms-NextLine.CM7.apk) 2011-11-14
- Initial release.

Notes:
CM7:
- Be sure to disable the Send on Enter option in the app's settings. (Not applicable to the ICS Version.)

ICS:
- Modified ICS APK should work on most (if not all) deodexed vanilla ICS ROMS. Apk may or may not work on ROMs not running vanilla ICS. Some manufacturers (Samsung - TouchWiz, HTC - Sense, etc.) introduce other features to their ROMs that can render the patched apk nonfunctional. Prepare a backup properly before trying the posted apk.
- ICS version is reported to also work on Samsung Galaxy S2 running CM9 (by rehanraza)
CM7 modifications were taken from: http://code.google.com/p/cyanogenmod/issues/detail?id=2898
ICS modifications required the same patch and additional smali edits to bypass the Send on Enter check done in CM7.

Tested using i9023 on respective CM7 and ICS, CM9 KANG Builds. (APK should be fine on GSM versions of the Nexus S)
Reported not applicable to Nexus S 4G phones. (by blacknet101)

Let me know if this works for you or not (Please indicate your current ROM and phone model: i.e. i9020, i9023, etc.)
If you are experiencing errors and FCs, please provide a logcat if possible.
Screenshots:
Preview.jpgPreview-ICS.jpgPermissions.jpgOwner.jpg
Please download the appropriate file for your ROM.
Apply mod at your own risk.
 
Last edited:

recepo1

Senior Member
May 29, 2010
1,029
200
Philly,PA
It worked i flashed it but my messaging icon dissapeard but when i went into my email account just to check if it worked it did, but i dont why messaging icon dissapeared after i installed this
 

kladd

Senior Member
Aug 14, 2011
269
209
Detroit, MI
Looking for a way to insert new lines in the default SMS application, I've modified CM7's Mms.apk to enable inserting new lines (Enter key) in an SMS.

Instructions:
1. Backup your current Mms.apk before using this one.
2. Rename the dowloaded Mms-WithNextLine.apk to Mms.apk.
3. Using Root Explorer (or any file manager of your preference) copy file to /system/app.
4. Set proper permissions (rw-r--r-- or 644).
5. Hit the Thanks button if you liked this one. :D



Screenshot is attached for reference. Enjoy!:cool:

Modifications were taken from: http://code.google.com/p/cyanogenmod/issues/detail?id=2898
Tested on an CM7 KANG Build.

Is your method exclusive to the CM7 Mms.apk or can this be done to the stock apk as well?
 

mikko3024

Senior Member
Jul 26, 2011
85
156
Manila
It worked i flashed it but my messaging icon dissapeard but when i went into my email account just to check if it worked it did, but i dont why messaging icon dissapeared after i installed this
What ROM are you using?

Is your method exclusive to the CM7 Mms.apk or can this be done to the stock apk as well?
Yes, I think. You'll just have to edit /res/layout/compose_message_activity.xml
 
Last edited:
  • Like
Reactions: starman7 and kladd

Paparasee

Senior Member
Apr 19, 2009
1,105
198
Kuwait
mikko3024, Is it possible for you to modify the mms.apk from CM9?

Alternatively, can you please give us a step by step guide?

Problem is that even I get FC when I go to settings.

Thanks for any help :)
 

kelosh

Member
Jun 21, 2011
20
0
Been looking for this for a while. Works fine in ics.

Thanks for putting effort into this. On a side note are you able to increase the size of text entry box for SMS so it shows more than 3 lines (say about 7 lines). This would make it easier to write long texts
 

blacknet101

Senior Member
Dec 4, 2010
472
88
California
man wth haha this broke mms on my nexus s 4g AOKP v19 rom lol **** n I forgot to do a backup of the original mms app lol can someone post it up so I can get the old mms working plz :D thanks in advance

Sent from my Nexus S 4G using Tapatalk
 

mikko3024

Senior Member
Jul 26, 2011
85
156
Manila
man wth haha this broke mms on my nexus s 4g AOKP v19 rom lol **** n I forgot to do a backup of the original mms app lol can someone post it up so I can get the old mms working plz :D thanks in advance

Sent from my Nexus S 4G using Tapatalk

aw.. sorry man, updated the 1st post from your feedback. Do you still have the ROM's .zip file on your phone? Try extracting the Mms.apk from there. Don't have a copy of AOKP here. :D
 

Paparasee

Senior Member
Apr 19, 2009
1,105
198
Kuwait
Thanks Mikko ... works great :)
I presume there is no need to play around in the setting and that hitting the enter key will not send the sms!

Thanks again!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Looking for a way to insert new lines in the default SMS application (through the stock keyboard), I've modified the Mms.apk to enable inserting new lines (Enter key) in an SMS.

    Instructions:
    1. Backup your current Mms.apk before using this one.
    2. Rename the dowloaded apk file (from the link below) to Mms.apk.
    3. Using Root Explorer (or any file manager of your preference) copy file to /system/app.
    4. Set proper permissions (rw-r--r-- or 644).
    5. Set File ownership to root:root.
    6. Hit the Thanks button if you liked this one. :D

    Enjoy!:cool:

    Troubleshooting:
    1. Missing Messaging icon in launcher:
    - Verify that Mms.apk has proper permissions and ownership. (See Instructions)
    - Reboot device.

    2. Force closing when opening message threads:
    - Are you running a non-vanilla ROM? (ie. TouchWiz ROMs)
    - Samsung has a database issue with the vanilla version of the Mms.apk. You can try using this patched apk: MmsTW.patched.apk
    Note: The above apk (MmsTW.patched.apk) is a patched version of the apk from https://play.google.com/store/apps/details?id=com.concentriclivers.mms.com.android.mms to support entering new lines. The base apk's credit goes to the original author. Features don't include features from the CM9 apk (ie. Emoji support, gestures, etc).
    Change Log:
    JB Version 1: (Mms-NextLineV1-JB.apk) 2012-07-26
    - Patched Jelly Bean Mms.apk file.

    ICS Version 5: (Mms-NextLineV5-ICS.apk) 2012-05-19
    - Updated base Mms.apk file.
    - Various fixes (Gestures, etc).

    ICS Version 4: (Mms-NextLineV4-ICS.apk) 2012-05-07
    - Updated base Mms.apk file.
    - Emoji support.

    ICS Version 3: (Mms-NextLineV3-ICS.apk) 2012-04-01
    - Updated base Mms.apk file from ICS 4.0.4. (From fipsib)

    ICS Version 2: (Mms-NextLineV2-ICS.apk) 2012-03-02
    - Updated base Mms.apk file. (With contact images in notifications from fipsib)
    - Fixed FC when attaching images/multimedia.

    ICS Version 1: (Mms-NextLine-ICS.apk) 2012-01-21
    - Ported patch to ICS Mms.apk
    - Initial ICS release.

    CM7 Version: (Mms-NextLine.CM7.apk) 2011-11-14
    - Initial release.

    Notes:
    CM7:
    - Be sure to disable the Send on Enter option in the app's settings. (Not applicable to the ICS Version.)

    ICS:
    - Modified ICS APK should work on most (if not all) deodexed vanilla ICS ROMS. Apk may or may not work on ROMs not running vanilla ICS. Some manufacturers (Samsung - TouchWiz, HTC - Sense, etc.) introduce other features to their ROMs that can render the patched apk nonfunctional. Prepare a backup properly before trying the posted apk.
    - ICS version is reported to also work on Samsung Galaxy S2 running CM9 (by rehanraza)
    CM7 modifications were taken from: http://code.google.com/p/cyanogenmod/issues/detail?id=2898
    ICS modifications required the same patch and additional smali edits to bypass the Send on Enter check done in CM7.

    Tested using i9023 on respective CM7 and ICS, CM9 KANG Builds. (APK should be fine on GSM versions of the Nexus S)
    Reported not applicable to Nexus S 4G phones. (by blacknet101)

    Let me know if this works for you or not (Please indicate your current ROM and phone model: i.e. i9020, i9023, etc.)
    If you are experiencing errors and FCs, please provide a logcat if possible.
    Please download the appropriate file for your ROM.
    Apply mod at your own risk.
    16
    How to apply the Mms.apk next line mod.

    Note: This guide assumes that you have knowledge of decompiling-recompiling apks, baksmali-ing and smali-ing.

    The mod is a two part modification.
    - First is to remove the smiley button when typing an sms/mms with the enter button by modifying layout xml res files. After changing the xml res files, the enter button would appear. But the enter button would function as in the enter-to-send behavior.
    - Second is to modify a smali ui file to change the enter-to-send behavior and allow inserting next lines in the text editor.

    Part I - Showing the enter button.
    1. Decompile the Mms.apk. (apktool or any tool of your preference)

    2. Open res/layout/compose_message_activity.xml

    3. find |textShortMessage and delete it. (From my experience there is usually a single instance of that text in the file.)

    4. Recompile the apk.

    Note: You may need to perform apktool if framework-res.apk first to successfully decompile and recompile without errors.


    Part II - Smali edit.
    1. From the decompiled files under Part I, open smali/com/android/mms/ui/ComposeMessageActivity.smali.

    2. Modify the method onEditorAction with the snippet below. (The line with .method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z)

    Modified .method snippet:
    Code:
    .method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
        .locals 4
        .parameter "v"
        .parameter "actionId"
        .parameter "event"
    
        .prologue
        const/4 v3, 0x1
    
        const/4 v2, 0x0
    
        .line 3217
        if-eqz p3, :cond_4
    
        .line 3218
        invoke-virtual {p3}, Landroid/view/KeyEvent;->getKeyCode()I
    
        move-result v0
    
        const/16 v1, 0x17
    
        if-eq v0, v1, :cond_0
    
        invoke-virtual {p3}, Landroid/view/KeyEvent;->getKeyCode()I
    
        move-result v0
    
        const/16 v1, 0x42
    
        if-ne v0, v1, :cond_1
    
        :cond_0
        move v0, v2
    
        .line 3232
        :goto_0
        return v0
    
        .line 3221
        :cond_1
        invoke-virtual {p3}, Landroid/view/KeyEvent;->isShiftPressed()Z
    
        move-result v0
    
        if-nez v0, :cond_3
    
        .line 3222
        invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->isPreparedForSending()Z
    
        move-result v0
    
        if-eqz v0, :cond_2
    
        .line 3223
        invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->confirmSendMessageIfNeeded()V
    
        :cond_2
        move v0, v3
    
        .line 3225
        goto :goto_0
    
        :cond_3
        move v0, v2
    
        .line 3227
        goto :goto_0
    
        .line 3229
        :cond_4
        invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->isPreparedForSending()Z
    
        move-result v0
    
        if-eqz v0, :cond_5
    
        .line 3230
        invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->confirmSendMessageIfNeeded()V
    
        :cond_5
        move v0, v3
    
        .line 3232
        goto :goto_0
    .end method

    3. Adjust the .line numbering to the numbering used by the previous method before patching. Not adjusting the .line numbering would/may cause errors.

    Note that your .line numbering may be different from my .line numbering. For example your previous .method may occupy 3040 to 3055. Adjust the above code's .line numbering to fit that range.

    4. After modifying the smali file, create a duplicate of the smali folder.

    5. Smali the smali folder to obtain a new classes.dex file.
    Code:
    java -jar ./smali.jar -o ./classes.dex ./smali

    6. Open the patched Mms.apk file earlier using WinZip or WinRAR and overwrite its classes.dex file with the new modified one.

    If you're on Ubuntu you can type this command in terminal:
    Code:
    zip -m Mms.apk classes.dex

    7. Copy the patched Mms.apk file to your phone's /system/app folder. Apply proper ownership and permissions.
    3
    Updated first post.

    Version 2:
    - Updated based Mms.apk file.
    - Fixed FC when attaching images/multimedia files.
    2
    It worked i flashed it but my messaging icon dissapeard but when i went into my email account just to check if it worked it did, but i dont why messaging icon dissapeared after i installed this
    What ROM are you using?

    Is your method exclusive to the CM7 Mms.apk or can this be done to the stock apk as well?
    Yes, I think. You'll just have to edit /res/layout/compose_message_activity.xml
    2
    please fix this in Android 4.0.3 stock or AOKP :(

    Updated for ICS.