Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: ANE

yes, but mine is still referencing 4.5.1 SDK (which is uninstalled).

 

Wondering where to re-configure to use 4.6 SDK.

 

Regards,

Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: ANE

ok - its set on the export screen itself: Air SDK

 

now, says

:

Invalid swc file. The extension NameSpace requires the SWF verison to be 13 or lower.

Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: ANE

this is so much fun:

 

changed xmls 2.5 to:

<extension xmlns="http://ns.adobe.com/air/extension/3.1">

 

now working up to the call to my actual ANE, then crashes.  trace not working in AIR library... where does fprintf(stdout send its output? or how to debug extensions?

 

my extension is simply SHA1 encoding a password using openssl: takes/returns a String

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: ANE

I got rid of that error by adding:
-swf-version 13
to the compiler parameters. I will try your method which seems like a better approach. (which I see in my JAM notes, is the correct thing to do)

I have not tried debugging yet. I know there is a way to connect the ANE back to the IDE.
Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: ANE

I raced to get an app submitted in time for the JAM contest in Orlando back in April, but RIM took over a month to respond, and still not approved...

 

Anyway, I switched to:

QNX® Momentics IDE for BlackBerry® 10 Native SDK

Version: 10.0.4
Build id: 201204250810

 

now:

1.none of the #includes are found,

2.on export, I get the following error:

**** Rebuild of configuration Simulator-Coverage for project NativeAS3 ****

**** Internal Builder is used for build               ****
qcc -o src\main.o ..\src\main.c -V4.6.3,gcc_ntox86 -w1 -shared -IC:/Program Files (x86)/Adobe/Adobe Flash Builder 4.6/sdks/4.6.0/usr/include/openssl -IC:\ndk-10.0.4-workspace\NativeAS3\public -IC:/Program Files (x86)/Adobe/Adobe Flash Builder 4.6/sdks/4.6.0/usr/include/freetype2 -IC:/Program Files (x86)/Adobe/Adobe Flash Builder 4.6/sdks/4.6.0/../target-override/usr/include -D_FORTIFY_SOURCE=2 -c -O0 -g -fstack-protector-all -Wc,-ftest-coverage -Wc,-fprofile-arcs
cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files
Build error occurred, build is stopped

 

Regards,

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: ANE

[ Edited ]

Under Windows/Preferences/QNX, do you have the SDK paths set?

Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: ANE

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: ANE

This is likely your issue.  I have for the SDK Platform Path:

C:/bbndk-10.0.4-beta/target/qnx6

 

My menu options (Select SDK) is "BlackBerry 10 Native SDK 10.0.4-beta" and when selected, the Version is "10.0.4". 

 

This should have no references to Flash Builder paths. 

Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: ANE

thanks - i must have added that 4.6 in desperation...

 

(almost) working now - at least it returns a string...

Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: ANE

FREObject encrypt(FREContext ctx, void* functionData, uint32_t argc,
		FREObject argv[]) {
	unsigned char *out = SHA1(argv[0], strlen(argv[0]), NULL);
	char buf[2*SHA_DIGEST_LENGTH + 1];
	int j;
	for (j = 0; j < SHA_DIGEST_LENGTH; j++) {
		sprintf(&(buf[2*j]), "%02x", out[j]);
	}
	FREObject result;
	FRENewObjectFromUTF8((uint32_t)(strlen(buf) + 1), (uint8_t*) buf, &result);
	return result;
}

above, my native code to generate SHA1:

 

below, AS3:

		public function encrypt( s:String ):String
		{
			return new String( this._ctx.call( "encrypt", s ) );
		}

 instead of 40 ascii characters, I get 20 binary... I expect there is an openssl function to convert bin to hex but can't find it...

 

Regards,