Compiling or protecting external files with app
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Compiling or protecting external files with app
don't bother with files, just base64encode the image data and place it in the html and then display the html in a rev browser..
- Attachments
-
- html_with_embedded_image.zip
- (9.35 KiB) Downloaded 269 times
Re: Compiling or protecting external files with app
User guide for encrypt refers to Rev Online which provides the synax: encrypt source using cipher with [password|key] passorkey[and salt saltvalue] [and IV IVvalue] [at bit ]
I've tried this syntax in various ways and cannot get it to work on an external file. I would want to encrypt the external html file and maintain it as encrypted on the disk, decrypting it in memory when ran in revBrowser. Research online finds no code examples for encrypting an external file but only a text string, which I've done successfully. If you can post here the code you indicated that works for you, that would be appreciated.
I've tried this syntax in various ways and cannot get it to work on an external file. I would want to encrypt the external html file and maintain it as encrypted on the disk, decrypting it in memory when ran in revBrowser. Research online finds no code examples for encrypting an external file but only a text string, which I've done successfully. If you can post here the code you indicated that works for you, that would be appreciated.
Re: Compiling or protecting external files with app
read the file into a variable, encrypt it, write the encrypted out to a file.. read in the encrypted file, decrypt it, display in rev browser.. personally i think embedding the files into a custom property is easier (less files to keep track of)..
Re: Compiling or protecting external files with app
shaosean,
Actually, your thought to simply embed the html code rather than to fuss with files seems to be the most elegant solution, although a decrypt/encrypt method of exyernal files would nevertheless be good to know, e.g., for running more involved html files with associated files such as graphics in a revBrowser. Hopefully, Jacque will be able to provide some code.
I couldn’t get the code you sent () to work but I’ve attached here a file that will unzip to a folder containing a Live Code file “Browser_Embedded & External Html File. Rev” and a subfolder “Called Files” that contains a simple html file for illustrative use. The rev file contains the following two rev Browsers:
1) Browser_Embedded Html Code
This one attempts to open the html file by running its code embedded in the contents of a field, according to your suggested method. The calling button answers the variable and shows that it only results in part of the code and not the actual formatted complete html run.
2) Browser_External Html Code
This one runs successfully the external html file.
As stated, the former embedded option would be most favorable if it could be made to work. Otherwise, I’m back to square 1 attempting to encrypt-decrypt-encrypt external html files.
Please have a look and let me know if I’m missing something in the former code. If you can edit and return it, that would be great!
Actually, your thought to simply embed the html code rather than to fuss with files seems to be the most elegant solution, although a decrypt/encrypt method of exyernal files would nevertheless be good to know, e.g., for running more involved html files with associated files such as graphics in a revBrowser. Hopefully, Jacque will be able to provide some code.
I couldn’t get the code you sent () to work but I’ve attached here a file that will unzip to a folder containing a Live Code file “Browser_Embedded & External Html File. Rev” and a subfolder “Called Files” that contains a simple html file for illustrative use. The rev file contains the following two rev Browsers:
1) Browser_Embedded Html Code
This one attempts to open the html file by running its code embedded in the contents of a field, according to your suggested method. The calling button answers the variable and shows that it only results in part of the code and not the actual formatted complete html run.
2) Browser_External Html Code
This one runs successfully the external html file.
As stated, the former embedded option would be most favorable if it could be made to work. Otherwise, I’m back to square 1 attempting to encrypt-decrypt-encrypt external html files.
Please have a look and let me know if I’m missing something in the former code. If you can edit and return it, that would be great!
- Attachments
-
- Browser For Forum.zip
- (78.2 KiB) Downloaded 261 times
Re: Compiling or protecting external files with app
It works, just the following code is "wrong" (I say it in quotes because it is technically correct, just not for what we need)
This needs to be changed from:
to:
the reason for this change is your parameter pUrl is not actually a URL but raw HTML, so passing it as the second parameter of revBrowserOpen will fail, so we need to manually set the htmlText of the browser using the revBrowserSet command..
Code: Select all
on abOpenBrowser pURL
local tWindowId
put the windowid of this stack into tWindowId
local tBrowserId
put revBrowserOpen(tWindowId, pURL) into tBrowserId
if tBrowserID contains "error" or tBrowserId is not an integer then
answer warning tBrowserId
exit to top
end if
set the altBrowserID of this stack to tBrowserId
end abOpenBrowser
Code: Select all
put revBrowserOpen(tWindowId, pURL) into tBrowserId
Code: Select all
put revBrowserOpen(tWindowId) into tBrowserId
revBrowserSet tBrowserID, "htmlText", pUrl
Re: Compiling or protecting external files with app
Thank you, shaosean. That little parameter fix does it! Works like a charm. Your assistance and that of others who chimed in is greatly appreciated!