【发布时间】:2011-02-13 05:13:24
【问题描述】:
在我的机器上安装应用程序后,加密的本地存储将无法运行。我在这台计算机上使用 encryptedlocalstore 时遇到了问题,所以我设置了一个基本的测试程序。
从 adl 运行时一切正常,但在正常运行时无法正常运行。如果我从 .app/Contents/Resources 文件夹内对已安装的应用程序运行 adl,应用程序工作正常,但正常运行时会失败。
我已尝试删除整个 ~/Library/Application Support/Adobe/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"/>
【问题讨论】: