[Q] AOSP changing applications from source - Galaxy S I9000 Android Development

Hi,
I'm trying to change the Phone.apk application from google GIT source code. but when i import the application to Eclipse, I'm getting a lot of errors even after loading the correct android.jar file.
1) what is the right way to MOD application from google source code?
2) How can I know which libraries am i missing?
Thanks a lot,
Idan

Try in the q&a forum or general dev forum.
One hint you don't mod it through eclipse.
Sent from my phone using my Thumbs!

thanks for the reply,
I dont mean changing it through apktool or equivalent, I mean compiling the app from the google java source code...

you have the "correct" android.jar with hidden apis?
link or it did not happen .-.

i suppose nobody told me about this android.jar.
where can i get it then?

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

Samsung Galaxy Tab Development Environment

Hello developers,
I'm starting this thread because I'm interested in designing a development environment for the Samsung Galaxy Tab so that developers, like myself, can have an easy environment for modifying the Android OS. I'll be aiming this environment at all Android Devices but I want to start with the Samsung Galaxy Tab.
At the moment I don't have much of a structure for this project, nor much direction, so if anyone has any ideas for what tools etc I should include in this please let me know. If anyone wants to get on board with the project it would also be appreciated. Send me an email.
tool ideas:
- integrating the GCC and Javac compilers into the environment.
- integrating a way to generate make files and to build from these files.
- GUI for editing files from the kernel and application framework.
- easy to use way of setting up branches for projects with the Repo and Git included in the Android Source Code.
Count me in. I am getting a Tab tonight and I plan to develop for it. Currently, I have got the froyo source on my machine and want to integrate the open source code that Samsung released for this device.
Has anyone successfully built a custom ROM using the Samsung source code? Any help on this will be appreciated.
Awesome!
I've got Froyo working on the Tab, which I built from the source code from the android open source project website but it's just a generic build from the straight source, nothing special. not with the samsung code though. do you have any links for it?
I've put a small amount of stuff into the Dev Environment, most just shell files etc to make installing everything easier. One click sort of thing.
My first task though is going to be to try and fix the failure that is the Samsung display driver. Most noticeable are the 4 by 1 widgets that don't stretch across the whole screen.
After that I'm going to start work on a GUI for the environment and the iOS Emulator.
thoughts?
Whats wrong with Android SDK and Eclipse?
It's not the most straight forward thing. I'm looking to make something that includes its own libraries too. It's aimed at beginning developers mostly, so you can literally download one file which includes everything you'll need then start editting and then one click to compile and have it all work. Simplicity
I'm also interested in this... The SGT is my first android device, and my company will want android apps for internal and external uses... and a one click dev environment would be a most welcome option!
DevShroom said:
I've got Froyo working on the Tab, which I built from the source code from the android open source project website but it's just a generic build from the straight source, nothing special. not with the samsung code though. do you have any links for it?
Click to expand...
Click to collapse
Straight up AOSP? Could you have a crack at CM?
Anything you need, including testers, I'm in.
I have programmed some programs in android. If you need my help, i will be glad to help,
Sent from my GT-P1000 using Tapatalk
i'm currently setting up a new galaxy Tab ubuntu 10.10 VM but I always fail at installing java5-jdk, but when im ready i'm going to have a look at the CM and AOSP source and i !try! to port CM to the tab!
I am working on a custom rom , if you need any help do not hesitate
yann06 said:
I am working on a custom rom , if you need any help do not hesitate
Click to expand...
Click to collapse
are u building from source or are you modifing a stock rom?
DevShroom said:
Hello developers,
I'm starting this thread because I'm interested in designing a development environment for the Samsung Galaxy Tab so that developers, like myself, can have an easy environment for modifying the Android OS. I'll be aiming this environment at all Android Devices but I want to start with the Samsung Galaxy Tab.
At the moment I don't have much of a structure for this project, nor much direction, so if anyone has any ideas for what tools etc I should include in this please let me know. If anyone wants to get on board with the project it would also be appreciated. Send me an email.
tool ideas:
- integrating the GCC and Javac compilers into the environment.
- integrating a way to generate make files and to build from these files.
- GUI for editing files from the kernel and application framework.
- easy to use way of setting up branches for projects with the Repo and Git included in the Android Source Code.
Click to expand...
Click to collapse
I'll be interested in getting involved in a community driven project for the SGT. I'm a unix admin with lots of experience in the OS and system development field. Interested in what ideas you have on this.
Try using openjdk. It works for me.
Sent from my GT-P1000 using Tapatalk
Thanks everyone for the positive feedback on all this! it'll be good to have as many people on board as possible.
if you have troubles downloading the sun-java5-jdk there is a good tutorial on it on this site, it doesnt come as part of the repository by default so until you add it in sudo apt-get install sun-java5-jdk will not work.
atm i am only working with AOSP not CM, i am trying to set this dev environment up for a nice simple build and then i'll start working on more complex builds so we can start developing custom roms.
@paulshields - do you know much about linux/android drivers? i wanna fix the widget sizing problem on SGT but my driver knowledge is limited

Compile CM9 with CMParts included

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! )

How to get the device specific source code for Sony Xperia Z5 statusbar/policy

