Artenus 2D Framework
Artenus Reference
com.annahid.libs.artenus.security

PreferenceObfuscator

A wrapper for SharedPreferences that transparently performs data obfuscation.
public class PreferenceObfuscator

Constructor Summary

Modifier and TypeConstructor and Description
public PreferenceObfuscator(SharedPreferences sp, Obfuscator o)
Constructors a new instance of PreferenceObfuscator.

Method Summary

Modifier and TypeMethod and Description
public voidcommit()
Commits changes to settings.
public StringgetString(String key, String defValue)
Gets the value of the specified setting.
public voidputString(String key, String value)
Sets the value for the specified setting.

Methods inherited from java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PreferenceObfuscator
public  PreferenceObfuscator(
    SharedPreferences sp,
    Obfuscator o
)
Constructors a new instance of PreferenceObfuscator.
Parameters:
spA SharedPreferences instance provided by the system
oThe Obfuscator to use when reading or writing data

Method Detail

commit
public void commit()
Commits changes to settings.
getString
public String getString(
    String key,
    String defValue
)
Gets the value of the specified setting.
Parameters:
keyKey to the setting
defValueString representation of the default value
Returns:
String representation of the value
putString
public void putString(
    String key,
    String value
)
Sets the value for the specified setting.
Parameters:
keyKey to the setting
valueString representation of the value