obfuscation-commons-lang

Provides functionality for obfuscating objects using Apache Commons Lang

Лицензия

Лицензия

Группа

Группа

com.github.robtimus
Идентификатор

Идентификатор

obfuscation-commons-lang
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

obfuscation-commons-lang
Provides functionality for obfuscating objects using Apache Commons Lang
Ссылка на сайт

Ссылка на сайт

https://robtimus.github.io/obfuscation-commons-lang/
Система контроля версий

Система контроля версий

https://github.com/robtimus/obfuscation-commons-lang

Скачать obfuscation-commons-lang

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.robtimus/obfuscation-commons-lang/ -->
<dependency>
    <groupId>com.github.robtimus</groupId>
    <artifactId>obfuscation-commons-lang</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.robtimus/obfuscation-commons-lang/
implementation 'com.github.robtimus:obfuscation-commons-lang:1.0.1'
// https://jarcasting.com/artifacts/com.github.robtimus/obfuscation-commons-lang/
implementation ("com.github.robtimus:obfuscation-commons-lang:1.0.1")
'com.github.robtimus:obfuscation-commons-lang:jar:1.0.1'
<dependency org="com.github.robtimus" name="obfuscation-commons-lang" rev="1.0.1">
  <artifact name="obfuscation-commons-lang" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.robtimus', module='obfuscation-commons-lang', version='1.0.1')
)
libraryDependencies += "com.github.robtimus" % "obfuscation-commons-lang" % "1.0.1"
[com.github.robtimus/obfuscation-commons-lang "1.0.1"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.github.robtimus : obfuscation-core jar 1.3
org.apache.commons : commons-lang3 jar 3.11

test (3)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter jar 5.7.0
org.hamcrest : hamcrest jar 2.2
org.mockito : mockito-core jar 3.5.13

Модули Проекта

Данный проект не имеет модулей.

obfuscation-commons-lang

Provides extensions to Apache Commons Lang for obfuscating objects.

Currently it has one extension: an obfuscating ToStringStyle. This can obfuscate fields when used with ToStringBuilder or similar classes.

To create an obfuscating ToStringStyle, use one of the factory methods of class ObfuscatingToStringStyle to create a builder, add fields, and build the result. For instance, using the default style:

ToStringStyle style = ObfuscatingToStringStyle.defaultStyle()
        .withField("password", Obfuscator.fixedLength(3))
        .build();

Available styles

Most of the styles available in Apache Commons Lang 3 are available, including the recursive and multi-line recursive style. The only style that has been omitted is the JSON toString style.

Immutability

Most of the styles available in Apache Commons Lang 3 are all immutable. The same cannot be said for the obfuscating styles, they are not immutable and not thread-safe. Reusing the same instance should not be done concurrently (reusing it in the same thread should be possible).

However, it is possible to create immutable suppliers instead:

Supplier<? extends ToStringStyle> styleSupplier = ObfuscatingToStringStyle.defaultStyle()
        .withField("password", Obfuscator.fixedLength(3))
        .supplier();

The difference between using build() and using supplier() is that supplier() is more light-weight if you need to create multiple styles with the same settings. Such a supplier can be used directly or using ThreadLocal. For instance, in a class:

private static final Supplier<? extends ToStringStyle> TO_STRING_STYLE = ObfuscatingToStringStyle.defaultStyle()
        ...
        .supplier();

...

@Override
public String toString() {
    return ToStringBuilder.reflectionToString(this, TO_STRING_STYLE.get());
}

Serializability

Obfuscating ToStringStyle instances are serializable if the obfuscators they use are. This most often means that they are not serializable, even though most ToStringStyle implementations are.

Extending ObfuscatingToStringStyle

See examples for some examples. These include both an example that simply reuses ObfuscatingToStringStyle.Builder, and one that provides a builder with more properties.

Версии библиотеки

Версия
1.0.1
1.0