I am new to Xposed development. I figured out that we can override most methods in android. And from a famous tutorial I found out a way to change the clock to a smiley. Now, that android source code was different and My device's source code is different. I have a sony xperia z5. How do I reasearch my z5's 6.0.1 java code so that i can come up with a new xposed module??? Like where do I find my device's source code?
Please helpp......
thetitanium said:
I am new to Xposed development. I figured out that we can override most methods in android. And from a famous tutorial I found out a way to change the clock to a smiley. Now, that android source code was different and My device's source code is different. I have a sony xperia z5. How do I reasearch my z5's 6.0.1 java code so that i can come up with a new xposed module??? Like where do I find my device's source code?
Please helpp......
Click to expand...
Click to collapse
If OEM of your device does not provide source code repositories, the only way is to use apktool to decompile existing system components (e.g. SystemUI.apk for status bar). You'll get decompiled source in smali format which is quite hard to read and makes reverse engineering complicated. There are also tools which can convert smali to better looking representation which is close to java code but you still won't get the exact source code from which system was built. But it should give you basic info where your hooks have to be applied. In the past, I tried using Virtuous Ten Studio which is an all-in-one tool for reverse engineering but it was a long time ago thus not sure what the current state of the project is.
C3C076 said:
If OEM of your device does not provide source code repositories, the only way is to use apktool to decompile existing system components (e.g. SystemUI.apk for status bar). You'll get decompiled source in smali format which is quite hard to read and makes reverse engineering complicated. There are also tools which can convert smali to better looking representation which is close to java code but you still won't get the exact source code from which system was built. But it should give you basic info where your hooks have to be applied. In the past, I tried using Virtuous Ten Studio which is an all-in-one tool for reverse engineering but it was a long time ago thus not sure what the current state of the project is.
Click to expand...
Click to collapse
Thanks a lot! Ya I decompiled the apks and found some pointers that helped me a lot. Ya, sony provides developer sources but I was unable to convert the code into readable format... Can you help me with that?
Here is the link.... https://developer.sonymobile.com/do...rchives/open-source-archive-for-44-1-a-0-169/
thetitanium said:
Thanks a lot! Ya I decompiled the apks and found some pointers that helped me a lot. Ya, sony provides developer sources but I was unable to convert the code into readable format... Can you help me with that?
Here is the link.... https://developer.sonymobile.com/do...rchives/open-source-archive-for-44-1-a-0-169/
Click to expand...
Click to collapse
I'm not sure what that package contains since I did not download it due to its size but it's a packed image. You have to unzip and untar to get to the files.
Got it! Thanks anyways @C3C3C076. All I had to do was pull boot.oat and then use oat2dex. This gave me several dex files, and then there was this beautiful framework.dex and framework-classes.dex. The two things I needed to do look into.

Updated VTS

Hello decompilers
I am a long-time hobby VTS user. Since "stock" VTS is quite outdated, I have updated the included binaries to support decompiling of newer apks. Base version is the latest available, 3.6.30.14100.
updated binaries:
apk tool
smali and baksmali
procyon java decompiler
adb
dex2jar
since apktool has changed commandline arguments, I had to modify VTS itself (ToolWrapper.dll). Therefore this version only works with newer versions of apktool
If you have trouble opening it, you will probably have to bypass signature checking (will help on request, as I don't remember how to do it)
Full updated VTS: (106.5 MB)
https://mega.nz/file/m4oAGYbC#GfD-xo9bHMgWUXCncJg_YegfFzJK-KTTcBiGXamuUok
Update patch: (51.2 MB)
https://mega.nz/file/Lt4SjIiT#IcGkqT259M95DbpVIhShR-nTSvZuWvOkMm-cF7SLQpc
Thanks for the modification, really sad to see it not getting updates anymore :/
For some reasons though, when I try to create a new project, I cant press on "finish", no matter which configuration I choose.
I set the Java-path in the settings, I also added a framework and tried to replace the apktool and smali jars you provided with freshly downloaded ones, but this did not seem to work.
I also dont get any error in the logs, so Im pretty much out of ideas. Is this error know to you or do you have asolution?
trogper said:
Hello decompilers
I am a long-time hobby VTS user. Since "stock" VTS is quite outdated, I have updated the included binaries to support decompiling of newer apks. Base version is the latest available, 3.6.30.14100.
updated binaries:
apk tool
smali and baksmali
procyon java decompiler
adb
dex2jar
since apktool has changed commandline arguments, I had to modify VTS itself (ToolWrapper.dll). Therefore this version only works with newer versions of apktool
If you have trouble opening it, you will probably have to bypass signature checking (will help on request, as I don't remember how to do it)
Full updated VTS: (106.5 MB)
https://mega.nz/file/m4oAGYbC#GfD-xo9bHMgWUXCncJg_YegfFzJK-KTTcBiGXamuUok
Update patch: (51.2 MB)
https://mega.nz/file/Lt4SjIiT#IcGkqT259M95DbpVIhShR-nTSvZuWvOkMm-cF7SLQpc
Click to expand...
Click to collapse
Thanks for this update
But there is a problem that I hope you will solve.
The problem is that when decompiling the apk, the program only decompiling the main classes.dex.. but classes2.dex and classes3.dex do not unpack it.
Dark_Lion64 said:
Thanks for the modification, really sad to see it not getting updates anymore :/
For some reasons though, when I try to create a new project, I cant press on "finish", no matter which configuration I choose.
I set the Java-path in the settings, I also added a framework and tried to replace the apktool and smali jars you provided with freshly downloaded ones, but this did not seem to work.
I also dont get any error in the logs, so Im pretty much out of ideas. Is this error know to you or do you have asolution?
Click to expand...
Click to collapse
In the import wizard, there is one step where you set path where to save the project. There are 4 input fields (project name, solution name, something, path). You have to fill them all. I have spent some time on this issue too...
abo2sadam said:
Thanks for this update
But there is a problem that I hope you will solve.
The problem is that when decompiling the apk, the program only decompiling the main classes.dex.. but classes2.dex and classes3.dex do not unpack it.
Click to expand...
Click to collapse
Sorry, I don't use VTS anymore. I have found a replacement, APK Lab for visual studio code.

Categories

Resources