Compile CM9 with CMParts included - Samsung Galaxy Nexus

Hi all,
I've managed to properly build CM9 so far, but I noticed somehow CM settings aren't included. Does anyone know how to add this to the build? What I tried so far:
Downloaded the source files for CMParts from CM github, placed them in /packages/apps/CMParts/ and added CMParts to the core.mk file in build/../.
It starts compiling, but always returns an error complaining about deprecated API's.
Hope someone can give some advice here! Been searching like crazy the past few days, but cannot seem to find the answer. Thanks in advance...
(oh, and while I'm at it: after a build I have to manually add a couple of libs to /system/vendor/firmware/ -bcm4330 and some others-. Is there anyway to include them in the source so that they are automatically added? Thanks! )

Related

Modifying Android's built-in apps

Hi guys!
I'm wondering what I'd have to do if I wanted to modify the built in apps inside Android..
I've got a HTC Hero running FroydVillain 1.5.0. Let's say... I want to modify the messaging app that's included, MMS.apk. I wouldn't know how to go about this, and I have a few questions...
Firstly, what sources exactly are used for building the built in apps for a given ROM? The source code link in the FroydVillain post, for example, is just for the kernel. The rest of the OS isn't there.
Secondly, I hear that in order to modify a built in app, you need to build the entire OS. If I just download all the code from Google official repo, and compile that, will it just... work on my phone, provided I use a kernel that is specific to my phone?
Lastly, are there any tips anyone has for someone who just wants to modify a couple of the built in apps? Is it possible to build them as standalone apps? Or import them into Eclipse?
I've had a search around the forum and the internets in general, and people have asked similear questions, but I've yet to find a good answer. This thread comes to mind: http://forum.xda-developers.com/showthread.php?t=635197
If anyone could help me, or point me in the direction of any help, that'd be awesome! Thanks!!
FunkTrooper said:
Hi guys!
I'm wondering what I'd have to do if I wanted to modify the built in apps inside Android..
I've got a HTC Hero running FroydVillain 1.5.0. Let's say... I want to modify the messaging app that's included, MMS.apk. I wouldn't know how to go about this, and I have a few questions...
Firstly, what sources exactly are used for building the built in apps for a given ROM? The source code link in the FroydVillain post, for example, is just for the kernel. The rest of the OS isn't there.
Secondly, I hear that in order to modify a built in app, you need to build the entire OS. If I just download all the code from Google official repo, and compile that, will it just... work on my phone, provided I use a kernel that is specific to my phone?
Lastly, are there any tips anyone has for someone who just wants to modify a couple of the built in apps? Is it possible to build them as standalone apps? Or import them into Eclipse?
I've had a search around the forum and the internets in general, and people have asked similear questions, but I've yet to find a good answer. This thread comes to mind: http://forum.xda-developers.com/showthread.php?t=635197
If anyone could help me, or point me in the direction of any help, that'd be awesome! Thanks!!
Click to expand...
Click to collapse
1) The whole sources for everything are there
http://github.com/ninpo
2) You can import the sources to eclipse, but I think you will need to build the entire tree, as opposed to just what you change
3) Apktool lets you do smali and resource edits on an APK. Without knowing what you aim to do, it's hard to guide you specifically.
Most apps are based on the sources provided by google. I assume you are talking about Froyo Hero ROMs (i.e. FroydVillain), which apps are generally built from the source of CyanogenMod. Specifically for FroydVillain, if you look around ninpo github you will see some packages with some changes to their code, although it does seem that many of the changes in recent releases are not there. I have actually PMed ninpo about this and hopefully this is only a technicality.... I assume that the other packages and apps (most of them) he just compiled off the CM sources without changes.
In any case, if you compile an app either from the CM source or from google's original sources, it should work just to copy the apk file - just make sure you use an appropriate ROM (i.e. Froyo ROM if you built it from Froyo sources). The reason to want the CM sources, is that if they have incorporated further fixes (over the google sources) you may want them.
Finally, some more practical advice: I would start with the google sources: http://source.android.com/source/index.html since I have found these instructions and explanations easier to begin with - it should be quite straight forward to build these sources on a linux machine (or VM).
Then you can also try to tackle the cyanogen source: http://wiki.cyanogenmod.com/index.php?title=Building_from_source currently missing instructions on how to build for hero. But if you only want to copy apks out of it, you can just build a generic build (like in the google souce).
If you have specific problems, ask and I'll try to help you.
Good luck.
pulser_g2 said:
1) The whole sources for everything are there
http://github.com/ninpo
Click to expand...
Click to collapse
For example where are all the changes to the dalvik code? I do not follow closely enough the changes in Froyd to point out other things which might be missing (if at all), but there are relatively few committed changes to the CM code. Specifically the dalvik code, ninpo mentioned hundreds of changes which caught my interest and are definitively not there.
The kernel sources do seem to be up to date always - been following that one closely .
Thanks for the advice I love this forum!
What I'm trying to do, in case you're wondering, ultimately, is to modify the built-in messaging application to give the user the option of sending a message by the normal method, or by using their provider's free webtext service, something that all the carriers seem to offer here in Ireland.
So, for example, you'd press the Send button, and you'd be able to select one of those methods. (of course, you'd have to have a data connection for the webtext). There's also be an interface for entering your login credentials for your carrier's website.
I'm doing this party because it would be very useful. I also feel that it would give me a good introduction to how you'd go about modifying Android. I mean, from a programming point of view, it shouldn't be *too* hard to do. I already have a simple standalone app that I made which can send a text message via an Irish carrier's webtext service. But it's all good experience to try to modify other people big codebases.
I have a good bit of experience with web application development, but my experience with other programming is a little more limited. I usually use PHP, where there's none of this compiling nonsense. You just write scripts and off they go!
So I'm gonna go off and see if I can set up an environment where I can build.. the OS, I guess.
If I was to take the vanilla official Google sources, would they work on my phone? Or would I have to use an official Google developer phone... or the emulator? Or maybe if I stopped writing here and investigated those links you've provided, I'd know that by know.
Brb, investigating
Yeh investigating and just trying to do it is usually the best way
To clarify what I was trying to say above: All the java code is obvious very portable - one of the big advantages of java. In the case of android it is compiled to an .apk file and this file should be, at the very least, portable to all android "devices" running this android version. So the apk you build (for example from the vanilla 2.2 sources) should work on the emulator (good for initial debugging) and any 2.2 ROMs.
erasmux said:
For example where are all the changes to the dalvik code? I do not follow closely enough the changes in Froyd to point out other things which might be missing (if at all), but there are relatively few committed changes to the CM code. Specifically the dalvik code, ninpo mentioned hundreds of changes which caught my interest and are definitively not there.
The kernel sources do seem to be up to date always - been following that one closely .
Click to expand...
Click to collapse
I'm currently on "vacation" from any and all Android development for a week. I'll be back after the weekend, at which time my modifications will be cleaned up and committed to git. The kernel is always current with my latest kernel release due to GPL obligations. The extra time away has also highlighted some changes I need to make both to the kernel and to my Android modifications when I get back.
Hacre said:
I'm currently on "vacation" from any and all Android development for a week. I'll be back after the weekend, at which time my modifications will be cleaned up and committed to git. The kernel is always current with my latest kernel release due to GPL obligations. The extra time away has also highlighted some changes I need to make both to the kernel and to my Android modifications when I get back.
Click to expand...
Click to collapse
Thanks Ninpo

[DEV] LG P350 general dev thread - CM 7 & 9 or kernel development

THIS THREAD IS FOR DEVELOPERS ONLY!
Please do not post your problems with ROM here.
Post your ideas about working on ICS or CM7 and your problems with compiling sources or similiar.
I posted my p350 sources on github:
https://github.com/pax0r
You will find an instruction how to download mine soruces and compile it by yourself at:
https://github.com/pax0r/android_device_lge_pecan
Here we can speak how to improve this ROM ( 7.2 ) and also how to work on ICS. On my github you can find branch "ics" - it is somehow releated to my work on ICS but it's not complete.
So let's make our device EPIC!
For the begining I will post my problems releated to working on P350:
The problem I have with 7.2 release is that BT is not working - drapalyuk fixed it somehow in last release but I don't know how. If any one have idea what was changed from 1910 to 2010 drap release please let me know!
Also I started to port .35 kernel for our phone - but it's not working yet. Kernel boots and console via adb is usable at this moment but Android itself does not start on it. I will post more in this topic later.
now syncing the source
hi pax0r,
I'm trying to build CM 7.2 using your guide and source code but I notice a couple of issue that maybe create problems to someone beginner like me:
1) if you run ./extract-files.sh on a phone with CM 7.2 (vivekkalady) the extraction will fail on 3 files: libloc-rpc.so, libloc.so, libcommondefs.so. Maybe they are located in a different path.
2) I think this line of code in extract-files.sh is wrong:
Code:
adb pull /system/lib/hw/gralloc.default.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/lib/hw/gralloc.default.so
it should be:
Code:
adb pull /system/lib/hw/gralloc.default.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/lib/hw/gralloc.pecan.so
to avoid issue later.
I'd like to try to compile ics. What do you think is missing to make it works?
Best Regards,
Gabriele
hi pax0r,
the market crash few times at the begin but after I reboot it seems to be fine.
I attached the logcat.
Gabriele
megasoft78 said:
hi pax0r,
I'm trying to build CM 7.2 using your guide and source code but I notice a couple of issue that maybe create problems to someone beginner like me:
1) if you run ./extract-files.sh on a phone with CM 7.2 (vivekkalady) the extraction will fail on 3 files: libloc-rpc.so, libloc.so, libcommondefs.so. Maybe they are located in a different path.
2) I think this line of code in extract-files.sh is wrong:
Code:
adb pull /system/lib/hw/gralloc.default.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/lib/hw/gralloc.default.so
it should be:
Code:
adb pull /system/lib/hw/gralloc.default.so ../../../vendor/$MANUFACTURER/$DEVICE/proprietary/lib/hw/gralloc.pecan.so
to avoid issue later.
I'd like to try to compile ics. What do you think is missing to make it works?
Best Regards,
Gabriele
Click to expand...
Click to collapse
Thanks for your contribute
For me there are no missing libs - I was running it on 7.1 so mby Vivek 7.2 is missing them?
About gralloc - there should be two libraries gralloc.default.so and gralloc.pecan.so
About ICS I have no idea yet and now no time to look at it - studies, work and 7.2 rom is everything I can do at once ;P
pax0r said:
Thanks for your contribute
For me there are no missing libs - I was running it on 7.1 so mby Vivek 7.2 is missing them?
About gralloc - there should be two libraries gralloc.default.so and gralloc.pecan.so
About ICS I have no idea yet and now no time to look at it - studies, work and 7.2 rom is everything I can do at once ;P
Click to expand...
Click to collapse
I think the problem about missing libs is related with vivek 7.2 rom.
it's strange but I can't see gralloc.pecan.so. Anyway I'll check it this evening.
I was able to build everything using your tutorial but now I want to try with ICS. I need a bit of searching on internet.
Thank you for your work,
Gabriele
Hm I've checked it and it fact there were no gralloc.pecan in extract - it was obviously a bug, I pulled everything from device, then I was making some refactoring and I didnt check it after that. I will push commit with fixes today.
Thanks for pointing it!
I see a keylayout headset push, how did you make the headset button works? I replaced both keylayout (qwerty with the haptic fix and 7k), but the dammed button still with problems =/
Thanks
PD: The new implementation of gralloc will fix the dammn warning of prelink? (on the log)
I'm not sure if this keylayout will make headset work as I don't have one but it was suggested that it may help but this need test. New gralloc is because it is open source comparing to the original propriety one and I'm testing its speed - it is at least the same so I will leave it
To solve a problem with prelink there should be a prelink.map created but I dont know exatly how to build one. It is not a critical error but with prelink.map the boot process could be faster.
I still didnt fixed copybit ;/
If you have some idea how to help refer to this post:
http://forum.xda-developers.com/showpost.php?p=21592280&postcount=28
EDIT: copybit fixed
hey could some one with the headset use this app:
https://market.android.com/details?id=aws.apps.keyeventdisplay
click headset buttons few times and post output of this app (if any)?
BTW do the headset buttons works on Vivek ROM?
Let me compile it with the new changes and I will try
At least, I'm currently using 7.1.0 (your 7.1.0) and nothing happens. (EDITED)
call\music button problem
paxor can u rectify the call\music button for wired headset
Can you compile ICS with your new files and send it to me ??
I will try to port ICS with your new files
Hey pax0r, are you sure with the fix? Compiled, installed... but I get a weird screen on menu =S
Thanks
I get a minor success at porting .35 kernel for p350. It boots and works but it still to bugged to public release. However if you have any dev experience you can grab it here https://github.com/pax0r/lge-kernel-msm7x27 and help me fix it!
I don't know exactly how Android handles GUI, IDK how to help right now, but I just can told you about the bug when android it's displaying interface.
Can you upload your compiled ICS so that we can tweak it to get it working!
I've removed my built version and now my source code wont even build :/
Hi Pax0r! well, i want to become a dev, i have some kind of linux knowledgement and have a good willing to learn, could you please point me out to some basic tutorials about building from cyanogen source? i've searched myself in the wiki but i didnt saw anything about lg pecan, any information you can give me, I will study it and maybe then become of help in dev community! thanks in advance!!
There is not much info about anything for P350 as it is not very popular device. Everything you need to start building CM for P350 is here, in mine Readme file:
https://github.com/pax0r/android_device_lge_pecan/blob/gingerbread/README.mkdn
Everything else you need to get by yourself =p but I will try answer all your questions
I learned everything by checking avaibale info for similar devices (MSM7227 board, for example: LG P500, ZTE Blade) and source codes.

