6 Replies Latest reply on Apr 14, 2010 11:43 PM by stitchy

    Encrypted local store corrupted

    stitchy

      When using the ADL to run my HTML based application I can store data in the encrypted local store fine. When the app is packaged and installed, I can set and retrieve data from the local store the first time the application is run. If I then close down the application and start it up again, accessing the ELS throws an error.

       

      I've found information on various sites about how some AIR developers get their user base to overcome such issues but surely this isn't the way forward. Is their a fundamental bug with the ELS in Adobe Air or can anyone help point me in the right direction so I can rectify this problem.

        • 1. Re: Encrypted local store corrupted
          stitchy Level 1

          Bump. Anyone help out with this?

          Thanks

          • 2. Re: Encrypted local store corrupted
            stitchy Level 1

            Bump. Anyone help out with this?

            Thanks

            • 3. Re: Encrypted local store corrupted
              Joe ... Ward Level 4

              What is the error? Are you setting the stronglyBound parameter to true when adding data to the store? Are you changing any of the files in the application directory at runtime?

              • 4. Re: Encrypted local store corrupted
                stitchy Level 1

                Joe,

                 

                Thanks very much for responding. I have now added the stronglyBoung argument when setting data in the ELS although this was not causing the problem. I did however, fail to copy my pre-populated database from the application directory to the application storage directory which meant that I was indeed changing the database file in the application directory at runtime....doh!

                 

                When developing, my database was stored in the application directory which of course did not produce any unexpected results.

                 

                var database = {};


                database.dbFileName = 'lizard.db';

                database.dbFile =  air.File.applicationDirectory.resolvePath(database.dbFileName);

                 

                So, now I have changed the database file to the application storage directory and then copy a pre-populated template database over if this file does not exist:

                 

                var database = {};


                database.dbFileName = 'lizard.db';
                database.dbFile = air.File.applicationStorageDirectory.resolvePath(database.dbFileName);


                if (!database.dbFile.exists) {
                    var dbTemplate =  air.File.applicationDirectory.resolvePath(database.dbFileName);
                     dbTemplate.copyTo(database.dbFile, true); 
                }

                 

                Thanks very much for your help and pointing out where I could be going wrong - much appreciated.

                • 5. Re: Encrypted local store corrupted
                  Joe ... Ward Level 4

                  Actually, you should NOT set the stronglyBound parameter to true. It doesn't really add any security and using it means that those items in the store can't be accessed after an update to your application. I asked if you were using it because I thought it might be the cause of your problem -- not the solution.

                  • 6. Re: Encrypted local store corrupted
                    stitchy Level 1

                    Thanks again for your feedback. In my haste to fix this issue I've dived into the code and worked on both areas where you pointed out there could be issues. Setting the stronglyBound parameter to true does in deed bind the data to a specific version of the application. I have now removed this.