I just want to make quick and easy dynamic charts for my app which will only run on my computer.
Click here. Be aware, it instantly downloads the zip. We will only need the canvasjs.min.js file.
Here is a nice JS Beautifier. It will help with code readability.
If You scroll for some time, You'll see that some strings look weird, like "I`i`!vi`u!xntsd!mnnjhof!`u". In my case, most of these things were passed as arguments to ga(h) function. So let's see...
ga = function(h) {
for (var n = "", s = 0; s < h.length; s++) n += String.fromCharCode(Math.ceil(h.length /
57 / 5) ^ h.charCodeAt(s));
return n
}
"String.fromCharCode" sure looks like a great catch here. Let's make a quick demo on playcode.io and check what it means.
var ga = function(h) {
for (var n = "", s = 0; s < h.length; s++) n += String.fromCharCode(Math.ceil(h.length /
57 / 5) ^ h.charCodeAt(s));
return n
}
console.log(ga('I`i`!vi`u!xntsd!mnnjhof!`u'))
Gotcha. This function works in both ways, so we can find our beloved "CanvasJS Trial". It turns out to be "B`ow`rKR!Ush`m".
Simply find our "B`ow`rKR!Ush`m" string in JS file, and replace it with nothing. Or use sed, "s/B`ow`rKR!Ush`m//g".