-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
144 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (C) 2024 Nameless Production Committee | ||
* | ||
* Licensed under the MIT License (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://opensource.org/licenses/mit-license.php | ||
*/ | ||
package reincarnation; | ||
|
||
import org.objectweb.asm.AnnotationVisitor; | ||
import org.objectweb.asm.Opcodes; | ||
|
||
import reincarnation.meta.AnnotationMeta; | ||
import reincarnation.meta.AnnotationsMeta; | ||
|
||
public class JavaAnnotationDecompiler extends AnnotationVisitor { | ||
|
||
/** The metadata holder. */ | ||
private final AnnotationMeta meta; | ||
|
||
public JavaAnnotationDecompiler(Class clazz, AnnotationsMeta meta) { | ||
super(Opcodes.ASM9); | ||
|
||
System.out.println(clazz); | ||
this.meta = new AnnotationMeta(clazz); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void visit(String name, Object value) { | ||
super.visit(name, value); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public AnnotationVisitor visitAnnotation(String name, String descriptor) { | ||
return super.visitAnnotation(name, descriptor); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public AnnotationVisitor visitArray(String name) { | ||
return super.visitArray(name); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void visitEnum(String name, String descriptor, String value) { | ||
super.visitEnum(name, descriptor, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (C) 2024 Nameless Production Committee | ||
* | ||
* Licensed under the MIT License (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://opensource.org/licenses/mit-license.php | ||
*/ | ||
package reincarnation.meta; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public class AnnotationMeta { | ||
|
||
public final Class clazz; | ||
|
||
public final Map<String, Object> values = new LinkedHashMap(); | ||
|
||
public AnnotationMeta(Class clazz) { | ||
this.clazz = clazz; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (C) 2024 Nameless Production Committee | ||
* | ||
* Licensed under the MIT License (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://opensource.org/licenses/mit-license.php | ||
*/ | ||
package reincarnation.meta; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class AnnotationsMeta { | ||
|
||
public final List<AnnotationMeta> annotations = new ArrayList(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters