Skip to content

Commit

Permalink
Fix build script
Browse files Browse the repository at this point in the history
  • Loading branch information
strayfade committed Apr 24, 2024
1 parent e806a6d commit d2dbab3
Show file tree
Hide file tree
Showing 10 changed files with 862 additions and 68 deletions.
66 changes: 65 additions & 1 deletion Build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,67 @@
const fs = require('fs')
const Log = require('./Log').Log

const JSProcessorOptions = {
compact: true,
controlFlowFlattening: false,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: false,
deadCodeInjectionThreshold: 0.4,
debugProtection: false,
debugProtectionInterval: 0,
disableConsoleOutput: false,
domainLock: [],
domainLockRedirectUrl: 'about:blank',
forceTransformStrings: [],
identifierNamesCache: null,
identifierNamesGenerator: 'hexadecimal',
identifiersDictionary: [],
identifiersPrefix: '',
ignoreImports: false,
inputFileName: '',
log: false,
numbersToExpressions: false,
optionsPreset: 'default',
renameGlobals: false,
renameProperties: false,
renamePropertiesMode: 'safe',
reservedNames: [],
reservedStrings: [],
seed: 0,
selfDefending: false,
simplify: true,
sourceMap: false,
sourceMapBaseUrl: '',
sourceMapFileName: '',
sourceMapMode: 'separate',
sourceMapSourcesMode: 'sources-content',
splitStrings: false,
splitStringsChunkLength: 10,
stringArray: true,
stringArrayCallsTransform: true,
stringArrayCallsTransformThreshold: 0.5,
stringArrayEncoding: [],
stringArrayIndexesType: ['hexadecimal-number'],
stringArrayIndexShift: true,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 1,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 2,
stringArrayWrappersType: 'variable',
stringArrayThreshold: 0.75,
target: 'browser',
transformObjectKeys: false,
unicodeEscapeSequence: false,
}

const CSSProcessorOptions = {
level: 2,
}

const CSSProcessor = require('clean-css')
const JSProcessor = require('javascript-obfuscator')

const PackStylesheets = async () => {
Log('[BUILD] - Merging CSS files...')
let Stylesheet = ''
Expand All @@ -18,6 +79,8 @@ const PackStylesheets = async () => {
Stylesheet = Stylesheet.replace('\n', '')
Stylesheet = Stylesheet.replace(' ', '')
}

Stylesheet = new CSSProcessor(CSSProcessorOptions).minify(Stylesheet).styles;

fs.mkdir('./build', (err) => {})
let p = __dirname + '/build/production.css'
Expand All @@ -39,7 +102,8 @@ const PackScripts = async () => {
}
}

Log('[BUILD] - Skipping obfuscation')
Script = JSProcessor.obfuscate(Script, JSProcessorOptions).getObfuscatedCode()

fs.mkdir('./build', (err) => {})
let p = __dirname + '/build/production.js'
fs.writeFileSync(p, Script, { recursive: true })
Expand Down
Binary file added assets/images/Autofill1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Autofill2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/FeedForward1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/FeedForward2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Typing1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Typing2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/sf20401.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d2dbab3

Please sign in to comment.