├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .vercelignore ├── README.md ├── babel.config.js ├── components ├── form.js ├── header.js ├── layout.js └── output.js ├── lib └── javascriptobfuscator_unpacker.js ├── modules └── hooks │ ├── use-clipboard.js │ ├── use-event-listener.js │ └── use-key-press.js ├── next.config.js ├── package-lock.json ├── package.json ├── pages ├── _app.js └── index.js ├── public ├── card.png ├── favicon.ico ├── favicon.png ├── lib │ └── jsdec.js ├── manifest.json ├── touch-icon-512x512.png └── touch-icon.png ├── styles ├── global.css └── reset.css └── webpack.config.js /.eslintignore: -------------------------------------------------------------------------------- 1 | lib/* 2 | public/* 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es2020: true, 5 | }, 6 | extends: [ 7 | 'airbnb-base', 8 | 'plugin:react/recommended', 9 | 'plugin:react-hooks/recommended', 10 | ], 11 | parserOptions: { 12 | ecmaFeatures: { 13 | jsx: true, 14 | }, 15 | ecmaVersion: 11, 16 | sourceType: 'module', 17 | }, 18 | plugins: ['react'], 19 | rules: { 20 | 'react/react-in-jsx-scope': 'off', 21 | 'react/jsx-filename-extension': 'off', 22 | 'react/prop-types': 'off', 23 | }, 24 | settings: { 25 | react: { 26 | version: 'detect', 27 | }, 28 | 'import/resolver': { 29 | webpack: { 30 | config: require('./webpack.config'), 31 | }, 32 | }, 33 | 'import/core-modules': ['fs', 'path'], 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | .env* 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /.vercelignore: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | ``` 12 | 13 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 14 | 15 | You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. 16 | 17 | ## Learn More 18 | 19 | To learn more about Next.js, take a look at the following resources: 20 | 21 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 22 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 23 | 24 | You can check out [the Next.js GitHub repository](https://github.com/zeit/next.js/) - your feedback and contributions are welcome! 25 | 26 | ## Deploy on ZEIT Now 27 | 28 | The easiest way to deploy your Next.js app is to use the [ZEIT Now Platform](https://zeit.co/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 29 | 30 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 31 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | 'next/babel', 5 | { 6 | 'preset-env': { 7 | targets: { 8 | chrome: '58', 9 | }, 10 | }, 11 | }, 12 | ], 13 | ], 14 | }; 15 | -------------------------------------------------------------------------------- /components/form.js: -------------------------------------------------------------------------------- 1 | import { 2 | useState, useEffect, useRef, 3 | } from 'react'; 4 | import useKeyPress from '@/modules/hooks/use-key-press'; 5 | import JavascriptObfuscator from '@/lib/javascriptobfuscator_unpacker'; 6 | 7 | const TYPES_MAPPING = { 8 | Auto: process.browser && window.autoscan, 9 | Eval: process.browser && window.uneval, 10 | 'jsjiami/Obfuscator': process.browser && window.obdec_default, 11 | 'sojson v5': process.browser && window.dec_sojsonv5_default, 12 | 'sojson v4': process.browser && window.decsojson4, 13 | 'sojson 高级版': process.browser && window.decsojsonp, 14 | 'JS Beautifier': process.browser && JavascriptObfuscator.unpack, 15 | }; 16 | 17 | export default function Form({ onChange }) { 18 | const textareaRef = useRef(); 19 | const [formData, setFormData] = useState({ 20 | content: '', 21 | type: 'Auto', 22 | }); 23 | 24 | const handleSubmit = (event) => { 25 | event?.preventDefault(); 26 | const fn = TYPES_MAPPING[formData.type]; 27 | let result; 28 | try { 29 | result = fn(formData.content); 30 | } catch (error) { 31 | result = `Failed!\n${error}`; 32 | } 33 | onChange(result); 34 | }; 35 | 36 | useEffect(() => { 37 | handleSubmit(); 38 | }, [formData.content, formData.type]); 39 | 40 | useKeyPress(textareaRef.current, 'enter', (event) => { 41 | if (event.metaKey || event.ctrlKey) handleSubmit(); 42 | }); 43 | 44 | const handleChange = (event) => { 45 | setFormData((prevData) => ({ 46 | ...prevData, 47 | [event.target.name]: event.target.value, 48 | })); 49 | }; 50 | 51 | const handleClear = () => { 52 | setFormData((prevData) => ({ 53 | ...prevData, 54 | content: '', 55 | })); 56 | onChange(''); 57 | }; 58 | 59 | return ( 60 |
61 |