Android Question Reading encrypted string and decoding it into a string array

Stephen A Wolfe

Member
Licensed User
Here's some code I have:
B4X:
    Dim ReadString As String
    Dim EncryptedString As Object
    Dim MyPhone As PhoneId
And...
    EncryptedString = File.ReadString(File.DirRootExternal, "MyFolder/MyFile.txt")
    ReadString = DecryptText(EncryptedString, MyPhone.GetDeviceId)
    FileLoc = Regex.Split(CRLF, ReadString)
    Msgbox(FileLoc(1), "The line of decoded array I need")

I'm getting an error "String cannot be cast to Byte". It seems like this should work. The error occurs for the decrypt line. I am saving the file using the reverse method (
File.WriteString(File.DirRootExternal, "MyFolder/MyFile.txt", EncryptedString)

I have tried so many different things and am completely stumped.
 

OliverA

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0
Top