private MeshModel parsePreMigrationMeshModel(final JsonObject jsonObject) {
        final int modelId = jsonObject.getAsJsonObject().get("mModelId").getAsInt();
        final MeshModel meshModel = getMeshModel(modelId);

        final JsonArray jsonArrayBoundKeyIndexes = jsonObject.getAsJsonObject().getAsJsonArray("mBoundAppKeyIndexes");
        final JsonObject jsonBoundKeys = jsonObject.getAsJsonObject().get("mBoundAppKeys").getAsJsonObject();
        for (int i = 0; i < jsonArrayBoundKeyIndexes.size(); i++) {
            final int index = jsonArrayBoundKeyIndexes.get(i).getAsInt();
            final String key = jsonBoundKeys.get(String.valueOf(index)).getAsString();
            meshModel.mBoundAppKeyIndexes.add(index);
        }

        final JsonArray jsonSubscriptionAddresses = jsonObject.getAsJsonObject().get("mSubscriptionAddress").getAsJsonArray();

        for (int i = 0; i < jsonSubscriptionAddresses.size(); i++) {
            final JsonArray jsonArray = jsonSubscriptionAddresses.get(i).getAsJsonArray();
            final byte[] subscriptionAddress = new byte[2];
            for (int j = 0; j < jsonArray.size(); j++) {
                subscriptionAddress[j] = jsonArray.get(j).getAsByte();
            }
            meshModel.addSubscriptionAddress(addressBytesToInt(subscriptionAddress));
        }

        if (jsonObject.getAsJsonObject().has("mPublicationSettings")) {
            final JsonObject jsonPublicationSettings = jsonObject.getAsJsonObject().get("mPublicationSettings").getAsJsonObject();
            if (jsonPublicationSettings != null) {
                final int appKeyIndex = jsonPublicationSettings.get("appKeyIndex").getAsInt();
                final boolean credentialFlag = jsonPublicationSettings.get("credentialFlag").getAsBoolean();
                final int publicationResolution = jsonPublicationSettings.get("publicationResolution").getAsInt();
                final int publicationSteps = jsonPublicationSettings.get("publicationSteps").getAsInt();

                //final JsonArray jsonPublishAddress = jsonPublicationSettings.get("publishAddress").getAsJsonArray();

                if (jsonPublicationSettings.has("publishAddress")) {
                    final int publishAddress;
                    final JsonElement jsonElement = jsonPublicationSettings.get("publishAddress");
                    //We check if subscription address is a byte[] or not inorder to migrate the data without losing
                    if (jsonElement.isJsonArray()) {
                        final JsonArray jsonPublishAddress = jsonElement.getAsJsonArray();
                        final byte[] address = new byte[jsonPublishAddress.size()];
                        for (int i = 0; i < jsonPublishAddress.size(); i++) {
                            address[i] = jsonPublishAddress.get(i).getAsByte();
                        }
                        publishAddress = MeshParserUtils.unsignedBytesToInt(address[1], address[0]);
                    } else {
                        publishAddress = jsonElement.getAsInt();
                    }

                    final int publishRetransmitCount = jsonPublicationSettings.get("publishRetransmitCount").getAsInt();
                    final int publishRetransmitIntervalSteps = jsonPublicationSettings.
                            get("publishRetransmitIntervalSteps").getAsInt();
                    final int publishTtl = jsonPublicationSettings.get("publishRetransmitIntervalSteps").getAsByte();

                    meshModel.mPublicationSettings = new PublicationSettings(publishAddress,
                            appKeyIndex, credentialFlag, publishTtl, publicationSteps,
                            publicationResolution, publishRetransmitCount, publishRetransmitIntervalSteps);
                }
            }
        } else {
            final byte[] publishKeyAppIndex = new byte[2];
            final JsonObject jsonPublicationSettings = jsonObject.getAsJsonObject();
            if (jsonPublicationSettings.has("publishAppKeyIndex")) {
                final JsonArray jsonPublishKeyIndex = jsonObject.getAsJsonObject().get("publishAppKeyIndex").getAsJsonArray();
                for (int i = 0; i < jsonPublishKeyIndex.size(); i++) {
                    publishKeyAppIndex[i] = jsonPublishKeyIndex.get(i).getAsByte();
                }
            }

            if (jsonPublicationSettings.has("publishAddress")) {
                final int publishAddress;
                final JsonElement jsonElement = jsonPublicationSettings.get("publishAddress");
                if (jsonElement.isJsonArray()) {
                    final JsonArray jsonPublishAddress = jsonElement.getAsJsonArray();
                    final byte[] address = new byte[jsonPublishAddress.size()];
                    for (int i = 0; i < jsonPublishAddress.size(); i++) {
                        address[i] = jsonPublishAddress.get(i).getAsByte();
                    }
                    publishAddress = MeshParserUtils.unsignedBytesToInt(address[1], address[0]);
                } else {
                    publishAddress = jsonElement.getAsInt();
                }
                final int publicationResolution = jsonPublicationSettings.get("publicationResolution").getAsInt();
                final int publicationSteps = jsonPublicationSettings.get("publicationSteps").getAsInt();
                final int publishPeriod = jsonPublicationSettings.get("publishPeriod").getAsInt();
                final int publishRetransmitCount = jsonPublicationSettings.get("publishRetransmitCount").getAsInt();
                final int publishRetransmitIntervalSteps = jsonPublicationSettings.get("publishRetransmitIntervalSteps").getAsInt();
                final int publishTtl = jsonPublicationSettings.get("publishTtl").getAsInt();
                meshModel.mPublicationSettings = new PublicationSettings(publishAddress,
                        MeshParserUtils.removeKeyIndexPadding(publishKeyAppIndex), false,
                        publishTtl, publicationSteps, publicationResolution, publishRetransmitCount, publishRetransmitIntervalSteps);
            }
        }
        return meshModel;
    }
Parses mesh model data prior to migration

@param jsonObject jsonObject
mesh/src/main/java/no/nordicsemi/android/mesh/transport/InternalMeshModelDeserializer.java