This is a Runtime Resource Overlay for the dialer app in LineageOS to enable call recording in all countries.
LineageOS native call recording is enabled or disabled depending on your current location and the those countries are listed here, https://github.com/LineageOS/android_packages_apps_Dialer/blob/lineage-19.1/java/com/android/dialer/callrecord/res/xml/call_record_states.xml. One can enable or disable call recording by updating those values and this is what this overlay does.
A runtime resource overlay (RRO) is a package that changes the resource values of a target package at runtime. For example, an app installed on the system image might change its behavior based upon the value of a resource. Rather than hardcoding the resource value at build time, an RRO installed on a different partition can change the values of the app's resources at runtime.
One can enable or disable call recording by updating this file. However this overlay package changes the resource values of a target package at runtime.
https://source.android.com/docs/core/runtime/rros
Get flashable zip or magisk module from here https://github.com/2shrestha22/lineage-call-recording-enabler/releases
- If you have magisk installed you can use the magisk module. Download the module from releases.
-
Reboot to sideload mode:
adb reboot sideload -
Sideload zip (or flash from recovery):
adb sideload lineage_dialer_rro-recovery-arm64.zip
Overlay APK can be found in prebuilt/overlay/DialerCallRecordingAllowed.apk.
-
Restart ADB with root privileges:
adb root -
Mount the product folder as read-write:
adb shell mount -o rw,remount /product -
Copy the required package to the overlay folder:
adb push DialerCallRecordingAllowed.apk /product/overlay -
Verify if the correct permissions are set (optional):
adb shell stat /product/overlay/DialerCallRecordingAllowed.apk | grep "0644" -
Mount the system as read-write:
adb shell mount -o rw,remount / -
Copy the OTA survival script to the appropriate location:
adb push 20-call-recording.sh /system/addon.d -
Make the script executable:
adb shell chmod 755 /system/addon.d/20-call-recording.sh -
Verify if the correct permissions are set (optional):
adb shell stat /system/addon.d/20-call-recording.sh | grep "0755" -
After all the files have been copied, reboot the device:
adb reboot
You can compile overlay APK and package it to flashabel zip magisk module yourself. A prebuilt overlay APK can be found in recovery/system/product/overlay/DialerCallRecordingAllowed.apk.
Generate unsigned and unaligned APK.
aapt package -M AndroidManifest.xml -S res/ \
-I ~/Android/Sdk/platforms/android-33/android.jar \
-F DialerCallRecordingAllowed.apk.u
Sign the APK. Password for debug keystore is android.
jarsigner -keystore ~/.android/debug.keystore \
DialerCallRecordingAllowed.apk.u androiddebugkey
Align the APK.
zipalign 4 DialerCallRecordingAllowed.apk.u DialerCallRecordingAllowed.apk
You can find aapt and zipalign inside build-tool of Android SDK installation dir. e.g. ~/Android/Sdk/build-tools/33.0.0/
- Copy
toyboxfor your device architecture to./recovery, eg.cp toybox/arm64/toybox /recovery - Copy prebuilt overlay apk to
recovery/system/product/overlay/ - Create zip:
7za a -tzip -r lineage_dialer_rro-recovery-arm64.zip ./recovery/*
- Create zip:
7za a -tzip -r lineage_dialer_rro-magisk.zip ./magisk/*
update-binary: MindTheGapps
magisk: Developer Guides
zipsigner: Magisk (source), XDA (binary)
toybox: landley/toybox