Obfuscating Html project

225 views
Skip to first unread message

Nii Darko Darkoh

unread,
Jan 25, 2021, 7:57:17 PM1/25/21
to DroidScript
Hi I want to know if on creating an HTML project in DS, my codes will be proctected when I choose obfuscation during packaging.
Also I happen to use DS functions like the httprequest to handle ajax operations. 
Does the DS obfuscation protect at least such DS parts of the application?

Steve Garman

unread,
Jan 26, 2021, 2:49:46 AM1/26/21
to DroidScript
Very little obfuscation occurs in an html app unless you do your own obfuscating.

If you use app.HttpRequest() directly in the .html file of your html project, only the method name will be obfuscated

You can, however, add a .js file to your project beside the main .html file. 

You then load that into your html code using app.Script()

When you build your apk with obfuscation turned on, the .js file will be obfuscated as if it were part of a native app.

The attached minimal SPK shows how the files would be organized. inc.js holds the app.HttpRequest code.

The html code includes the JavaScript
    app.Script( "inc.js" )
    doAjax()

zhtml.spk

Nii Darko Darkoh

unread,
Jan 27, 2021, 8:12:34 PM1/27/21
to DroidScript

Thank you Steve for your response. Very helpful.
So that means any js file loaded through the app.Script directive will be obfuscated?
If so that's nice.

Guys, this is a side issue but kind of related. I am looking for a solid obfuscation for my web HTML, js, CSS and php file. Any help will be appreciated. Thanks to all.
Reply all
Reply to author
Forward
0 new messages