Skip to content

Mic-Scripts/fivem-js-css-obfuscator-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🔐 FiveM JS & CSS Obfuscator

A Python utility to obfuscate JavaScript and minify CSS files inside your FiveM resource folders before distribution.

Why?

When you upload a resource to cfx.re using Escrow, only Lua files are encrypted. Your .js and .css files remain fully readable. This tool protects those files by:

  • Obfuscating .js files (control-flow flattening, string array encoding, compaction)
  • Minifying .css files (removing whitespace, comments, and redundant code)

The result is a ready-to-distribute .zip file with the same folder structure.


Requirements

Requirement Install
Python 3.6+ python.org
Node.js & npm nodejs.org
javascript-obfuscator npm install -g javascript-obfuscator
clean-css-cli npm install -g clean-css-cli

Tip

The script will automatically detect missing npm packages and offer to install them for you on first run.


Usage

1. Place the script correctly

Put fivem-js-css-obfuscator.py in the same directory as the resource folder you want to protect — not inside it.

resources/
├── my_resource/        ← folder you want to obfuscate
│   ├── client.js
│   ├── style.css
│   └── fxmanifest.lua
└── fivem-js-css-obfuscator.py   ← script goes HERE

2. Run the script

python fivem-js-css-obfuscator.py

3. Enter the folder name

📁 Resource folder name: my_resource

4. Get your protected zip

The script will generate my_resource.zip with all JS obfuscated and CSS minified.


Notes

  • locales.js files are excluded from obfuscation by default to preserve translation functionality.
  • The original resource folder is never modified — the script works on a temporary copy.
  • Only .js and .css files are processed; all other files (Lua, HTML, images, etc.) are copied as-is.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages