String Constant Replacer

Status
This thread has been locked.

Demeng

Java Developer
Supreme
Feedback score
23
Posts
632
Reactions
526
Resources
3
I need a simple standalone application that allows me to put in an input jar file and then output a new jar file with certain configurable string constants replaced with something else. Here is an example:

Original Code (compiled and obfuscated- string encryption disabled):
Java:
public class Main {
  public static final String USER = "%%__USER__%%";

  public static void main(String[] args) {
    System.out.println(USER);
  }
}

Output Code (compiled and obfuscation is still kept- the USER constant is the ONLY thing that is changed);
Java:
public class Main {
  public static final String USER = "12345";

  public static void main(String[] args) {
    System.out.println(USER);
  }
}

Config:
YAML:
input: input.jar
output: output.jar
placeholders:
  1:
    original: "%%__USER__%%"
    replaced: "12345"
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Annie

ApolloSMP
Supreme
Feedback score
20
Posts
682
Reactions
402
Resources
9
I can help you with this, in fact I'll do it for free and post it to my github. :)[DOUBLEPOST=1599506602][/DOUBLEPOST]
I need a simple standalone application that allows me to put in an input jar file and then output a new jar file with certain configurable string constants replaced with something else. Here is an example:

Original Code (compiled and obfuscated- string encryption disabled):
Java:
public class Main {
  public static final String USER = "%%__USER__%%";

  public static void main(String[] args) {
    System.out.println(USER);
  }
}

Output Code (compiled and obfuscation is still kept- the USER constant is the ONLY thing that is changed);
Java:
public class Main {
  public static final String USER = "12345";

  public static void main(String[] args) {
    System.out.println(USER);
  }
}

Config:
YAML:
input: input.jar
output: output.jar
placeholders:
  1:
    original: "%%__USER__%%"
    replaced: "12345"
https://github.com/XillaTech/String-Injector/blob/master/target/StringInjector-1.0-SNAPSHOT.jar

Works like this
upload_2020-9-7_15-23-12.png


It worked in my testing, let me know if you have any issues
 

Attachments

  • upload_2020-9-7_15-23-12.png
    upload_2020-9-7_15-23-12.png
    12.8 KB · Views: 86
Last edited:
Status
This thread has been locked.
Top