Coder Social home page Coder Social logo

openudid's Introduction

##IMPORTANT NOTE

Please read this blog post before considering using OpenUDID:

http://blog.appsfire.com/udid-is-dead-openudid-is-deprecated-long-live-advertisingidentifier/

####OpenUDID project notes

IMPORTANT: IF YOU ARE GOING TO INTEGRATE OpenUDID INSIDE A (STATIC) LIBRARY,
PLEASE MAKE SURE YOU REFACTOR THE OpenUDID CLASS WITH A PREFIX OF YOUR OWN,
E.G. ACME_OpenUDID. THIS WILL AVOID CONFUSION BY DEVELOPERS WHO ARE ALSO
USING OpenUDID IN THEIR OWN CODE. 

image

####Follow OpenUDID on Twitter http://twitter.com/OpenUDID

####Who is behind OpenUDID The project was initiated by Yann Lechelle (co-founder Appsfire) on 8/28/11

Many have joined the effort since. Please browse this github projects to discover the many contributors (discussions, code, pull requests, alternative branches, etc…)

####Master Branches & ports to other OSes

####Usage

#include "OpenUDID.h"
NSString* openUDID = [OpenUDID value];

####Synopsis OpenUDID is a drop-in replacement for the deprecated uniqueIdentifier property of the UIDevice class on iOS (a.k.a. UDID) and otherwise is an industry-friendly equivalent for iOS and Android, and most recently Windows C# and Silverlight (see links above).

The agenda for this community driven project is to:

  • Provide a reliable proxy and replacement for a universal unique device identifier. That is, persistent and sufficiently unique, on a per device basis.
  • NOT use an obvious other sensitive unique identifier (like the MAC address) to avoid further deprecation and to protect device-level privacy concerns
  • Enable the same OpenUDID to be accessed by any app on the same device
  • Supply open-source code to generate and access the OpenUDID, for iOS and Android
  • Incorporate, from the beginning, a system that will enable user opt-out to match Apple’s initial intent

####Context If you’re not already familiar with UDID’s, it’s a critical piece of information used for analytics or CRM purposes. A developer could use a UDID as a means to track how much time a user spent in his free app before upgrading to the paid version. UDIDs are also helpful for tracking the source of a download when advertising on an ad network. This is a fairly universal need in a thriving ecosystem: developers need the traceability from clicks to downloads to ensure that they pay the right price for their promotion. Proper tracking and funnel conversion is what has made the web a better place, with healthy competition and quantifiable metrics.

In the wake of Apple’s decision to deprecate UDID, some ad networks have already introduced their own proprietary solutions or worse adopted a low hanging fruit like the MAC address. The main motivation here was to find a UDID replacement not owned by any single provider, not bound to the device in the hardware sense. This open source initiative is to enable a better solution for thousands of other mobile app developers.

#####Version History

####Contributions needed Equivalent OpenUDID systems on Blackberry, other platforms, etc...

####Seals to add on your sites if you use OpenUDID image image image

openudid's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openudid's Issues

Don't force ARC

I'd like to propose reverting this commit #20, where usage of ARC became a requirement. A number of publishers in our ad network have users who are running on iOS versions 4.2 and below, which causes crash issues for them. Whether or not using ARC is considered the "right way" to do things, this becomes a blocking issue for us as we can't just cut out a portion of our user base. I can only assume that this would also be a blocking issue for others as well who are potentially considering OpenUDID, since we must support all devices and OS versions at the end of the day.

OpenUDID Crashed

Detail crash info below:

com.apple.root.default-overcommit-priority
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xf16ea5a6

0 libobjc.A.dylib objc_msgSend + 1
1 CoreFoundation -[__NSDictionaryM objectForKey:] + 144
2 UIKit +[UIPasteboard pasteboardWithName:create:] + 236
3 xxxiPhone OpenUDID.m line 222
+[OpenUDID valueWithError:]
4 xxxiPhone OpenUDID.m line 173
+[OpenUDID value]

UIPasteboard leak in OpenUDID.m

Instruments is reporting a leak when running my application that is originating in OpenUDID.m around line 192:

UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:slotPBid create:NO];

It's not a huge leak, but it would be nice to have it sorted. I haven't been able to track down why this is happening, otherwise I'd submit a pull request — do you have any idea why it's happening?

