2011-02-13 130 views
0

一旦在我的計算機上安裝了應用程序,加密的本地存儲就無法運行。我一直在使用encryptedlocalstore在這臺電腦上遇到問題,所以我設置了一個基本的測試程序。Adob​​e AIR EncryptedLocalStore問題

事情從adl運行時工作正常,但運行正常時不起作用。如果我在.app/Contents/Resources文件夾內的已安裝應用程序上運行adl,則應用程序可以正常工作,但在正常運行時會失敗。

我試過刪除我的整個〜/庫/應用程序支持/ Adob​​e/AIR/ELS文件夾,但無濟於事。我卸載並重新安裝了Adobe Air 2.5.1,但ELS仍然失敗。應用程序的文件夾是在ELS文件夾中創建的,但是沒有任何對ELS函數的調用,並且在消息「一般內部錯誤」中引發錯誤。沒有堆棧跟蹤附加到錯誤消息。

我運行的Mac OSX 10.6.6

的代碼非常簡單,但我反正附加。

任何想法?

<?xml version="1.0"?> 
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        applicationComplete="init()"> 

<s:layout> 
    <s:VerticalLayout/> 
</s:layout> 

<fx:Script><![CDATA[ 
    import mx.controls.Alert; 

    protected function init():void 
    { 
     output.text += "before\n"; 

     try 
     { 
      var data:ByteArray = EncryptedLocalStore.getItem("testItem"); 
      if (!data) 
      { 
       output.text += "Value not set\n"; 
      } 
      else 
      { 
       output.text += "Value Was: " + data.readUTFBytes(data.bytesAvailable) + "\n"; 
       EncryptedLocalStore.removeItem("testItem"); 
       output.text += "Item Removed\n"; 
      } 
     } 
     catch (e:Error) 
     { 
      output.text += e.message + "\n"; 
      output.text += e.getStackTrace() + "\n"; 
     } 

     output.text += "after\n"; 
    } 

    protected function storeItem():void 
    { 
     var bytes:ByteArray = new ByteArray(); 
     bytes.writeUTFBytes(toStore.text); 
     EncryptedLocalStore.setItem("testItem", bytes); 
     output.text += "Value Stored: " + toStore.text + "\n"; 
    } 
    ]]></fx:Script> 

<s:TextInput id="toStore"/> 
<s:Button click="storeItem()" label="Store Val"/> 
<s:TextArea id="output"/> 

回答