[Infinix HOT 2] Nonta72:
Part 3: Fixing bugs

If your ROM boots, you'll likely get some bugs such as camera, sound, RIL etc.

For Stock or stock based ROMs

Audio fix:

Copy libaudio.primary.default from Stock ROM.

Camera fix:

If camera can't connect or force close

Copy libcamalgo.so and libcameracustom.so from stock ROM

If it still doesn't work, then copy all files with libcam from Stock ROM.

If it still persists, edit unpack boot.img using the method in Part 1. Compare both init.rc files and add extra lines from BootP/ramdisk/init.rc to BootS/ramdisk/init.rc

If camera size is wrong or swapped

Copy libcam.paramsmgr.so from Stock ROM

SIM card detection fix:

- Use Stock ROM's firmware folder

- Compare both build.prop files and make changes according (Guide by Nonta, stolen y Nayan Deka) to what is in Stock build.prop starting from # ADDITIONAL_BUILD_PROPERTIES DON'T TOUCH RINGTONE AND NOTIFICATIONS SETTINGS.

- Also think about restoring your IMEI or rewriting it using for example ToolHero.apk

For CM-12.1 or based ROMs

Bootloop fix:

- Unpack both BootS.img and BootP.img following the steps provided in Part 1.

- Compare init.environ.rc files and make changes according to what is in BootP init.environ.rc file. Only compare BOOTCLASSPATH section!

- Compare both init.rc files and add extra lines from BootP.

Shared by Rendy

If it still doesn't work, then sorry! I can't help further :fingers-crossed:

Sdcard detection fix:

If SD Card doesn't appear in file manager, follow these:

- Open Stock/system/framework/framework-res.apk file with 7-zip and go to res/xml. Extract storage_list.xml somewhere.

- Open Port/system/framework/framework-res.apk file with 7-zip and go to res/xml. Delete storage_list.xml. Drag and drop the storage_list.xml file you extracted in step (Guide by Nonta, stolen y Nayan Deka) one into 7-zip window.

RIL fix:

To fix RIL in cm-12.1 or based ROMs, follow:

- Unpack boot.img of your cm-12.1 or based ROM using the steps provided in Part 1. Let assume you named it BootS

- Go to BootS/ramdisk and edit init.modem.rc. Delete everything inside that file and copy paste the lines below.

# Copyright (C) 2012 The Android Open Source Project
#
# IMPORTANT: Do not create world writable files or directories.
# This is a common source of Android security bugs.
#

on post-fs-data

write /proc/bootprof "post-fs-data: on modem start"

# Modem related device nodes
mkdir /data/nvram/md 0770 root system
mkdir /data/nvram/md2 0770 root system
# Build-in Modified - S
# insmod /system/lib/modules/ccci_plat.ko
# insmod /system/lib/modules/ccci.ko
# Build-in Modified - E
# chown radio radio /sys/class/BOOT/BOOT/boot/md
chown radio radio /sys/kernel/ccci/boot
# xplod: this is not in the original mtk file... But I have no
# idea what kind of sorcery normally sets them
chown radio radio /dev/ccci_fs
chown radio radio /dev/ccci_ioctl0
chown radio radio /dev/ccci_ioctl1
chown radio radio /dev/ccci_ipc_1220_0
chown radio radio /dev/ccci_md_log_rx
chown radio radio /dev/ccci_md_log_tx
chown radio radio /dev/ccci_monitor
chown radio radio /dev/ccci_pcm_rx
chown radio radio /dev/ccci_pcm_tx
(Guide by Nonta, stolen y Nayan Deka)
chown radio radio /dev/ccci_uem_rx
chown radio radio /dev/ccci_uem_tx
#SeLinux
mkdir /data/ccci_cfg 0770 system radio
restorecon /data/ccci_cfg
restorecon_recursive /protect_f
restorecon_recursive /protect_s

# Encrypt phone function
setprop vold.post_fs_data_done 1

service gsm0710muxd /system/bin/gsm0710muxd -s /dev/ttyC0 -f 512 -n 8 -m basic
class core
user root
group radio cache inet misc
disabled
oneshot

service gsm0710muxdmd2 /system/bin/gsm0710muxdmd2 -s /dev/ccci2_tty0 -f 512 -n 8 -m basic
class core
user root
group radio cache inet misc
disabled
oneshot

service muxreport-daemon /system/bin/muxreport
class core
user radio
group radio cache inet misc
disabled
oneshot

service ril-daemon /system/bin/rild
class core
socket rild stream 660 root radio
socket rild2 stream 660 root radio
socket rild3 stream 660 root radio
socket rild4 stream 660 root radio
socket rild-ims stream 660 root radio
socket rild-debug stream 660 radio system
socket rild-oem stream 660 radio system
socket rild-mtk-ut stream 660 radio net_bt
socket rild-mtk-ut-2 stream 660 radio net_bt
socket rild-mtk-modem stream 660 radio system
socket rild-atci stream 660 root radio
user root
group radio cache inet misc audio sdcard_r sdcard_rw log system
disabled
oneshot

service ril-daemon-md2 /system/bin/rildmd2
class core
socket rild-md2 stream 660 root radio
socket rild2-md2 stream 660 root radio
socket rild-debug-md2 stream 660 radio system
socket rild-oem-md2 stream 660 radio system
socket rild-mtk-ut-md2 stream 660 radio net_bt
socket rild-mtk-ut-2-md2 stream 660 radio net_bt
socket rild-mtk-modem-md2 stream 660 radio system
socket rild-atci-md2 stream 660 root radio
user root
group radio cache inet misc audio sdcard_r sdcard_rw log system
disabled
oneshot

service md_minilog_util /system/bin/md_minilog_util
user radio
disabled
oneshot

#
# Modem related services (Begin)
#

service permission_check /system/bin/permission_check
class main
user root
group nvram
group system radio
oneshot

service ccci_fsd /system/bin/ccci_fsd 0
user root
user radio
group radio system
class core
oneshot

service ccci2_fsd /system/bin/ccci_fsd 1
user root
user radio
group radio system
class core
oneshot

service ccci_mdinit /system/bin/logwrapper /system/xbin/strace -s 1024 /system/bin/ccci_mdinit 0
user root
user system
group radio system
class core
oneshot

service ccci2_mdinit /system/bin/ccci_mdinit 1
user root
user system
group radio system
class core
oneshot

service ccci_rpcd /system/bin/ccci_rpcd 0
user radio
group radio system
class core
oneshot

service ccci2_rpcd /system/bin/ccci_rpcd 1
user radio
group radio system
class core
oneshot

service pppd_gprs /system/bin/pppd_dt /dev/ttyACM0 debug noauth refuse-eap usepeerdns nodetach
user root
group radio cache inet misc
disabled
oneshot

#Add by T.Zh for ppp daemon
service pppd /system/bin/pppd file /data/misc/ppp/ppp_options
user root
disabled
oneshot

#
#
# Modem related services (End)
#

#Add by hp.chen for
#
# Telephony Early Read service
#
service terservice /system/bin/terservice
class core
(Guide by Nonta, stolen y Nayan Deka)
user radio
group radio cache inet misc
oneshot

on property:ril.muxreport=1
start muxreport-daemon

- Repack the BootS.img and flash it.

- Download this file Fix_RIL_CM12.1.zip and flash it in recovery.

- Reboot your device, RIL should start to work. If not, try restoring or rewriting your IMEI.

Other bugs can be fixed using stock rom bug fixing methods as well

Credits:

Special thanks to

[MENTION=6052432]RendyAK[/MENTION]

[MENTION=5927654]Besik_13[/MENTION]