diff --git a/aware-core/src/main/java/com/aware/Applications.java b/aware-core/src/main/java/com/aware/Applications.java
index 286da09e4..7add73bf7 100644
--- a/aware-core/src/main/java/com/aware/Applications.java
+++ b/aware-core/src/main/java/com/aware/Applications.java
@@ -342,7 +342,10 @@ public void onAccessibilityEvent(AccessibilityEvent event) {
touch.put(Screen_Provider.Screen_Touch.DEVICE_ID, Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID));
touch.put(Screen_Provider.Screen_Touch.TOUCH_APP, event.getPackageName().toString());
touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION, Screen.ACTION_AWARE_TOUCH_CLICKED);
- touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION_TEXT, event.getText().toString());
+ if (Aware.getSetting(getApplicationContext(), Aware_Preferences.MASK_TOUCH_TEXT).equals("true"))
+ touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION_TEXT, Converters.maskString(event.getText().toString()));
+ else
+ touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION_TEXT, event.getText().toString());
touch.put(Screen_Provider.Screen_Touch.TOUCH_INDEX_ITEMS, event.getItemCount());
touch.put(Screen_Provider.Screen_Touch.TOUCH_FROM_INDEX, event.getFromIndex());
touch.put(Screen_Provider.Screen_Touch.TOUCH_TO_INDEX, event.getToIndex());
@@ -363,7 +366,10 @@ public void onAccessibilityEvent(AccessibilityEvent event) {
touch.put(Screen_Provider.Screen_Touch.DEVICE_ID, Aware.getSetting(getApplicationContext(), Aware_Preferences.DEVICE_ID));
touch.put(Screen_Provider.Screen_Touch.TOUCH_APP, event.getPackageName().toString());
touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION, Screen.ACTION_AWARE_TOUCH_LONG_CLICKED);
- touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION_TEXT, event.getText().toString());
+ if (Aware.getSetting(getApplicationContext(), Aware_Preferences.MASK_TOUCH_TEXT).equals("true"))
+ touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION_TEXT, Converters.maskString(event.getText().toString()));
+ else
+ touch.put(Screen_Provider.Screen_Touch.TOUCH_ACTION_TEXT, event.getText().toString());
touch.put(Screen_Provider.Screen_Touch.TOUCH_INDEX_ITEMS, event.getItemCount());
touch.put(Screen_Provider.Screen_Touch.TOUCH_FROM_INDEX, event.getFromIndex());
touch.put(Screen_Provider.Screen_Touch.TOUCH_TO_INDEX, event.getToIndex());
diff --git a/aware-core/src/main/java/com/aware/Aware_Preferences.java b/aware-core/src/main/java/com/aware/Aware_Preferences.java
index 36e077536..7c9ec01b1 100644
--- a/aware-core/src/main/java/com/aware/Aware_Preferences.java
+++ b/aware-core/src/main/java/com/aware/Aware_Preferences.java
@@ -645,4 +645,9 @@ public class Aware_Preferences {
* Log touch and gesture events
*/
public static final String STATUS_TOUCH = "status_touch";
+
+ /**
+ * Masks text produced by touch events
+ */
+ public static final String MASK_TOUCH_TEXT = "mask_touch_text";
}
\ No newline at end of file
diff --git a/aware-core/src/main/java/com/aware/utils/Converters.java b/aware-core/src/main/java/com/aware/utils/Converters.java
index aa2c07c93..7be549bd0 100644
--- a/aware-core/src/main/java/com/aware/utils/Converters.java
+++ b/aware-core/src/main/java/com/aware/utils/Converters.java
@@ -38,7 +38,7 @@ public static boolean isNumeric(String str) {
}
/**
- * Anonymises a string by substituting all alphanumeric characters with a random one.
+ * Anonymises a string by substituting all alphanumeric characters with A, a, or 1.
*
* @param originalInput
* @return string
diff --git a/aware-core/src/main/res/xml/aware_preferences.xml b/aware-core/src/main/res/xml/aware_preferences.xml
index b683ebdc4..f6c208b56 100644
--- a/aware-core/src/main/res/xml/aware_preferences.xml
+++ b/aware-core/src/main/res/xml/aware_preferences.xml
@@ -662,6 +662,14 @@
android:summary="Capture clicks, long clicks and scroll up/down events"
android:title="Screen interaction" />
+
+