Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
smallfawn authored Jun 28, 2024
1 parent 192bfd6 commit 3428ae6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const PluginObfuscator = require('./plugin/obfuscator.js')
const PluginAwsc = require('./plugin/awsc.js')

// 读取参数
let type = 'test'
let encodeFile = 'input.js'
let decodeFile = 'output.js'
for (let i = 2; i < process.argv.length; i += 2) {
Expand All @@ -18,7 +17,6 @@ for (let i = 2; i < process.argv.length; i += 2) {
decodeFile = process.argv[i + 1]
}
}
console.log(`类型: ${type}`)
console.log(`输入: ${encodeFile}`)
console.log(`输出: ${decodeFile}`)

Expand All @@ -41,7 +39,7 @@ const plugins = [

for (let plugin of plugins) {
const code = plugin.plugin(sourceCode);
if (code !== processedCode) {
if (code && code !== processedCode) {
processedCode = code;
pluginUsed = plugin.name;
break;
Expand All @@ -58,7 +56,3 @@ if (processedCode !== sourceCode) {
console.log(`所有插件处理后的代码与原代码一致,未写入文件。`);
}

// 输出代码
if (code) {
fs.writeFile(decodeFile, code, () => { })
}

0 comments on commit 3428ae6

Please sign in to comment.