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

Web and WebWorks Development

Reply
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

[Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

The bbwp packager doesn't remove any comments from the CSS and JS of apps and doesn't do any minification or aggregation.

So, unless you do it yourself, your documented source code is delivered with every webworks app.

Professional app developers will probably implement advanced compilation techniques right in their build scripts, but people new to it all, may need some extra tools.

 

One way to easily clean things up is to use the YUI Compressor. It works for both CSS and JS and does a pretty good job without destroying the code.

 

So, if enough people are interested, I'll publish a batch script, otherwise, I'll spend my time on other stuff Smiley Happy.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 46
Registered: ‎02-16-2011
My Device: 8300>9000>9700>9900>Z10
My Carrier: Vodafone

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

You are right, by default the application sits in the bar file and on the device with no source code protection.
RIM has previously stated that apps delivered over AppWorld will have no "View Source" ability, the app will be safe from prying eyes.
Unfortunately, it may be the case that this is broken already:
http://forums.crackberry.com/f222/apps-pb-without-appworld-not-so-much-but-getting-them-off-pb-61005...

Minifying is not a solution to this issue, but it is a good way to add an obfuscation layer, which I'd say is better than nothing.

I would certainly like to experiment with a YUI Compressor type tool - please do share a script if possible, that may be very handy I think.

For something easier to use, there is an online service to minify javascript at: http://jscompress.com/
Select "Packer (Dean Edwards)" to get the more obscure method.
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

Minimize all you want but this site brings it right back;

 

http://jsbeautifier.org/

 

Don't bother.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

That website won't bring back the comments and file structure and that's what YUIC can be used to remove.

 

Unless you're using advanced compilation techniques, any experienced coder will rebuild the app from YUI compressed files, there is not much we can do about that.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 46
Registered: ‎02-16-2011
My Device: 8300>9000>9700>9900>Z10
My Carrier: Vodafone

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

@themarco - That is true, I'm more used to web development, where end users are unlikely to know that. But with other developers... you're right, they probably know how to bring it back.

Its a shame that RIM haven't covered even the basic security holes before launch. It doesn't hold up much hope for commercial apps at this point.
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

Indeed. What we need is for our bar files to be encrypted and for RIM to make it impossible to get apps off the PlayBook. Assuming they'll keep a tight lid and QNX won't get rooted that should make life a lot safer for us.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

I'm not sure encryption would work for WebWorks apps since the browser can be put in debug mode. Sooner or later, someone will be able to enable that for webworks apps since they're using a browser shell.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

WebWorks apps can only have Web Inspector connected to them if you build your app with a -d with the bbwp command line.

We recommend following the same techniques as you would to protect your assets from a "view source" on a desktop browser. minifying and obfuscating where you can.
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

Tim, I do hope that's just a temporary bit of advice until you guys sort out a proper encryption mechanism for us?

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: [Playbook] Anybody interested in a minifying batch script based on the YUI Compressor?

Hi TheMarco,

I want to make sure I understand your main primary concern. Is your main concern source code theft? With any potential enhancement we would make, I would like to make sure we are addressing the root concern.

With the WebWorks project being open source any potential enhancement would have to fit the primary concern in a way that could not be easily reverse engineered by simply looking at the platform source code. Otherwise you are back to square one.
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter