ADOBE/ ActionScript

as3 air 모바일 개발 모바일 정보, 고유 시리얼 , 모델 UDID, UUID, identifierForVendors,advertisingIdentifier 등등

AlrepondTech 2020. 9. 22. 04:28
반응형

 

 

=================================

=================================

=================================

 

 

ios android 고유 키값(기기의 고유넘버 또는 고정 시리얼) 얻기 ane 파일

모바일기기(ios,android 등등)을 adobe air로 개발중, 고유키값을 가지고 구분해야할 일이 많아서 ios 고유넘버를 쓰려고 하는데 ios6이후 개인보안 여파로 udid와 mac address 를 못쓰게 되어서 찾은 ane 파일이다. 사용법은 기존 ane 라이브러리를 추가시키고 xml에 <extensions> 확장 목록에 추가하여 빌드 시켜주면 된다. 

 

구글검색: https://www.google.co.kr/search?newwindow=1&site=&source=hp&ei=dPgfVNT4L87q8AWrmoLADA&q=%EC%95%84%EC%9D%B4%ED%8F%B0+%EA%B0%9C%EB%B0%9C+%EA%B3%A0%EC%9C%A0%EC%8B%9D%EB%B3%84%EB%B2%88%ED%98%B8&oq=%EC%95%84%EC%9D%B4%ED%8F%B0+%EA%B0%9C%EB%B0%9C+%EA%B3%A0%EC%9C%A0%EC%8B%9D%EB%B3%84%EB%B2%88%ED%98%B8&gs_l=mobile-gws-hp.12...3287.11920.0.12873.23.22.1.0.0.1.319.3441.0j20j0j1.21.0....0...1c.1.53.mobile-gws-hp..16.7.1061.3.sBwp4zwt_n0#newwindow=1&q=adobe+as3.0+identifierforvendor

 

ANE 파일 다운로드 아래 링크

AirDeviceId.ane
0.03MB

 

파일출처: https://github.com/freshplanet/ANE-DeviceId

 

API:

AirDeviceId.getInstance().getID("key"); //key값을 섞어서 고유의 키를 생성하는것 같다 이건 다른기기에도 똑같은 값을 같는 고유의 키이다

AirDeviceId.getInstance().getIDFA(); //기기의 고유번호 (advertisingIdentifier) identifies //IDFA-identifierForIdentifier

AirDeviceId.getInstance().getIDFV(); //기기의 고유번호 IDFV (Vendor ID)  (identifierForVendors) //IDFV-identifierForVendor

 

//IDFA, IDFV 관련 링크

http://tech.tapjoy.com/product-overview/sdk-change-log/tapjoy-and-identifiers?lang=ko

http://security.stackexchange.com/questions/22709/privacy-implications-of-idfa-idfv-iphone-ios

http://stackoverflow.com/questions/15984325/alternative-way-to-create-lifetime-unique-id

http://zengrong.net/post/2152.htm

 

 

 

=================================

=================================

=================================

 

 

 

IOS 관련 IDFA, IDFV

 

Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

Privacy implications of IDFA/IDFV? (iPhone/iOS)

 

Apparently, iOS 6 introduced IDFA, "identifier for advertisers", which identifies your device so that advertisers can track you and send you ads. It appears they also introduced IDFV, "identifier for vendor".
How do IDFA and IDFV work? What exactly do they identify? Are they different for each app on your phone, or are they the same for all apps on your phone?
What are the privacy implications of IDFA and IDFV? Can they be used to track you? How do they compare to UDID and to cookies on the web, as far as the privacy impact?
Do users have any way to tell which apps are gathering this information? Also, if you set "Limit Ad Tracking" to On in settings, what happens under the covers? How does that change what information apps receive?
Background: Apple Has Quietly Started Tracking iPhone Users Again, And It's Tricky To Opt Out;Apsalar's Take on Apple's Recent AnnouncementHow To Get Advertisers To Stop Tracking Your iPhone.
privacy ios
 

2 Answers

