[MOD][GUIDE][NOOB] How to mod lewa os PIM.apk (sms)

Search This thread

Sudeep Duhoon

Inactive Recognized Contributor
Oct 23, 2012
1,261
2,770
Delhi
There is no guide/tutorial/apk on the web to do all this for Lewa OS, searched a lot, so I decided to do this myself.
This tutorial will do/add/change these things in LewaOS PIM.apk (SMS)


1. 5 lines to write sms
2. Enter key on main keyboard
3. Replaced smiley texts [no nose - in smiley]
4. Default sms per thread=5000 instead of 500
5. Default mms per thread=500 instead of 50
6. Can send sms to 200 people now instead of 20
7. No sms to mms conversion, default was limited to 8 sms


Required Knowledge:
1. Notepad++
2. Apk compiling and decompiling (I use APK-Multi-Toolv1.0.10 for this)
3. Compression tool (like winrar, 7zip)


Steps:

Setting Up Environment (for noobs):


1. Get Apk-Multi-Tool from here or here and set it up/extract in any drive, C, D, whatever.
2. Run ‘Setup.bat’ and press 3 to setup directories.
3. Get framework-res.apk and PIM.apk of LewaOS and place them in folder ‘other’ and ‘place-apk-here-for-modding’, respectively.
4. Again press 2->enter->1->enter (wait) ->any key->any key to install ‘framework-res.apk’
5. Close cmd (setup.bat) or press 00->enter to exit.
6. Run ‘Script.bat’, press enter.
7. To set current project, enter 24 and select PIM.apk by pressing 1
8. Switch Decompile mod by entering 26 so it decompiles sources and resources files.
9. Press 9 to decompile.
10. Now navigate to ‘projects/PIM.apk’ folder.


Moding:


RES PART (XML)
1.
Open 'res\values\arrays.xml'
And delete all the noses -

2.
Open ‘res\xml\mms_config.xml’

change
Code:
    <int name="defaultSMSMessagesPerThread">[COLOR="Red"]500[/COLOR]</int>
    <int name="defaultMMSMessagesPerThread">[COLOR="Red"]50[/COLOR]</int>
    <int name="recipientLimit">[COLOR="Red"]20[/COLOR]</int>
    <int name="smsToMmsTextThreshold">[COLOR="Red"]8[/COLOR]</int>

To

Code:
    <int name="defaultSMSMessagesPerThread">[COLOR="Blue"]5000[/COLOR]</int>
    <int name="defaultMMSMessagesPerThread">[COLOR="Blue"]500[/COLOR]</int>
    <int name="recipientLimit">[COLOR="Blue"]200[/COLOR]</int>
    <int name="smsToMmsTextThreshold">[COLOR="Blue"]800[/COLOR]</int>


3.
Go to ‘res\layout\destk_message_main.xml’

find '|textShortMessage' and delete it
find ‘android:maxLines=’ in the same line and change value to 5

4.
Go to ‘res\layout\mms_compose_edit.xml’
Do the same



SMALI PART

Go to ‘smali\com\lewa\PIM\mms\ui\ComposeMessageActivity.smali’
Find ‘.method public onEditorAction


Look for
Code:
.method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
    .locals 6
    .parameter "v"
    .parameter "actionId"
    .parameter "event"

    .prologue
    const/4 v0, 0x0

    const/4 v5, 0x0

    const v4, 0x7f0d032a

    const v3, 0x7f0d030d

    const v2, 0x1010355

    .line [COLOR="SeaGreen"]5511[/COLOR]
    [COLOR="Red"]if-eqz p3, :cond_4[/COLOR]
and paste the following (text in blue, including .line x), just below ‘if-eqz p3, :cond_4

Code:
[COLOR="Blue"]    [COLOR="Red"].line x[/COLOR]
    iget-boolean v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mIsHardKeyboardOpen:Z

    if-nez v3, :cond_1

    iget v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mInputMethod:I

    const/16 v4, 0x50

    if-ne v3, v4, :cond_1[/COLOR]

Edit the .line x according to the previous value (5511 in this case) and the entry should NOT get repeated, or PIM.apk will force close.

To check this, edit .line x according to previous value and search the edited number, if you get more than one results, edit it again, keep doing this,

Eg: because of previous entry of 5511 here we will edit .line x to .line 5512 and search 5512, if we get 2 or more results, we will further edit it to 5513 and again search.

So, now it should look like this

