Skip to content

Wrong resource file encoding when using proguard obfuscation option -adaptresourcefilecontents #371

Open
@rolandas-karosas

Description

@rolandas-karosas

after obfuscation resource file(s) become corrupted (UTF-8 encoding is lost)

OS name: "windows 11"
Java 8
Maven 3.9.7

plugin configuration:
proguard.conf

proguard.conf:
-dontshrink
-dontoptimize
-adaptresourcefilecontents META-INF/**.tld

All my resource files are correct with UTF-8 encoding.

Need to pass JVM argument -Dfile.encoding=UTF-8 to the forked java process. (same as passing maxMemory)

I checked directly executing proguard.jar. With argument -Dfile.encoding=UTF-8 resource files are good. Without argument -Dfile.encoding=UTF-8 I also get corrupted resource files.

P.S. other maven plugins (surefire plugin, failsafe plugin) have argLine argument for passing JVM options to the forked java process

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions