Stringer exclusion.

Discussion in 'Spigot Plugin Development' started by Marido, May 30, 2018.

  1. Hello.
    Basically (please don't discuss whether it's useless or not) I'm testing a Premium resource license system and I obfuscate it with Zelix Klassmaster 10 and Stringer.

    The issue is when I want to add an exclusion to Stringer since the string variable %%_USER_%% shouldn't be encrypted. But the issue is that I can't find a way to exclude that string in Stringer.

    I've read the documents online and couldn't find any solution besides 'filtering'.

    If anyone has experience with it, I would really appreciate your useful reply.

    Thanks.
     
  2. Maximvdw

    Benefactor

  3. Maximvdw

    Benefactor

    Also, you will need to export a proguard map first from zelix and use that map in stringer (since the package name might change depending on your obfuscation)

    Code (Text):
    <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.2.1</version>
                    <executions>
                        <execution>
                            <id>Convert Zelix map</id>
                            <phase>package</phase>
                            <goals>
                                <goal>exec</goal>
                            </goals>
                            <configuration>
                                <executable>java</executable>
                                <commandlineArgs>-classpath ZKM/ZKM.jar com.zelix.ZKMChangeLogConvert ../ZKM_map.txt ../ZKM_proguard_map.txt</commandlineArgs>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
     
  4. Sorry, but I'm a bit confused. Shouldn't it be regex since it's just one string that shouldn't be encrypted? Wouldn't it something be like:
    regex:!%%__USER__%%
    I've tried it but unfortunately, this doesn't work.

    I've done that already so far.
     
  5. Maximvdw

    Benefactor

    have you changed the mode to filter?
     
    • Winner Winner x 1
  6. Yes, of course. I'll try again to be sure about it.
     
  7. Maximvdw

    Benefactor

    Fields can not be excluded unless you use the annotations - you can only exclude a file
     
    • Winner Winner x 1
  8. Mhm, and which annotation would I have to use then?
     
  9. Maximvdw

    Benefactor

    You should also not apply it to all strings, for multiple repeating tasks (in my case animations) you want to avoid using stringer
     
    • Winner Winner x 1
  10. Gosh, I feel so dumb now. I excluded %%_USER_%% instead of %%__USER__%% (2 underlines).
    It works like a charm now, thank you so much for your great quick help man.