[Treble][RIL] Qualcomm device and in-call audio not working? Check this out

Search This thread

linuxct

Recognized Contributor & Social Contributor
Hello,

After a few weeks of having Project Treble GISs running in my Razer Phone, I had one big issue to solve, and that was the in-call audio. I stumbled upon a few people in #phh-treble Telegram group that suggested me to use ZUK (MSM8996) patches to get it to work, but unfortunately they weren't fully working... because of a missing apk from my device's stock image (which I didn't know until 2 or 3 days ago). Starting from there, I worked on it quite a lot of time until almost giving up, to then finally getting it to work just now.

Steps I followed:

1. Pull from your device's stock image the following files (they may not be in /system and instead be located in /vendor, depends on your OEM's Treble implementation)
- app/QtiSystemService
- app/QtiTelephonyService
- framework/qcrilhook.jar
- framework/QtiTelephonyServicelibrary.jar
- etc/permissions/privapp-permissions-qti.xml
- etc/permissions/qcrilhook.xml
- etc/permissions/qti_permissions.xml
- etc/permissions/telephonyservice.xml
- priv-app/qcrilmsgtunnel

2. Fortunately, those APKs will contain a .dex inside of them, but in case they didn't, you'd need to first deodex your rom based on the vdex files located in /system/framework/oat. However, the jars will definitely and for sure won't have the inner .dex classes. You'll need to use a tool such as vdexExtractor to get the final .dex files for qcrilhook.jar and QtiTelephonyServicelibrary.jar. Then, open the metioned .jar's as zip files, embed the .dex inside and done.

3. The tricky part comes now: With a tool such as APKTool, decompile the qcrilmsgtunnel.apk file you've extracted from your Stock ROM image. I'm not going to go throught the steps to perform that. Now, open up the AndroidManifest.xml and find the line:
Code:
<uses-library android:name="[email protected]" />
and replace it with
Code:
<uses-library android:name="[email protected]" android:required="false" />
Recompile the apk and, without signing it yet, put it in a safe place.

4. Open up the other APKs and remove the META-INF folders from inside of them (the signatures). Now, download a copy of SignAPK and sign every apk (including the ones we've removed the signature from, plus the modded version of qcrilmsgtunnel.apk with the platform keys (platform.*) from Android AOSP.
You can do so by using the following command:
Code:
java -jar /path/to/signapk.jar /path/to/platform.x509.pem /path/to/platform.pk8 NameOfTheApk.apk NameOfTheApk_signed.apk

5. Open up the files qcrilhook.xml and telephonyservice.xml and ensure that the file="" path points to /vendor. i.e:
Code:
file="/vendor/framework/qcrilhook.jar"

6. Move the files to your device according to this table:
- app/QtiSystemService -> /system_root/system/app/QtiSystemService (replace)
- app/QtiTelephonyService -> /system_root/system/app/QtiTelephonyService (replace)
- framework/qcrilhook.jar -> /vendor/framework/qcrilhook.jar (delete the original file wherever you found it)
- framework/QtiTelephonyServicelibrary.jar -> /vendor/framework/QtiTelephonyServicelibrary.jar (delete the original file wherever you found it)
- etc/permissions/privapp-permissions-qti.xml -> /system_root/system/etc/permissions/privapp-permissions-qti.xml (delete the original file wherever you found it)
- etc/permissions/qcrilhook.xml -> /system_root/system/etc/permissions/qcrilhook.xml (delete the original file wherever you found it)
- etc/permissions/qti_permissions.xml -> /system_root/system/etc/permissions/qti_permissions.xml (delete the original file wherever you found it)
- etc/permissions/telephonyservice.xml -> /system_root/system/etc/permissions/telephonyservice.xml (delete the original file wherever you found it)
- priv-app/qcrilmsgtunnel -> /system_root/system/priv-app/qcrilmsgtunnel (replace)

Reboot and profit.
 

Laptapper

Senior Member
Jan 17, 2016
1,639
860
Hello,

After a few weeks of having Project Treble GISs running in my Razer Phone, I had one big issue to solve, and that was the in-call audio. I stumbled upon a few people in #phh-treble Telegram group that suggested me to use ZUK (MSM8996) patches to get it to work, but unfortunately they weren't fully working... because of a missing apk from my device's stock image (which I didn't know until 2 or 3 days ago). Starting from there, I worked on it quite a lot of time until almost giving up, to then finally getting it to work just now.

Steps I followed:

1. Pull from your device's stock image the following files (they may not be in /system and instead be located in /vendor, depends on your OEM's Treble implementation)
- app/QtiSystemService
- app/QtiTelephonyService
- framework/qcrilhook.jar
- framework/QtiTelephonyServicelibrary.jar
- etc/permissions/privapp-permissions-qti.xml
- etc/permissions/qcrilhook.xml
- etc/permissions/qti_permissions.xml
- etc/permissions/telephonyservice.xml
- priv-app/qcrilmsgtunnel

