What can be changed before an entire reflash/recompile is required? - Android Q&A, Help & Troubleshooting

In the interest of learning the ins and outs of Android firmware modding I wanted to start small with changing icons, perhaps making basic theme changes, adding new buttons/actions etc. To what degree can changes be made to the currently installed ROM before an entire reflash is required? Can such changes be made simply through the file system using a shell by replacing binaries, etc? Or, is it necessary always to download a particular Android version from Google and recompile/reflash to your device after implementing the desired changes?

Perhaps this is too general of a question.

sherrellbc said:
To what degree can changes be made to the currently installed ROM before an entire reflash is required? Can such changes be made simply through the file system using a shell by replacing binaries, etc?
Click to expand...
Click to collapse
As long as you don't make a mistake that causes your device to no longer boot, a full reflash is never required if you just modify single files. Make sure you know how to recover from a non-booting Android system before you start modding.

Related

Rom building questions.

If we have a base rom even from a backup.
Couldn't we edit simple things in the rom. Like host files for blocking adds. Add the changes that the super charger script makes. Disable/remove alot of blur like we do now with titanium backup. Longer wifi scan times. ect.
How would you get the base rom and how do you edit the files contained in the rom. I'm used to linux I run it at the house. If its like editing cfg files and what not. I might be able to make my own rom for myself.
Figured out you can open apk files easily with winrar.
And if all else fails sbf here i come
infinity8x3 said:
If we have a base rom even from a backup.
Couldn't we edit simple things in the rom. Like host files for blocking adds. Add the changes that the super charger script makes. Disable/remove alot of blur like we do now with titanium backup. Longer wifi scan times. ect.
How would you get the base rom and how do you edit the files contained in the rom. I'm used to linux I run it at the house. If its like editing cfg files and what not. I might be able to make my own rom for myself.
And if all else fails sbf here i come
Click to expand...
Click to collapse
Can't wait to see what you come up with... I'll test it.
You don't need a custom rom in order to block ads. There its a hosts file floating around that does that in one of the X2's subforum.
Sent from my DROID X2 using XDA App
or get ad free from the market...and guess what? it's free! >.>
It's true that those small changes don't require a custom rom but I think tinkering with the idea and trying to put something together would be a great learning experience and could lead to the first "custom rom".
Questions should be posted in the general forum. I will recommend you visit the chef central forums where they have all the tools and possible many answers for rom building.
Cheers and thread moved.

[Q] APK Creation

