Saturday, May 2, 2026
HomeiOS Developmentios - Hiding Javascript as a string in a Swift file and...

ios – Hiding Javascript as a string in a Swift file and having it construct/ship all Javascript at runtime?

[ad_1]

I’ve constructed a browser-based recreation utilizing vanilla JS, and now I would like to show it into an iOS app. I’ve executed this in XCode and it really works nice, however after all the online recordsdata do not get compiled just like the Swift recordsdata do. So I can navigate to the app file on my Mac, view contents and see the JS recordsdata. I do know I can obfuscate, minify, and many others. however that may be simply reversed.

So I used to be questioning is there a approach I may embody all of the JS code in a Swift file (assigned to a variable perhaps?) that might be included in Swift compile and human-unreadable, and have it solely be despatched to the opposite internet recordsdata or have the JS file be constructed at runtime?

I’ve seen somebody say it is attainable to encrypt the JS and have the encryption key be within the Swift code, however it obtained me questioning if it will work to simply throw all of the JS code into Swift.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments