[Samsung Galaxy Ace 4] Nikiz:
[MENTION=6100326]itigr[/MENTION] You could do a dual-device build, that switches between single and dual-sim RIL. You could also include NFC and use the HN-kernel config. (Or enable NFC somehow in HU-kernel) (The only real difference between HU and HN kernel is NFC support and the machine name (hawaii_ss_vivaltonfc3g))

Changes:

init/Android.mk

ifeq ($(TARGET_INIT_VENDOR_LIB),libinit_vivaltonfc3g)

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := system/core/init
LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"
LOCAL_SRC_FILES := libinit_hawaii_ss.c

LOCAL_MODULE := libinit_hawaii_ss
include $(BUILD_STATIC_LIBRARY)

endif

init/libinit_hawaii_ss.c

/*
Copyright (c) 2013, The Linux Foundation. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdlib.h>
#include <stdio.h>

#include "vendor_init.h"
#include "property_service.h"
#include "log.h"
#include "util.h"

void vendor_load_properties() {
FILE* file;
char* simslot_count_path = "/proc/simslot_count";
char simslot_count;

file = fopen(simslot_count_path, "r");

if (file != NULL) {
simslot_count = fgetc(file);
property_set("ro.multisim.simslotcount", simslot_count);

if(!strcmp(simslot_count, "1")) {
property_set("persist.dsds.enabled", "false");
property_set("persist.radio.multisim.config", "none");
property_set("ro.telephony.ril_class", "SamsungBCMRIL");
property_set("ro.product.model", "SM-G313HN");
property_set("ro.product.device", "vivaltonfc3g");
} else {
property_set("persist.dsds.enabled", "true");
property_set("persist.radio.multisim.config", "dsds");
property_set("ro.telephony.ril_class", "SamsungBCMDSRIL");
property_set("ro.product.model", "SM-G313HU");
property_set("ro.product.device", "vivaltods5m");
}
} else {
ERROR("Could not open '%s'", simslot_count_path);
}

fclose(file);
}

BoardConfig.mk

#Change:
# Assert
TARGET_OTA_ASSERT_DEVICE := vivaltonfc3g,G313HN,SM-G313HN,vivaltods5m,G313HU,SM-G313HU,hawaii

#Add
# Init
TARGET_INIT_VENDOR_LIB := libinit_hawaii_ss

device_vivaltods5m.mk:

#Add:
# Init
PRODUCT_PACKAGES += \
libinit_hawaii_ss

#Change:
ro.telephony.ril_class=SamsungBCMDSRIL \

Rename /run/media/nikiz/Android-dev/Android/Sources/CyanogenMod-11.0/device/samsung/vivaltonfc3g/ril/com/android/internal/telephony/SamsungBCMRIL.java

to /run/media/nikiz/Android-dev/Android/Sources/CyanogenMod-11.0/device/samsung/vivaltonfc3g/ril/com/android/internal/telephony/SamsungBCMDSRIL.java

and add the single-SIM ril as SamsungBCMRIL.java

I am not sure if this works though. I coded this when I was bored and I have not tried compiling it. The kernel SHOULD auto-detect the SIM-count. If I remember correctly, the /proc/simslot_count displayed 1 when I booted the phone with HU-kernel. I think this would also treat the phone as single-SIM device, when booted with a single SIM-card, so it will not show a missing second SIM.