Have you spent months working on the perfect application? Are you now worried someone will just copy your source code right from your NativeScript application? (This is not a unique issue to NativeScript; ReactNative, Titanium*,Cordova/PhoneGap and any other platforms that are not compiling Java code have this exact same issue. )

Well, I have a solution for you. After a lot of hard work; I am proud to introduce my first commercial component into the NativeScript eco-system; NativeScript-Protect. The NativeScript-Protect plugin is a (very) simple install and then it will automatically encrypt and/or minimize your source code while you are building your release version of the project.

It automatically ties itself into the NativeScript (tns) command so that you do not have to do anything. When you run anything that does a build; it will automatically encrypt and/or minimize your build copies of the code.

This does NOT touch your original source code; only the BUILD copies that the NativeScript (tns) command copies into the build system. So it makes itself a seamless part of your standard build process that you can just totally forget it even exists.

The initial release is only for Android; but I expect to have the iOS runtimes done early next year.

If you would like to see it in action; I have a 4 minute video showing it from start to end.

In addition, two demo APK's compiled as a debug app with everything encrypted or just the main app files encrypted, can be downloaded for you to check out and kick the tires.

In a lot of larger web sites it is pretty common that you use several third party resources like JavaScript. However, this is a potential malicious door into your customers computer via your website. What happens if the third party resource is changed by someone who does not have your best interests at heart. Your page will still happily load the malware right onto your customers browsers. So what can you do about this?

Well I'm glad you asked. In the just released Chrome 45 (and soon in an upcoming Firefox release), they have added a awesome new feature to protect your customers (and your reputation). When you link to any resources in your web page; you can now use the integrity attribute to tell the browser that this file must match this hash to load and use this file.

The browser integrity attribute must support the sha 256, 384 and 512 hashes according to the w3 spec. For browsers that don't support this yet; then this won't do anything and the resources will load fine just like normal. But in browsers that do support this; when the browser downloads the resource it will hash it and verify the hash matches before allowing it to be used.

Or if you don't have openssl installed; you can also easily cheat by using Chrome. Just add the integrity with a bogus value; then reload the page. Chrome in the developer log will show you the computed hash for the file when it blocks it.