activeoldestvotes

The IDFA (advertisingIdentifier) identifies the device but is reset when the device is erased. The IDFA is intended for use by advertising networks which need to be able to identify users across apps.
As far as privacy is concerned, the IDFA is very similar to the UDID, but does the following to mitigiate the UDID privacy issues:
  1. Unlike the UDID, the user can prevent apps from accessing the IDFA, by turning on "Limit Ad Tracking" in the device settings.
  2. The IDFA is reset when the device is erased.
  3. Access to the IDFA is probably limited only to advertising networks and not available to most app developers. This is not known as fact, but is an assumption of the developers community.
The IDFV (identifierForVendors) is unique per app vendor so it doesn't present any real risk to privacy. I would guess that the IDFV is a one-way function of the UDID (which still exists - only the API was deprecated) and the vendor ID. Incidentally I suggested that Apple do this when they originally announced the deprecation of the UDID API.
 

 

Ars Technica has an article with an overview of IDFA and IDFV. It explains how these new mechanisms provide users with greater control over their privacy.
IDFA is a persistent identifier that is consistent across all apps, and thus allows cross-app tracking. However, users can disable IDFA by setting "Limit Ad Tracking" to On.
IDFV is a persistent identifier that is different for each app. This still allows tracking of users, but does not allow correlating your activities with one app against your activities with another app.
The comments on that article clarify that, if the user sets "Limit Ad Tracking" to On, then this sets a global flag (advertisingTrackingEnabled) that advertising code is supposed to check before reading the IDFA. Advertisers are supposed to write their code to check this global flag and not collect the IDFA if it is set (though there is no technical measure that prevents them from doing so; they are on their honor). Thus, in this sense it is vaguely akin to the "Do Not Track" flag. Technically, it would be possible for an advertiser to still collect the IDFA even if the user has set "Limit Ad Tracking" to On. We have to hope that Apple has a way to detect that and would ban the advertiser from the app store.

 

 

 

=================================

=================================

=================================

 

 

 

IOS, 안드로이드 각종 디바이스기기 정보 얻기. ane

 

사용법은 기존 ane 라이브러리를 추가시키고 xml에 <extensions> 확장 목록에 추가하여 빌드 시켜주면 된다. 

 

아래와같이 for문을 돌면서 각종 정보가 나온다. 

ios에서 시리얼넘버나 맥어드레스는 막혀나 나오지 않으니 참고. (개발자가 ane를 새로 업데이트해주면 나올수도..)

 

// var dictionary:Dictionary = SystemProperties.getInstance().getSystemProperites(); 

// for (var key:String in dictionary) 

//

// var readingType:String = key; 

// var readingValue:String = dictionary[key]; 

//

//

// dictionary = null;

 

ANE 파일 다운로드 아래 링크

SystemProperties.ane
0.28MB

 

 

파일출처:

https://github.com/mateuszmackowiak/SystemProperties

 

 

 

=================================

=================================

=================================

 

 

 

츌처: http://www.as3gamegears.com/air-native-extension/device-identification/

 

Device Identification Extension

TITLE SystemNFO
Extension ID com.flashvisions.mobile.android.extensions.system.SystemNFO
FUNCTION Provides access to device identification data such as, IMEI code, IMEI SV code, Device Serial Number, MODEL and IMSI code.
API LEVEL API Level 1
PERMISSIONS <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
FREE VERSION Download * IMEI and SERIAL not available in free version
BUY NOW BUY THIS EXTENSION HERE

DISCLAIMER (Read Me!)

views: 2525

Price: $0.00

ShareThis

Avg. Customer Rating:

Your Rating:  1  2  3  4  5   

2 Comments - Leave a comment

  1. Mario says:I’ve bought this document, Send me an email (code@vip.sohu.com)
  2. Thank you!
  3. December 21, 2012 at 5:55 am
  4. Mario says:’ve bought this document.
    download package ? where? URL?
  5.  
  6. December 21, 2012 at 7:06 am

Leave a Reply - Quote

