How to use IMEI-based protection on N7710?

Login to reply to this topic.
Mon, 2006-01-02 01:10
Joined: 2005-12-05
Forum posts: 4
Is there any working way how to get programatically IMEI from N7710 to protect an application written for this platform? All solutions working well on S60, S80, UIQ devices, all IMEI-regarded tips mentioned in this forum and on www.symbian.com seem not to work correctly on N7710 for me.

Neither ETel3rdParty nor Mobinfo usage gives a proper result, on N7710. Is there a way to get it work? Does anybody know how to achieve this?
Thanks.

midnightowl

Thu, 2006-03-02 20:55
Joined: 2003-04-03
Forum posts: 39
Re: How to use IMEI-based protection on N7710?
Try it.

Code:
/////////////////////////////////////////////////////////////////////////
// CIMEIRetriever
/////////////////////////////////////////////////////////////////////////

class CIMEIRetriever : public CActive
{
public:
  static void GetIMEIL(TDes& aPhoneId);

protected:
  CIMEIRetriever(TDes& aPhoneId);
  ~CIMEIRetriever();
  void ConstructL();

  void DoCancel();
  void RunL();
 
  CTelephony* iTelephony;
  TDes& iIMEI;

  CTelephony::TPhoneIdV1 iPhoneId;
};

Code:
/////////////////////////////////////////////////////////////////////////
// CIMEIRetriever
/////////////////////////////////////////////////////////////////////////

void CIMEIRetriever::GetIMEIL(TDes& aIMEI)
{
  LOG_F(CIMEIRetriever::GetIMEIL);

  CIMEIRetriever* self = new (ELeave) CIMEIRetriever(aIMEI);
  CleanupStack::PushL(self);
  self->ConstructL();
  CleanupStack::PopAndDestroy();
}
 

/////////////////////////////////////////////////////////////////////////

CIMEIRetriever::CIMEIRetriever(TDes& aIMEI)
: iTelephony(NULL), iIMEI(aIMEI), CActive(EPriorityStandard)
{
}


/////////////////////////////////////////////////////////////////////////

CIMEIRetriever::~CIMEIRetriever()
{
  Cancel();
  delete iTelephony;
}


/////////////////////////////////////////////////////////////////////////

void CIMEIRetriever::ConstructL()
{
  iTelephony = CTelephony::NewL();
  CActiveScheduler::Add(this);
  CTelephony::TPhoneIdV1Pckg pckg(iPhoneId);
  iTelephony->GetPhoneId(iStatus, pckg);
  SetActive();
  CActiveScheduler::Start();
}

 
/////////////////////////////////////////////////////////////////////////

void CIMEIRetriever::DoCancel()
{
  iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
}


/////////////////////////////////////////////////////////////////////////

void CIMEIRetriever::RunL()
{
  iIMEI = iPhoneId.iSerialNumber;
  CActiveScheduler::Stop();
}
Sun, 2006-04-02 17:15
Joined: 2004-06-17
Forum posts: 47
Re: How to use IMEI-based protection on N7710?
Hi,

when and where can I use this?

It is e.g. working perfectly in AppUI::HandleCommandL, but never returns in my AppUI::ConstructL() method.

Regards
lkz633
Thu, 2006-04-27 14:50
Joined: 2003-04-03
Forum posts: 39
Re: How to use IMEI-based protection on N7710?
Try to call it after BaseConstructL()
  • Login to reply to this topic.