Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,682 Members 42,541 Now Online
XDA Developers Android and Mobile Development Forum

[MOD] Remove SMS/MMS from Log via MMS.apk

Tip us?
 
jeboo
Old
#1  
jeboo's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 3934
Posts: 750
Join Date: Apr 2010

 
DONATE TO ME
Default [MOD] Remove SMS/MMS from Log via MMS.apk

This is a simple mod for a very popular "feature." I think this approach is unique and may be beneficial as mms.apk is modified much more often than logsprovider. This is based on XWLA4 btw, Enjoy!

1. Decompile mms.apk with apk_manager or whatever.
2. Go to /smali/com/android/mms/transaction
3. Open MessagingNotification.smali and the two methods we are interested in are: updateHistoryForMms & updateHistoryForSms
These two functions basically build an sql query to insert the messaging entries into the log database.
4. Within both functions, we will simply comment out (place a # in front) the final insert. Here are the exact changes based on XWLA4:

(line 3669)
Code:
Select Code
    const-string v6, "content://logs/mms"

    invoke-static {v6}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v6

#    invoke-virtual {v5, v6, v7}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    .line 1348
    add-int/lit8 p2, p2, 0x1
(line 4002)
Code:
Select Code
   const-string p1, "content://logs/sms"

    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p1

#    invoke-virtual {v1, p1, v9}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
5. And that's it, recompile, send to phone and reboot. Note that with this patch the log entries are never saved. So if someone gets a hold of your phone and tries to dig them up, you're fine!

Lastly, I haven't looked at the ICS code yet..I'm guessing it's pretty similar. I posted in themes because I don't have privileges to post in dev yet
The Following 14 Users Say Thank You to jeboo For This Useful Post: [ Click to Expand ]
 
manny05
Old
#2  
manny05's Avatar
Senior Member
Thanks Meter 157
Posts: 1,410
Join Date: Feb 2011
Good work. I'll be waiting for the ICS version
 
fone_fanatic
Old
#3  
fone_fanatic's Avatar
Senior Member
Thanks Meter 237
Posts: 2,735
Join Date: Aug 2005
Location: Central Texas

 
DONATE TO ME
This is awesome! Thank you. Ever since upgrading this has annoyed me. Will definitely try this when I get home!
| Magician | Wizard | Hermes | Kaiser | Raphael | Rhodium | Dell STREAK (sorry HTC )
__________________
Dell Streak MO1M
Streakdroid v161-1

__________________
Streak Boot Animations: Stock , Bios & Scribble
 
mccune
Old
#4  
mccune's Avatar
Senior Member
Thanks Meter 50
Posts: 2,677
Join Date: Nov 2005

 
DONATE TO ME
This also works for the normal I9100.

Applied this to my Mms.apk from the Villain 3.0 ROM (Gingerbread).

The lines you're looking for are #3782 and #4142.
 
DriftorX
Old
#5  
DriftorX's Avatar
Senior Member
Thanks Meter 131
Posts: 772
Join Date: Aug 2010
Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?
 
fone_fanatic
Old
(Last edited by fone_fanatic; 19th March 2012 at 05:19 AM.)
#6  
fone_fanatic's Avatar
Senior Member
Thanks Meter 237
Posts: 2,735
Join Date: Aug 2005
Location: Central Texas

 
DONATE TO ME
I'm on ICScewD v2.1 and mine is different. So I searched for "Content://logs/mms" and this is what it looks like:

Code:
Select Code
    const-string v16, "content://logs/mms"

    invoke-static/range {v16 .. v16}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v16

    move-object v0, v5

    move-object/from16 v1, v16

    move-object v2, v7

    invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    .line 1319
    const-string v7, "Mms/MessagingNotification"
Should I comment out
Code:
Select Code
    invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
?

And this is what it looks like for the sms:
Code:
Select Code
    const-string v0, "content://logs/sms"

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    invoke-virtual {v1, v0, v9}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    .line 1242

So it worked out well. I commented out the
Code:
Select Code
    invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
for mms and
Code:
Select Code
invoke-virtual {v1, v0, v9}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
for sms. Thank you!
| Magician | Wizard | Hermes | Kaiser | Raphael | Rhodium | Dell STREAK (sorry HTC )
__________________
Dell Streak MO1M
Streakdroid v161-1

__________________
Streak Boot Animations: Stock , Bios & Scribble
 
jeboo
Old
#7  
jeboo's Avatar
Recognized Contributor / Recognized Developer - OP
Thanks Meter 3934
Posts: 750
Join Date: Apr 2010

 
DONATE TO ME
Nice work fanatic!

I went ahead and checked mms.apk from ICS 4.0.3 LPQ, and it's pretty much identical. You can just search for 'insert' and it will land you on the 2 lines to comment out. I haven't tried ICS yet, so someone let me know how it goes.
 
crz6662
Old
#8  
crz6662's Avatar
Senior Member
Thanks Meter 17
Posts: 436
Join Date: Jan 2009
Location: pgh, pa
Quote:
Originally Posted by DriftorX View Post
Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?
Curious bout this also...
 
Simba501
Old
#9  
Simba501's Avatar
Recognized Contributor
Thanks Meter 1131
Posts: 3,167
Join Date: Feb 2010
Quote:
Originally Posted by DriftorX View Post
Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?
Quote:
Originally Posted by crz6662 View Post
Curious bout this also...
Likely. Definitely likely enough to try it. Or you can download Samsung Log Converter; I've heard it works if you're not into smali .
 
G3-SCORPIO
Old
(Last edited by G3-SCORPIO; 12th April 2012 at 09:41 PM.)
#10  
G3-SCORPIO's Avatar
Member
Thanks Meter 3
Posts: 46
Join Date: Feb 2011
Location: Краснодар
Quote:
1. Decompile mms.apk with apk_manager or whatever.
2. Go to /smali/com/android/mms/transaction
3. Open MessagingNotification.smali and the two methods we are interested in are: updateHistoryForMms & updateHistoryForSms
These two functions basically build an sql query to insert the messaging entries into the log database.
4. Within both functions, we will simply comment out (place a # in front) the final insert. Here are the exact changes based on XWLA4:
Good day all ! Do I understand correctly that this will remove the logs sms and mms from logging calls? for firmware 2.2.1
Someone already tried? This method helps?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Enjoy Wallpaper Overload with PhotoPhase

We don’t usually feature live wallpapers on the XDA Portal unless they are somewhat innovative … more

Monitor What Your Phone’s Camera Sees with Android Wear

Having a smart device strapped to your wrist certainly has its merits. A … more

Mod Lets You Have Stereo Speakers on Your Sony Xperia Z1 (Sort Of)

The stereo speakers onthe Sony Xperia Z2areprobably a relatively large … more

Give Your Screen Some Color with HexaTime Live Wallpaper

We don’t often cover very many live wallpapers here on the XDA Portal. You may … more