TL; DR
Implementation of Entity#getBytes is currently mName.getBytes("UTF-16"), but it should be either mName.getBytes("UTF-16BE") or mName.getBytes("UTF-16LE")
detail
I am trying to implement java cli app to decrypt files encrypted by conceal, and getting tag mismatch error all the time.
And after some investigation I realized that the result of String.getBytes("UTF-16") is different between Android and Mac.
when I execute Arrays.toString("teststring".getBytes("UTF-16")) on Android, it returns
[-1, -2, 116, 0, 101, 0, 115, 0, 116, 0, 115, 0, 116, 0, 114, 0, 105, 0, 110, 0, 103, 0]
but when I execute same code on mac as gradle task or standard java project, it returns
[-2, -1, 0, 116, 0, 101, 0, 115, 0, 116, 0, 115, 0, 116, 0, 114, 0, 105, 0, 110, 0, 103]
Apparently this is why I got tag mismatch error all the time :(
To fix this issue, I create custom Entity class whose getBytes method encodes mName with UTF-16LE.
But I think this should be done in library side. any thought?