Hello,
I think it is the last post about porting b4a to b4i. I use this b4a code in order to encrypt and decrypt chat messages:
In b4i throws this error:
As I read at posts there is a problem about charset. Here is table structure for encrypted chat messages:
Any ideas?
Thank you for your time.
I think it is the last post about porting b4a to b4i. I use this b4a code in order to encrypt and decrypt chat messages:
B4X:
Sub EncryptText(text As String, password As String) As Byte()
#if b4a
Dim c As B4XCipher
#Else
Dim c As Cipher
#End If
Return c.Encrypt(text.GetBytes("utf8"), password)
End Sub
Sub DecryptText(EncryptedData() As Byte, password As String) As String
#if b4a
Dim c As B4XCipher
#Else
Dim c As Cipher
#End If
Dim b() As Byte = c.Decrypt(EncryptedData, password)
Return BytesToString(b, 0, b.Length, "UTF8")
End Sub
In b4i throws this error:
B4X:
*** fullprofilepage: B4XPage_Disappear [mainpage, fullprofilepage, chatpage]
*** chatpage: B4XPage_Appear [mainpage, fullprofilepage, chatpage]
*** chatpage: B4XPage_Resize [mainpage, fullprofilepage, chatpage]
ready
Class (b4i_dbrequestmanager) instance released.
Class (b4i_httpjob) instance released.
Error occurred on line: 141 (misc)
Error decoding data as string.
Stack Trace: (
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 601236
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 941700
fitbook.gr -[B4ICommon BytesToString::::] + 264
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 134416
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 249336
fitbook.gr +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1348
fitbook.gr -[B4IShell runMethod:] + 420
fitbook.gr -[B4IShell raiseEventImpl:method:args::] + 1472
fitbook.gr -[B4IShellBI raiseEvent:event:params:] + 1360
fitbook.gr -[b4i_misc _decrypttext::] + 316
fitbook.gr -[ResumableSub_chat_getChatMessages resume::] + 4164
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 134416
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 249336
fitbook.gr +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1348
fitbook.gr -[B4IShell runMethod:] + 420
fitbook.gr -[B4IShell raiseEventImpl:method:args::] + 1968
fitbook.gr -[B4IShellBI raiseEvent:event:params:] + 1360
fitbook.gr -[B4IDelegatableResumableSub resume::] + 376
fitbook.gr -[B4I checkAndRunWaitForEvent:event:params:] + 468
fitbook.gr -[B4IShellBI raiseEvent:event:params:] + 1216
fitbook.gr __33-[B4I raiseUIEvent:event:params:]_block_invoke + 52
libdispatch.dylib 34EF3925-0303-30BF-9946-AD99311620DD + 405652
libdispatch.dylib 34EF3925-0303-30BF-9946-AD99311620DD + 409748
libdispatch.dylib 34EF3925-0303-30BF-9946-AD99311620DD + 68932
libdispatch.dylib 34EF3925-0303-30BF-9946-AD99311620DD + 67988
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 319540
CoreFoundation 309E77AA-4FF2-35B9-8AF6-33AF9C2B7929 + 46392
CoreFoundation CFRunLoopRunSpecific + 572
GraphicsServices GSEventRunModal + 160
UIKitCore 697C7D5C-9761-36E9-8E0F-200035BF3F39 + 5134984
UIKitCore UIApplicationMain + 336
fitbook.gr main + 100
dyld start + 444
)
As I read at posts there is a problem about charset. Here is table structure for encrypted chat messages:
Any ideas?
Thank you for your time.