- See more at: http://flashvisions.com/goodies/air-android-extensions/device-identification/#sthash.OOVdq2fo.dpuf

 

Device Identification is a Native Extension  that provides access to device identification data. It is possible to read the IMEI code, IMEI SV code, Device Serial Number, MODEL and IMSI code.

Sample

import com.flashvisions.mobile.android.extensions.system.data.DeviceIdentity; import com.flashvisions.mobile.android.extensions.system.SystemNFO; var systemInfo:SystemNFO = new SystemNFO(); var result:DeviceIdentity = systemInfo.getDeviceIdentity(); trace(result.IMEI); trace(result.IMEISV); trace(result.IMSI); trace(result.MODEL); trace(result.SERIAL); trace(result.PHONENUMBER);

 Air Native ExtensionAndroid  CommercialFreeURL.

 ANE StoreKit

Anthill 

last reply was november 24, 2012

 

  1. YopSolothx for that !
  2. November 23, 2012
  3. DovyskiYou’re welcome!
  4. November 23, 2012
  5. Chris5$ and thats work only on android ?
  6. January 2, 2013
  7. DovyskiIt’s not that bad Chrishave you test to build an ANE like this one ?
  8. January 2, 2013
  9.  I agree that it could be much better if iOS was supported as well.
  10. January 2, 2013
  11. DovyskiNo, I haven’t. In fact I never tried to build any ANE so far.
  12. January 2, 2013
  13. BayoHi, can’t access the files. Links please.
  14. January 3, 2013
  15. DovyskiHi Bayo! Looks like their website is down for now. I am not an affiliate or something, I just listed their ANE here. I am afraid you will have to wait until the website is back online.
  16. January 3, 2013
  17. ChrisHi, i have build a free version
    https://github.com/goabonga/DeviceIDExtension
  18. January 3, 2013
  19. DovyskiHey there! That’s awesome! I will add your version to the site tomorrow. Thanks!
  20. January 3, 2013
  21. Chrisif you have ideas for others extensions, send me an email, i can build it 
  22. January 3, 2013
  23. DovyskiThat’s outstanding! Thank you again for the contribution.
  24. January 3, 2013
  25. Adobe AIR Native Extensions for Mobile-24/7 Software[...] Device Identification Native Extension that provides access to device identification data. It is possible to read the IMEI code, IMEI SV code, Device Serial Number, MODEL and IMSI code. [...]
  26. January 15, 2013
  27. BayoHi Chris, can you please walk me through now to use the extension? I have it downloaded already. And while at it, is it applicable to iOS too or just Android? Thanks
  28. February 17, 2013
  29. pedro vicentenot work with Flash Professional CS5.5
  30. April 11, 2013
  31. sanu philipHow to use this for action script 3?
  32. September 6, 2013

 

 

 

반응형

 

728x90

 

 

 

=================================

=================================

=================================

 

 

 

출처: http://forum.starling-framework.org/topic/detect-device-modelperformance

  1. Hi all,POSTED 2 YEARS AGO #
  2. Is there any way to detect which device (i.e. iPhone4, 4S etc) an Air app is running on?
  3. ctp2ndThe flash.system.Capabilities class has some useful information you can use to guess which device your app is currently being viewed on. You could do something like:
  4. Novice Bird
    Joined: Feb '12
    Posts: 8
