Android Question readEncryptedObject Error

Stulish

Active Member
Licensed User
Longtime User
i am trying to read an old settings ini file i created years ago, the code below is lifted directly from the B4A program i used but it doesn't seem to work now using the latest B4A:

B4X:
Dim raf As RandomAccessFile
    Dim ini As Map
    ini.Initialize
    raf.Initialize(File.DirInternal, "Settings.ini", True)
    ini = raf.readEncryptedObject("Password1", raf.CurrentPosition)
    Log("INI Version: " & ini.Get(1))
    Log("Use Deg/Min/Sec instead of Decimal: " & ini.Get(2))
    Log("Display a Gyro: " & ini.Get(3))
    Log("Display ROT: " &  ini.Get(4))
    Log("Device ID: " & ini.Get(5))
    Log("Rate of Turn Step 1: " & ini.Get(6))
    Log("Rate of Turn Step 2: " & ini.Get(7))
    Log("Rate of Turn Step 3: " & ini.Get(8))
    Log("Rate of Turn Step 4: " & ini.Get(9))
    Log("Bluetooth Device Name: " & ini.Get(10))
    Log("Bluetooth Device MAC: " & ini.Get(11))
    Log("Wifi SSID: " & ini.Get(12))
    Log("Wifi Port: " & ini.Get(13))
    Log("Wifi IP: " & ini.Get(14))
    Log("Demo Mode (checked): " & ini.Get(15))
    Log("Name: " & ini.Get(16))
    raf.Close

i get the following error in the log:


Does anyone have any ideas? thanks
 

Stulish

Active Member
Licensed User
Longtime User
Thanks Erel, i will see if it is the device i have installed it onto, as it still works on the old device (i have been told)
 
Upvote 0

Stulish

Active Member
Licensed User
Longtime User
I found the issue, the file they sent me was corrupt .

Thanks
 
Upvote 0