If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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

Native Development

Reply
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10
Accepted Solution

How to add external library in NDK?

Hi!

 

I have problems adding libhuapi library.

 

It is not offered in Add library wizard. And if libhuapi.so file is added as an external lib the device logs:

 

unknown symbol: hu_ECDSAWAPINoHashVerify

unknown symbol: hu_ECDSAWAPINoHashSign

ldd:FATAL: Could not resolve all symbols

 

Thank you very much for any help.

 

Regards, SOAman

--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.
Developer
BBSJdev
Posts: 6,029
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: How to add external library in NDK?

Add this in your .pro file...

 

LIBS += -lhuapi


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10

Re: How to add external library in NDK?

Thank you very much for your help.

Now I need to test APIs :smileyhappy:
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10

Re: How to add external library in NDK?

Add lib screwed up my project. New one solved the problem.

--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: How to add external library in NDK?

How has your crypto coding gone?

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10

Re: How to add external library in NDK?

Better :smileyhappy:

I've found AES example on github that helps a lot.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: How to add external library in NDK?

Great!

 

If it's the AESCryptoDemo I'm planning on updating it soon to show RSA key import and usage too...

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10

Re: How to add external library in NDK?

I've found a bug in AES example. Method fromHex() must use toUtf8() and not toLocal8Bit() to support special UTF8 characters.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: How to add external library in NDK?

'must'?

Hexadecimal uses 0-9 and a-f... if you have utf8 characters in there, is it hex???

The sample demonstrates encrypting and decrypting utf8, the default plain text is Montréal...

Thanks.
--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10

Re: How to add external library in NDK?

Yes, the word must is too harsh :smileyhappy:

My special characters čćžšđ (above 255, far away from ASCII) were shown corrupted after decryption process. Replacing toLocal8Bit() with toUtf8() solved the problem.

The problem is not in translating into hex format, but QByteArray is different regarding the usage of above mentioned methods.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.