[Treble][RIL] Qualcomm device and in-call audio not working? Check this out - Treble-Enabled Device Development A/AB ROMS

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.

Nice job now maybe the devs can add it to their rom.a little lengthy and out of my league to try

Of course this is not a final solution @gillim74.
But if the mentioned Qcomm apks or jar libs aren't present in the device's vendor partition (which I bet they aren't), the steps of decompiling them, and placing them into vendor is still needed, even for GSI's that include the patch.

What ZUK patch? I got a ZUK Z2 with treble rom and calling is not working.
Where can i get the patches?

andreas951207 said:
What ZUK patch? I got a ZUK Z2 with treble rom and calling is not working.
Where can i get the patches?
Click to expand...
Click to collapse
https://github.com/zuk-devs/android_vendor_zuk/commit/9ab51560c8d5632a08bdb949bd433909b8db5752

great explanation

linuxct said:
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.
Click to expand...
Click to collapse
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

Thread dead?
No more updates?

Laptapper said:
No more updates?
Click to expand...
Click to collapse
This has already been implemented into phh's gsi repo. I have no clue what you expect from this thread anymore.

linuxct said:
This has already been implemented into phh's gsi repo. I have no clue what you expect from this thread anymore.
Click to expand...
Click to collapse
Thanks, but even as before there are problems with Bluetooth in call and/or audio as before on a couple of devices....

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

guillermohs9 said:
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
Click to expand...
Click to collapse
I said it literally 2 posts ago.
linuxct said:
This has already been implemented into phh's gsi repo. I have no clue what you expect from this thread anymore.
Click to expand...
Click to collapse
IT IS implemented in all new, recently built GSIs. Just try any.

linuxct said:
I said it literally 2 posts ago.
IT IS implemented in all new, recently built GSIs. Just try any.
Click to expand...
Click to collapse
damn, my bluetooth calling still doesn't work on any GSI i try.

knives of ice said:
damn, my bluetooth calling still doesn't work on any GSI i try.
Click to expand...
Click to collapse
Yeah bluetooth calling on Qualcomm devices is still a no-go.
There is a bounty for it: https://github.com/phhusson/treble_experimentations/issues/374

phhusson said:
Yeah bluetooth calling on Qualcomm devices is still a no-go.
There is a bounty for it: https://github.com/phhusson/treble_experimentations/issues/374
Click to expand...
Click to collapse
ok, I'm glad I'm not alone. AndroPlus posted in your bounty thread on github as well and he maintains the GSI based build for my device the mi mix 3. for most people bluetooth calling does work with his fix, but for me it does not. i will contribute to the bounty as well.

nice work bro but can you make a video to explain the way?

I have this problem in the Qualcomm j4 core msm8917

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.

Related

[HELP][Q] CM7 Rom missing folders and files

Edited: I have figuered all out and have no more problem with missing folders and files. Thank you to the allmighty XDA search button, mother Google and one person who gave me some cool tips.
Hello, dear developers.
I have compiled CM7 from sources using Noejn's howto everything went fine I assume but after compilation is complete I am missing some folders and files in system folder of compiled files.
List of My files in system:
Code:
app
bin
etc
lib
usr
build.prop
I assume it should be like this:
Code:
app
bin
etc
fonts
framework
lib
media
tts
usr
xbin
build.prop
So the main thing is missing is framework folder with all files. I checked Noejn's Void for how the files should be or look like and found that my compilation is missing them.
How to add all those folders and files to complete rom to work? May the compilation went wrong or something? Maybe they are feched manually from sources or compiled separately from main building process?
dr.notor said:
You obviously need to state exactly the steps you have done so far. Otherwise, your guess is as good as mine.
Click to expand...
Click to collapse
I did everything exacly as writen in Noejn's HowTo.
1. Used Linux
2. Made Folders
3. Downloaded Sources
4. Instaled Java
5. Downloaded and extracted proprietay files to /vendor/lge
6. Built using terminal commands
7. Went to /out/target/product/thunderg/
8. Looked inside system folder... OMG some files are missing.
Click to expand...
Click to collapse
nikoltu said:
How to add all those folders and files to complete rom to work? May the compilation went wrong or something?
Click to expand...
Click to collapse
You obviously need to state exactly the steps you have done so far. Otherwise, your guess is as good as mine.

Help work out bugs in CM9/10/sense4/aokp- smali/baksmali and more to come..

How can I contribute to development?
Post #1 is a tutorial for how to decompile/recompile jar files to help with the project.
Post #2 will have information on how to pull a proper logcat and how to post your logcat
___________________________________________________________________
I'll write up a quick little guide for smali/baksmali that can be used with the previous resource I posted.
First, windows will work just fine. You will have to install the java JDK(not sdk, you can have both however), this is straightforward, just google and follow directions.
Next, download http://smali.googlecode.com/files/smali-1.3.2.jar and http://smali.googlecode.com/files/baksmali-1.3.2.jar (both are also attached)
If you can already type "adb" in the command prompt of windows, then the path was set for the tool.. find where you have ADB at, and paste those files into the same directory. If not follow the directions in the following quote, except you will be putting the above downloaded files in the directory you chose.
There's two simple ways to get there:
1 way = click Start > Control Panel > System icon.
2nd way = click the Start button, right-click “My Computer”(Computer for Vista/7) and select “Properties”.
If your using XP, your there. If your using Vista/7, click on Advanced system settings on the left side.
You should now be in the System Properties window.
Click on the Advanced tab.
Click on the Evironment Variables... button
In the System variables(lower box), scroll through the list until you see Path under the Variable column.
Click on it to highlite it, click on the Edit... button.
We are going to add our path to adb, where we installed the SDK, in the Variable value: box.
Make sure your cursor is at the end of the last entry, and type this:
;C:\android\tools\
Click to expand...
Click to collapse
Press the windows button or click start button, type cmd and press enter(to open command prompt), and type "java -jar baksmali-1.3.2.jar -o out/rogers/dexout/rogers-classes.dex" and see if the error it gives you shows you that there is no "rogers-classes.dex" file, if so then you've done everything right thus far.
Now you should look at the resource I had posted before, so you don't have to search, here it is again http://rootzwiki.com/topic/19262-protip-getting-data-working-on-that-epic-port-you-just-did/
For this example, look under where it says "Data:", I am going to do what it says for the framework.jar file. Jar files are basically zip files, rename framework.jar to framework.zip, then unzip it with whatever program you use, making sure you know where it is located. Do this for BOTH the cm9 rom, and also with the stock rom(we should be able to use any rom we currently have, ARHD, energy, speedrom, etc). I would name the stock rom zip folder "base" and the cm9 zip folder "port", so you can keep track easily.
If you have followed along this far, you will have a file called classes.dex, this will be what we are decompiling for both cm9 and stock, then we will copy files as needed, and recompile just the cm9 classes.dex, so again, pay attention to which is which, and what the path is. Ignore the other file that was unzipped for now, just know when you rezip it, you have to replace the original classes.dex file and zip it up with the other file that it was unzipped with.
So lets say this is the result, I have a folder c:\android\porting\base folder that contains a classes.dex file, and a c:\android\porting\base(I renamed the unzipped folder after I unzipped each) that also contains a classes.dex file.
Here is a post that explains what we are about to do if you need a reference. http://forum.xda-developers.com/showpost.php?p=4152564&postcount=2
To decompile(if you correctly installed the java jdk and set the path correctly for baksmali/smali) you would type this in:
Code:
java -jar baksmali-1.3.2.jar -o out/base locationOFyour/classes.dex
the "out/base" is where it will put the output files, in a directory called OUT in your USER folder. Quick protip if you are unsure how to type in the location of the classes.dex file, just type in "java -jar baksmali-1.3.2.jar -o out/base" and then DRAG the classes.dex file from your file explorer to the command prompt window, and IT will put the correct path(it should be something like ~/android/porting/base if I remember correctly). I am working on OSX, so you may have to do this if the example isn't helpful enough. Protip #2: Write all this $h*t down! Create a text document with every step you do, then you can just copy/paste the line above, and modify it as needed- this also helps keep track of what you are doing- aka a changelog.
If you followed protip #2 above, copy the same command you just typed in, but change where it says "base" in the path, to "port". If you have two folders in your OUT folder, one called base, and one called port, you have done everything correctly thus far.
Since this is an example, this is what the resource I posted above on rootzwiki says to do with the result output files:
android/net - the ConnectivityManager classes and interfaces as well as all the NetworkStateTrackers.
android/telephony
com/android/internal/telephony
Click to expand...
Click to collapse
So basically I am just copying everything from the above folders from my BASE, to the PORT, overwriting each file in the port. Once done, you will type this:
Code:
java -Xmx512M -jar smali-1.3.2.jar out/port -o new-classes.dex
This is because we are recompiling the files in our PORT, and it will create a file in the root of your USER folder called new-classes.dex. Rename the file classes.dex, unzip the CM9 framework.jar and replace the original classes.dex, rezip it, then rename framework.zip to framework.jar.
This concludes the tutorial. Once you have everything setup, if you follow protip #2, the matter of baksmali/smali is a quick copy/paste into command prompt, so modifying a jar file will take less than 5 minutes. Push the resulting jar file into the appropriate folder on your phone, reboot your phone, run a logcat(I have a good guide linked in the BIBLE in my signature how to logcat like a pro), and see if data(for this example, you could be working on GPS or whatever) is working any better.
Protip #3: You've just learned quite a bit, the same can be done to most apk's- rename whatever.apk to whatever.zip, unzip it, then baksmali the resulting classes.dex file- this is how many programs are backported to older versions of android, hacked, etc. If you want to see the simple edit that was made to the ext.jar using this same process that got data working, you can see it here: http://forum.xda-developers.com/showpost.php?p=25786037&postcount=13
If anyone wants to try to push the file I just created and attached, feel free.. if you have major issues, create a logcat, if not, post your result. My changelog:
In android/net I copied over ConnectivityManager.smali and each file beginning with "NetworkState"
In android/telephony I copied over all the files
There was no com/android/internal/telephony directory, so it was skipped
Click to expand...
Click to collapse
This is all I have time for at the moment, I have to go to work soon so I cannot test the file.. this tutorial took a bit to do, so I am hoping someone at least gives it a try to make it worth my time. I can give some assistance, but would prefer that if it is something you can figure out on your own with some basic googling, please do so.
I will update on different methods to pull a proper logcat in the near future, for right now please post what rom you are on, and what you expect the log to contain such as "I was enabling data"..
Also reserved just in case
As posted in the previous thread, there are probably 250+ more constants in the base rom than there is the in the cm9 RILConstants.smali file. Are these the kinds of glaring differences we need to look for, or is this just the difference between sense/aosp...
I'm pushing your framework.jar and seeing how it works out. I'll get back to you in a moment.
Just boot loops...
Hey, just wanted to throw this out there. I found an amazing studio that makes digging around in apk and jar files incredibly easy to do.
You can check it out here - http://www.virtuousrom.com/p/ten-studio.html
I haven't tried any jar files with it but it says they are supported. Might be worth checking out.
Ok I just tried switching it our with your framework.jar and it got to upgrading the 82 apps now it's stuck in a bootloop after that
Sure wish we could get some if those Kats over here. The virtuous team always had something cool for the g2
Sent from my HTC_Amaze_4G using xda app-developers app
craigtut said:
Hey, just wanted to throw this out there. I found an amazing studio that makes digging around in apk and jar files incredibly easy to do.
You can check it out here - http://www.virtuousrom.com/p/ten-studio.html
I haven't tried any jar files with it but it says they are supported. Might be worth checking out.
Click to expand...
Click to collapse
Yep, I saw that and saved it to my read it later account.. but I never even boot into windows anymore, lol. If someone wants to try it out, if it streamlines things.. would definitely be pretty awesome. I didn't know it did jars, I thought it just did apks.
Learning how to do it still has its own value I think tho Thanks for sharing craig
bos2333 said:
Ok I just tried switching it our with your framework.jar and it got to upgrading the 82 apps now it's stuck in a bootloop after that
Click to expand...
Click to collapse
I noticed afterwards that I included a few too many files, I should have done just the one file rather than 3.. I think we will have much more success by making single changes, seeing if it improves things, or at LEAST continues to boot, rather than making broad sweeping changes.
Even if it gets stuck in a bootloop, see if it will post a logcat, the errors it puts out will help figure out what was too much.
Also, I think the mentioned guide would be MUCH more direct for porting sense4- as both have all proprietary htc files, and therefor the different flags in the smali file will help a ton.. as far as porting cm9, we will likely have to be much more concise about the changes- it likely won't take much, just a few changes here and there.
bos2333 said:
Ok I just tried switching it our with your framework.jar and it got to upgrading the 82 apps now it's stuck in a bootloop after that
Click to expand...
Click to collapse
Here's the logcat from replacing framework.jar with the one you supplied...I had to zip it though because it's too big apparently
Silentbtdeadly said:
Yep, I saw that and saved it to my read it later account.. but I never even boot into windows anymore, lol. If someone wants to try it out, if it streamlines things.. would definitely be pretty awesome. I didn't know it did jars, I thought it just did apks.
Learning how to do it still has its own value I think tho Thanks for sharing craig
Click to expand...
Click to collapse
i guess ill give it a go
ill mess with it too once i get my straight talk plan. (cause right now i dont have a plan so i cant check data )
you can use Winrar to extract .jar files so you don`t have to rename to .zip http://www.rarlab.com/download.htm download it here
Ok, so again, very new to this...I just merged the 4 MobileDataStateTracker files from Android/net from speedrom 5.1 to the cm9...same thing, boot loops.
bos2333 said:
Ok, so again, very new to this...I just merged the 4 MobileDataStateTracker files from Android/net from speedrom 5.1 to the cm9...same thing, boot loops.
Click to expand...
Click to collapse
Then you likely have the cause of the original boot loop. Two things you can do, check the logcat - it may tell you something useful.. another thing to do is get software to compare the files, I think for windows there's a free one called winmerge... The output files are usually text, and you may see some specific lines that would help us from the stock file and change those(things relating to data), leaving everything else alone.
Someone recently posted how to do a log for data errors, but I have a really good tutorial in the bible in my signature, logcat like a pro.
Sent from my HTC_Amaze_4G using xda app-developers app
i'm trying to learn my ways around the android ecosystem... please correct me if I have any incorrect info below
bascially, what you're doing for this tutorial is trying to decompile and debug problems, only going up to the assembly level (smali)
jar/apk = container like a zip... contains resources like compiled binaries and images etc
dex = compiled binary for the android system
you first disassemble the dex files to smali ("assembly") files
-> a developer here would make changes to the smali... lets say you don't make any
you reassemble back to dex, gather it into a jar/apk file to put on the phone
-------------
for porting a phone to use CM9/10/aokp, you basically use the base CM9/10/aokp system, copy over relevant jar/apk, and debug to fix any problems (like function calls, data etc)?
using logcat, you can see where function calls fail (or when you have a exception), and then try to fix it?
how good is debugging? basically you can see most of the source code?
would it be also possible to go dex->smali->java? like this post, though it says its not ideal either http://stackoverflow.com/questions/5582824/decompile-smali-files-on-an-apk
Silentbtdeadly said:
Then you likely have the cause of the original boot loop. Two things you can do, check the logcat - it may tell you something useful.. another thing to do is get software to compare the files, I think for windows there's a free one called winmerge... The output files are usually text, and you may see some specific lines that would help us from the stock file and change those(things relating to data), leaving everything else alone.
Someone recently posted how to do a log for data errors, but I have a really good tutorial in the bible in my signature, logcat like a pro.
Sent from my HTC_Amaze_4G using xda app-developers app
Click to expand...
Click to collapse
Yeah, I attached a logcat last page and looked at it, saw the errors. I'll do some searching tomorrow to see if I can work my way through some of them.
Sent from my HTC Ruby using xda app-developers app
paperWastage said:
i'm trying to learn my ways around the android ecosystem... please correct me if I have any incorrect info below
bascially, what you're doing for this tutorial is trying to decompile and debug problems, only going up to the assembly level (smali)
jar/apk = container like a zip... contains resources like compiled binaries and images etc
dex = compiled binary for the android system
you first disassemble the dex files to smali ("assembly") files
-> a developer here would make changes to the smali... lets say you don't make any
you reassemble back to dex, gather it into a jar/apk file to put on the phone
-------------
for porting a phone to use CM9/10/aokp, you basically use the base CM9/10/aokp system, copy over relevant jar/apk, and debug to fix any problems (like function calls, data etc)?
using logcat, you can see where function calls fail (or when you have a exception), and then try to fix it?
________________________________________________________________________________________________
how good is debugging? basically you can see most of the source code?
would it be also possible to go dex->smali->java? like this post, though it says its not ideal either http://stackoverflow.com/questions/5582824/decompile-smali-files-on-an-apk
Click to expand...
Click to collapse
Everything above the line=yes(ish). That is a fair explanation of things. If you mean how good is the debugging on smali'd files.. you should do it to some and find out
I'm not sure I understand what you mean by dex>smali>java.. dex is the compiled, smali is decompiled, it can't be more decompiled than smali to the best I can see. What that link you posted was talking about was different tools to get the job done- some can be helpful, tho many don't work properly with ICS as of yet.
Sorry if my answers are unclear, I wasn't sure of the questions perhaps..
So there are some smali edits in this miui4 porting guide that can be looked at to help understand how/what files matter.. furthermore, all ril specific edits could be looked at for our phone http://forum.xda-developers.com/showpost.php?p=28885450&postcount=2
Also, the third post has some great info on debugging and reading logs.. http://forum.xda-developers.com/showpost.php?p=28885450&postcount=3
That entire guide is extremely comprehesive, and the language isn't more complex than what you are already doing, so you will learn quite a bit. I may pull relevant info from that guide to the second post when I have more time.
Silentbtdeadly said:
Everything above the line=yes(ish). That is a fair explanation of things. If you mean how good is the debugging on smali'd files.. you should do it to some and find out
I'm not sure I understand what you mean by dex>smali>java.. dex is the compiled, smali is decompiled, it can't be more decompiled than smali to the best I can see. What that link you posted was talking about was different tools to get the job done- some can be helpful, tho many don't work properly with ICS as of yet.
Sorry if my answers are unclear, I wasn't sure of the questions perhaps..
Click to expand...
Click to collapse
my question is whether we decompile all the way back to the Java source instead of stopping at the assembly(smali) stage
from doing more searching, it looks like you might be able to get readable Java source code, but you can't recompile them as it'll be incomplete and as you said might not work on ics
I assume one would need to to flash the cm9/10 and then get those logcats
Silentbtdeadly said:
Then you likely have the cause of the original boot loop. Two things you can do, check the logcat - it may tell you something useful.. another thing to do is get software to compare the files, I think for windows there's a free one called winmerge... The output files are usually text, and you may see some specific lines that would help us from the stock file and change those(things relating to data), leaving everything else alone.
Someone recently posted how to do a log for data errors, but I have a really good tutorial in the bible in my signature, logcat like a pro.
Sent from my HTC_Amaze_4G using xda app-developers app
Click to expand...
Click to collapse
Ok, so I tried again this morning by only adding "HtcMobileDataStateReceiver.smali" to the port in the android/net, and I got the boot loops again. Checked the logcat and found this...
I/ServiceManager( 144): service 'media.audio_flinger' died
I/ServiceManager( 144): service 'media.camera' died
I/ServiceManager( 144): service 'media.player' died
I/ServiceManager( 144): service 'media.audio_policy' died
I/Netd ( 496): Netd 1.0 starting
D/AndroidRuntime( 497):
D/AndroidRuntime( 497): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
D/AndroidRuntime( 497): CheckJNI is OFF
I/dalvikvm( 497): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
D/dalvikvm( 497): Unable to process classpath element '/system/framework/framework.jar'
I/ ( 498): ServiceManager: 0x1293958
E/JNIHelp ( 497): Native registration unable to find class 'android/debug/JNITest', aborting
Any ideas? It seems like it's not taking my new classes.dex file for some reason.

How To Know Which Files Are Required In Device Tree?

Hi! I am trying to build a device tree for my device. I am wondering which files are required in a device tree. I know you need certain files that are mandatory, like BoardConfig.mk, system.prop etc. but how do I know which other files and folders I need. For example, the 1+1 device tree has audio, bluetooth, gps, camera and other folders, but certain device trees don't have a GPS folder. It varies between device. So, how do I know which files are needed in my device tree? Thanks
Looking forward to see answer to this. I also need to know this
NateDev473 said:
Hi! I am trying to build a device tree for my device. I am wondering which files are required in a device tree. I know you need certain files that are mandatory, like BoardConfig.mk, system.prop etc. but how do I know which other files and folders I need. For example, the 1+1 device tree has audio, bluetooth, gps, camera and other folders, but certain device trees don't have a GPS folder. It varies between device. So, how do I know which files are needed in my device tree? Thanks
Click to expand...
Click to collapse
I would start by checking out this guide for some better information about the required files and what is involved https://docs.omnirom.org/Porting_Omni_To_Your_Device. But I personally before I even started would find a device as close to yours as possible and look at its device tree and the files it has. What device are you building for?
shimp208 said:
I would start by checking out this guide for some better information about the required files and what is involved https://docs.omnirom.org/Porting_Omni_To_Your_Device. But I personally before I even started would find a device as close to yours as possible and look at its device tree and the files it has. What device are you building for?
Click to expand...
Click to collapse
I am porting for the BLU Energy X 2, and as a reference, I am using the device tree from the Infinix Hot 2. They are very similar.
NateDev473 said:
I am porting for the BLU Energy X 2, and as a reference, I am using the device tree from the Infinix Hot 2. They are very similar.
Click to expand...
Click to collapse
Since you found a starting point setup your device tree similar to the device tree of the Hot 2 you found.
shimp208 said:
Since you found a starting point setup your device tree similar to the device tree of the Hot 2 you found.
Click to expand...
Click to collapse
OK, I will do that and see how everything goes.
NateDev473 said:
OK, I will do that and see how everything goes.
Click to expand...
Click to collapse
Great! Best of luck let me know if you still have questions!
OK, so I've completed all the files and folders from the Infinix device tree, but I still am wondering a couple things. Since the Infinix device tree didn't have files like proprietary-files.txt, do I need that in my device tree, as mentioned by some guides? Also, since I'm making the vendor files as well, do I put all the lib files from my device, or just the files that are in the Infinix vendor files? I am also facing an error that says: No rule to make target device/.../kernel. Sorry for all the questions, I'm a bit of a noob Thanks!
NateDev473 said:
OK, so I've completed all the files and folders from the Infinix device tree, but I still am wondering a couple things. Since the Infinix device tree didn't have files like proprietary-files.txt, do I need that in my device tree, as mentioned by some guides? Also, since I'm making the vendor files as well, do I put all the lib files from my device, or just the files that are in the Infinix vendor files? I am also facing an error that says: No rule to make target device/.../kernel. Sorry for all the questions, I'm a bit of a noob Thanks!
Click to expand...
Click to collapse
Where did you find the files which has to be in folders like gps, camera etc. Did you find that folders in phone or kernel source or what?
Professor Woland said:
Where did you find the files which has to be in folders like gps, camera etc. Did you find that folders in phone or kernel source or what?
Click to expand...
Click to collapse
I'm currently using the files from the Infinix Hot 2, to see which will work and which need changing. Some of the files are on the device but they're not in the kernel source code, as far as I can tell. I'm currrently using the prebuilt kernel, but I've looked at other source code.
However, I get an error when running make. It will tell me I need an audio.cpp file.
That doesn't make sense though, because that audio.cpp file isn't needed if I don't make any changes to the device tree (so the straight Infinix device tree).
EDIT: Ok, so I used just the sepolicy file, and I got a different error around 9 mins in, about a twrp.fstab, so I will work to correct that, but atleast I don't have have the audio.cpp file anymore.
EDIT: I just added the rootdir folder, and it got past that error, so I won't be posting anymore updates until I find which folder gives me the audio.cpp error, and then I will not include that folder in the build.
After that, with all the other folders in, I will built it, and flash it on my device.
OK, so in the device tree, I have included the Bluetooth folder, the rootdir folder, the sepolicy folder and the wpa_supplicant folder. For the files I have included AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, cm.mk, device_e050u_blu.mk, kernel, system.prop, vendorsetup.sh.
I ran make, and it completed successfully. I didn't make the flashable zip however, so the images are separate, but I can flash them through adb to test. But, if I want a flashable ZIP, is there a way to turn those .img files into a zip? Will the building of the flashable zip take less time if I already have built it once? Because I don't want to have to sit through 2 and a half hours again. I am assuming that from here, I put in the other folders 1 by 1 until I find which folder gives the audio.cpp error, I remove that, and then I build the ROM again. Am I correct on this process? Because the rest of the folders are asec_helper, audio, gralloc_extra, include, libbt-vendor-mtk, libxlog and overlay. Could someone explain to me what these folders do/enable?
EDIT: I ran make bacon and I am getting an error saying:
build/core/Makefile:1498: recipe for target '/home/nate/cm12.1/out/target/product/e050u_blu/obj/PACKAGING/target_files_intermediates/cm_e050u_blu-target_files-f63afd6f51.zip' failed
make: *** [/home/nate/cm12.1/out/target/product/e050u_blu/obj/PACKAGING/target_files_intermediates/cm_e050u_blu-target_files-f63afd6f51.zip] Error 1
#### make failed to build some targets (05:53 (mm:ss)) ####
Thanks
OK, so I solved the make error, but I get error 1 when I run make bacon. It says error 1 relating to a zip file, the name of the finished zip.

Made a ROM. Now what...

I built a rom for my device based on lineage oreo. So far it looks good. I want to do the following things and not sure how to achieve this, will keep working on it, but any tips are appreciated.
1. change the name etc of the ROM. Different generated name for the rom zip file. different name in settings->About phone after the install.
2. Add an existing apk to the code base so that its automatically installed. How do I make it removable (pre installed app, can be removed) or not-removable (pre installed app, can't be deleted.
3. Add sources for an apk to the code base so that it gets compiled and installed. Same question with removable/non-removable. I tried this with f-droid sources. Added a line for this to the local manifests. Sources get downloaded, but dont get compiled. I added a line for this to the PRODUCT_PACKAGES in common.mk (for the vendor tree) but I dont see anything related to f-droid in the build log or the out folder related to f-droid. App does not get installed on the phone.
4. Change settings for an app. i guess this would require modifying the contents of some file where the settings are stored. Is there a concept of a post install script where it can be taken care of.
Thats all I can think of now, more later. Thanx guys..

Enable Hidden Features on A750FN/DS [Oreo](24.06.19)

Iam not a good thread maker so i will try to write everything as simple as i can.
Few days ago i bought and switched to A7 2018 from A5 2017, which was/is still an excellent phone to me.
On A5 i was on Oreo and on A7 i am and will be still on Oreo. Not planning to test this on Pie, but be my guest and try it on Pie, some stuff should work. Report if it does.
On A5 i made a similar thread to enable some features, but it was much easier to do because i had a CSC folder instead of ODM folder which has some files encrypted and you need them decrypted to proceed. And there is no flashable zip, you will need to do all on your phone, except decrepitng some files which you will need to do on your pc, and then put back and overwrite the same files on your phone and give necessary permissions.
First of all iam not a developer and i dont know anything about developing.
This is just enabling some features that were allready there in the phone through some lines on some files in ODM/OMC folder and some lines implemented in the stock floating_feature.xml file.
Never delete floating_features.xml file from your phones etc folder and dont touch permissions (0644), or your phone wont boot up. You just need to edit them and save.
Iv tested only on stock A750FNXXU1ASA4 OREO, which was only rooted and nothing else was modified.
The features you should get if everything goes right are:
1. Floating messages (option in Advanced features)
2. Record calls in (phone options)
3. Show network speed (option in status bar)
4. Data Usage Notification (option in data usage)
5. Camera Shutter sound on/of (in camera options)
6. ScreenRecord (options accessible from QPannel and Advanced Features)
7. S Bike Mod
8. Places option on keypad
9. Caller ID spam protection (in phone option)
9. LiveMessages in samsung keyboard
10. S PowerPlanning (Device Maintenance/battery)
11. HomeMode(screensaver option)
12. S Pen features( needed if you ever find working AirCommand).
13. In Samsung video options, but in option that apear when you press play on video,
you should see Video Enhancer option. Download Samsung video from Galaxy apps.
14. Multiuser support
15. Dolby Atmos dual speaker (works with speaker not just with earphones)
Anyway...
I f you dont know anything about floating_features.xml or bulid.prop or ODM/OMC folders and editing them, then dont try this beacuse I won't be held accountable if something happens to your phone if you loose your data or go into bootloop! So Dont Forget to Backup your Phone!
INSTRUCTIONS:
1.You have to be ROOTED offcourse and have a file manager like RootExplorer or simillar.
2. Now you need to copy from root of your phone two files from your contry ODM/OMC folder that your phone/SIMcard uses. It must be from your contrys ODM/OMC folder no other ones. The files are cscfeature.xml and cscfeature_network.xml After you decrypt them put them back in your phone and overwrite the ones inside your contry ODM/OMC folder and give permission 0644.
After that open in text editor with your Root Explorer cscfeature.xml file and on the bottom insert the lines that you can see in the attachment, then save and restart the phone.
To decrypt cscfeature.xml files follow this thread:
https://forum.xda-developers.com/android/software/decode-encode-omc-files-omc-decoder-t3791471
3. Now open your floating_feature.xml which is located in system/etc folder and just edit/enter on the bottom of the file lines that you can see in the attachment, save and restart the phone. Dont do nothing else with this file just insert the lines then save and restart the phone. If you delete it you will go in to bootloop.
4. Now open your build.prop and on the bottom of the file enter lines that you can see in the attachment, save and restart the phone.
5. Now copy all files in system from the attachment and put them in their corresponding places.
Give perrmission for folder 0755 and 0644 for files.
Thats it!
I hope it works for you like it did for me.
Il try to answer any questions, when i have free time.
And if you all have problems doing this i will make a video tutorial when i have free time.
Does this tutorial applies to a7 2018 with android pie? I mean do I have to decrypt those files? I just want to enable call recording.
Adutz1 said:
Does this tutorial applies to a7 2018 with android pie? I mean do I have to decrypt those files? I just want to enable call recording.
Click to expand...
Click to collapse
Yes you have to decrypt and it works on android pie
@kraken77 Can you help me to decrypt those two files if i send them to you? I have problems installing python
I only want to enable call recording
Adutz1 said:
@kraken77 Can you help me to decrypt those two files if i send them to you? I have problems installing python
I only want to enable call recording
Click to expand...
Click to collapse
Okay upload the file. Will decrypt it if i got some time tomorrow. Easiest way is by using firefds xposed module. Youll see call recording setting under phone section.
So can I enable only call recording without decrypting those files? I've did it on my s8, just copied the csc code into build.prop...it will work on this device too?
Some more features if anybody is interested.
Its for Pie
https://forum.xda-developers.com/android/general/samsung-additional-features-t3930900
This works for Galaxy S10e?

Categories

Resources