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

edgex

Senior Member
Jan 29, 2012
638
120
0
San Francisco
This looks absolutely amazing and how the MMS app should look, unfortunately nobody can get it to work with the recent ICS leak for the Skyrocket, GS2 tmobile, or note. It opens, but force closes when you select a thread.

We all REALLY want this, and I'm wondering if maybe there are other related files that may be needed for us to work? for instance i gave a note user the VVM app, and it didnt work until i also provided the jar and xml files i found by searching in root explorer.

Any help to get this to work on our phones would be greatly appreciated by many and worthy of large donations.

Send me a PM if you think you can help.
 

breakingspell

Senior Member
Dec 1, 2010
392
122
43
This looks absolutely amazing and how the MMS app should look, unfortunately nobody can get it to work with the recent ICS leak for the Skyrocket, GS2 tmobile, or note. It opens, but force closes when you select a thread.
Wish i would have read this before i spent all night with apktool trying to splice the smali lines in. No matter what, tampering with the apk gives us FC's upon selecting threads. I can compose and send texts, but it crashes upon switching to the thread view after sending
 

mikko3024

Senior Member
Jul 26, 2011
81
153
63
Manila
Wish i would have read this before i spent all night with apktool trying to splice the smali lines in. No matter what, tampering with the apk gives us FC's upon selecting threads. I can compose and send texts, but it crashes upon switching to the thread view after sending
You can try this:
Experimental Version: (For 4G devices)
- ICS V4-4G: Mms-NextLineV4-4G-ICS.Experimental.apk

Please post a logcat if you are experiencing FCs. I don't have a 4G device so I can't test the modified version properly.
 

aikman069

New member
May 15, 2012
2
0
0
Problem Disabling Send with enter

I tried this with an LG P500h. And the enter button appeared correctly, however, it is not working properly since every time I push it sends the sms.

I tried to disable the option you mentioned in Editor Options but not able to find it.

I am running CMod 7.2.0 RC1 with GGB 2.3.7

Thanks in advance..
Aldo
 

mikko3024

Senior Member
Jul 26, 2011
81
153
63
Manila
I tried this with an LG P500h. And the enter button appeared correctly, however, it is not working properly since every time I push it sends the sms.

I tried to disable the option you mentioned in Editor Options but not able to find it.

I am running CMod 7.2.0 RC1 with GGB 2.3.7

Thanks in advance..
Aldo
hhhmmn.. editor options?

it's in the Settings of the Mms app.
Press the Menu button (inside the Mms app) > Settings.
 
  • Like
Reactions: aikman069

309041291a

Senior Member
Dec 29, 2011
2,411
353
0
I have a problem with gestures. If anyone hasn't tried gestures, it is basically drawing something on the screen (not including the keyboard) and having it spell a word, or whatever you preset for the drawing'/trace/gesture. The problem is that as soon as I use one gesture, even if I use a completely and unrelated gesture it will use the the first gestures gestures word.

For example ... I could have two gestures. A circle to spell hi, and a triangle shape to spell lol. So I'll do the circle to spell hi. Then I trace a triangle and it will still use hi.

If I leave the threat on my phone and come back to it in the messages app, or I kill the messages app and relaunch it then I can use another gesture. But if I want to she another gesture besides that I have to repeat.

I have like 20 gestures now and I have having to go in and out to spell a word. It kills the point of it.. cause then it isn't quick anymore... I make sure to make all my gestures very different, so that isn't the problem...

Gestures are a really cool feature, I'm glad they're here. But the bug is annoying :p

Nexus S (GSM i9020a)
GummyNex (1.2.0 - 4.0.4)
Matrix Kernel (CFS - 19.5)
Intellidemmand (1000/100)
Deep Idle (Off - Noop)
 

andreivv

Senior Member
Apr 16, 2012
117
49
0
Hi. I'm on a Galaxy S2 running Dynamic 1.4 ROM .. it's deodexed so it should work, but I too get FC when trying to open a thread.. starting a new one, sending an text is ok, but when I try to open an existing one the processes is terminated.. Any ideas (solution)??
 

Pungi

Member
Mar 14, 2012
31
3
0
Hi. I'm on a Galaxy S2 running Dynamic 1.4 ROM .. it's deodexed so it should work, but I too get FC when trying to open a thread.. starting a new one, sending an text is ok, but when I try to open an existing one the processes is terminated.. Any ideas (solution)??
I have the same problem. I have applied the mod on my mms.apk. Galaxy S on AOKP.

Inviato dal mio GT-I9000 usando Tapatalk 2 Final
 

Difusal

Senior Member
Jul 3, 2011
456
410
93
Edinburgh
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.
How do I adjust the .line numbers? compared to my previous smali, the modded snipet has more .lines...
 

mikko3024

Senior Member
Jul 26, 2011
81
153
63
Manila
Hi. I'm on a Galaxy S2 running Dynamic 1.4 ROM .. it's deodexed so it should work, but I too get FC when trying to open a thread.. starting a new one, sending an text is ok, but when I try to open an existing one the processes is terminated.. Any ideas (solution)??
I have the same problem. I have applied the mod on my mms.apk. Galaxy S on AOKP.
Can you provide a logcat for the FC?
You can also check the Troubleshooting Section of this thread: http://forum.xda-developers.com/showthread.php?p=24473206
I have updated it just today. It is about FCs on TouchWiz based ROMs though. If you can provide a logcat for the FC, I can try to see if the issue is the same.

(Edit: Updated this thread's first post too.)

How do I adjust the .line numbers? compared to my previous smali, the modded snipet has more .lines...
The modded snippet has 15 .lines (3232 - 3217), how many .lines does your previous smali have? You can try using some .line values from your previous smali's range not explicitly shown in the smali code.

You can also try deleting some .line entries in the modded snippet. As far as I know, they are there for debugging purposes only.
 
Last edited:

pandu15

Senior Member
Jun 13, 2012
70
10
0
Dumai
Can I request the apocalypse [17.06.2012] mms.apk with enter key? :D
thanks before :p
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.
thanks dude for your helpfull tutorial :p, now I have my own moded mms.apk from apocalypse rom :D

How do I adjust the .line numbers? compared to my previous smali, the modded snipet has more .lines...
you don't have to change the line numbers, just adjust your line with this one :D