Update podspec to current head

Could you please retag and update the podspec to point to the current head. This will remove some warnings and things that have been fixed months ago but aren't accessable via Cocoapods. Thanks

cfstring leak

XCode 4.5 analyzer reports a leak of cfstring in _generateFreshOpenUDID. The string allocated by this line is never released:

    CFStringRef cfstring = CFUUIDCreateString(kCFAllocatorDefault, uuid);

I suggest adding "CFRelease(cfstring);" after the CFRelease(uuid).

New OpenUDIDs generated on each call to [OpenUDID value]

Currently the implementation of [OpenUDID value] generates a new OpenUDID with each call because of two reasons:

  1. it fetches data from the pasteboard expecting it to be of type NSDictionary when it is actually stored as NSData. As a result, the check on line 93 to see whether the item returned from the UIPasteboard is of type NSDictionary will always fail. It should instead verify that the item is of type NSData.
  2. In the case that there is no data in the OpenUDID pasteboard, the variable dict is not properly initialized to be a new NSMutableDictionary, so nothing ends up getting stored.

The fix to both of these issues is to replace the initialization of dict on line 93 with the following:

NSMutableDictionary* dict = item && [item isKindOfClass:[NSData class]]
? [NSMutableDictionary dictionaryWithDictionary:[NSKeyedUnarchiver unarchiveObjectWithData:item]]
: [NSMutableDictionary dictionary];

modify openudid source code

  1. there 're 2 app , the first one use normal openudid but the second one modify openudid source code. If it possible that the second one will replace the first.?

OpenUDID Persistence

I've been looking at the history of this project and it strikes me that the device Keychain is not being used at all in the current version. This confuses me. While the keychain CANNOT be used to SHARE the OpenUDID across other apps (that's why the UIPasteboard implementation was used), it CAN be used to guarantee persistence across installations when only one OpenUDID enabled app has been installed. Using the keychain as a back-off persistence mechanism removes PART of the "UDID Reset" issue when all OpenUDID apps on a particular device have been removed. If the user then reinstalls any of the previously installed OpenUDID apps, then they get the same UDID back. If they install a DIFFERENT app first, then a new UDID would still be generated, and the code would have to account for that... but this may provide some small additional persistence where there is currently none?

RespondToSelector uniqueIdentifier should be removed

We are using openUDID as part of a multifaceted solution to UDID deprecation. In our implementation, we have removed the lines of code I have listed below from the openUDID source files.

This code should be removed from the openSource project for two reasons, A) uniqueIdentifier is deprecated and B) If Apple simply changes the property to no longer send a unique identifier (all 0's or some other non-unique value) but still responds to the property, the openUDID project will not create an openUDID value.

if([UIDevice instancesRespondToSelector:@selector(uniqueIdentifier)]){
_openUDID = [[UIDevice currentDevice] uniqueIdentifier];
}

OpenUDID persistence and Potential Crash

Hi,

I've looked through the code, as I'm interested in the idea and am considering using openUDID. I have some concerns about it, however, and was wondering if maybe I'm misunderstanding something.

  1. Please correct me if I'm wrong, but as far as I understand, a UIPasteboard key-value pair created by an app vanishes when the app is deleted. As far as I understand, that's the purpose of the redundant 100 UIPasteboard slots you've employed. Nevertheless, am I correct in saying that if every OpenUDID-enabled app was removed from a device and then another OpenUDID-enabled app was installed on it, a new unique OpenUDID would be created for that device?
  2. Here I'd like to refer to the following code from the + (NSString*) _getOpenUDID function:

// One day, this may no longer be allowed in iOS. When that is, just comment this line out.
//

if TARGET_OS_IPHONE

_openUDID = [[UIDevice currentDevice] uniqueIdentifier];

endif

If I (and others) were to build OpenUDID into their apps, when Apple discontinues uniqueIdentifier, this will result in a crash. I understand, we can then comment out this line and rebuild the apps and things will work again, but in the meantime, there would be an avalanche of crashes sweeping the OpenUDID-land. Would this not be a more bulletproof solution:

if([UIDevice instancesRespondToSelector:@selector(uniqueIdentifier)]){
_openUDID = [[UIDevice currentDevice] uniqueIdentifier];
}

I appreciate you working on this problem and let me know what you think if you have time.

vova

OpenUDID value changes on resetting the device

I am testing OpenUDID just by printing it out on a label. I deleted the app and reinstalled it again. The number remained unchanged. But, when I reset the device to the factory settings, and then installed the app again, the number changed. is this faced

NSString * openUDID = [OpenUDID value];
NSLog(@"The value is %@",openUDID);

[idLabel setText:openUDID];

I tried uninstalling the app and running it again in the device, the OpenUDID value doesn't change. However, when you reset the device and run the same app again, the OpenUDID value changes, Am I doing something wrong? Or is this the way it should work.

Please advise.

openUDID location

Does openUDID value collected in both of share and local storage?

EXC_BAD_ACCESS on iOS6

  • (NSString_) valueWithError:(NSError *_)error{
    lind 267:UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:slotPBid create:NO];
    }

