Open CosminCirlea opened 3 years ago
Hi @CosminCirlea,
Thank you for reporting this issue.
I have tests setup so that they can run on emulators or devices. Could you checkout this repo and run the tests in app/androidTest
on your devices? It should be a case of right-clicking on the folder androidTest
and then clicking Run all tests
which should launch on your connected device via adb.
If any of them fail then the problem is something in this library. If they all run successfully then the problem is in your code somewhere.
Hello! I'm trying to decrypt data and it's working on any emulator, but real devices do not work (tested on API 24 and 30). Any clues? Below is my code snippet
` public String decryptData(String transportKey, String cipher){ lazySodium = new LazySodiumAndroid(new SodiumAndroid()); byte[] cipherBytes = Base64.decode(cipher, Base64.DEFAULT); byte[] transportKeyBytes = Base64.decode(transportKey, Base64.DEFAULT); byte[] nonceBytes = Arrays.copyOfRange(cipherBytes, 0, AEAD.AES256GCM_NPUBBYTES); byte[] cipherTextBytes = Arrays.copyOfRange(cipherBytes, AEAD.AES256GCM_NPUBBYTES, cipherBytes.length);