This commit is contained in:
Andrew Lee 2019-08-31 11:37:47 -04:00
parent 8224c64032
commit 96021d7aa2
10 changed files with 1188 additions and 2 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
node_modules/

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project>

34
app.js Normal file
View file

@ -0,0 +1,34 @@
const express = require('express');
const http = require('http');
const app = express();
const port = 4000;
// Require Filesystem module
const fs = require("fs");
// Require the Obfuscator Module
const JavaScriptObfuscator = require('javascript-obfuscator');
// Read the file of your original JavaScript Code as text
fs.readFile('./src/js/main.js', "UTF-8", function(err, data) {
if (err) {
throw err;
}
// Obfuscate content of the JS file
const obfuscationResult = JavaScriptObfuscator.obfuscate(data);
// Write the obfuscated code into a new file
fs.writeFile('./public/js/main.js', obfuscationResult.getObfuscatedCode() , function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
});
app.use(express.static(__dirname + '/public'));
console.log(`Started the server in port ${port}`);
http.createServer(app).listen(port);

1107
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

25
package.json Normal file
View file

@ -0,0 +1,25 @@
{
"name": "project-techrpg",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node app.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Alee14/Project-TechRPG.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Alee14/Project-TechRPG/issues"
},
"homepage": "https://github.com/Alee14/Project-TechRPG#readme",
"dependencies": {
"express": "^4.17.1",
"fs": "0.0.1-security",
"http": "0.0.0",
"javascript-obfuscator": "^0.18.1"
}
}

View file

Before

Width:  |  Height:  |  Size: 573 KiB

After

Width:  |  Height:  |  Size: 573 KiB

View file

@ -7,7 +7,9 @@
<title>Title</title>
</head>
<body>
<h1>Welcome to Project: TechRPG</h1>
<h2>Pre-Alpha</h2>
<canvas></canvas>
<script src="js/sprite.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
</body>
</html>

1
public/js/README Normal file
View file

@ -0,0 +1 @@
Please note that this folder contains obfuscated code and use (src/js) folder instead.

1
public/js/main.js Normal file
View file

@ -0,0 +1 @@
var _0x2ebe=['context','width','height','Script\x20has\x20been\x20started','src','images/coin-sprite-animation.png'];(function(_0x571588,_0x3cdf19){var _0x59e977=function(_0x16d605){while(--_0x16d605){_0x571588['push'](_0x571588['shift']());}};_0x59e977(++_0x3cdf19);}(_0x2ebe,0x1dd));var _0x31f5=function(_0x58a9a4,_0x35d81b){_0x58a9a4=_0x58a9a4-0x0;var _0x2395e2=_0x2ebe[_0x58a9a4];return _0x2395e2;};console['log'](_0x31f5('0x0'));var coinImage=new Image();coinImage[_0x31f5('0x1')]=_0x31f5('0x2');function main(_0x505f11){var _0xf724a9={};_0xf724a9[_0x31f5('0x3')]=_0x505f11[_0x31f5('0x3')];_0xf724a9[_0x31f5('0x4')]=_0x505f11[_0x31f5('0x4')];_0xf724a9[_0x31f5('0x5')]=_0x505f11[_0x31f5('0x5')];_0xf724a9['image']=_0x505f11['image'];return _0xf724a9;}

View file

@ -1,7 +1,16 @@
/*************************************
*
* Project TechRPG by Alee Productions
*
* Please don't steal the reuse code without our credit.
*
*************************************/
console.log("Script has been started");
var coinImage = new Image();
coinImage.src = "images/coin-sprite-animation.png";
function sprite (options) {
function main (options) {
var that = {};