OpenUDID is not unique across devices

Suppose that a user has your application installed on device A. The user then buys a new device, device B. The user creates a backup of device A using iTunes and then restores it onto device B.

When the user launches your application on device B, it will report the same udid as device A because this information is read from NSUserDefaults (which was copied from device A to B during the backup/restore).

Backup a device and restore it to a new device

Consider the following scenario:

I have a device with application installed using the OpenUDID.

I do backup of the iOS and then restore it on another device.

What will happen is two devices with the same identifier, no ?

Returns different OUDIDs under iPhone sim 5.1

I'm using OpenUDID, unmodified, to replace the deprecated Apple-provided uniqueIdentifier api.

When compiling for iOS 5.1 everything works fine, except that [OpenUDID value] returns a different value every time the application is relaunched (I'm using the 5.1 Simulator). It seems unable to store the value persistently.

Going through the code with the debugger, I can see the lines:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString * guuid = (NSString *) [defaults objectForKey:kAppGUUID];

...returning always guid==nil.

Am I doing something wrong?

OpenUDID privacy problem?

Currently OpenUDID exposes the bundle id and installation time of every application that uses OpenUDID. This seems unnecessary, and adds a significant privacy problem that didn't exist with the old UDID system.

Previously, sharing of information like this was explicit between partners, and typically the only people who had access to this kind of information was the ad networks. Now, any developer would be able to tell which apps are installed on the device, when the app was installed, and if an app was uninstalled (watch it disappear from the pasteboard).

This seems to be a much larger privacy concern than the original UDID ever presented, but it should also be possible to side step it entirely.

If instead of storing the bundle id, a guid was generated by each application (and stored with the application in the prefs) then you would never be able to tell which install was what. The key is that you don't use the same value for each installation of the application.

NSUserDefaults has not been synchronized.

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]
this defaults has not called [defaults synchronize] in [OpenUDID valueWithError:].
I think this should be a bug.

OpenUDID doesn't work on iOS 7

I have an application use OpenUDID on iOS 7. After installing the application, my UDID is AAAAA but after reinstalling, it's BBBBBB, they are not the same! But with iOS6 or less, they are the same!

Crashed with method +[OpenUDID valueWithError:], on iPhone 5s, iOS 10.1.1

Got crashed on iPhone 5s ( iOS 10.1.1) once I launched my app, but It got self-recovered after restart my iPhone. Is there Anyone facing the same annoying issue?

Here's the crash log below.

Incident Identifier: 2CB0CD31-2816-403B-904E-1853D1AD9B6D
CrashReporter Key: 77e9b2c94bb52416d5ddc0f8771f37ff7e96495d
Hardware Model: iPhone6,2
Process: [2055]
Path:
Identifier:
Version: 49 (1.0.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: [1394]

Date/Time: 2016-12-21 16:13:48.7664 +0800
Launch Time: 2016-12-21 16:13:28.5736 +0800
OS Version: iPhone OS 10.1.1 (14B100)
Report Version: 104

Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Triggered by Thread: 0

Filtered syslog:
None found

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018aa681a8 semaphore_wait_trap + 8
1 libdispatch.dylib 0x000000018a9537ec _dispatch_semaphore_wait_slow + 216
2 UIKit 0x0000000192138624 _existingItemCollectionWithName + 880
3 UIKit 0x000000019213802c +[_UIConcretePasteboard _pasteboardNamed:createIfNotFound:] + 264
4 UIKit 0x0000000191bdf37c +[UIPasteboard(Private) _pasteboardWithName:create:] + 148
5 YesIDo 0x0000000100322e14 +[OpenUDID valueWithError:] (OpenUDID.m:212)

Does this actually, you know, work?

According to the project agenda in the README:

  • Enable OpenUDID to be accessed by any app

I assume this means the SAME OpenUDID for all apps that use it? How is that possible? The keychain does NOT allow sharing of keychain data between apps unless they belong to the same Keychain Access Group. See http://developer.apple.com/library/mac/#documentation/Security/Reference/keychainservices/Reference/reference.html for more information - but the gist of it is only apps released by one develop can share keychain items.

Without the ability to share the OpenUDID between apps you've really just re-invented CFUUIDCreate.

OpenUDID crashes on iOS 6

I got several crash reports that indicates
At line 265 OpenUDID.m
[OpenUDID valueWithError:] causes the crash by calling
[UIPasteboard pasteboardWithName:create:]

Exception Type: EXC_BAD_ACCESS
Code: KERN_INVALID_ADDRESS at 0xc1fdd899

There are ~2% probability for the App to crash.

Possibility of compromising OpenUDID

It seems that both SecureUDID and OpenUDID have a possibility of a third party modifying the base UID that both libraries rely on and compromising the SecureUDID/OpenUDID.

A third party could write a paste a pasteboard with the same format and with the same naming schema. If the third party app was installed before any OpenUDID apps were installed (or if there was just one OpenUDID app), valid OpenUDID apps installed after would copy the base UID the third party created as a valid OpenUDID.

The best solution might be providing a closed source library that uses a signature to sign and validate valid pasteboards.

A few questions

Hi,

I represent an ad network and for the last few days I have been looking for ways using which we can track iOS app installs. openUDID seems to be the solution we were looking for but the problem is that I don't understand it fully. I googled a lot before posting here on how to use it, how it works, what's the technique etc etc. but couldn't find anything. I know HTML, javascript and a little about android programming but don't have iOS experience at all.

Is there a tutorial or description of the system? I am looking for answers to the following questions:

How can we get unique ID from a user's browser?
Where is that unique ID stored? as in when the same user installs the app and your code runs, where does it look for comparison?
What are the information that openUDID fetches from the device to create a fingerprint/UDID?

Sorry to pose these question here and starting a new topic but I couldn't find this info on github or anywhere else.
Thanks in advance for the help!

License?

Put on a license.

Currently it's public domain, but also some people won't use it if there's no license on it.
Choose a very open one that doesn't require attribution, like a BSD.

crash on iOS 4.x (arc problem)

Project is not using ARC and base IOS 4.0

Added to project as described (including -fobj-arc for OpenUDID.m).
Runtime crash on iOS 4.3.3 on:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

dyld: Symbol not found: _objc_retainAutoreleasedReturnValue

Cannot remove OpenUDID from project

Hi all,
I have a project where OpenUDID was used. Then was decided to move from it to IDFV(identifier for vendor). Now there's a problem. Every time app starts there's a OpenUDID dictionary no matter what happens.
What i have already tried:

  1. removing OpenUDID dictionary from user defaults and calling synchronize afterwards
  2. going though cycle(1..100) to create name for uipasteboard. then set nil for pasteboard type that OpenUDId used. remove that pasteboard.
    but still, nothing helps. Every time app starts, that dictionary in user defaults get overridden with new values.
    Thank you for any help.

Memory leak in valueWithError method

NSString * guuid = [(NSString *) [defaults objectForKey:kAppGUUID] retain];
if(guuid == nil)
{
//generate a new uuid and store it in user defaults
CFUUIDRef uuid = CFUUIDCreate(NULL);
guuid = (NSString *) CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
}

if guuid was nil and created within the if block, it is never released

40 chars UDID is returned sometimes but my app expects it only 36 char

Hi ,

I have found that sometime this OpenUDID returns 40 char UDID but i always need id to be 36 chars as returned by CFUUIDRef . Although i have commented out the code "_openUDID = [[UIDevice currentDevice] uniqueIdentifier];" in + (NSString*) _getOpenUDID function.

Is that beacuse some other app is using this line and thus generating 40 char id and this shared id using UIPasteboard is getting picked up and returned to my app??

Its really urgent. Please help how to get rid of this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.