views:

224

answers:

3

Hello - I would like to disable auto text capture by OS, if you type in UITextField/UITextView OS capture this text ( If not found in it's dictionary ) in your application, it will be stored as plain text in dynamic-text.dat file in /root/Library/Keyboard

Now if you open and read this file, you can easily read what you typed in your application.

My requirement is, how can i disable this feature so that within my application, OS does not capture typed in text into this file?

You can check this out even on iPhone Simualtor

+1  A: 

I don't know much about iPhone programming but... if you can disable the autocorrection, that would surely keep it from going into the user words database.

Nicolás
Nope, this does not work
iamiPhone
Actually, yes it does (see my post).
Kendall Helmstetter Gelner
A: 

If disabling auto correction doesn't work, I don't believe this is possible with the built in keyboard. The only solution seems to be to create your own keyboard implementation, which others have done for various reasons.

Colin Gislason
Is is possible to replace native keyboard? Do you have any application example which has done this?
iamiPhone
You can't exactly replace it, but you can go around it. You have to implement everything yourself. But basically the idea is to create some buttons that update the value of a text yourself. You also have to show and hide the keyboard yourself.You can see games that have done this. Textropolis does it well, but that's not a full keyboard.
Colin Gislason
Pretty sure this is not an aspect of the keyboard, but instead the UITextField container.
Kendall Helmstetter Gelner
+5  A: 

In the simulator, if I had a UITextField set to Secure (with autocomplete set to off though that should be the default) I never saw any text I typed there in the ~/Library/Application Support/iPhone Simulator/User/Library/Keyboard/dynamic-text.dat, though a UITextField set to autocomplete did have text end up in there.

If I turned off autocorrection on the field that was capturing before, I saw no more entries that I typed show up in that file.

I tried this both on the simulator, and also on the device - on the device I ran my same test application with a secure and unsecured text field (where I alternately turned on and off autocorrection), and then used SpyPhone to examine the keyboard cache. Again in all cases where the text field was marked as secure or had autocorrection turned off, I did not see anything I typed show up in the keyboard cache where I did if I typed it into a text field with auto-correction enabled - just to be clear even explicitly turning on autocorrection in an IB defined text field did not record anything if the field was also marked as secure (and I'm also not sure it tried to autocorrect).

Now I did note, that if I tried a UITextView instead of a UITextField, in that case even turning off autocorrection did not stop the text from being recorded. That seems like an oversight rather than a design choice. A workaround would be to use a UITextField, but that's not always possible... I'd file a Radar on that with Apple.

I can also verify that no common passwords I use (in Safari or applications) showed up in SpyPhone, so they are not in the cache. But pretty much any app collecting passwords uses a UITextField to do so.

Kendall Helmstetter Gelner
I repeated Kendall's experiment and can confirm what he has observed.
Alex Reynolds
Note that I added a small bit here - UITextView does have an issue, which is probably what led him to think it didn't work at all.
Kendall Helmstetter Gelner
Yes I see that nothing is captured for secure fields but even if i disable autocorrectionType to NO for UITextField, it does capture the key in text into the dynamic-text.dat. You can see this problem, by deleting dynamic-text.dat file from your simulator directory structure and launch your app with a text field with autocorrection set to NO, key in few unique characters, exit your app and you will see these characters in the .dat file.
iamiPhone
Nope, didn't see anything in there. I started with a blank directory (had just done a simulator reset) and in repeated testing, when a UITextField has autocorrection set to NO I never saw typed text show up there whereas I always did when I turned autocorrection back on. Alex also replicated my results so I think you missed something somewhere when you tried to turn of autocorrection (perhaps it was an IB instance that had not been wired up and so was nil at the time you tried to set autocorrection?)
Kendall Helmstetter Gelner