我正在加密objective-c中的字符串,并使用AES加密Java中的相同字符串,并且看到一些奇怪的问题.结果的第一部分与某个点匹配,但后来却不同,因此当我将Java的结果解码到iPhone上时,它无法对其进行解密.
我正在使用一个源代码字符串"现在然后这是什么废话.你知道吗?" 使用"1234567890123456"的键
加密的objective-c代码如下:注意:它是NSData类别,因此假设在NSData对象上调用该方法,因此'self'包含要加密的字节数据.
- (NSData *)AESEncryptWithKey:(NSString *)key {
char keyPtr[kCCKeySizeAES128+1]; // room for terminator (unused)
bzero(keyPtr, sizeof(keyPtr)); // fill with zeroes (for padding)
// fetch key data
[key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
NSUInteger dataLength = [self length];
//See the doc: For block ciphers, the output size will always be less than or
//equal to the input size plus the size of one block.
//That's why we need to add the size of one block here
size_t bufferSize = dataLength + …
Run Code Online (Sandbox Code Playgroud) 我试图在膨胀LinearLayout并调用setContentView之后显示键盘:
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(etContent, InputMethodManager.SHOW_FORCED);
getContent.requestFocus();
Run Code Online (Sandbox Code Playgroud)
它没用.我也试过这个:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
Run Code Online (Sandbox Code Playgroud)
但它也没有用.如何强制键盘显示/隐藏?我做错了什么?
任何人都知道是否存在某种方式来检查App Store上是否存在一个更新?
我想要通知用户我的应用程序的新更新开始...
谢谢
objective-c ×2
aes ×1
android ×1
app-store ×1
encryption ×1
ios4 ×1
iphone ×1
java ×1
keyboard ×1
xcode4 ×1