[Q] Compile CM9 help

After following this tutorial I compiled CM9 for my r800x and everything works fine but since I first compiled I have edited the SystemUI sources. The problem is when I compile it doesn't compile the new sources. Anyone know what I'm doing wrong? Sorry if this is a noob question.
Extra information (not sure if important but might help find the cause):
Using Xubuntu 12.10
Oracle Java 6
I edited /frameworks/base/packages/SystemUI
I compiled for zeusc instead of zeus
What more specifically did you modify? Not sure why it would not rebuild, unless there's some kind of issue with the timestamps or your system clock. (It knows to rebuild if the source files have a newer timestamp than the compiled files they produced)
You can always just do a clean build. You can even just change the output directory without messing up your current build:
http://source.android.com/source/initializing.html said:
export OUT_DIR_COMMON_BASE=<path-to-your-out-directory>
Click to expand...
Click to collapse
You can set that to a different directory and it will build it all over again, putting all the output in that directory instead. With this different, it won't affect the output of your current build and you can always clear this variable to go back. Then you can use this for comparison. Alternatively you can just wipe out your output directory and build it over. You may also be able to dig into your output directory and delete the compiled files for the sources you have modified and then it should definitely notice and rebuild those.
EDIT: Also note that there are build instructions on the CyanogenMod wiki: http://wiki.cyanogenmod.org/w/Build_for_zeus
On the repo init line you can also say '-b jellybean' instead of ics and it will build CM10 (which is pretty good too but not fully stable, it's CM10.1 that is more unstable)
I also noticed that in the 'stable' release of CM9 for zeus the proximity sensor does not work, but there are patches for it in the repo and I've built from source with CM10 and it works fine.
~Troop
Trooper_Max said:
What more specifically did you modify? Not sure why it would not rebuild, unless there's some kind of issue with the timestamps or your system clock. (It knows to rebuild if the source files have a newer timestamp than the compiled files they produced)
You can always just do a clean build. You can even just change the output directory without messing up your current build:
You can set that to a different directory and it will build it all over again, putting all the output in that directory instead. With this different, it won't affect the output of your current build and you can always clear this variable to go back. Then you can use this for comparison. Alternatively you can just wipe out your output directory and build it over. You may also be able to dig into your output directory and delete the compiled files for the sources you have modified and then it should definitely notice and rebuild those.
EDIT: Also note that there are build instructions on the CyanogenMod wiki: http://wiki.cyanogenmod.org/w/Build_for_zeus
On the repo init line you can also say '-b jellybean' instead of ics and it will build CM10 (which is pretty good too but not fully stable, it's CM10.1 that is more unstable)
I also noticed that in the 'stable' release of CM9 for zeus the proximity sensor does not work, but there are patches for it in the repo and I've built from source with CM10 and it works fine.
~Troop
Click to expand...
Click to collapse
Never even thought about changing the location it is output to or anything like that. Kinda feel dumb not trying that but I will soon. Also I've looked at CyanogenMod's wiki already. And is CM 10 working on zeusc? I thought it was still only zeus but I haven't checked in a while.
bandoncontortion said:
Never even thought about changing the location it is output to or anything like that. Kinda feel dumb not trying that but I will soon. Also I've looked at CyanogenMod's wiki already. And is CM 10 working on zeusc? I thought it was still only zeus but I haven't checked in a while.
Click to expand...
Click to collapse
Cj360 made a zeusc version and uploaded it to fxp cm10 page. I've tested it and it works great
Sent from my Xperia Play (r800x)
Also all I did to SystemUI was add one .java file. I didn't know zeusc had cm 10. I'll check it out.
bandoncontortion said:
Also all I did to SystemUI was add one .java file. I didn't know zeusc had cm 10. I'll check it out.
Click to expand...
Click to collapse
Make sure the timestamp of the file you added is newer than the time you built. Otherwise, make will not realize there is a new file. Seems like you must have modified some other source file though to make use of the new source file.
A simple way to update the timestamp of a file is the "touch" command. If you touch a file before your build, it should always rebuild that file unless you have more serious problems.
Also, I forgot about the zeusc not being as well supported... so hopefully all the fixes for CM10 on the zeusc are in the repositories.
I do like CM10 better than CM9... especially since I figure if we're going to ditch stock-based GB, there's even less reason to live in the past.
~Troop
Changing the timestamp didn't do anything. I'll try deleting the already compiled files and recompile everything over again tomorrow. Also CM10 is a lot better in my opinion too so I'll try it now so hopefully it'll work and fix the problems I'm having.
Trooper_Max said:
Make sure the timestamp of the file you added is newer than the time you built. Otherwise, make will not realize there is a new file. Seems like you must have modified some other source file though to make use of the new source file.
A simple way to update the timestamp of a file is the "touch" command. If you touch a file before your build, it should always rebuild that file unless you have more serious problems.
Also, I forgot about the zeusc not being as well supported... so hopefully all the fixes for CM10 on the zeusc are in the repositories.
I do like CM10 better than CM9... especially since I figure if we're going to ditch stock-based GB, there's even less reason to live in the past.
~Troop
Click to expand...
Click to collapse
CM10 works good on zeusc. Haven't found any bugs and I added the changes to it's SystemUI and it compiled it for me and works great. Thanks for the help!

[Q] Some problems about compile CM 10.1

Recent period of time. I have been learning compiler cm.
Accumulated a lot of problemsr. Can you help me, help me to answer it?
1: AOSP kernel and Samsung official kernel, what difference? This issue has been bothering me.
Did not they are compiled from the same source it?
2: The config file is how to configured? Is there any quick tool?
Before use "make localmodconfig" command. Configuration config file.
Used more than four hours before configuration is complete. And the result is simply not compile.What a **** day!
3:What is "ramdisk" ?how to build it? the AOSP ramdisk,and Samsung official, what difference?
I could not find the answer on the network.
thanks.

Making a CAF based rom.

Alright so I've built and modified both LOS and RR a bit and it went pretty well. Tutorials o'plenty when it comes to building those roms.
However I now want to try and build a rom from scratch and I'd like to base it on CAF.
I've *I think* correctly synced up with the latest msm8996 tag, but I may have ****ed that up as well.
My problem is is that I literally can not find any resource for building with CAF sources, and I can't even find my local_manifests/roomservice, so I have no idea where to start.
If any of you have any resources or want to share a bit of your knowledge it would be greatly appreciated.
Thanks.
Anyone?
Hey, check out AOSP-CAF(https://github.com/AOSP-CAF). This is all you'll ever need and it's updated regularly. The dev has already added all the necessary stuff(HALS) and also has CM's build system so all you need to do is fork some device tree , sync it's dependencies and you should be good to go.
INT3NSE07 said:
Hey, check out AOSP-CAF(https://github.com/AOSP-CAF). This is all you'll ever need and it's updated regularly. The dev has already added all the necessary stuff(HALS) and also has CM's build system so all you need to do is fork some device tree , sync it's dependencies and you should be good to go.
Click to expand...
Click to collapse
Thanks! I've synced up with it and also synced with the OnePlusOSS device tree. The builds are failing however because the pull_library.sh script they give doesn't work anymore. Is there another device tree you would recommend? And how could I go about finding the dependencies?
Thanks for your help

Categories

Resources