File tree Expand file tree Collapse file tree
main/java/com/emanuelef/remote_capture/model
test/java/com/emanuelef/remote_capture Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ public static String serialize(SharedPreferences prefs) {
6363 JsonObject settings = new JsonObject ();
6464
6565 for (Map .Entry <String , ?> entry : prefs .getAll ().entrySet ()) {
66- if (PrefsSchema .isExcludedFromBackup (entry .getKey ()))
66+ String key = entry .getKey ();
67+
68+ if (PrefsSchema .isExcludedFromBackup (key ) || !PrefsSchema .isKnown (key ))
6769 continue ;
6870
6971 JsonObject encoded = encode (entry .getValue ());
7072 if (encoded != null )
71- settings .add (entry . getKey () , encoded );
73+ settings .add (key , encoded );
7274 }
7375
7476 JsonObject root = new JsonObject ();
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ public void testExcludedKeysNotExported() {
130130 .putString ("available_skus" , "{}" )
131131 .putString ("unlock_token" , "token" )
132132 .putLong (Billing .SKU_PREF_PREFIX + Billing .PCAPNG_SKU , 1234 )
133+ .putString (Prefs .PREF_COLLECTOR_IP_KEY , "1.2.3.4" )
133134 .putBoolean (Prefs .PREF_ROOT_CAPTURE , true )
134135 .commit ();
135136
@@ -143,6 +144,7 @@ public void testExcludedKeysNotExported() {
143144 assertFalse (json .contains (Prefs .PREF_API_KEY ));
144145 assertFalse (json .contains (CtrlPermissions .PREF_NAME ));
145146 assertFalse (json .contains ("peer_skus" ));
147+ assertFalse (json .contains (Prefs .PREF_COLLECTOR_IP_KEY ));
146148 assertFalse (json .contains ("available_skus" ));
147149 assertFalse (json .contains ("unlock_token" ));
148150 assertFalse (json .contains (Billing .SKU_PREF_PREFIX ));
You can’t perform that action at this time.
0 commit comments