Skip to content

Commit

Permalink
Unescape the XML entities in the APPX publisher attribute (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebourg committed Oct 23, 2024
1 parent de54040 commit fb8a6e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions jsign-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<version>2.16.1</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.12.0</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion jsign-core/src/main/java/net/jsign/appx/APPXFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import javax.security.auth.x500.X500Principal;

import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.poi.util.IOUtils;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.DERNull;
Expand Down Expand Up @@ -201,7 +202,7 @@ String getPublisher() throws IOException {

Pattern pattern = Pattern.compile("Publisher\\s*=\\s*\"([^\"]+)", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(manifest);
return matcher.find() ? matcher.group(1) : null;
return matcher.find() ? StringEscapeUtils.unescapeXml(matcher.group(1)) : null;
}

@Override
Expand Down

0 comments on commit fb8a6e5

Please sign in to comment.