This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const fs = require('fs-extra'); | |
/* | |
some roku libraries obfuscate the code in their player. | |
We can deobfuscate a bunch of the code with these functions | |
*/ | |
export function Chr(code) { | |
var num = 0; | |
if (code.substring(0, 2) === '&H') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Based on the provided information, you can modify the updateAsFunctionCalls function as follows to correctly transpile the asString(m.titles[m.video.id].text) call to mc_getString(m, "title." + m.video.id + ".text): | |
Update the regex in the updateAsFunctionCalls function to also match function calls that include array indexing, such as m.titles[m.video.id]. This can be done by adding \[\] to the regex pattern, so that it looks like this: | |
Copy code | |
let regex = /^as(Any|Array|AA|Boolean|Number|Float|Integer|Node|Point|String)(\[\])*/i; | |
In the getStringPathFromDottedGet function, add a check for array indexing to the while loop that builds up the path parts array. If the current expression is an indexed get expression (isIndexedGetExpression), you can add the index value to the parts array, like this: | |
Copy code | |
while (root) { | |
if (isCallExpression(root) || isCallfuncExpression(root)) { | |
throw this.getWrongAsXXXFunctionPartError(root); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I make roku apps in Brighterscript. Brighterscript is an extension of the BrightScript language. It adds classes with the class, end class key words, and provides public, protected and private method visibility. It also adds the "@." expression, which transpiles to ".callFunc", so `[email protected](name)`, transpiles to `node.callFunc("sayHello", name)` | |
please respond with : "ok" | |
OlderNewer