Skip to content

Commit e6a2ed0

Browse files
committed
fix string length being in utf-16
1 parent 5038b87 commit e6a2ed0

File tree

1 file changed

+3
-2
lines changed
  • dex-translator/src/main/java/com/googlecode/d2j/dex

1 file changed

+3
-2
lines changed

dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2jar.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ public void visitEnd() {
138138
}
139139
try {
140140
if (baos != null) {
141-
baos.write(ByteBuffer.allocate(4).putInt(className.length()).array());
142-
baos.write(className.getBytes(StandardCharsets.UTF_8));
141+
byte[] classNameBytes = className.getBytes(StandardCharsets.UTF_8);
142+
baos.write(ByteBuffer.allocate(4).putInt(classNameBytes.length).array());
143+
baos.write(classNameBytes);
143144
baos.write(ByteBuffer.allocate(4).putInt(data.length).array());
144145
baos.write(data);
145146
}

0 commit comments

Comments
 (0)