MCRcortex / nekodetector

Nekoclient infection detector
MIT License
569 stars 42 forks source link

Documentation improvements, handle non-lowercase file extensions, and add public method to scan from within Java #18

Closed mica-alex closed 1 year ago

mica-alex commented 1 year ago

This PR adds two commits, one to improve Main.java and one to improve Detector.java.

The commit for Main.java adds the following:

  1. Javadocs and comments throughout
  2. Improved console output by compiling a list of infected files to show at the end
  3. Added support for running a scan from within Java (i.e. launcher automatically check downloaded mod files, etc.)
  4. Converted file name to lowercase when checking file extension to ensure capitalization does not affect scanning (i.e. JAR, JaR, JAr, jaR, etc.)

The commit for Detector.java adds the following:

  1. Javadocs and comments for the class itself and the scan method.
  2. Improved the scan method so it returns a boolean indicating if infection was found or not.
  3. Converted file name to lowercase when checking for .class file extension to ensure capitalization does not affect scanning (i.e. CLASS, claSS, CLasS, etc.)
mica-alex commented 1 year ago

Will fix conflicts and update

mica-alex commented 1 year ago

@MCRcortex @IMS212 @Huskydog9988 This pull request is ready for review now. My apologies for tagging you if not the correct person, but I just wanted to make sure this was back on the radar now that earlier conflicts are resolved.

Huskydog9988 commented 1 year ago

we are currently working on some issues with detection rn, but you have the clear from me

mica-alex commented 1 year ago

we are currently working on some issues with detection rn, but you have the clear from me

Sounds good. Hopefully everyone approves/like these changes., and let me know if you need anything with regards to changes.

mica-alex commented 1 year ago

Eating dinner then will fix conflicts

Huskydog9988 commented 1 year ago

Hey are you fine reimplementing the color codes from #23? Currently we may need to drop them temporally because the gui can't render the ansi colors.

mica-alex commented 1 year ago

Hey are you fine reimplementing the color codes from #23? Currently we may need to drop them temporally because the gui can't render the ansi colors.

Sorry I did not see this sooner. I have that handled already in this PR. I do a replaceAll on the ANSI color codes which I moved in to a constants file

mica-alex commented 1 year ago

Oh, I did not see that more PRs were merged. More conflicts....again....

mica-alex commented 1 year ago

Ok, I have addressed all conflicts

mica-alex commented 1 year ago

Fixes #27

mica-alex commented 1 year ago

@Huskydog9988 @MCRcortex @IMS212 I am going offline for the evening shortly. This PR is ready for review again though.

Please let me know if there is anything I need to change, but hopefully everything is all well-documented/self-explanatory in code (and no more merge conflicts).

mica-alex commented 1 year ago

Corrected a mistake (sorry) where I omitted output of compiled scan results on the GUI.

Huskydog9988 commented 1 year ago

our discord is now public, you can coordinate with us here if you want https://discord.gg/zPdFK47682 (we are currently working on a rewite)

mica-alex commented 1 year ago

I will try joining in the morning, thanks!

I am fairly discouraged. 😞 At this point, I have had to handle merge conflicts 4+ times, some rather large.

Hopefully there is a review soon, so these changes can be rebased into the rewrite branch and not lost again. There is a great deal of improvement here that shouldn't be missed including:

  1. Better Javadocs
  2. Documentation fixes
  3. Main class improvements to allow launchers, etc. to start a scan and receive a list of results (infected files)
  4. ANSI color code handling
  5. Auto-scroll for log in GUI (there is a checkbox to turn it off too)
  6. Cancel button in GUI
  7. more...
Huskydog9988 commented 1 year ago

yea hopefully we can get one in, ill try and remind the maintainers tomorrow

MCRcortex commented 1 year ago

sorr looking at it now