Android TV Launcher Pushed to Google Play

Over the past decade, the tech universe has seen two drastic and widely contrasting changes with … more

Cyngn, OnePlus, Micromax – The Legal Battle

Recently, a battle has been waging in India over the rights to distribute the commercial … more

Lean Mean Battery Power Saving App Review

We talk a lot about battery topics here at XDA TV. We talk about everything from Power Banks to USB … more

Android 5.1 Possibly Coming February 2015

Google released Android 5.0 just over a month ago, and since then Lollipop has been trying to … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP jeboo

17th March 2012, 01:19 AM   |  #1  
jeboo's Avatar
OP Recognized Contributor / Recognized Developer
Thanks Meter: 3,970
 
761 posts
Join Date:Joined: Apr 2010
Donate to Me
More
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:
    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:
   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: [ View ]
18th March 2012, 11:22 PM   |  #2  
manny05's Avatar
Senior Member
Thanks Meter: 158
 
1,424 posts
Join Date:Joined: Feb 2011
Good work. I'll be waiting for the ICS version
18th March 2012, 11:58 PM   |  #3  
fone_fanatic's Avatar
Senior Member
Flag Central Texas
Thanks Meter: 237
 
2,739 posts
Join Date:Joined: Aug 2005
Donate to Me
More
This is awesome! Thank you. Ever since upgrading this has annoyed me. Will definitely try this when I get home!
19th March 2012, 12:07 AM   |  #4  
mccune's Avatar
Senior Member
Thanks Meter: 51
 
2,677 posts
Join Date:Joined: Nov 2005
Donate to Me
More
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.
19th March 2012, 03:45 AM   |  #5  
DriftorX's Avatar
Senior Member
Thanks Meter: 133
 
780 posts
Join Date:Joined: Aug 2010
More
Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?
19th March 2012, 05:25 AM   |  #6  
fone_fanatic's Avatar
Senior Member
Flag Central Texas
Thanks Meter: 237
 
2,739 posts
Join Date:Joined: Aug 2005
Donate to Me
More
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:
    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:
    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:
    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:
    invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
for mms and
Code:
invoke-virtual {v1, v0, v9}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
for sms. Thank you!
Last edited by fone_fanatic; 19th March 2012 at 06:19 AM.
19th March 2012, 06:47 AM   |  #7  
jeboo's Avatar
OP Recognized Contributor / Recognized Developer
Thanks Meter: 3,970
 
761 posts
Join Date:Joined: Apr 2010
Donate to Me
More
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.
21st March 2012, 10:42 AM   |  #8  
crz6662's Avatar
Senior Member
Flag pgh, pa
Thanks Meter: 18
 
436 posts
Join Date:Joined: Jan 2009
More
Quote:
Originally Posted by DriftorX

Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?

Curious bout this also...
21st March 2012, 01:18 PM   |  #9  
Simba501's Avatar
Recognized Contributor
Thanks Meter: 1,142
 
3,180 posts
Join Date:Joined: Feb 2010
Quote:
Originally Posted by DriftorX

Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?

Quote:
Originally Posted by crz6662

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 .
12th April 2012, 10:11 PM   |  #10  
G3-SCORPIO's Avatar
Member
Flag Краснодар
Thanks Meter: 3
 
46 posts
Join Date:Joined: Feb 2011
More
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?
Last edited by G3-SCORPIO; 12th April 2012 at 10:41 PM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes