Getting Device ID for Licensing

MDEnt

Member
Licensed User
Longtime User
I'm trying out the Licensing Library... I was originally playing around with the Phone library method of doing things, but I am now using the Unique ID method that uses the Reflection library found in this thread

I'm wondering what the syntax is to replace this line below:

Code: Copy
lc.Initialize("lc", p.GetDeviceId, publicKey, "kljdflkf".GetBytes("UTF8"))

I've tried a few ways & can only get licensing to work when using the phone library (p.GetDeviceId).

Thanks!
 
Yes GetDeviceId is what I have been trying. I'm not actually getting an error - it seems like just no value being returned possibly.

For example I have placed a few toastmessages/msgboxes along the way as a trail - and I cannot seem to get a value for GetDeviceId or lc.SetVariableAndValue. At one point I had seen an "unknown" as a result for GetDeviceId (stock Samsung Galaxy S2 Epic 4G Touch). I didn't know if that was a problem in my code or it just can't determine the Id.

I am essentially using the Licensing library example and the Unique Id example together.

UPDATE: before submitting this reply, I was able to quickly test on an HTC EVO 4G - got a blank value for lc.SetVariableAndValue but did get a device ID for the HTC - also received an ID fine on a Kindle Fire.
 
Upvote 0
I did some more playing around and...

with API < 9 (As is in the example code)

Non-rooted stock ROM Samsung Galaxy S2 Epic 4G Touch - Unknown
Non-rooted stock ROM Kindle Fire - Device Id returned
Rooted HTC EVO 4G with stock ROM - Device Id returned
Rooted Kindle Fire with CM7 custom ROM - Unknown

when I set the API < 11

All 4 devices receive a random Id and go through the license check OK.

Is it feasible/recommended to bump up the API to 11 or just assign a random ID to all devices and skip the check? I saw that in another thread an "unknown" was also being reported by a Sony E Xperia Arc S. I would imagine there are quite a few Samsungs/Sonys out there plus others yet to be discovered that may report "unknown" and give a problem during the license check.
 
Upvote 0
Not good idea to use the deviceID for license, since that you can change the deviceId from build.prop (if the device is rooted)
 
Upvote 0
Back
Top