BEFORE:
Code:
[COLOR="Red"]
.method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
    .locals 6
    .parameter "v"
    .parameter "actionId"
    .parameter "event"

    .prologue
    const/4 v0, 0x0

    const/4 v5, 0x0

    const v4, 0x7f0d032a

    const v3, 0x7f0d030d

    const v2, 0x1010355

    .line [COLOR="SeaGreen"]5511[/COLOR]
    if-eqz p3, :cond_4

    .line 5514
    invoke-virtual {p3}, Landroid/view/KeyEvent;->isShiftPressed()Z

    move-result v1

    if-nez v1, :cond_0

    .line 5521
    invoke-virtual {p3}, Landroid/view/KeyEvent;->getAction()I

    move-result v1

    if-nez v1, :cond_1
[/COLOR]

AFTER
Code:
[COLOR="Red"]
.method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
    .locals 6
    .parameter "v"
    .parameter "actionId"
    .parameter "event"

    .prologue
    const/4 v0, 0x0

    const/4 v5, 0x0

    const v4, 0x7f0d032a

    const v3, 0x7f0d030d

    const v2, 0x1010355

    .line [COLOR="SeaGreen"]5511[/COLOR]
    if-eqz p3, :cond_4

    [COLOR="Blue"].line 5512
    iget-boolean v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mIsHardKeyboardOpen:Z

    if-nez v3, :cond_1

    iget v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mInputMethod:I

    const/16 v4, 0x50

    if-ne v3, v4, :cond_1[/COLOR]

    .line 5514
    invoke-virtual {p3}, Landroid/view/KeyEvent;->isShiftPressed()Z

    move-result v1

    if-nez v1, :cond_0

    .line 5521
    invoke-virtual {p3}, Landroid/view/KeyEvent;->getAction()I

    move-result v1

    if-nez v1, :cond_1
[/COLOR]


Save everything.

Compiling back:

1.To compile back, press 11 and enter, say no by pressing n.
2.Go back to ‘place-apk-here-for-modding’ and find ‘unsignedPIM.apk
3.Open ‘unsignedPIM.apk’ and ‘PIM.apk’ using a compression tool (I use 7zip/winrar)
4.And drag and drop everything except ‘res’ and ‘classes.dex’ from PIM.apk to unsignedPIM.apk
5.Rename unsignedPIM.apk to PIM.apk and flash in recovery or push it in system with proper permissions.




