https://github.com/lesmiscore/classnullifier
Makes Java methods blank in classes in a JAR/ZIP file.
https://github.com/lesmiscore/classnullifier
Last synced: 23 days ago
JSON representation
Makes Java methods blank in classes in a JAR/ZIP file.
- Host: GitHub
- URL: https://github.com/lesmiscore/classnullifier
- Owner: Lesmiscore
- Created: 2017-02-13T13:06:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-30T12:45:14.000Z (about 6 years ago)
- Last Synced: 2025-03-18T20:50:54.815Z (about 1 year ago)
- Language: Groovy
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ClassNullifier
Makes Java methods blank in classes in a JAR/ZIP file.
If there's a class file compiled from Java file like this,
```java
package com.nao20010128nao;
public class TestClass{
public static void main(String[] args){
System.out.println(test());
}
public static String test(){
return "This is a test.";
}
}
```
The Java file decompiled from result class file will look like:
```java
package com.nao20010128nao;
public class TestClass{
public static void main(String[] args){
}
public static String test(){
return null;
}
}
```
For all the non-constructor methods, the code will be replaced to:
| Return Type | Code |
|:-----------------------------------:|:------------------------------|
| `void` | `;`(only one blank statement) |
| primitive types (except for arrays) | `return 0;` |
| non-primitive and array types | `return null;` |
For all the constructors and class initializers, the code will be replaced to `;`.
Arguments are kept as is.
Fields are unchangeable because javassist doesn't support to change them.
Non-class file (e.g. `META-INF/MANIFEST.MF`) are ignored and it will not be included in the output.
# Usages
In command line:
- `--input=(filename)` Input file name (full path) of the JAR/ZIP file. (required)
- `--output=(dirname)` Output directory to save processed classes (default is to append `_nullified` on the `input`'s filename)