From 7a5d01b12bc61ce654d93e6b61d5a31be3af3c87 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sun, 1 Jul 2018 21:31:55 +0100 Subject: [PATCH 1/5] 0.3.1: Prepare for next dev cycle This release will extend on the documentation of Lorenz. I plan to release it next week. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 62d87e3..7a81cda 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ targetCompatibility = '1.8' group = 'me.jamiemansfield' archivesBaseName = project.name.toLowerCase() -version = '0.3.0' +version = '0.3.1-SNAPSHOT' repositories { mavenCentral() From 470940b215e2efd860f3841dd7d739e89cc5168d Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sun, 1 Jul 2018 21:44:00 +0100 Subject: [PATCH 2/5] Update README, with lots more content --- README.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6362ee0..df32dec 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,84 @@ Lorenz ====== -Lorenz is a library for interacting with Java deobfuscation mappings, within the Java -programming language. Licensed MIT. +Lorenz is a library intended for creating and altering de-obfuscation mappings for Java +programs (compiled or otherwise), this is done independent of the format being used. Lorenz +supports a variety of mapping formats itself: + +- SRG +- CSRG +- TSRG + +There are also plans to support the following mapping formats for the (eventual) 1.0.0 +release: + +- Engima +- JAM + +## Branches + +Lorenz makes use of the [git-flow] branching structure, briefly put: + +- **master** is the source for the latest released version +- **develop** is the source of the latest developments + +All releases will also be tagged, with further descriptions in their GitHub release. +These descriptions will include information such as migration advice. ## Usage -Lorenz is available through my Maven repository (repo.jamiemansfield.me). +Lorenz is centred around the `MappingSet`, the root container of mappings. A provided +implementation can be constructed through `MappingSet.create()`. + +Lorenz releases can be obtained through Maven Central: + +### Maven + +```xml + + me.jamiemansfield + lorenz + 0.3.0 + +``` + +### Gradle + +```groovy +compile 'me.jamiemansfield:lorenz:0.3.0' +``` + +Lorenz snapshots are also available through my own Maven repository +(repo.jamiemansfield.me), under the same group/artifact id. + +## License -```gradle -repositories { - mavenCentral() - maven { - name = 'jamiemansfield' - url = 'https://repo.jamiemansfield.me/' - } -} +Lorenz is licensed under the MIT License, this was chosen for its permissive nature - +giving developers the freedom to do as they please with it, with no assurances from myself. -dependencies { - compile 'me.jamiemansfield:lorenz:0.1.0-SNAPSHOT' -} ``` +The MIT License (MIT) + +Copyright (c) Jamie Mansfield +Copyright (c) contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +``` + +[git-flow]: https://nvie.com/posts/a-successful-git-branching-model/ From 356e0e69d1cac62c7d57f25293acf8f29889bc4c Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sun, 1 Jul 2018 22:33:52 +0100 Subject: [PATCH 3/5] docs: Provide package info for all packages --- .../lorenz/impl/model/package-info.java | 29 +++++++++++++++ .../lorenz/impl/package-info.java | 34 ++++++++++++++++++ .../lorenz/io/reader/package-info.java | 36 +++++++++++++++++++ .../lorenz/io/writer/package-info.java | 36 +++++++++++++++++++ .../lorenz/model/jar/package-info.java | 29 +++++++++++++++ .../model/jar/signature/package-info.java | 29 +++++++++++++++ .../lorenz/model/package-info.java | 29 +++++++++++++++ 7 files changed, 222 insertions(+) create mode 100644 src/main/java/me/jamiemansfield/lorenz/impl/model/package-info.java create mode 100644 src/main/java/me/jamiemansfield/lorenz/impl/package-info.java create mode 100644 src/main/java/me/jamiemansfield/lorenz/io/reader/package-info.java create mode 100644 src/main/java/me/jamiemansfield/lorenz/io/writer/package-info.java create mode 100644 src/main/java/me/jamiemansfield/lorenz/model/jar/package-info.java create mode 100644 src/main/java/me/jamiemansfield/lorenz/model/jar/signature/package-info.java create mode 100644 src/main/java/me/jamiemansfield/lorenz/model/package-info.java diff --git a/src/main/java/me/jamiemansfield/lorenz/impl/model/package-info.java b/src/main/java/me/jamiemansfield/lorenz/impl/model/package-info.java new file mode 100644 index 0000000..6699b4a --- /dev/null +++ b/src/main/java/me/jamiemansfield/lorenz/impl/model/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Lorenz, licensed under the MIT License (MIT). + * + * Copyright (c) Jamie Mansfield + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * The default Lorenz model implementation. + */ +package me.jamiemansfield.lorenz.impl.model; diff --git a/src/main/java/me/jamiemansfield/lorenz/impl/package-info.java b/src/main/java/me/jamiemansfield/lorenz/impl/package-info.java new file mode 100644 index 0000000..651ecbc --- /dev/null +++ b/src/main/java/me/jamiemansfield/lorenz/impl/package-info.java @@ -0,0 +1,34 @@ +/* + * This file is part of Lorenz, licensed under the MIT License (MIT). + * + * Copyright (c) Jamie Mansfield + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * The default Lorenz implementation. + * + *

Lorenz is split into API and implementation to allow for callbacks and + * special-casing by external tools to be made easily. External tools can even + * replace single components, by using the + * {@link me.jamiemansfield.lorenz.MappingSetModelFactory}

. + */ +package me.jamiemansfield.lorenz.impl; diff --git a/src/main/java/me/jamiemansfield/lorenz/io/reader/package-info.java b/src/main/java/me/jamiemansfield/lorenz/io/reader/package-info.java new file mode 100644 index 0000000..45a66d8 --- /dev/null +++ b/src/main/java/me/jamiemansfield/lorenz/io/reader/package-info.java @@ -0,0 +1,36 @@ +/* + * This file is part of Lorenz, licensed under the MIT License (MIT). + * + * Copyright (c) Jamie Mansfield + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * A collection of pre-built readers for common mapping formats. + * + *

There are readers for the following formats:

+ *
    + *
  • SRG
  • + *
  • CSRG
  • + *
  • TSRG
  • + *
+ */ +package me.jamiemansfield.lorenz.io.reader; diff --git a/src/main/java/me/jamiemansfield/lorenz/io/writer/package-info.java b/src/main/java/me/jamiemansfield/lorenz/io/writer/package-info.java new file mode 100644 index 0000000..7920431 --- /dev/null +++ b/src/main/java/me/jamiemansfield/lorenz/io/writer/package-info.java @@ -0,0 +1,36 @@ +/* + * This file is part of Lorenz, licensed under the MIT License (MIT). + * + * Copyright (c) Jamie Mansfield + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * A collection of pre-built writers for common mapping formats. + * + *

There are writers for the following formats:

+ *
    + *
  • SRG
  • + *
  • CSRG
  • + *
  • TSRG
  • + *
+ */ +package me.jamiemansfield.lorenz.io.writer; diff --git a/src/main/java/me/jamiemansfield/lorenz/model/jar/package-info.java b/src/main/java/me/jamiemansfield/lorenz/model/jar/package-info.java new file mode 100644 index 0000000..8fc7ae6 --- /dev/null +++ b/src/main/java/me/jamiemansfield/lorenz/model/jar/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Lorenz, licensed under the MIT License (MIT). + * + * Copyright (c) Jamie Mansfield + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * A model for Java-specific types, often based on entries from the jvms manual. + */ +package me.jamiemansfield.lorenz.model.jar; diff --git a/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/package-info.java b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/package-info.java new file mode 100644 index 0000000..19ccfbc --- /dev/null +++ b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Lorenz, licensed under the MIT License (MIT). + * + * Copyright (c) Jamie Mansfield + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * A model for method and field signatures. + */ +package me.jamiemansfield.lorenz.model.jar.signature; diff --git a/src/main/java/me/jamiemansfield/lorenz/model/package-info.java b/src/main/java/me/jamiemansfield/lorenz/model/package-info.java new file mode 100644 index 0000000..f78b4e8 --- /dev/null +++ b/src/main/java/me/jamiemansfield/lorenz/model/package-info.java @@ -0,0 +1,29 @@ +/* + * This file is part of Lorenz, licensed under the MIT License (MIT). + * + * Copyright (c) Jamie Mansfield + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * A model of the various mappings types that Lorenz represents. + */ +package me.jamiemansfield.lorenz.model; From 43120f4a93ab8e27eb06aba5d6d1db893b45372e Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Thu, 12 Jul 2018 22:21:09 +0100 Subject: [PATCH 4/5] docs: Improve some jar model javadocs --- .../jamiemansfield/lorenz/model/jar/MethodDescriptor.java | 7 ++++++- .../lorenz/model/jar/signature/FieldSignature.java | 2 +- .../lorenz/model/jar/signature/MemberSignature.java | 2 +- .../lorenz/model/jar/signature/MethodSignature.java | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/jamiemansfield/lorenz/model/jar/MethodDescriptor.java b/src/main/java/me/jamiemansfield/lorenz/model/jar/MethodDescriptor.java index fa5e16a..fd22ce5 100644 --- a/src/main/java/me/jamiemansfield/lorenz/model/jar/MethodDescriptor.java +++ b/src/main/java/me/jamiemansfield/lorenz/model/jar/MethodDescriptor.java @@ -33,7 +33,12 @@ import java.util.Objects; /** - * A representation of a method's descriptor. + * A model of a method descriptor, a text representation of a method's + * parameter type and return type. + * + *

The format is simply {@code "(ParamTypes...)ReturnType"}, for example + * given a method with two integer parameters and a {@link String} return + * type - the descriptor would be {@code "(II)Ljava/lang/String;"}.

* * @see Method Descriptors * diff --git a/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/FieldSignature.java b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/FieldSignature.java index 3bb4acd..947e88d 100644 --- a/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/FieldSignature.java +++ b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/FieldSignature.java @@ -32,7 +32,7 @@ import java.util.Optional; /** - * A representation of the signature of a field. + * Represents a field within a class, by its name and descriptor. * * @author Jamie Mansfield * @since 0.2.0 diff --git a/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MemberSignature.java b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MemberSignature.java index 2ba4375..883f34a 100644 --- a/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MemberSignature.java +++ b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MemberSignature.java @@ -46,7 +46,7 @@ public abstract class MemberSignature { * * @param name The name of the member */ - public MemberSignature(final String name) { + protected MemberSignature(final String name) { this.name = name; } diff --git a/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MethodSignature.java b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MethodSignature.java index 011b6a4..1740703 100644 --- a/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MethodSignature.java +++ b/src/main/java/me/jamiemansfield/lorenz/model/jar/signature/MethodSignature.java @@ -31,7 +31,7 @@ import java.util.Objects; /** - * Represents a method within a class. + * Represents a method within a class, by its name and descriptor. * * @author Jamie Mansfield * @since 0.2.0 From 01bd774cd84c11260e9673421727f76d1594dfdd Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Thu, 12 Jul 2018 22:22:34 +0100 Subject: [PATCH 5/5] 0.3.1: Release Time --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7a81cda..72aa1ea 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ targetCompatibility = '1.8' group = 'me.jamiemansfield' archivesBaseName = project.name.toLowerCase() -version = '0.3.1-SNAPSHOT' +version = '0.3.1' repositories { mavenCentral()