package
{
  import flash.system.Capabilities;
 
  public class MyClass extends Sprite
  {
    private var _device:String;
    public function MyClass()
    {
      var resolutionY:Number = 960; // picking a default device to emulate
                                    // iPhone 4's resolutionY is 960
      if (!Capabilities.isDebugger) // quick check to see if we're using the debugger
      {
        resolutionY = Capabilities.screenResolutionY;  // if not, use the device's
                                                       // resolution.  When using the
                                                       // debugger the screenResolutionY
                                                       // will reflect your monitor's
                                                       // screenResolutionY, not the
                                                       // debugger player.
      }
      // a shorter way to do the above
      // var resolutionY:Number = (!Capabilities.isDebugger)?Capabilities.screenResolutionY:960;
      if(resolutionY == 960)  // now we just guess the device based on that resolution
      {
        _device = 'iphone4'; // high def iphone (4, 4s)
      }
      else if (resolutionY == 480)
      {
        _device = 'iphone';  // low def iphone  (3g, 3gs, iPod Touch)
      {
      else if (resolutionY == 1024)
      {
        _device = 'ipad';  // ipad ( 1 & 2)
      }
      else if (resolutionY == 2048)
      {
        _device = 'ipad3';  // ipad (3) supposedly
      }
    }
  }
}

There is probably a better way to do this and hopefully someone will share that. This is, at the most basic level, functional.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Yes, this is a good approach.

Or you can use a native extension (ANE) if you want to rely on native APIs on the OS t detect this or get more detailed information about the device.

Thibault

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks for the responses. I really need to be specific on the phone model and need to differentiate between and an iPhone 4 and a 4S as these have significantly different performance. Not sure whether to apply some benchmark test when the game loads or to go for an ANE.

I'll mull it over. Thanks for the help guys!

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

We are told many times in docs not to use Capabilities.os to control application logic (though Adobe's flashx.textLayout lib does).

Let the user beware, but in the current impls of AIR mobile, Capabilities.os on iOS platforms will return strings like 'iPhone OS 5.0.1 iPad2,2" or 'iPhone OS 5.0.1 iPhone3,1' where the actual hw.machine sysinfo text is included at the end.

So again, you might not want to rely on this but given the naming conventions, a lowercase.indexOf('iphone3,') or lowercase.indexOf('iphone4,') will distinguish 4 from 4S.
(Search the web for multiple listings of current hw.machine values in iOS.

Including the comma at the end as a distinguisher helps ignore the variants but also won't break you when the iPhone 10 comes out 

Not advocating this solution one way or the other personally if there are other feature ways of distinguishing models...

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Definitely a preliminary benchmark is the way to go, it will work anywhere you deploy. This is something that even guys from Adobe are thinking about doing natively but its actually pretty easy to implement yourself.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Yes, I'd rather go for the benchmark. I'm not 100% sure of the best way to approach performing this test though. I will do some digging, but in the meantime if anyone has a tried and tested method that they would describe, it may help.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I would go for pure fillrate test, I mean thats the major hog for all games anyway. Unless you are doing some heavy logic, AI or physics that may impact the CPU significantly which is simply not going to happen in 99% of games.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Capabilities.screenResolutionY will not render 2048 with the new iPad (iPad 3). I have the 3rd generation iPad and the iPad 2 and both render the same "screenResolution" as well as dpi (which is showing 132 on both iPad 2 and the new iPad). What we need is a way to gather the ppi since those numbers are different I think, but I don't know how. Anybody?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have different layouts and graphics for the different devices in my IPA, so this was pretty important. Figured I would share my findings.

I tested out Jeff's suggestion above and that method works on the new iPad (iPad 3). 

Here is my code that worked on my iPad 2, new iPad and my iPhone 4S:

var myOS:String = Capabilities.os;
var myOSLowerCase:String = myOS.toLowerCase();
 
if(myOSLowerCase.indexOf("ipad3,", 0) >= 0) {
 // go to Scene for new iPad 3
} else if(myOSLowerCase.indexOf("ipad2,", 0) >= 0) {
 // go to Scene for iPad 2
} else if(myOSLowerCase.indexOf("iphone4,", 0) >= 0) {
 // go to Scene for iPhone 4 and 4S
} else {
 // trace("not detected device"); // Probably should have a catch all and show iPhone 4 version - since that would scale the best
}

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

this little bit of code is what i've been using in all of my starling based games because, well, i can. As we said back in my youthful days: She ain't the prettiest sheep in the flock, but she'll do well enough for me. 

// =================================================================================================
//
//  ctp2nd's constants / iOS device detect-o-matic
//	This is probably far from optimal, but, as I tell my wife, 'It was good for me.'
//  <a href="http://www.ctpstudios.com" rel="nofollow">http://www.ctpstudios.com</a> | ctp2nd @ gmail / gtalk / twitter
//
// =================================================================================================
 
package
{
	//
	import flash.geom.Rectangle;
	import flash.system.Capabilities;
 
	public class Constants
	{
 
		// first check to see if we're on the device or in the debugger //
		public static const isDebugger:Boolean = Capabilities.isDebugger;
		// set a few variables that'll help us deal with the debugger//
		public static const isLandscape:Boolean = true;  // most of my games are in landscape
		public static const debuggerDevice:String = "iPhone3"; // iPhone3 = iPhone4,4s, etc.
 
		// we create an object here that'll keep a detailed abount of the current environment.
		public static const DeviceDetails:Object = getDeviceDetails();
 
		public static const GameWidth:int  = DeviceDetails.width;  // set an Easy reference for Height & Width
		public static const GameHeight:int = DeviceDetails.height; 
 
		public static const CenterX:int = DeviceDetails.x;  // Calculate the CenterX & Y for the screen
		public static const CenterY:int = DeviceDetails.y;
 
		// I find that having a rect that accurately represents the screen size is useful, so I make one here for both main orientations.
		public static const GameScreenLandscape:Rectangle = new Rectangle(CenterX, CenterY, GameWidth, GameHeight);
		public static const GameScreenPortrait:Rectangle = new Rectangle(CenterY, CenterX, GameHeight, GameWidth); 
 
		public static function getDeviceDetails():Object {
			var retObj:Object = {};
			var devStr:String = Capabilities.os;
			var devStrArr:Array = devStr.split(" ");
			devStr = devStrArr.pop();
			devStr = (devStr.indexOf(",") > -1)?devStr.split(",").shift():debuggerDevice;
			if ((devStr == "iPhone1") || (devStr == "iPhone2")){
				// lowdef iphone, 3, 3g, 3gs
				retObj.width = 480;
				retObj.height = 320;
				retObj.x = 240;
				retObj.y = 160;
				retObj.device = "iphone";
				retObj.scale = 1;
			} else if ((devStr == "iPhone3") || (devStr == "iPhone4") || (devStr == "iPhone5")){
				// highdef iphone 4, 4s, 5?
				retObj.width = 960;
				retObj.height = 640;
				retObj.x = 480;
				retObj.y = 320;
				retObj.device = "iphone4";
				retObj.scale = 2;
			} else if ((devStr == "iPad1") || (devStr == "iPad2")){
				// ipad 1,2
				retObj.width = 1024;
				retObj.height = 768;
				retObj.x = 512;
				retObj.y = 384;
				retObj.device = "ipad";
				retObj.scale = 1;
			} else if ((devStr == "iPad3")){
				//what ipad 3... i mean 'The new iPad', sorry
				retObj.width = 2048;
				retObj.height = 1536;
				retObj.x = 1024;
				retObj.y = 768;
				retObj.device = "ipad";
				retObj.scale = 2; // oops!  thanks for pointing that out
			} else {
				//Wait, it wasn't ANY of those devices?  Oh well, lets make an ASS of yoU and ME
				//I'm assuming the OS reported something stupid, so we'll default to the high def iPhone graphics
				retObj.width = 960;
				retObj.height = 640;
				retObj.x = 480;
				retObj.y = 320;
				retObj.device = "iphone4";
				retObj.scale = 2;
			}
			return retObj;
		}
 
	}
}

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

To detect a device its best to use the "os" property of the flash.system.Capabilities class.

For Apple's devices, it returns the "internal name", refer to this wiki -
iPhone -
http://theiphonewiki.com/wiki/index.php?title=IPhone
iPad -
http://theiphonewiki.com/wiki/index.php?title=IPad
iTouch -
http://theiphonewiki.com/wiki/index.php?title=IPod_touch

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


 

=================================

=================================

=================================

 

 

반응형