Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fake Key injection does not function for singleton enum classes #29

Open
zphensley42 opened this issue Sep 20, 2022 · 0 comments
Open

Comments

@zphensley42
Copy link

Looking at the source and tracing down what is happening, the Java Parser doesn't know to treat top-level enum classes as a ClassBlock. Since fake injection requires a class block in the array, it fails to pass and thus nothing is actually injected to the class.

I have a singleton handler for secrets in my test example in a class HiddenTreasure.java

This class starts as:

public enum HiddenTreasure {
INSTANCE;

public static final String key = "akfjakgjag";
public static final String iv = "akfkjakgthg";

This is a valid class to provide fake values on, but nothing is added since the parser does not think it can. I do wonder why there is a separate parser to determine things like classes or functions vs just using the reflection API, but this is still an issue regardless. I can address it locally by modifying the class I am 'enigmafying', but it is still a gap in the full solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant