The function
[[UIDevice currentDevice] uniqueIdentifier]
Is deprecated in iOS 5 and I found the solution in this project using the MAC address: https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5
Ok, it is solved. But now I discovery that iOS 5 CHANGED the format of code that uniqueIdentifier return.
In iOS 4.x it is in this format:
93F38DEB-3C0B-5C09-B746-0DFDFDDB297C
Now the iOS 5, the same function return in this format:
93f38deB3c0b5c09b7460dfdfddb297c
Anyone know if the code changed at all? It is different only is format or the code in really different for the same device?
A MAC Address is a (supposedly) globally unique identifier attached to a network interface, though they can be changed in many ways.
The uniqueidentifier that Apple used to provide access to was attached to the device hardware and not changeable, which made it excellent for tracking a user across apps and sessions. That's also the reason Apple is removing it, if I had to guess. Not having a way to track users across apps and sessions increases a user's privacy on their devices.
I wouldn't be surprised if Apple removes access to the MAC Address eventually for the same reasons, so it might benefit you to examine other options for tracking devices.
[[UIDevice currentDevice] uniqueIdentifier] will still give you the same result as before. The project that you link to is not a 1:1 replacement, it is an alternative that gives you a similar solution using a different implementation, thus the two string are different.
You shouldn't use unique identifier on iOS 5. That's all you need to know.
The unique identifier on iOS was always something redundant and a big security threat. Other operating systems don't have unique identifiers and they can live without them.
You can always generate unique identifiers on your server and send them to your device.
You can always generate them from some unique system property (e.g. MAC), using system functions. On iOS you can create a unique identifier using CFUUIDCreate. This identifier is unique across devices and across time (you'll get a different identifier every time you call it) but you can save them (e.g. into keychain).
The code CHANGED!!!!!
UniqueIdentifier is no more UNIQUE!!!
The first format have 36 hexa lenght
93F38DEB-3C0B-5C09-B746-0DFDFDDB297C
The second have 40 hexa!!!!!
Because this, it changed. I don't know if it append more hexa to identifier, but the bigger size changed al all.
Related
I recently used the website iphoneimei.info, and I was wondering if there is any way to obtain any or all of the following using Objective-C (with the IMEI and Serial Numbers):
The iPhone's Activation status
First and/or Most Recent activation dates
Expiration date(s) for Support, Repairs, & Service coverage
The iPhone's firmware version
If the SIM card is locked (if the iPhone has one)
I am already aware of the fact that getting the IMEI (and Serial) numbers is not possible, at least on the latest iOS versions and devices, so if there is any way to programmatically obtain the following information, please let me know.
Also, if this is not possible in objective-c, but rather in another language, please let me know. My base goal is to understand how online services (like iphoneimei.info) work, and what enables them to obtain their information (that is, specifically to do with the code).
I seen a website month ago that shows the general info of an iDevice, of them, it's type/ios version..etc
but i currently cant find it anymore, does anyone know what else can do the same process ?
You can define the device type on your developer's account page in "Certificates, Identifiers & Profiles" section. Unfortunately it contains only a small thumbnail of the device and also may include model's serial number (but not always)
To get device information, such as the UDID, you can use this:
[[UIDevice currentDevice] uniqueIdentifier];
If you want other information, such as orientation, system version, system name, etc, then just change uniqueIdentifier to the value you want. If you hold down option + esc or look at the link lawicko posted, then you can see some of your extra options.
Are you talking about the UDID or the Serial number?
The UDID is basically a SH1 hash of the serial number, ECID, wifiMAC, and the bluetoothMAC.
There is no public database of UDID's, so I doubt what you are refering to has to do with UDIDs.
If it involves the device's serial number, you can make reference to the site below:
https://selfsolve.apple.com/agreementWarrantyDynamic.do
In iOS 5 the usage of [[UIDevice currentDevice] uniqueIdentifier] got deprecated. We are now encouraged to use own-generated UUIDs and store them in the app's NSDefaults. That's OK for most usage, I guess.
But my question is - is it possible to generate somehow the UUID that would behave like the device ID right now - I would like to keep it the same even after the application is removed and reinstalled. The purpose of this is to help tracking possible fraud tries taken from the iPhone.
I'm wondering if usage of MAC-address, as with this category: https://github.com/erica/uidevice-extension/blob/master/UIDevice-Hardware.m would be OK?
The discussion for the uniqueIdentifier property in the documentation states:
Do not use the uniqueIdentifier property. To create a unique
identifier specific to your app, you can call the CFUUIDCreate
function to create a UUID, and write it to the defaults database using
the NSUserDefaults class.
Writing it to the user defaults should ensure that it is kept if the app is removed/reinstalled I would have thought.
Edit:
Sorry, they are not kept when an application is removed apparently. The documentation describes how to generate a UUID but I can't find out whether it is constant for a given user/device. I have seen some people proposing the use of keychain for persistence through app removal/re-installation but don't know how recommendable it is (and in any case the user can, I suppose, remove the entries).
Create your own UUID using the method described by Apple (the one pointed out by jbat), store it in NSUserDefaults.
Using iCloud you can then use the Key-value store to help 'persist' this UUID to a specific user, between installs and different devices.
Duplicate: Validate iPhone device Ids?
Does anyone know what constitutes a valid iPhone UDID?
Context: I am working on some session code for a server that interacts with iPhones, and was going to use the iPhone's UDID as a unique identifier. However, I can't seem to find any resources on the range of valid UDIDs, and I want to know exactly what I can expect coming from an iPhone.
Clarification: I'm not asking about how to validate an iPhone UDID as a legitimate iPhone UDID, I'm trying to figure out the range of UDIDs. For example, in programming languages there are specs on what you can use to name your variables (starts with a letter, contains letters and numbers, etc.). I want the same sort of spec for the UDID.
It is a 40 character hex string. There is no spec or doc out there that specifies the layout to this string.
I'm not really sure how you can determine what is 'valid' since only Apple knows which UDID are real and which are false.
My best guess, given the various UDIDs that I've seen, they are 40 characters in length, consisting of alphanumeric characters. (a-f0-9)
Actually, the iphone simulator udid has dashes and is 36 hex characters long.
For example:
002ebf12-a125-5ddf-a739-67c3c5d20177
Though I have only seen actual iphone udid's with hex only chars and 40 long.
No, there is no way to do so. This question asks the same thing: Validate iPhone device Ids?
UPDATE:
From what I've seen, the device ID is a 40 character hex string (0-9 and a-f). Apple's documentation for the deviceIdentifier property of UIDevice states:
A unique device identifier is a hash
value composed from various hardware
identifiers such as the device’s
serial number. It is guaranteed to be
unique for every device but cannot
publically be tied to a user account.
You can use it, for example, to store
high scores for a game in a central
server or to control access to
registered products. The unique device
identifier is sometimes referred to by
its abbreviation UDID.
Most are 40 character HEX strings; we have 1 in our company that is 41 characters and is authorized in the dev center for Beta apps. Only way to add it was via safari however so worth noting if anyone gets the same.
try following regex ^([A-F0-9]{40})$
or you could go here and just paste it.
Hope this saves you some time.
I know each iPhone has a electronic identifier other than the phone # or ESN - how do I call it and what does it return?
The UIDevice class contains the information you need.
[[UIDevice currentDevice] uniqueIdentifier]
If you need security, then you probably can't use the device's built-in unique identifier, because one could easily spoof this information. I'm just guessing here, but, most likely, from your server's perspective there's an incoming connection/request that contains the phone's ID. Now, how can you be really sure the connection/request is actually coming from the iPhone with that ID?
One solution is to issue each new device that connects to your server with a unique ID of your own in a secure way (i.e., the ID can't be obtained by a third party). You then need to use a secure protocol whereby a connection/request proves to your server that it originated from a device that knows the above ID.
if you are writing a web app, why don't you use standard cookies?