So I'm hoping that I can get some clarification about how an android rom works exactly, and how things can be modified and such.
My current understanding of a ROM, is that essentially android is a linux distribution with a special type of java virtual machine (called a dalvik machine) that runs java code in the form of .apks. This all runs ontop of a specialized linux kernel (for example kernals with BFS in Cyanogen & JAC's ROMs). The .apk's that run in the virtual machine have access to frameworks and libraries. The frameworks are part of different ROM versions, for example, HTC Hero ROMs have a different frameworks and libraries than say a stock 1.6 ROM.
What is the difference between a framework and a library?
Do most ROMs have modified frameworks/libraries?
How would you edit a framework? A library?
What are odexes? Are they a neccessary part of a ROM?
How are .apk's (that come with ROMs, such as Browser or Rosie or MMS) modified to say remove a dependency or "optimized" to go faster?
I have the android SDK 1.6r1 installed and I have learned how to sign .apk's and update.zip's, I understand the flashing process and fastboot etc.
I am kind of looking for a way to run Hero's Stock Widget and Stock application on my Cyanogen build, but I realize there isn't a dev out there for every one of my wants and want to play with it myself.
If I have a concept wrong or you want to elaborate on something I said please feel free, all of my knowledge is just stuff I have picked up and I'm still not confident in my understanding. Thanks for your answers!
I'll try and help you out here but this is mainly a bump so you can get where you need to go.
I may not be 100% correct and I'll let someone correct me if I'm wrong.
Your first paragraph is correct.
Do most ROMs have modified frameworks/libraries?
Click to expand...
Click to collapse
Yes. The Hero ROM's frameworks are heavily modded and closed-source, making it very hard to reverse engineer. Some of these frameworks have been modified to allow for HTC apps on the stock android platform, such as HTC Music. However, this is a very difficult and arduous process so it is rarely undertaken and the distribution of HTC apps are limited for the stock android platform. ( you mention you want the stock widget and the twitter widget. These rely on the Hero framework. Many attempts have been made. If you can port this, props man. You should release it publicly )
Some ROM's, especially those that use Cyanogen ROM, have modified framework for speed or feature reasons. I am not very sure of the mods made, but there are plenty as can be seen by the release of Cyan's theme templates.
How are .apk's (that come with ROMs, such as Browser or Rosie or MMS) modified to say remove a dependency or "optimized" to go faster?
Click to expand...
Click to collapse
Some apks are optimized by reducing the file size of images located within the .apk. Also, recently a new method of zipping the .apk files has been unveiled by google which makes them faster at runtime.
Thats all I can answer with relative confidence
EDIT: i forgot to mention, if you want to sign your .apk's and update.zip's
http://forum.xda-developers.com/showthread.php?t=473580
Thx for your reply. That helps a lot. Any other comments anyone?
Related
I was using manup's eclair rom and I was trying to edit the bootanimation (nexus) but I couldn't because there wasn't any space on my phone. So it switched over to the defualt android boot screen. I told a friend of my about this and he told me that eclair is not orginally for the g1. So I was wondering if there is a github or in the android tree where I could get the source for the eclair and editted. My plans on saving disk space is either to remove most apps and command scripts that take up space or to remove pngs inside the apps themselfs, which will create a picture-less rom. Would do you guys think? I am a themer and I also know basic java (OOP). So I have some experince in programming and also photo editting.
mohsinkhan47 said:
I was using manup's eclair rom and I was trying to edit the bootanimation (nexus) but I couldn't because there wasn't any space on my phone. So it switched over to the defualt android boot screen. I told a friend of my about this and he told me that eclair is not orginally for the g1. So I was wondering if there is a github or in the android tree where I could get the source for the eclair and editted. My plans on saving disk space is either to remove most apps and command scripts that take up space or to remove pngs inside the apps themselfs, which will create a picture-less rom. Would do you guys think? I am a themer and I also know basic java (OOP). So I have some experince in programming and also photo editting.
Click to expand...
Click to collapse
Since your a andro themer, you must know that it is better to do all of your mods n stuff before flashing the rom. This gives you the chance to remove apps you dont need and allows you to change the boot.
Let me explain what I mean by "casual". I've come to find that I always end up removing stuff from custom ROMs that I don't like/don't use and end up with something much much better.
With NFX's permission (should he give it) I'd like to make a custom ROM based on my slimmed down approach, one that left me with tons of free space, lots of free RAM, great battery life, and smooth operation. I'm looking at the ROM right now, and I'm wondering; is there anything special I need to know about adding my own apks to be preinstalled with the ROM? I'd like to add Fancy Widget and LauncherPro since I stopped using the Sense Launcher. My ideal setup is one where the app is recognized by the market so that it can be updated as and when needed. Also, what can I do to ensure that LauncherPro is the default launcher?
I'd love to get into this. I'm not big on code editing but have no issue with doing so when needed, can anyone nudge me in the right direction?
Update #1: My first attempt failed . I was using Nfinite's Odexed NFX Rom. I tried to just change around the apps in the data/app/ folder. Also attempted to delete all the HTC Sense Widgets beforehand. (I do this after install, but I wanted to do it before.) Should I not be working with an odexed ROM, and is there some sort of signature process that I need to be using?
Pretty sure you need deodexed.
CM6 Android 2.2.1 Froyo Darchstar
Radio 2.42.01.04.27
*Bite me Sprint!
Search for avabox on these forums. It has the zip signing tool to make the zip flashable after editing it. And many other helpful tools
Sent from my HERO200 using XDA App
davec1234 said:
Pretty sure you need deodexed.
CM6 Android 2.2.1 Froyo Darchstar
Radio 2.42.01.04.27
*Bite me Sprint!
Click to expand...
Click to collapse
danaff37 said:
Search for avabox on these forums. It has the zip signing tool to make the zip flashable after editing it. And many other helpful tools
Sent from my HERO200 using XDA App
Click to expand...
Click to collapse
Thanks guys! I'll give this a shot and see what happens
LiquidSolstice said:
Let me explain what I mean by "casual". I've come to find that I always end up removing stuff from custom ROMs that I don't like/don't use and end up with something much much better.
With NFX's permission (should he give it) I'd like to make a custom ROM based on my slimmed down approach, one that left me with tons of free space, lots of free RAM, great battery life, and smooth operation. I'm looking at the ROM right now, and I'm wondering; is there anything special I need to know about adding my own apks to be preinstalled with the ROM? I'd like to add Fancy Widget and LauncherPro since I stopped using the Sense Launcher. My ideal setup is one where the app is recognized by the market so that it can be updated as and when needed. Also, what can I do to ensure that LauncherPro is the default launcher?
I'd love to get into this. I'm not big on code editing but have no issue with doing so when needed, can anyone nudge me in the right direction?
Update #1: My first attempt failed . I was using Nfinite's Odexed NFX Rom. I tried to just change around the apps in the data/app/ folder. Also attempted to delete all the HTC Sense Widgets beforehand. (I do this after install, but I wanted to do it before.) Should I not be working with an odexed ROM, and is there some sort of signature process that I need to be using?
Click to expand...
Click to collapse
Like some else said you'll need the deodexed rom. Also if your altering the rom for personal purposes there is no need to ask nfinite... if you post the rom then you'll need to ask and give props.
Next you need some kind of rom manager tools so that you can sign and zip align your apk and have a flashable after you make your changes. maybe read threw the rom cooking guide on the hero wiki page also.
You most definitely what an odexed ROM. Its been a while since I messed with it, but i think you will want to place apps you want updated in /data/app. As for the default launcher, it should ask which one you want as default when you first boot into the ROM.
unCoRrUpTeD said:
You most definitely what an odexed ROM. Its been a while since I messed with it, but i think you will want to place apps you want updated in /data/app. As for the default launcher, it should ask which one you want as default when you first boot into the ROM.
Click to expand...
Click to collapse
@[email protected] Confusion. A few people above have said I need deodexed?
The only problem you will run into with odexed vs deodexed is changes to any jar files within an apk on system. Only really applies to framework level edits. Things like removing haptic or rotary lock screen or battery percentage mods, etc.
Sent from my HERO200 using XDA App
LiquidSolstice said:
@[email protected] Confusion. A few people above have said I need deodexed?
Click to expand...
Click to collapse
I meant to type deodexed. I was so tired and doing ten things at once. Didn't even reread what I was posting.
danaff37 said:
The only problem you will run into with odexed vs deodexed is changes to any jar files within an apk on system. Only really applies to framework level edits. Things like removing haptic or rotary lock screen or battery percentage mods, etc.
Sent from my HERO200 using XDA App
Click to expand...
Click to collapse
Ah. Nah, the only thing I'd love to experiment with is to swap out images and png files. The functionality of the ROM and its inner workings are fine . Assuming that I can remove all the HTC widgets and a few of the apps I won't be using (using LP, so Sense Widgets are unneeded), and that I can set a default launcher, and perhaps mess around with all the status bar icons/button images, that's all I want to do
LiquidSolstice said:
@[email protected] Confusion. A few people above have said I need deodexed?
Click to expand...
Click to collapse
You will need deodexed
You can always re-Odex it afterwards.
I assume you've realized this, as you have a stable odexed ROM out, but I'm putting it up for reference's sake. Don't want someone reading the thread and getting the wrong idea.
Where do I start? What kitchens are the best?
I have no idea where to start, could someone provide me with a couple of links and tutorials.
What inspired me is that all the roms out there have bits and pieces of what I want, but not one that has everything. I want to create that myself.
On a side note, all I wan't to achieve right now is getting the sense weather widget, live wallpaper, and the htc camera on stock 2.2. If that is extremely difficult or advanced, than I have no problem learning how to.
Thanks.
you can add and remove apps from any rom you downloaded and then you need to resign it or flash from recovery with disabled signature check. another way is build whole rom from aosp.
porting sense widgets and apps which are depending on htc framework is not extremely difficult but it's impossible to run on stock nonsense rom.
everything can be found on google, there is thousands of tutorials
I made a thread in the Android General section, but it must not be getting attention from anyone capable of deodexing an apk, or just nobody wants to do it.
I probably should have created the thread here, so I'm linking to it here.
http://forum.xda-developers.com/showthread.php?t=1504082
Thanks all
bizzump
+10char
There's a few things we need to know first. Why only one apk? Why not deodex your whole ROM? Or if you have a copy of the whole ROM could your send it to me…..I can't deodex just the SystemUI when it has dependencies on the other functions within the ROM i.e. Framework.jar.
Or if you could explain maybe what your hoping to achieve I could probably sort somethingout for you a much simpler way.
What phone do you have and what apks are you using now? If you want to theme or want some sort of function from an apk that’s not yours but is odex version there may be a way of breaking it down to its classes (if I knew what ROM it was from and you had the entire framework folder from the ROM along with the odex file) and then I can decompile the apk you use (I think that’s what your trying to achieve correct?) from your ROM, then bring the classes and/or pngs across, rebuild, re-optimise (not odex btw) and send it back to you maintaining the signature for your apks in your ROM.
The phone and rom it is running are in my sig. I only want the SystemUI deodexed so that I can make the status bar transparent and still enjoy the slightly improved performance of an odex'ed rom, because this is a low-end phone so anything to increase performance helps. I have also tried using the AutoDeo Tool, but I don't know how to figure out what the correct custom bootclass path line input should be.
I asked for some help in that thread this morning and feel that I'm getting closer to having a deodexed SystemUI. I hate having posts in so many places about the same problem, but it seems like not a whole lot of people know how to do it, and even fewer want to explain such a complex process.
Hopefully I'll be able to deodex my entire rom.zip and just replace the systemui that's on my phone with the deodexed one and delete the .odex file and everything will be ok.
Sent from my SGH-T499 using XDA App
HI devs this is regarding a dark theme I am making for the n5 found here http://forum.xda-developers.com/goo...-material-black-theme-lollipop-t2958812/page9
so heres the probblem i am facing ... I started theming on a stock based odexed rom ... xtrasmooth to be exact and i theme by decompiling the apks modding and then recompiling the current build works fine on alot of odexed roms and it all cool there
but i also want this mod to run on deodexed roms ... this is where i have the problem
as of now i cant find a way to deodex lollipop apks trust me i searched but none of them seem to work I understand the problem with deodex
I managed to get a build to boot on slim but i did that by decompiling the slim apks comparing the xmls and replacing the values this works but is very time consuming and it runs only on slim and not anyother deodexed roms
Im new to themeing so I dont really know how to figure this out myself , thats why im here
BUUUUT I have come up with some possible approachees
the problem as we understand it
quoting @Incredible_Culp from this page
Quote:
Originally Posted by Incredible_Culp
eh, doesnt matter since it didnt work ha
im starting to think that to apply your theme on deodex roms, you would have to manually grab whatever deodex rom you'd like, grab its system, settings, framework, etc apk's and modify them specifically for that rom itself..
i think its going to be very difficult trying to 'universify' (not a word, i know lol) custom themes to work on both odex and deodex rom's on lollipop..
lollipop is so different setting things up from kitkat, that every apk will be totally different depending on what rom youre using (it seems)
I think (pertaining to lollipop) it's either make a theme for deodex roms or odex roms.. or even build both separately...
i could be TOTALLY WRONG on this idea.. but everything that i did on kitkat, is not working on lollipop, and this idea is what i came up with...
i think this is a valid hypothesis because terminus rom has its own theme specifically made for it/made for a certain date.. it wont boot/work on newer builds so the theme has to be updated to work with its newer rom.. and terminus rom is deodex.. same thing goes with the new Elix-R theme.. its specifically made for stock based roms which are odex roms
Again, i could be wrong. But i think you (or I) will have to make separate theme builds.. one for odex and one for deodex..
take this with a grain of salt lol -- im going to be doing more testing tonight to get more of a valid conclusion.
Click to expand...
Click to collapse
AND THE POSSIBLE APPROACHES
quoting myslef from this page
Quote:
Originally Posted by androidous
Yes like I said before from looks lollipop is wayy different to kitkat......
yes bro you're right .... I dont think its possible to univerify (lol) a single build ite either odex or deodex or both seperately
Approaches
1) as mentoined before two seperate builds
2) build for odex and then deodex it - by the looks this seems the easiest but I CANT FIND A SINGLE TUTORIAL ON THE INTERNET TO DEODEX LOLLIPOP APPS :/ understandable cause its a fairly very new OS
3) what ive been doing to get a deodexed build working is manually decompile the deodex and copy paste the xml values from odex to maintain consistancy rather then having one colour on odex and the other on deod ..... this seems to work well but is very time consuming :/ ILL do this afte exams if it our only hope <----- this method i tested on slim and works i used http://www.diffnow.com/ to manuallyy compare the xmls its a little more efficient than rremebering all the changes
well thats what ive figured out on how to get a deodexed build.......
hope we can fix soon
Click to expand...
Click to collapse
so what i need to know is Are my approaches the only way ? or is there some other way i dont know of.... is it practical to so
and
is there a way to universiy the deodex build as in make a build to run on all deodexed custom roms or should a build be made for each seperately ?
thanks
andoidous
No.
How's that for a detailed answer?
Basically, if your theming includes changing XML or adding or removing resources, you have to decompile the apk's. If your theming just involves changing the icons, you're better off looking at something that can inject those icons, like the Ultimate Flashing Tool.
I'm sure that Smali/baksmali will be updated soon to be Lollipop-compatible. We're all waiting for it!
You are thinking about it wrong and...... being lazy. Sorry. But Linux in general is about passing along knowledge and teaching others. In the spirit of this I encourage you to learn how to build from source. (what site has that kind of information you can learn to do that?...) You can modify and play around all you want to with the apks BEFORE its compiled and not wait for JF to do the hard work.
You'll learn a lot of things along the way and educate yourself better in understanding your end goal.
The question about development has been asked and answered.
Feel free to check out the XDA University
Thread closed