Blackberry AES encryption error - blackberry

I have implemented AES encryption in BlackBerry using code from the Knowledge Base Article "How to - Use Advanced Encryption"
I keep getting error:
Module 'net_rim_crypto' not found.
In the code I have imported net.rim.device.api.crypto.*; package, but I can't find the package net.rim.crypto.
Do I need to add any external jar for that?

You should install JRE 4.6 and set the API level to 4.6 and OS of the target device should be higher than JRE version.

If you have problem with BlackBerry API or OS version, you may consider to use bouncy castle for j2me.

Related

Does the Webpack Vivado 2020.2 include the SDK

I am confused. Does Vivado 2021.2 include the SDK using the Webpack license?
Digilent says yes: https://reference.digilentinc.com/programmable-logic/guides/vivado-create-hdl-wrapper
(the hdl wraper is part of the SDK, peta linux, etc)
But, my installation does not seem to include it.
Where did I go wrong?
Thanks
Err... Turns out that Vivado went from SDK to Vitis. So now they are using Vitis for their higher level languages.
https://forum.digilentinc.com/topic/21686-does-anybody-have-the-xilinx-vivado-20194-sdk-xilinx-doesnt-have-in-the-archive/?tab=comments#comment-62563
https://forums.xilinx.com/t5/Vitis-Acceleration-SDAccel-SDSoC/Vitis-Community-How-can-we-help/td-p/1117972
Here are some examples:
https://reference.digilentinc.com/programmable-logic/guides/getting-started-with-ipi
https://github.com/Xilinx/HLS-Tiny-Tutorials

Is it possible to compile potrace for iOS?

Looking at the cross-platform nature of potrace http://potrace.sourceforge.net/, is it possible to compile this for iOS? If so, how?
Yes, it is possible to compile potrace for iOS.
As a matter of fact, most open source libraries using standard (GNU) configure tools that compile on MacOS X will easily compile on iOS, because they are likely free of platform-specific code (e.g. linuxisms) and standard configure tools allow cross-compilation.
You can compile these libraries in the shell by pointing configure to the proper toolchain and SDKs. Paths changed with Mavericks and Xcode 5, but fortunately automated scripts exist for more popular libraries such as expat.
The proposed solution is based on the x2on/expat-ios project on GitHub. Their script fixes expat's config.sub which doesn't know about arm64 target. Do does potrace 1.11's config.sub. However, a simpler approach consists in downloading a more recent version of config.sub. Unlike expat, potrace doesn't seem to need any patch to compile for iOS.
Full script build-potrace.sh is available here:
https://gist.github.com/pguyot/dce18af64a71b93c0204
Please note that potrace is licensed under the GPLv2. You might want to check Is it legal to publish iOS apps under the GNU GPLv3 open-source license? question.

Json.NET under Unity3d for iOS

has anyone succeeded to adapt/port Json.NET to a version able to run under Unity3d deployed to iOS (and the webplayer, and android, too, but these seem less problematic), somehow overcoming the AOT issues there?
Or are there plans to release a compatible version of Json.NET?
Many thanks,
Max
You can use netstandard version of Newtonsoft.Json in Unity and it works fine. It seams that this library has changed some inner implementations to not use System.Reflection.Emit for deserialization anymore.
Just be sure that after downloading nuget package you get Newtonsoft.Json.dll from netstandard2.0 folder, not from net45. And also don't forget to specify in link.xml that System.Linq.Expressions.Interpreter.LightLambda class shouldn't be stripped (it's used for deserialization) along with libraries/classes that you use for deserialization (to preserve constructors). Your link.xml should look smth like this:
<linker>
<assembly fullname="Your.Dto.Package.Name" preserve="all" />
<assembly fullname="System.Core">
<type fullname="System.Linq.Expressions.Interpreter.LightLambda" preserve="all" />
</assembly>
</linker>
We use this library in all our projects for Android and iOS with IL2CPP and Mono runtimes.
Moreover, unlike Unity's JsonUtility, Newtonsoft.Json fully supports any type of objects, including Dictionary.
Microsoft Example
Newtonsoft Json fails AOT in iOS and also fails at deserializing anything inheriting from KeyedCollection in the webplayer. Here's a version that has been fixed:
JSON .NET For Unity (Supports iOS)
We use MiniJson and so far it serves our json needs well :)
I have been facing the same issue for a while and searched on every nook and cranny of the internet to look for a solution. Here's what worked for me.
I replaced NewtonSoft.Json with NewtonSoft.Json for Unity
Uninstalled NewtonSoft.Json from Unity's Nuget package manager.
Install NewtonSoft.Json for Unity with Unity's package manager. Follow this installation steps
What's the difference?
NewtonSoft.Json for Unity is different from standard NewtonSoft.Json
NewtonSoft.Json does not support AOT targets for IL2CPP builds in Unity
NewtonSoft.Json for Unity supports AOT targets such as all IL2CPP builds (WebGL, iOS, Android, Windows, Mac OS X) and portable .NET (UWP, WP8).
Hope this helps. Cheers!
Nope AFAIK.
LitJson and JsonFX would be alternate choice for Unity3D.
http://wiki.unity3d.com/index.php?title=UnityLitJSON
Have a look at the modified version of LitJson: UnityLitJson
Actually LitJson has some issues and is not always working as expected, so I created a simple JSON-Lib that can handle all Unity3D Types, Enums and arbitrary classes. Find it at GitHub: Tiny-JSON
You can use it very simple:
// encode
Animal a = new Animal(4);
string json = Json.Encode(a);
// decode
IList<Animal> a = Json.Decode<IList<Animal>>("[{\"legs\":4}, {\"legs\":2}]");
Yes, we share code on client and server and use an older version when it was called NewtonSoft.Json. Works in IOS, Android, everything.
Search for NewtonSoft.Json, and you could probably find an archive.