Well as many of you know we're over most of the hurdles we needed to jump with the CM7 build for Nook tablet.
Updates for the internal version are simple via CWM, the SD version is not so simple of course.
I'm assuming that it should be possible to built an APK that gains superuser permissions then copies the new files to the system. Can anybody confirm this is possible please?
We need to know that we can tell our SD user that they can update their version just as easy as the internal user
Thanks in advance for your help again everyone!
Well presumably this is how ROM Manager and Metamorph both do their thing, just in a slightly more round about way (as they don't come with the files they need to copy). I'm almost 100% sure this is possible, but I've never tried it personally.
EDIT: Looks like this is how you'd do it: http://developer.android.com/reference/java/io/File.html. Specifically the renameTo() method.
CelticWebSolutions said:
Well as many of you know we're over most of the hurdles we needed to jump with the CM7 build for Nook tablet.
Updates for the internal version are simple via CWM, the SD version is not so simple of course.
I'm assuming that it should be possible to built an APK that gains superuser permissions then copies the new files to the system. Can anybody confirm this is possible please?
We need to know that we can tell our SD user that they can update their version just as easy as the internal user
Thanks in advance for your help again everyone!
Click to expand...
Click to collapse
Well there are about a dozen ways to do this. First of one of the hardest things is comming up with the commands/script. I can defiantly do this. If you want an apk, there are a few guys whom could port my script to an apk. I'm going to make a script here that will format, and create partitions and extract directly from the nook, no need to go through the fancy formatting and such, just go into terminal and run the script. Ill post a prototype for you to have the testers test!
Do you think something like BacksideUpdater inside custom ROM for LG Optimus V?
made by JerryScript
JerryScript i very nice guy, I bet if you ask him, he will let you play with his code
if is it what you looking for
Yes, this is possible. I wrote an app that flashes the recovery partition for my older Froyo phone in the very rudimentary Basic4Android. Copying files under root privileges was part of this process. Fairly easy if you find the right coding examples in whatever your development platform of choice.
xdajunkman said:
Yes, this is possible. I wrote an app that flashes the recovery partition for my older Froyo phone in the very rudimentary Basic4Android. Copying files under root privileges was part of this process. Fairly easy if you find the right coding examples in whatever your development platform of choice.
Click to expand...
Click to collapse
So one of the problems is its not really copying. Its more of an extraction from one place to another. We are required to use dd, and fdisk(for formatting).
GREAT! I was worried updates would be to complicated for people
Sent from my Nook Tablet using xda premium
... and I was worried that I might have to wipe my NT clean again to get the updates. After a week with this wonderful upgrade, I've got a LOT of customization I don't want to lose...
Whoops, wrong button with the thanks. Anyway, it occurs to me you could just have people run a script from a terminal emulator. That would probably be the simplest way to do it. Make an Update folder on the SD card, add it to the PATH by default, and users could just copy over the update files and run the script. Just a thought.
Sycobob said:
Whoops, wrong button with the thanks. Anyway, it occurs to me you could just have people run a script from a terminal emulator. That would probably be the simplest way to do it. Make an Update folder on the SD card, add it to the PATH by default, and users could just copy over the update files and run the script. Just a thought.
Click to expand...
Click to collapse
Has to be simple, something like copy an update.zip onto the SD card then run the apk which will automatically run the update in the zip But my knowledge of such things is limited so I need help there
Same process. With the above method, the user would only have to copy over the file, open a terminal, and type 'update'. With the apk idea you just have to add a little more time for someone to actually write the app (not that it would take too long).
Sycobob said:
Same process. With the above method, the user would only have to copy over the file, open a terminal, and type 'update'. With the apk idea you just have to add a little more time for someone to actually write the app (not that it would take too long).
Click to expand...
Click to collapse
Hmm.... that sounds good.
Anybody know how to actually implement it ?
Dammit, idk why I keep hitting the thanks button thinking it's reply >.>
Anyway, it's just a matter of setting the PATH variable to include /sdcard/Update/ or something similar. To make an actual update, make a folder called Update, fill it with all the files that need to be copied over (probably in a directory structure), and write a script that actually copies everything over. You'll need to make sure sh is in /system/bin (I think it is by default).
You could zip the the files as well, using gunzip (busybox?) to extract them before copying them, then deleting them when you're done, just to keep it cleaner for the user.
The only downside to all this is that I don't know how you would flash a kernel.
Sycobob said:
Dammit, idk why I keep hitting the thanks button thinking it's reply >.>
Click to expand...
Click to collapse
That makes two of us!
Sycobob said:
Anyway, it's just a matter of setting the PATH variable to include /sdcard/Update/ or something similar. To make an actual update, make a folder called Update, fill it with all the files that need to be copied over (probably in a directory structure), and write a script that actually copies everything over. You'll need to make sure sh is in /system/bin (I think it is by default).
You could zip the the files as well, using gunzip (busybox?) to extract them before copying them, then deleting them when you're done, just to keep it cleaner for the user.The only downside to all this is that I don't know how you would flash a kernel.
Click to expand...
Click to collapse
I'm guessing you'd just flash it as usual, surely that one is the easiest? Copying stuff to boot partition would hopefully be just as simple, I was mainly worried about updating system files. I could do with building one for the current update to test the theory!

NMM type for Recoveries

Anyone think it's possible to implement the manager system from nexus mod manager or something similar to a recovery. For example, have it keep track of the mods you install and the files it changes and put an option to remove it where it removes the files that were editing and replaces them with the files that were there prior to installing the file? If it help nexus mod manager is open source allowing to view the source code and I believe all that is handled under the NexusClient under ModManagement. If someone can implement this it will make it a lot easier to manage the mods we install on top of the roms since the only way to remove mods currently is making a backup prior to flashing the mod or by dirt flashing the Rom on top and reinstalling other mods.
Here's a link to the sourcehttp://goo.gl/PFnqI0
Sent from my HTCONE using Tapatalk
luigi311 said:
Anyone think it's possible to implement the manager system from nexus mod manager or something similar to a recovery. For example, have it keep track of the mods you install and the files it changes and put an option to remove it where it removes the files that were editing and replaces them with the files that were there prior to installing the file? If it help nexus mod manager is open source allowing to view the source code and I believe all that is handled under the NexusClient under ModManagement. If someone can implement this it will make it a lot easier to manage the mods we install on top of the roms since the only way to remove mods currently is making a backup prior to flashing the mod or by dirt flashing the Rom on top and reinstalling other mods.
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
So you are simply stating having a program that automate a backup of the files yyou change? So instead of having to do it manually, as soon as you change something it makes a backup..
lacoursiere18 said:
So you are simply stating having a program that automate a backup of the files yyou change? So instead of having to do it manually, as soon as you change something it makes a backup..
Click to expand...
Click to collapse
Similar. The way I see this working is to create a class that adds this support and have it create a temp file of sorts with everything that was editing and a list of files that were created and allowing it to backup the files that were replace so it can put them back when u decide to remove the mod and delete the extra files that were created. Doing this would make it easier for developers to implement this into the scripts used to install the mods and possible having installations split between roms and mods, having the developers define it in the script and if undefined have it follow the default install which should be roms. Defining roms and mods could possibly be done through if-else statements such as adding InstallAsMod or InstallAsRom on the first line of a script and on the recovery have it check if it says InstallAsMod or InstallAsRom on the first line and if neither have it follow the InstallAsRom code which could be an exact copy of the way the recovery currently works. Though those are just my thoughts with my very basic java knowledge, maybe someone else with more insight can give a better method. Also having something like a extra menu in the recovery that displays the installed mods and having the uninstall/removal process there. The problem I see with this would be with rom updates, they will make changes to the files causing issues with the uninstall option if the files where changed through the rom update.
Sent from my HTCONE using Tapatalk

Deodex and odex

What is the difference between deodex and odex roms? Sorry for the noob question but ive always been curious
Sent from my SCH-I605 using XDA Free mobile app
WHAT IS EXACTLY AN ODEX FILE ?
In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space The odexed file structure works well as an optimization tool. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster.
On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.
For instance, on a non-rooted device you’ll find
system/app/Phone.apk ===> as well as ===> system/app/Phone.odex
AND NOW THE DEODEX FILE ?
It’s the process to take all the packages out from .odex file and reassemble them all together in classes.dex file which is kept inside the APK file. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.
In summary, Deodexed ROMs (or APKs) have all their application packages put back together in one place, allowing for easy modification such as theming. Since no pieces of code are coming from any external location, custom ROMs or APKs are always deodexed to ensure integrity.
on the same device but rooted now, you’ll find this:
system/app/Phone.apk ===> but no longer the corresponding .odex file. The reassembled files become classes.dex
CONCLUSION: ADVANTAGES & DISADVANTAGES FOR BOTH SYSTEM FILES
The advantage of deodexing is in modification possibilities. This is most widely used in custom ROMs and themes. A developer building a custom ROM would almost always choose to deodex the ROM package first, that’s why developers prefer it and most, if not all, of the custom ROMs come pre-deodexed.
The advantage of .odex file is the faster load time of the app and were supposed to quickly build the dalvik cache, removing them would mean longer initial boot times. However, this is true only for the first ever boot after deodexing, since the cache would still get built over time as applications are used. Longer boot times may only be seen again if the dalvik cache is wiped for some reason.
And finally rooting need not necessarily mean your device is deodexed, rather that almost all stock ROMs are odexed to some extent, and usually most custom ROMs are deodexed for easy theming.
For a casual user, the main implication is in theming possibilities. Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.

Questions concerning flashable ZIP creation

I'd like to create a TWRP flashable ZIP of my phone meant for public release so I'd like to hide any information specific to my phone or self. As far as not installing a bunch of apps or backing up data that's obvious but what I'm unsure about is the process of creating a ZIP file instead of those folders that TWRP creates. How would I go about doing that?
This is basically what I'd like to do:
Backup my own stuff
Flash stock ROM and make customizations to the interface, possible minor debloat, installation of a few useful things, etc...
Release a flashable ZIP -- essentially just like flashing a custom ROM except it's just the stock ROM with customizations like ad blocking and interface changes, etc...
The idea is similar to @ChazzMatt posting images of his settings but involves more things and in a prepared format for flashing. It's sort of like a "lazy" version of creating a ROM.. where you're just modifying some things and doing all the work that would normally take a lot of discovery and time to do then releasing that.

Categories

Resources