For Canvas Music (should work for Canvas 2 and other ported roms too), here is the modded PIM.apk (extract the .rar archive and flash the ‘Lewa-moddedPIM.zip’ in recovery.


Now press THANX please.


 

Attachments

  • ModPIM.rar
    6.6 MB · Views: 989
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    There is no guide/tutorial/apk on the web to do all this for Lewa OS, searched a lot, so I decided to do this myself.
    This tutorial will do/add/change these things in LewaOS PIM.apk (SMS)


    1. 5 lines to write sms
    2. Enter key on main keyboard
    3. Replaced smiley texts [no nose - in smiley]
    4. Default sms per thread=5000 instead of 500
    5. Default mms per thread=500 instead of 50
    6. Can send sms to 200 people now instead of 20
    7. No sms to mms conversion, default was limited to 8 sms


    Required Knowledge:
    1. Notepad++
    2. Apk compiling and decompiling (I use APK-Multi-Toolv1.0.10 for this)
    3. Compression tool (like winrar, 7zip)


    Steps:

    Setting Up Environment (for noobs):


    1. Get Apk-Multi-Tool from here or here and set it up/extract in any drive, C, D, whatever.
    2. Run ‘Setup.bat’ and press 3 to setup directories.
    3. Get framework-res.apk and PIM.apk of LewaOS and place them in folder ‘other’ and ‘place-apk-here-for-modding’, respectively.
    4. Again press 2->enter->1->enter (wait) ->any key->any key to install ‘framework-res.apk’
    5. Close cmd (setup.bat) or press 00->enter to exit.
    6. Run ‘Script.bat’, press enter.
    7. To set current project, enter 24 and select PIM.apk by pressing 1
    8. Switch Decompile mod by entering 26 so it decompiles sources and resources files.
    9. Press 9 to decompile.
    10. Now navigate to ‘projects/PIM.apk’ folder.


    Moding:


    RES PART (XML)
    1.
    Open 'res\values\arrays.xml'
    And delete all the noses -

    2.
    Open ‘res\xml\mms_config.xml’

    change
    Code:
        <int name="defaultSMSMessagesPerThread">[COLOR="Red"]500[/COLOR]</int>
        <int name="defaultMMSMessagesPerThread">[COLOR="Red"]50[/COLOR]</int>
        <int name="recipientLimit">[COLOR="Red"]20[/COLOR]</int>
        <int name="smsToMmsTextThreshold">[COLOR="Red"]8[/COLOR]</int>

    To

    Code:
        <int name="defaultSMSMessagesPerThread">[COLOR="Blue"]5000[/COLOR]</int>
        <int name="defaultMMSMessagesPerThread">[COLOR="Blue"]500[/COLOR]</int>
        <int name="recipientLimit">[COLOR="Blue"]200[/COLOR]</int>
        <int name="smsToMmsTextThreshold">[COLOR="Blue"]800[/COLOR]</int>


    3.
    Go to ‘res\layout\destk_message_main.xml’

    find '|textShortMessage' and delete it
    find ‘android:maxLines=’ in the same line and change value to 5

    4.
    Go to ‘res\layout\mms_compose_edit.xml’
    Do the same



    SMALI PART

    Go to ‘smali\com\lewa\PIM\mms\ui\ComposeMessageActivity.smali’
    Find ‘.method public onEditorAction


    Look for
    Code:
    .method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
        .locals 6
        .parameter "v"
        .parameter "actionId"
        .parameter "event"
    
        .prologue
        const/4 v0, 0x0
    
        const/4 v5, 0x0
    
        const v4, 0x7f0d032a
    
        const v3, 0x7f0d030d
    
        const v2, 0x1010355
    
        .line [COLOR="SeaGreen"]5511[/COLOR]
        [COLOR="Red"]if-eqz p3, :cond_4[/COLOR]
    and paste the following (text in blue, including .line x), just below ‘if-eqz p3, :cond_4

    Code:
    [COLOR="Blue"]    [COLOR="Red"].line x[/COLOR]
        iget-boolean v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mIsHardKeyboardOpen:Z
    
        if-nez v3, :cond_1
    
        iget v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mInputMethod:I
    
        const/16 v4, 0x50
    
        if-ne v3, v4, :cond_1[/COLOR]

    Edit the .line x according to the previous value (5511 in this case) and the entry should NOT get repeated, or PIM.apk will force close.

    To check this, edit .line x according to previous value and search the edited number, if you get more than one results, edit it again, keep doing this,

    Eg: because of previous entry of 5511 here we will edit .line x to .line 5512 and search 5512, if we get 2 or more results, we will further edit it to 5513 and again search.

    So, now it should look like this

    BEFORE:
    Code:
    [COLOR="Red"]
    .method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
        .locals 6
        .parameter "v"
        .parameter "actionId"
        .parameter "event"
    
        .prologue
        const/4 v0, 0x0
    
        const/4 v5, 0x0
    
        const v4, 0x7f0d032a
    
        const v3, 0x7f0d030d
    
        const v2, 0x1010355
    
        .line [COLOR="SeaGreen"]5511[/COLOR]
        if-eqz p3, :cond_4
    
        .line 5514
        invoke-virtual {p3}, Landroid/view/KeyEvent;->isShiftPressed()Z
    
        move-result v1
    
        if-nez v1, :cond_0
    
        .line 5521
        invoke-virtual {p3}, Landroid/view/KeyEvent;->getAction()I
    
        move-result v1
    
        if-nez v1, :cond_1
    [/COLOR]

    AFTER
    Code:
    [COLOR="Red"]
    .method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
        .locals 6
        .parameter "v"
        .parameter "actionId"
        .parameter "event"
    
        .prologue
        const/4 v0, 0x0
    
        const/4 v5, 0x0
    
        const v4, 0x7f0d032a
    
        const v3, 0x7f0d030d
    
        const v2, 0x1010355
    
        .line [COLOR="SeaGreen"]5511[/COLOR]
        if-eqz p3, :cond_4
    
        [COLOR="Blue"].line 5512
        iget-boolean v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mIsHardKeyboardOpen:Z
    
        if-nez v3, :cond_1
    
        iget v3, p0, Lcom/android/mms/ui/ComposeMessageActivity;->mInputMethod:I
    
        const/16 v4, 0x50
    
        if-ne v3, v4, :cond_1[/COLOR]
    
        .line 5514
        invoke-virtual {p3}, Landroid/view/KeyEvent;->isShiftPressed()Z
    
        move-result v1
    
        if-nez v1, :cond_0
    
        .line 5521
        invoke-virtual {p3}, Landroid/view/KeyEvent;->getAction()I
    
        move-result v1
    
        if-nez v1, :cond_1
    [/COLOR]


    Save everything.

    Compiling back:

    1.To compile back, press 11 and enter, say no by pressing n.
    2.Go back to ‘place-apk-here-for-modding’ and find ‘unsignedPIM.apk
    3.Open ‘unsignedPIM.apk’ and ‘PIM.apk’ using a compression tool (I use 7zip/winrar)
    4.And drag and drop everything except ‘res’ and ‘classes.dex’ from PIM.apk to unsignedPIM.apk
    5.Rename unsignedPIM.apk to PIM.apk and flash in recovery or push it in system with proper permissions.




    For Canvas Music (should work for Canvas 2 and other ported roms too), here is the modded PIM.apk (extract the .rar archive and flash the ‘Lewa-moddedPIM.zip’ in recovery.


    Now press THANX please.