From 991b1257d157241670ca3d26b130f7f5ae5126c0 Mon Sep 17 00:00:00 2001 From: Radoslaw Date: Fri, 3 Sep 2021 00:01:45 +0200 Subject: [PATCH] xstream permission --- .../androidaps/plugins/pump/common/sync/PumpSyncStorage.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt index 0e285b6643..592674088a 100644 --- a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt +++ b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.sync import com.google.gson.Gson import com.google.gson.GsonBuilder +import com.thoughtworks.xstream.security.AnyTypePermission import com.thoughtworks.xstream.XStream import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.interfaces.PumpSync @@ -45,6 +46,7 @@ class PumpSyncStorage @Inject constructor( val jsonData: String = sp.getString(pumpSyncStorageKey, ""); if (jsonData.isNotBlank()) { + xstream.addPermission(AnyTypePermission.ANY) pumpSyncStorage = xstream.fromXML(jsonData, MutableMap::class.java) as MutableMap> aapsLogger.debug(LTag.PUMP, String.format("Loading Pump Sync Storage: boluses=%d, tbrs=%d.", pumpSyncStorage[BOLUS]!!.size, pumpSyncStorage[TBR]!!.size))