reddr / LibScout

LibScout: Third-party library detector for Java/Android apps
Apache License 2.0
283 stars 48 forks source link

Add supported character for windows machine in paint function #25

Closed Drjacky closed 5 years ago

Drjacky commented 5 years ago

The replacing paint function is:

private void print(String prefix, boolean isTail, boolean includeClazzCount) {
  logger.info(prefix + (isTail ? "|___ " : "|--- ") + name + (includeClazzCount && clazzCount > 0? " (" + clazzCount + ")" : ""));

  for (int i = 0; i < childs.size(); i++) {
    childs.get(i).print(prefix + (isTail ? "    " : "|   "), i == childs.size()-1, includeClazzCount);
  }
}
reddr commented 5 years ago

Hi, I can't merge this as is. As said, this is only a workaround solution if your console cannot properly render the box-drawing unicode characters. This probably only affects (some) Windows machines (at least on Linux/MacOS it works fine for me).

I think some config option would be best here that allows to choose ASCII in case unicode does not work. Since the number of such nice-to-have config options is steadily increasing, I'm thinking of introducing a simple LibScout.conf for this. In case you are interested to contribute, I can share more information on this.

reddr commented 5 years ago

@Drjacky With commit 16072f1023990fe7a06316e32f93dc0fde684251 I added an option ascii_rendering in the new configuration file config/LibScout.toml to toggle between unicode/ascii rendering. This should resolve the issue.

Drjacky commented 5 years ago

Great work! That approach works better. :ok_hand:

Sure, I'll be happy to help you in future.