Retrieving the device IMEI code
17 août 2003 - 10:35

The IMEI, short for International Mobile Equipment Identity, is a unique number given to every single mobile phone [1]. It is not modifiable by the user and a written copy of it can typically found behind the battery. It can also be displayed on screen by entering the *#06# key sequence.

Depending on your mobile, this number can have two different formats (the old and the new format:
-  aabbbb-cc-dddddd-e if your mobile has been manufactured before April 1st 2004.
-  xxxxxxxx-dddddd-e if your mobile has been manufactured after this date.

The old IMEI format

The format aabbbb-cc-dddddd-e was in use until April 1st 2004. Its meaning is:
-  aabbbb is the Type Approval Code (TAC). The first two digits (aa) represent the country code.

-  The second group of numbers (cc) is the Final Assembly Code (FAC). This identifies the device manufacturer [2]:

01,02 = AEG   60 = Alcatel
07,40 = Motorola  61 = Ericsson
10,20 = Nokia  65 = AEG
30 = Ericsson  70 = Sagem
40,41,44 = Siemens  75 = Dancall
50 = Bosch  80 = Philips
51 = Sony, Siemens, Ericsson  85 = Panasonic

-  dddddd represents the device serial number (SNR)

-  the last single digit (e) is an check digit (usually set to 0).

The new IMEI format

The new format xxxxxxxx-dddddd-e is used since 1st April 2004. The FAC value has disappeared and the Type Approval Code has been be replaced by a Type Allocation Code (TAC in both cases):
-  xxxxxxxx is a eight digit number: the Type Allocation Code.
-  dddddd and e have the same meaning as in the old format.

The IMEISV format

You may have two extra digits at the end of the IMEI. IN this case, these two additional numbers reflects the software version number of your phone. You can check in ETSI specs 02.16 and 03.03 if you need to have more details.

Retrieving the IMEI code on a Symbian device

Here is a small function that let you retrieve the IMEI of a device (link against plpvariant.lib):

#include <plpvariant.h>

void DeviceUtils::GetImei(TDes& aImei)
{
#ifndef __WINS__
  // This only works on target machine
  TPlpVariantMachineId imei;
  PlpVariant::GetMachineIdL(imei);
  aImei.Copy(imei);
#else
  // Return a fake IMEI when working on emulator
  _LIT(KEmulatorImei, "000000000000000");
  aImei.Copy(KEmulatorImei);
#endif
}

User of UIQ 3 devices can also take a look at http://www.newlc.com/how-retrieve-p... as it appears that the API above is deprecated on this platform.

[1] The IMEI identifies the phone itself, not its user nor his subscription. These are identified by the IMSI code. Practically, this means that:
-  a user will change of IMEI but not of IMSI when he changes its phone, keeping the same subscription.
-  a user will change of IMSI but keep the same IMEI when he changes his subscription, keeping the same phone

[2] This value is set to 00 for all mobiles manufactured from 1st January 2003

Tutorial posted août 17th, 2003 by eric

Soumis par minstn (non vérifié) le dim, 2003-08-17 20:00.

Hi, as I can see the code is only valid for UIQ platform (P800).

Soumis par Anonymous le dim, 2003-08-17 20:15.

Should work on all platform.

You also have an alternative using Etel which is described in Symbian Knowledge base but which doesn't works on P800.


Soumis par Anonymous le ven, 2003-09-05 09:25.

Works fine! Great info! Thank you

Soumis par Amedee Potier (non vérifié) le jeu, 2004-01-08 15:15.

On a related thread, I was wondering how to retrieve the current phone number.

Any help would be greatly appreciated.


Soumis par Joonas Kekoni (non vérifié) le mer, 2005-02-02 16:18.

GSM phones do not know generally know their phone number.

Soumis par Anonymous le mar, 2005-03-29 20:57.

hi there ijust wanted to ask about some thing how can a mobile be attacked from an imei number

Soumis par Alexandr315 (non vérifié) le mer, 2005-06-08 09:39.

Hello all! I have Nokia 3650 And Series 60 SDK 1.2 for Symbian OS, Nokia Edition of course. Have I any chance to protect my programm? I see plpvariant.h, I see plpva.h , I see all links. What's wrong? There are good possibility to sell my job, but I can't to tune protection.Who can help me ??? SOS anybody!!!

Soumis par daz (non vérifié) le lun, 2006-05-15 09:07.

Hello,

is this code working on S60 3rd edition ?

thanks


Soumis par Anonymous le mer, 2006-09-27 15:41.

please how can define TDes in WINCE application... Under which .h or .lib it is existing ?? Thunks

Soumis par eric le ven, 2006-09-29 08:18.

This is not applicable to WinCE. This is for Symbian OS only.

Soumis par Kalderas (non vérifié) le jeu, 2004-03-18 14:45.

GetMachineIdL is not available anymore in the Series 60 SDK 2.1 beta ( perhaps also in 2.0 ). There are workarounds for this. See:

http://discussion.forum.nokia.com/forum/showthread.php?s=&threadid=32480


Soumis par Alex (non vérifié) le lun, 2004-07-26 00:04.

I would like to create a text file containing the IMEI number during istallation of a sis file.

Does code exists to put in the pkg file ?

Is that possible ? If yes, can someone put a sample code ?

thanks


Soumis par Dennis (non vérifié) le dim, 2005-09-18 04:57.

Create an exe which will retrieve and store the IMEI in a file... And make the exe run during installation.

To run the application during installation use the following options in the pkg file

Pre-Symbian OS v9.0:

".\imei.exe"-"!:\System\Apps\MyApp\imei.exe", FILERUN, RUNINSTALL

Symbian OS v9.0 and beyond: ".\imei.exe"-"!:\sys\bin\imei.exe", FILERUN, RUNINSTALL


Soumis par Marvel (non vérifié) le mer, 2005-05-18 15:22.

How do i use the codes mentioned here in retrieving IMEI? i formatted my P800 using the hidden menu and I lost my IMEI. need help

Soumis par Anonymous le mar, 2005-09-20 15:30.

Proabably you missed the starting paragraph of this article. Let me quote it here.

"a written copy of it(IMEI) can typically found behind the battery."



copyright 2003-2009 NewLC SARL