2. Fortunately, those APKs will contain a .dex inside of them, but in case they didn't, you'd need to first deodex your rom based on the vdex files located in /system/framework/oat. However, the jars will definitely and for sure won't have the inner .dex classes. You'll need to use a tool such as vdexExtractor to get the final .dex files for qcrilhook.jar and QtiTelephonyServicelibrary.jar. Then, open the metioned .jar's as zip files, embed the .dex inside and done.

3. The tricky part comes now: With a tool such as APKTool, decompile the qcrilmsgtunnel.apk file you've extracted from your Stock ROM image. I'm not going to go throught the steps to perform that. Now, open up the AndroidManifest.xml and find the line:
Code:
<uses-library android:name="[email protected]" />
and replace it with
Code:
<uses-library android:name="[email protected]" android:required="false" />
Recompile the apk and, without signing it yet, put it in a safe place.

4. Open up the other APKs and remove the META-INF folders from inside of them (the signatures). Now, download a copy of SignAPK and sign every apk (including the ones we've removed the signature from, plus the modded version of qcrilmsgtunnel.apk with the platform keys (platform.*) from Android AOSP.
You can do so by using the following command:
Code:
java -jar /path/to/signapk.jar /path/to/platform.x509.pem /path/to/platform.pk8 NameOfTheApk.apk NameOfTheApk_signed.apk

5. Open up the files qcrilhook.xml and telephonyservice.xml and ensure that the file="" path points to /vendor. i.e:
Code:
file="/vendor/framework/qcrilhook.jar"

6. Move the files to your device according to this table:
- app/QtiSystemService -> /system_root/system/app/QtiSystemService (replace)
- app/QtiTelephonyService -> /system_root/system/app/QtiTelephonyService (replace)
- framework/qcrilhook.jar -> /vendor/framework/qcrilhook.jar (delete the original file wherever you found it)
- framework/QtiTelephonyServicelibrary.jar -> /vendor/framework/QtiTelephonyServicelibrary.jar (delete the original file wherever you found it)
- etc/permissions/privapp-permissions-qti.xml -> /system_root/system/etc/permissions/privapp-permissions-qti.xml (delete the original file wherever you found it)
- etc/permissions/qcrilhook.xml -> /system_root/system/etc/permissions/qcrilhook.xml (delete the original file wherever you found it)
- etc/permissions/qti_permissions.xml -> /system_root/system/etc/permissions/qti_permissions.xml (delete the original file wherever you found it)
- etc/permissions/telephonyservice.xml -> /system_root/system/etc/permissions/telephonyservice.xml (delete the original file wherever you found it)
- priv-app/qcrilmsgtunnel -> /system_root/system/priv-app/qcrilmsgtunnel (replace)

Reboot and profit.

Hi
It seems to be a great work.
For me in resurrection remix 8.1 in call audio is working, but music sound over Bluetooth isn't working. Do you've got any ideas?
Please could you share your modified files for in call fix?
Thanks in advance
 

guillermohs9

Senior Member
Nov 30, 2015
226
50
Does somebody know if this fix has been included in some ROM? I don't know which ROM to try as GSI on my Razer Phone
 

linuxct

Recognized Contributor & Social Contributor
  • Like
Reactions: guillermohs9

knives of ice

Senior Member
Jul 12, 2007
1,505
252

xzaviergomez

Member
Nov 7, 2008
43
2
So I have a Qualcomm device(SD845 in an AGM X3), in-call audio and bluetooth calling work great but main audio does not work at all. I can force sound to route through the in-call speaker, but not really viable.

Any chance following this guide would help? Are there other files I should include since my issue is not in-app calling.

My device will not boot past v123, so if this has been resolved in newer releases unfortunately I can't install.

I tried building an overlay. I followed the method in the guide from phh as well as from a post on XDA. First few attempts broke boot but when I finally got an overlay build to boot it did not resolve problem.

So, would trying this route be worth a shot?
9.0 otherwise runs flawlessly on this device. Sound and MTP are the only things broken. Fingerprint reader is detected as volume down, but I don't use it anyway. It's very stable.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 22
    Hello,

    After a few weeks of having Project Treble GISs running in my Razer Phone, I had one big issue to solve, and that was the in-call audio. I stumbled upon a few people in #phh-treble Telegram group that suggested me to use ZUK (MSM8996) patches to get it to work, but unfortunately they weren't fully working... because of a missing apk from my device's stock image (which I didn't know until 2 or 3 days ago). Starting from there, I worked on it quite a lot of time until almost giving up, to then finally getting it to work just now.

    Steps I followed:

    1. Pull from your device's stock image the following files (they may not be in /system and instead be located in /vendor, depends on your OEM's Treble implementation)
    - app/QtiSystemService
    - app/QtiTelephonyService
    - framework/qcrilhook.jar
    - framework/QtiTelephonyServicelibrary.jar
    - etc/permissions/privapp-permissions-qti.xml
    - etc/permissions/qcrilhook.xml
    - etc/permissions/qti_permissions.xml
    - etc/permissions/telephonyservice.xml
    - priv-app/qcrilmsgtunnel

    2. Fortunately, those APKs will contain a .dex inside of them, but in case they didn't, you'd need to first deodex your rom based on the vdex files located in /system/framework/oat. However, the jars will definitely and for sure won't have the inner .dex classes. You'll need to use a tool such as vdexExtractor to get the final .dex files for qcrilhook.jar and QtiTelephonyServicelibrary.jar. Then, open the metioned .jar's as zip files, embed the .dex inside and done.

    3. The tricky part comes now: With a tool such as APKTool, decompile the qcrilmsgtunnel.apk file you've extracted from your Stock ROM image. I'm not going to go throught the steps to perform that. Now, open up the AndroidManifest.xml and find the line:
    Code:
    <uses-library android:name="[email protected]" />
    and replace it with
    Code:
    <uses-library android:name="[email protected]" android:required="false" />
    Recompile the apk and, without signing it yet, put it in a safe place.

    4. Open up the other APKs and remove the META-INF folders from inside of them (the signatures). Now, download a copy of SignAPK and sign every apk (including the ones we've removed the signature from, plus the modded version of qcrilmsgtunnel.apk with the platform keys (platform.*) from Android AOSP.
    You can do so by using the following command:
    Code:
    java -jar /path/to/signapk.jar /path/to/platform.x509.pem /path/to/platform.pk8 NameOfTheApk.apk NameOfTheApk_signed.apk

    5. Open up the files qcrilhook.xml and telephonyservice.xml and ensure that the file="" path points to /vendor. i.e:
    Code:
    file="/vendor/framework/qcrilhook.jar"

    6. Move the files to your device according to this table:
    - app/QtiSystemService -> /system_root/system/app/QtiSystemService (replace)
    - app/QtiTelephonyService -> /system_root/system/app/QtiTelephonyService (replace)
    - framework/qcrilhook.jar -> /vendor/framework/qcrilhook.jar (delete the original file wherever you found it)
    - framework/QtiTelephonyServicelibrary.jar -> /vendor/framework/QtiTelephonyServicelibrary.jar (delete the original file wherever you found it)
    - etc/permissions/privapp-permissions-qti.xml -> /system_root/system/etc/permissions/privapp-permissions-qti.xml (delete the original file wherever you found it)
    - etc/permissions/qcrilhook.xml -> /system_root/system/etc/permissions/qcrilhook.xml (delete the original file wherever you found it)
    - etc/permissions/qti_permissions.xml -> /system_root/system/etc/permissions/qti_permissions.xml (delete the original file wherever you found it)
    - etc/permissions/telephonyservice.xml -> /system_root/system/etc/permissions/telephonyservice.xml (delete the original file wherever you found it)
    - priv-app/qcrilmsgtunnel -> /system_root/system/priv-app/qcrilmsgtunnel (replace)

    Reboot and profit.
    1
    great explanation
    1
    Does somebody know if this fix has been included in some ROM? I don't know which ROM to try as GSI on my Razer Phone

    I said it literally 2 posts ago.

    This has already been implemented into phh's gsi repo. I have no clue what you expect from this thread anymore.

    IT IS implemented in all new, recently built GSIs. Just try any.
    1
    nice work bro but can you make a video to explain the way?:confused: