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

Setting main class attribute in MANIFEST.MF to a class that doesnt exist (Name Obfuscation) #3

Closed
MOMIN5 opened this issue May 21, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@MOMIN5
Copy link

MOMIN5 commented May 21, 2021

Describe the bug
When i try to name obfuscate, it sets the MainClass attribute to a class that doesnt exist

To Reproduce
use the "Alphabet" method in a jar with mainclass
here is my config (saved in .txt for only uploading as attachement)
bozarConfig.txt

Expected behavior
sets the main variable as the obfuscated main file name

Screenshots
bozer

Bozar version
the newest one in releases

Additional context
nope

@MOMIN5 MOMIN5 added the bug Something isn't working label May 21, 2021
@vimasig
Copy link
Owner

vimasig commented May 21, 2021

I made a JAR like that to test this
classes

Renaming job is done correctly and the application is running without any issues.
metainf

Did you get any errors when obfuscating? Maybe class exists but cannot be written for another reason.
Does the new class count match the old one?

Also, "Dummy class" watermark is enabled in your config but I can't see that.
Look for errors in the console for that too.

Can you provide more information so I can reproduce it?

@MOMIN5
Copy link
Author

MOMIN5 commented May 22, 2021

huh, I tested it in a Windows VM and it worked, maybe it's a Linux only issue?

working on windows
bz3

it still didn't create a dummy class tho, here are the two errors I got (in the windows VM)

bz1
bz2

@vimasig
Copy link
Owner

vimasig commented May 22, 2021

The main issue looks like Bozar can't process all of your classes. The class count is different from the first SS.
Looks like something is wrong with CustomClassWriter (used to find classes) but I can't tell without making tests.

Try disabling shuffle so maybe you can always get the same error & result. (Shuffle can cause the unprocessable class to be randomly selected. Which is why you get different class count)

You can try excluding all classes and removing them one by one to find unprocessable classes.

Unfortunately, I can't reproduce this issue.
Can you provide a sample JAR/code which can reproduce this?

@MOMIN5
Copy link
Author

MOMIN5 commented May 22, 2021

i turned shuffle off, there is no error but now there are only 3 classes and no dummy class, some classes of the jar is in kotlin tho, maybe this has to do something with the fact that the jar is an anti-debugger / anti-dumper, its a heavily modified version of
Falcon-forge with some extra disablers, I will send you the original jar later after removing all the sensitive details

@MOMIN5
Copy link
Author

MOMIN5 commented Jun 1, 2021

here is the jar, sorry for being late btw
[removed cause private info]

Also any idea why it doesnt include any library files in the output jar when i exclude them from obfuscating

@vimasig
Copy link
Owner

vimasig commented Jun 1, 2021

Fixed. Will be released as v1.6.0 soon.

Do you want libraries to be automatically placed in the output JAR?
Or the input jar contains libraries already, but when you exclude them, they're not placed in the output JAR?

vimasig added a commit that referenced this issue Jun 1, 2021
@MOMIN5
Copy link
Author

MOMIN5 commented Jun 2, 2021

the input jar contains libraries already, but when i exclude them, they're not placed in the output JAR

@vimasig
Copy link
Owner

vimasig commented Jun 2, 2021

I think it's not related to exclude. In v1.5, Bozar aborts the writing process when an exception occurs while processing classes.
This should not happen in v1.6 as the issue is fixed, and it will continue even when an exception occurs.

Let me know if it still happens

@vimasig vimasig closed this as completed Jun 2, 2021
@MOMIN5
Copy link
Author

MOMIN5 commented Jun 2, 2021

thanks it worked 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants