Hi guys, I'm back again with somewhat of a guide.
How to dissect, repackage, and flash a ROM to your satisfaction without a kitchen!
Don't let anyone else fool you. The awesome devs at XDA, one in particular dsixda have made making ROMs very easy with kitchens. But you don't need to go through the process of installing and using one to get a ROM the way you want it. If installing and working with a kitchen seems too cumbersome and/or hard, or you're tired of waiting for or asking your ROM chef to include/exclude/change a feature, then this guide is for you.
ROMs aren't scary things, they're actually quite simple in terms of structure. As long as they're built correctly from the get go, you will learn how to mod it to suit your needs.
Tools needed: (most of which will be included in this guide)
A base ROM (start with your favorite)
WinRAR (or any good archiver)
Notepad++ (Recommended or something that can handle files encoded in UNIX)
SignAPK/APK Manager/APKTOOL/smali/baksmali (optional/advanced)
Time
Patience
Common sense (can't stress this enough)
Step 0:
-Start with a clean working environment, such as a folder or partition dedicated to this task. Your desktop probably won't be very good if you have a lot of stuff on it already.
Step 1:
-Using the archiver of your choice, you will need to extract the ROM to the work environment you've set up in Step 0.
--Your final result will look something similar to this:
NOTE: I am using my ROM as a reference.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Most ROMs will follow this structure, with some utilizing the folders "sdcard" and possibly others, depending on how customized they are. But as long as you have the /system folder, you will be fine. It is where you will probably spend the majority of your modding time. Get a feel for how the folder structure is. Navigate through them (don't make any changes). This guide will focus mainly on removing and adding apps, the more advanced stuff such as editing text files (with the exception of build.prop) and apks may come later.
NOTE: Please keep the original archive, do not delete it after extracting.
Step 2:
Navigate to the /system folder, which again should look similar to this:
Step 3:
The first folder we'll focus on is app. This is one of the most important folders when customizing your ROM. It will look something like this:
This folder is important because it houses your 'system apps', which are included in your ROM and cannot be uninstalled by traditional means. Here you can remove or add your own apps you want to include as system apps. Remember that not all apps are capable of running as system apps--actually, apps that are placed in this folder receive a higher permission level than apps that are placed in /data/app, so use caution when adding your own here. I would also suggest creating a "removed" folder [in a different location] and move any apps you decide to take away to here so you'll have them in case you remove something that causes a side effect you weren't intending to cause. If you feel comfortable with your WinRAR or 7zip skills, most of the images in these apks can be simply overwritten (this is initially how themes are created, among other ways). Be careful not to overwrite any 9.pngs because they are a special format. You can simply explore (not extract) them with your favorite archive program and replace images as you find them, which will typically reside in the res/drawable and res/drawable-hdpi folders.
Step 4:
Next up is the bin folder. This folder is very tricky and I would advise caution against removing anything that's currently in here unless you get real familiar with the contents of this folder. It will look something like this:
Most ROMs will include all the necessary scripts you will need in this folder. However, it doesn't hurt to familiarize yourself with it. Scripts such as bash and even sometimes busybox, can be installed here. If you're working with a very stock ROM, and I mean stock as in the only thing that was changed is adding root, then it wouldn't hurt to add bash here, other than that, let's move on.
Step 5:
Here we have the customize folder. This folder is pretty important as well. It holds all of your first boot activities and pretty much sets your phone up after you've flashed and/or updated ROMs. It looks like this:
Things start to get more involved and interesting around here. You'll notice three sub-folders inside of here, which house various customization scripts. To be honest, I'm not even sure how many of these get ran, but I'm almost positive the ones labeled "default" do get ran. Here's where Notepad++ will finally start to come in handy! If you're looking to do quick editing, then you can open any one of these xml files in Notepad++ and poke around. (For advanced script editing, I would suggest looking at the appropriate Android documentation. I'll see if I can get a link to that up.)
NOTE: Be VERY careful of what you remove from these xml files, the syntax has to be perfect, otherwise the script won't get initialized. I would suggest copying everything you intend on editing to another folder of the same name, in a different location of course, so that you can have copies. True beginners should not attempt editing any files in here until you familiarize yourself with their syntax.
Folder structure:
-CID
--cidProfile1.xml: I don't think this file gets parsed. However, I do take the time to remove language settings that I will never use, just for my own OCD reasons.
--cidProfile2.xml: I don't think this file gets parsed. However, I do take the time to remove language settings that I will never use, just for my own OCD reasons.
--default.xml: Settings such as screen timeouts, IME language settings, etc gets parsed here. Nothing of too much importance. However, I do take the time to remove language settings that I will never use, just for my own OCD reasons.
-MNS
--default.xml: This is probably the single most important file in the customize folder. Here houses most, if not all the first boot settings that get parsed, such as widget placement, bookmarks, and a whole plethora of other settings. This is a very fun and interesting file to edit, but again i heavily caution you to edit this file if you're a beginner. One simple mistake can lead to nothing getting parsed here--a mistake I've made a few times because of incorrect syntax.
-resource: This is probably the second most important folder in the customize section. Here lies all of the thumbnails and wallpapers for Sense. If you are planning on removing Sense, you can safely remove all the files here with the exception of CCInfo.txt. You can also replace the images as well as boot/power down animations here.
Step 6:
Ah, the etc folder--you'll spend probably no more than five minutes in this folder unless you're truly advanced, which means this guide is probably meaningless to you. It houses a lot of useless epub (ereader) books and looks like this:
If you have time, you can definitely do some exploring of files in here with your favorite text editor (Notepad++) and see if anything is of significance. If you find something, please report back! So far, I don't think very much, if anyone takes advantage of the actual files in this folder (the folders are a different story)
Folder structure:
-bluetooth: nothing to see here. bluetooth configuration files. could be useful down the line.
-dhcpcd: looks like configuration files for dhcp/dns/internet. could be useful down the line.
--dhcpcd-hooks: same as above
-fakeserverxml: This folder looks strange, even has a strange name. I assume if you're removing Sense, this won't be needed either. I'm not even sure it's needed WITH Sense. Poking around revealed some configuration files for what appears to be HTC Hub and scenes, widgets, skins, and other things.
-firmware: I wouldn't touch anything in here unless you know exactly what you're doing.
-init.d: Finally, something that matters! A lot of ROM chefs make use of this folder because it initializes scripts in here upon system boot. You'll see various things in here from various ROMs including: zipaligning, overclocking, kernel stuff, apps2sd, and more. If you know what you're doing, you could even drop your on initialization scrips into this folder and have them boot with the system. Be careful what you do in this folder though. You want to make sure you are following the correct set of steps to either add or remove things. I would poke around with a text editor at those files to see any dependencies, etc.
-iproute2: Nothing here for the average user.
-permissions: If you're removing Sense, without any intent on having it return, remove the relevant files from this folder as well. Other than that, let's move on.
-ppp: Nothing here for the average user.
-security: Nothing here for the average user.
-slideshow: Safe to get rid of. Inside are pictures that Sense uses as a slideshow.
-soundimage: Nothing here for the average user. However, things in here look promising for sound enhancement!
-terminfo: Nothing here for the average user.
--l: Same as above
--u Same as above
-updatecmds: Nothing here for the average user.
-wifi: Nothing here for the average user. However, you may be able to replace the wpa_supplicant file with a modified one for WiFi improvements.
-wimax: Nothing here for the average user. However, the files in the sub-folders here may be used in the future to enhance or modify WiMAX.
--dhcp: Same.
--sequansd: Same.
Before we move on, if you're going to use any sort of adblocking, your preconfigured hosts file should go here. Downloading ad-free from the market will overwrite this file when updating hosts, but if you want to supply your ROM users with a hosts file already somewhat updated, you can place that here. Looking at the various .sh/txt/csv/cfg/* files in Notepad++ will show you some defaults you can change, if you're comfortable in your editing skills, take a look at some of them and see what you can do. Not even I have bothered to look through most of these.
Step 7:
In and out like a robbery for this folder, "fonts", which houses the default fonts that Android uses for various things. I like to replace the clocktopia (which is used on the aosp lockscreen as the clock font) with the honeycomb clock font. Other than that, fonts replaced in here must retain the Android naming structure:
Step 8:
The framework folder is very...sensitive aka dangerous. Deleting or modifying the wrong thing in here can render your system unbootable. Until you're more seasoned in modifying ROMs, I would steer clear of this folder. However, the framework-res.apk file can be used to modify a lot of images to change the look, or "theme" of your ROM. So again, if you feel comfortable, fire up that archive program and get to replacin', otherwise let's move on:
If you're anything like me (anal) then you will wanna remove anything from the framework folder that has anything to do with apps you've removed. For instance, there is a blockbuster file in here that you can safely remove if you've removed the blockbuster app. Again, be careful with what you modify or remove from here, because your system can quickly become unbootable which will leave you wondering what happened.
Step 9:
The lib folder, like the framework folder, is very sensitive aka dangerous. Deleting or modifying the wrong thing in here can render your system unbootable. Until you're seasoned in modifying ROMs, I would steer clear of this folder. However, there are a few things that can be done in here if you've deleted other apps:
Folder structure:
-bluez-plugin: nothing here for the average user.
-egl: nothing here for the average user.
-hw: nothing here for the average user.
-modules: This is where kernel modules for things like WiFi/WiMAX/TUN/CIFS/ETC go. If you are modifying a ROM, and are including a kernel, be sure to delete what's here, and add the modules that came with the kernel. Not doing so will more than likely make its associated parts not function. Example: Error starting WiFi can usually be traced to wrong modules in this folder after updating a kernel.
-plugins: This folder houses plugins for different preinstalled apps. For instance, the Adobe Flash plugin would be here, but if you remove Flash from your ROM (since you can get it from the market and may be more updated than what was included) you should remove its associated files. I wouldn't remove the flashlite plugin though.
-soundfx: nothing here for the average user.
The lib folder can be very overwhelming from the sheer number of files in here but the majority of them will have little of no value to the average user. BUT, you should definitely check here if you are removing any system apps for associated lib files. For instance, Swype is included on HTC's stock software, and if you remove it from the /system/app folder, you want to come here and remove its associated lib file. There won't be a lib file for every program you remove, but it's good to double check here afterward to make sure you get all traces of it gone.
Step 10:
The media folder, probably the easiest folder ever, and least time spent in here. This folder controls all the built in audio sounds such as notifications/ringtones/etc as well as any other media related files, like video clips, images that would indicate an animation, etc:
Folder structure:
-audio: parent folder for system sounds.
--alarms: self explanatory.
--notifications: self explanatory.
--ringtones: self explanatory
--ui: self explanatory
-GPU: nothing here for the average user. Not sure what it even is for.
-mms: nothing here for the average user. Not sure what it even is for.
-weather: This folder isn't really of any use, but it does contain weather animations that the HTC weather app uses. If by some reason you want to edit, replace, or modify those animations, here they are. I would suggest placing files of the same resolution in here.
Be sure to place the files you want in their respective folders, because they won't show up when you try and select them for things they aren't intended for. For instance, placing notification sounds in the ringtones folder will make them not show up when you go to choose a notification sound from within Android.
To be continued...
Now that this guide is progressing nicely, below you will find a list of items that I have removed or replaced. This list will be edited as I make further adjustments. For the sake of consistancy, I too am working with Freeza's rom FreEVO 3D 1.1, which can be downloaded from this same subforum. Please keep in mind that this list is based on my particular needs and is heavily dependent upon which custom rom you choose to modify.
-Here's what I've removed from /system/app
browser.apk
DCSStock.apk
DebugTool.apk
dms.apk
DockMode.apk
DSPManager.apk
EReader.apk
Flickr.apk
FriendStream.apk
GoogleQuickSearchBox.apk
HtcCarPanel.apk
HtcConnectedMedia.apk
HtcDirect.apk
HtcFacebook.apk
HtcFMRadio.apk
HtcGreader.apk
HtcHubSyncProvider.apk
HTCLivewallpaperStreak.apk
HtcMusic.apk
HtcMusicEnhancer.apk
HtcMusicMarkedItems.apk
HtcRecommends.apk
HtcRingtoneTrimmer.apk
HtcSoundRecorder.apk
HtcStreamPlayer.apk
HtcTwitter.apk
HTMLViewer.apk
JETCET_PRINT.apk
JETCET_PRINT_Resources.apk
LiveWallpapers.apk
LiveWallpapersPicker.apk
LMW.apk
MagicSmokeWallpapers.apk
Mail.apk
Mode10Wallpapers.apk
MyHTC.apk
picasapryramid.apk
PolarisOffice.apk
QuickLookup.apk
SetupWizrd.apk
SoundRecorder.apk
SprintZoneNC.apk
TrimIt.apk
VisualizationWallpapers.apk
VoiceDialer.apk
VpnServices.apk
Weather.apk
WeatherAgentService.apk
WeatherProvider.apk
WeatherSyncProvider.apk
WorldClock.apk
-Here's what I've removed from /system/customize/resource
hTC_bootanimation
hTC_downanimation
Sprint_bootanimation
Sprint_downanimation
-Here's what I've removed from /system/media:
-The entire /weather folder from /system/media .
-All unused ringtones (all but 2) from /system/media/audio/ringtones
-All unused notifications (all but 3) from /system/media/audio/notifications
-All unused alarms (all but 3) from /system/media/audio/alarms
I should also mention, not only can you remove these, you can also replace them with any .mp3 file you like. So in theory, you could remove every .mp3 from these folders and put your own .mp3 files in.
After removing all of the above contents from Freeza's rom, the flashable zip size has gone from 307MB to 168MB. This should just about conclude my list of removed .apk's and files from Freeza's rom. After a little more testing, I'll move the "to be tested" .apks into the list of safe to remove .apk's, and finally begin theming this thing
Congratulations on taking the first step towards customizing your rom. More information to follow as I further refine this rom. Happy flashing!
hockeyfamily737 said:
Nice tutorial. I'm sure lots of people will find it helpfull when it's finished.
Click to expand...
Click to collapse
You keep giving me good ideas lol
excellent! going to utilize this
Can't wait for this to evolve. I have been looking for a good place to start.
very cool, looking forward to this!
Thanks. About time for me to get into this)
Sent from my PG86100 using XDA Premium App
Thank you very much for this noobs like me will learn a lot
I'm gonna reserve my weekend to go through this once complete.
Thanks for your time and effort for the tutorial in advance.
Been waiting for a "how to" tutorial on this specifically.
looking forward to it..
Thanks...
Thank You! This will be awesome! Can't wait till its finished!
Post #2 has been updated with a quick little starting off point for those of you who are anxious to begin while Freeza's tutorial is still under construction. I will attempt to help Freeza with his guide and help to answer questions within the thread. However, this guide is completely Freeza's. Any information that I provide that might conflict with or contradict anything in the guide should be disregarded until such time as I can edit my posts.
I see that this is under the "EVO 3D" Section, But this seems like a general rom guide. Will it extend later into how to put only onto a EVO 3D? Curiosity is all.
edit;
As previously stated, this guide is a work in progress and it is aimed at the EVO 3D, but the general concept is the same across all Android devices. Please leave your feedback and thoughts for the dev.
Click to expand...
Click to collapse
Ooops :|
Page Bookmarked ..
I am a Desire user and have been playing with ROMS for months adding stuff and changing stuff and i look forward to checking this out once its complete.
Very hectic day. HAven't forgotten about it. I'm working on the guide.
freeza said:
Very hectic day. HAven't forgotten about it. I'm working on the guide.
Click to expand...
Click to collapse
Thank You! looking forward to this!!!
Lol this is exactly how I learned... I've never used dsixda's kitchen, or any kitchen, in my life. Good guide man, I'm sure many will find this useful.
Hey it got featured!
lets dive into playing around with the framework-res.apk next!!!
gREAT JOB iM USING AUTOSIGN RIGHT NOW BUT WILL LOVE TO BE ABLE TO EXTRACT THE ROM AND REMOVE THE FILES THAT WILL BE JUST GREAT i HAVE TRIED TO EXTRACT ROM BUT COULDNT ZIP THE FILE BACK SO THAT IT COULD BE FLASHED
Hello community,
I'm very glad to share my first trial of development which ran successfully for me and hope this will be useful for the rest.
I'm a big fan of a few chinese apps (baidu cloud, weiyun). Previously I was able to decompose and translate these apks to english until vendors injected apk signature validations into their apps. I even used these apps in foreign language but the experience were annoying. So I decided to translate these apps with some development. Eventually I came across resXploit by WisdomSky which give me a clue and I started this and it works :good:.
Basically resOverloader overloads strings.xml file for any apk (application). Source code is hosted on github for other devs to incorporate other resources as well. I'm not experienced dev and sharing this here for others and further development.
How to setup
Extract strings.xml from your target apk using apktool. read more
Translate strings.xml to your language. (I had developed a tool for it and would share it later)
Now create resOverloader folder in sdcard.
Find your app full qualified name in applications under settings and create a folder with app full name. (eg. com.baidu.netdisk)
Now copy the translated strings.xml to app folder inside resOverloader.
Restart your phone and it is done.
Hope this will help starters and requesting experience devs to add arrays.xml to this.
Github: https://github.com/babuilyas/resOverloader
Change log:
2.0 : rebuilt with targetSDK 14 and it should work for 2.2+ now. pls confirm.
Thank you for reading... Cheers.
reserved
Thanks all for praising my work. Here is my translation utility which can help you translate any xml file with auto fixing of literals and escapes within source text.
How it works!
The first step is, hand your xml file (strings.xml). Read OP
Run XML_translator.exe and select the file to translate. (language selectors are not working now and hardcoded to CN->EN)
Click Start translating.
The utility will take time and depends on source file length. At the end you will see strings-new.xml file. Rename it to strings.xml and use it with resOverloader.
I would soon remove the hardcoded part to enable multilingual translations.
Thank you very much.
I made a request for this feature in the request thread sometime back, but no developer was interested. . I will try it now and report back.
Edit: IT WORKS. My translated texts show up.
However, I would like only to see the translated texts when the system language is switched to that language only. So I could see original English texts when the system language is set to English.
nqk said:
Thank you very much.
I made a request for this feature in the request thread sometime back, but no developer was interested. . I will try it now and report back.
Edit: IT WORKS. My translated texts show up.
However, I would like only to see the translated texts when the system language is switched to that language only. So I could see original English texts when the system language is set to English.
Click to expand...
Click to collapse
OP could add localized string switching by checking filename suffix against Locale.getDefault().getLanguage(). So if you wanted to add multiple languages to an app, you'd just need strings-en.xml, strings-it.xml, etc etc
Yay , now yunpan/tencent/baidu drive shall all become translated
I was thinking about it latest two weeks and someone made it! Impressive!
nice work.. i'm waiting the translate strings tool..
This is really impressive.
Thank you very much for you work m8.
I'm on stock N4, and can't get this module to work. I decompiled and translated strings.xml, but there's no change in app. Should be translated strings.xml compiled back, before putting it to sdcard?
Great module, thx for your work. Also very interested in your translation tool. Also been thinking a lot about how to automate APK translation but to no avail.
Some features that i was thinking that can be added BUT not sure if they can be implemented:
- Load list of installed apps via GUI;
- Decompile the apk and extract the strings to a full app name folder (No idea if apk can be decompile from within an app)
- Tell user to edit the strings.xml
- Check if strings.xml was edited and in case it was prompt for reboot.
joluke said:
Some features that i was thinking that can be added BUT not sure if they can be implemented:
- Load list of installed apps via GUI;
- Decompile the apk and extract the strings to a full app name folder (No idea if apk can be decompile from within an app)
- Tell user to edit the strings.xml
- Check if strings.xml was edited and in case it was prompt for reboot.
Click to expand...
Click to collapse
I'm new and still learning android development. Im planning to integrate translating utility inside this app and would allow users to translate any app on the fly on the device.
geekon said:
I'm on stock N4, and can't get this module to work. I decompiled and translated strings.xml, but there's no change in app. Should be translated strings.xml compiled back, before putting it to sdcard?
Click to expand...
Click to collapse
make sure, you have copied translated xml in resOverloader\[your app full name]\strings.xml in internal memory (sdcard).
Bug: translated apps show an escaping slash-chars.
Can you add a possibility:
- to download and update of translation resources from github for all installed apps? In such case you should only define a resource location URL.
- for localization of res/layout/*.xml & res/xml/*.xml & etc
Is there a opportunity to use also preferences.xml?
babuilyas said:
make sure, you have copied translated xml in resOverloader\[your app full name]\strings.xml in internal memory (sdcard).
Click to expand...
Click to collapse
I tried with 4 apps, the results are as follows:
- AppSetting (xposed module): OK
- Nova Launcher: Partially OK, many strings remain in English
- Omniswitch (OmniRom): Not working (all texts are still in English)
- Transdroid: OK
:highfive:
nqk said:
I tried with 4 apps, the results are as follows:
- AppSetting (xposed module): OK
- Nova Launcher: Partially OK, many strings remain in English
- Omniswitch (OmniRom): Not working (all texts are still in English)
- Transdroid: OK
:highfive:
Click to expand...
Click to collapse
Share Xposed log and thanks for testing this app.
I saw the log, but didn't find any FC. See if there is anything in translated xml.
Benko111 said:
Great module, thx for your work. Also very interested in your translation tool. Also been thinking a lot about how to automate APK translation but to no avail.
Click to expand...
Click to collapse
i have some more ideas, so i will fork your module and add my ideas.
babuilyas said:
Share Xposed log.
Click to expand...
Click to collapse
Please have a look
https://m.app.box.com/view/f_16953900439
Sent from my Nexus 4
Very pleased.. Share it with all..
Sent from my LG-GEEB using Tapatalk