我正在创建一个垂直的LinearLayout,它将显示在垂直的ScrollView中.我在Android Studio中找不到一种方法来查看位于ScrollView底部下方的LinearLayout部分.有没有办法查看完整的布局而不是将其约束到渲染器提供的视口?
我正在使用数字证书在我的应用程序中签署数据文件.当SecKeyRawVerify使用-9809返回调用时,下面的代码片段失败.这是在iPhone上运行.我甚至无法准确确定此错误代码的含义
先前的安全框架调用加载并创建SecTrustRef,从中获取公钥似乎没问题 - 没有错误.唯一的小问题是调用SecTrustEvaluate返回a kSecTrustResultUnspecified,但我认为这是因为我使用的策略是SecPolicyCreateBasicX509调用返回的样板.
非常感谢任何帮助或见解.
谢谢
SecKeyRef keyRef = SecTrustCopyPublicKey (trustRef);
fileURL = [[NSBundle mainBundle] URLForResource:@"data" withExtension:@"txt"];
NSData *data = [NSData dataWithContentsOfURL:fileURL];
fileURL = [[NSBundle mainBundle] URLForResource:@"data" withExtension:@"sgn"];
NSData *signature = [NSData dataWithContentsOfURL:fileURL];
NSLog(@"Hash block size = %zu",SecKeyGetBlockSize(keyRef));
status = SecKeyRawVerify (keyRef,
kSecPaddingPKCS1SHA1,
(const uint8_t *)[data bytes],
(size_t)[data length],
(const uint8_t *)[signature bytes],
(size_t)[signature length]
);
Run Code Online (Sandbox Code Playgroud) 这个applescript有效
set myFile to (POSIX path "/Users/fred/Documents/data.dat")
Run Code Online (Sandbox Code Playgroud)
这个applescript 不起作用
set myFileName to "/Users/fred/Documents/data.dat"
set myFile to (POSIX path myFileName)
Run Code Online (Sandbox Code Playgroud)
它因错误而失败
get POSIX file "/Users/fred/Documents/data.dat"
--> error number -1728
Result:
error "iTunes got an error: Can’t get POSIX file \"/Users/fred/Documents/data.dat\"." number -1728 from file "Macintosh HD:Users:drew:Desktop:Music:DIY:DIY-01.mp3"
Run Code Online (Sandbox Code Playgroud)
看起来好像在使用变量时,POSIX 路径在文件名中包含双引号作为显式字符。我究竟做错了什么?
下面的脚本重现了该问题。
tell application "Finder"
set newFileName to "/Users"
set newFile to POSIX file newFileName
end tell
Run Code Online (Sandbox Code Playgroud)
谢谢