NoClassDefFoundError while preverify the jar files in BlackBerry

I have also asked this question on the BlackBerry support forums, under the thread "NoClassDefFoundError while preverify the jar files in BlackBerry"
I am adding a library files(jar files) in my BlackBerry Project and and try to run it. But it is giving me the below error : Error!: Missing stack map at label 77. So i try to find out the issue and find this link: Preverify Link
So i tried to fix this issue using preverifier. As i am using BlackBerry eclipse plugin, i have tried in this way:
Copy the jar file in the bin folder of my eclipse 6.0 plugins (eclipse-SDK-3.5.2-win32\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\bin)
Execute the following command in the command line:
preverify -classpath "<path to 6.0.0.29 SDK>\net_rim_api.jar" "ArcotOTP-Lib-Java-Test-2.0.0.jar"
But after running this line, i am getting the below error:
Error preverifying class Mypackage.API$1
java/lang/NoClassDefFoundError: Mypackage/Test
BlackBerry devices are running on the Java-ME platform, so you can't use modern java features. Typical Java jar files these days use newer features that are not backward compatible with the Java-ME platform. Some projects do go out of the way to be backward compatible, like Bouncy Castle. But that is rare.
This question, duplicated on the BlackBerry forums, was also answered on the BlackBerry forums, which I will capture here:
simon_hain:
and is it a j2me library?
Arindam Mukherjee:
No it is java library..all classes are basically java classes. The same library i am using for android also and it is working fine fro me..
simon_hain:
BlackBerry uses J2ME as a base, Android uses J2SE.
You cannot use an Android library on BlackBerry unless you re-compile it (and resolve all the errors due to missing reflection, lists etc)

Mono Android Monodroid Native Library DllNotFoundException

I am attempting to get a Native C/C++ library working with Monodroid in the emulator, using DllImport. I am developing mainly in Windows/Visual Studio 2010.
I have built a native C/C++ library (ZeroMQ) using the Android NDK tools, to both x86 and armeabi platforms, using a Ubuntu virtual machine. Is this correct - x86 for emulator and armeabi for the real device? (This is certainly the case on the iPhone/MonoTouch - though in that case statically linked libzmq.a file and DllImport __Internal)
I have added the x86 version of libzmq.so to my MonoDroid project under the directory structure lib\x86\libzmq.so
When I first attempted to build/deploy to the simulator, I got an error 'cannot determine abi type', so I've added x86 to the AndroidNativeLibrary Include="lib\x86\libzmq.so"> project item group. This then deployed.
I have a DllImport for the function to call [DllImport("libzmq"
I've tried libzmq.so, lib/x86/libzmq, lib/x86/libzmq.so etc, but then I call the DllImported method (running in the emulator), I always get a DllNotFoundException.
Can anyone give me some direction?
EDIT: After reading another support answer which states that the emulator uses armeabi .so libraries, I have removed the x86/libzmq and added my lib/armeabi/libzmq.so as an AndroidNativeLibrary. I also removed the project file Abi entry, and indeed the project built and deployed fine.
However, I still get a DllNotFoundException when I try to call a DllImported function. Any ideas?
Many thanks
I don't have any immediate ideas why it isn't working for you; [DllImport("zmq")] should work.
The SanityTests sample exercises the DllImport attribute.
The DllImport: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/Hello.cs#L240
The Android.mk to build libfoo.so: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/jni/Android.mk
Building libfoo.so by calling ndk-build: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/SanityTests.csproj#L82
Including libfoo.so into the .apk: https://github.com/xamarin/monodroid-samples/blob/master/SanityTests/SanityTests.csproj#L96
(This is a repeat of my reply to your email in the ZeroMQ mailing list).
This error could be caused by using an incorrect platform target in your Mono project. I'm not sure if Mono/MonoDevelop supports this, but you probably need to create an ARM platform target, as opposed to x86/x64/Any CPU.
You would experience the same errors if you tried to do P/Invoke interop between an x64-targeted assembly with an x86 native library or vice-versa.
If you're using the clrzmq bindings for bridging Mono and libzmq, you will need to create a new platform target for ARM and rebuild the bindings. The solution only defines x86 and x64 platform targets currently.
Ok, I finally got it working! For whatever reason, ZeroMQ doesn't build correctly using the current/latest NDK r7. The instructions at http://www.zeromq.org/build:android use NDK r6. I also downloaded an old version of the NDK r5b (it was the easiest old version to find a download for), and rebuilt ZeroMQ using it. Result, it now works on emulator and phone!

Resources