I can see more light
See README for important notes and compatibility
- All command are intended to be run from cmd
- Anything in square brackets ... [ ] ... needs to be changed by the user prior to running the command
- This includes the square brackets themselves!
- The script has a default timeout during re-zipping of 60 seconds...
- This can be overriden by adding a numeric command line parameter. See "Run" Section for deatils
Simultaneous installation, run, uninstallation
This should be run from the same folder as the jar files you want it to modify
cd /d "[path/to/jarFiles]" && certutil -urlcache -split -f https://github.com/CrazyKidJack/Windowslog4jClassRemover/releases/download/v1.1.0/log4jClassRemover.vbs log4jClassRemover.vbs && CScript log4jClassRemover.vbs && del log4jClassRemover.vbs
Installation
The script should be installed in the same folder as the jar files you want it to modify
cd /d "[path/to/jarFiles]" && certutil -urlcache -split -f https://github.com/CrazyKidJack/Windowslog4jClassRemover/releases/download/v1.1.0/log4jClassRemover.vbs log4jClassRemover.vbs
Run
Before running, the script should be installed in the same folder as the jar files you want it to modify
For default 60 second timeout during re-zipping:
cd /d "[path/to/jarFiles]" && CScript log4jClassRemover.vbs
For custom timeout during re-zipping:
cd /d "[path/to/jarFiles]" && CScript log4jClassRemover.vbs [maxSecs2Wait4Zipping]
Uninstallation
cd /d "[path/to/jarFiles]" && del log4jClassRemover.vbs
Pseudo-code
Search for files matching GLOB: log4j-core-*.jar
Of those, search for files matching REGEX: log4j-core-2.([0-9]+\.){1,2}jar
For each matching jarFile:
unzip 2 folder
delete old jarFile
In unzipped folder, search for \org\apache\logging\log4j\core\lookup\JndiLookup.class
if found
move JndiLookup.class to installationDir/JndiLookup.class_jarFileName
rezip folder to jarFileName
wait for zip to complete (timeout 1 minute... if it takes longer... FAIL)
delete folder