[GUIDE + ROM] Rom Translation Tutorial + Minimoto 1.7 & MavROM 4.5 Italian Version - Motorola Droid 3

[GUIDE + ROM] Rom Translation Tutorial + Minimoto 1.7 & MavROM 4.5 Italian Version
THIS GUIDE IS FOR PEOPLE THAT KNOW WHAT ARE DOING! DO NOT TELL ME THAT I BRICKED YOUR PHONE OR STUFF LIKE THAT, YOU ARE RESPONSIBLE OF WHAT HAPPENS TO YOUR PHONE, BE CAREFUL!
Here are the Italian versions of Minimoto 1.7 and MavROM 4.5:
Minimoto 1.7
MavROM 4.5
(The MavROM has 2 files to flash: first the D3-MavROM-4.5.zip original file and then the MavROM-AOSPICSTheme.zip that contains the translation plus the ICS theme. If you want to translate another theme, or just the basic rom, you can extract the language files from the theme .zip following the guide!)
Every Droid 3 owner out of the English/Spanish area knows that every D3 ROM comes out with only two languages preloaded in it, right? well...if you know well english (or spanish!) maybe i have something for you!
Ok, i hope this guide could be helpful to everyone like me that wanted to find a non-english, non-spanish Gingerbread ROM for Droid 3.
After some studies, and a lot of searching too, i've found the best (i think) way to translate roms. Oh and this guide is good for every android phone out there! Let's start!
Part 1 - Download all the stuff! (plays Monkey Island music )
Our needs are very few, what you need with this is a lot of patience, and knowing some english could help.
- A rooted Droid 3 (or any other phone)
- The ROM you want to translate
- WinRAR / 7-Zip
- Notepad / Notepad++ (Highly recommended!!!) http://notepad-plus-plus.org/
- Java Development Kit www.java.com
- APK Manager/APK Multi-Tool, since now i will call them APKM and APKMT ( i used APK Manager, but multi-tool should be fine anyway) http://apkmultitool.com/?q=node/5
- Google Translator Toolkit http://translate.google.com/toolkit/
- Safestrap (optional, but very, very recommended)
- MoreLocale2 or another language changing program
Note 1: If APK Manager/Multi-Tool bother you with something about java not found do this: http://wiki.answers.com/Q/How_do_you_stop_the_error_%27java%27_is_not_recognized_as_an_internal_or_external_command_operable_program_or_batch_file
Note 2: In APKMT, the commands are a little different from APKM, e.g. in APKM the "set project" command is listed as 22 and in APKMT is listed as 24....the functions we'll use are the same, just read the description if you're not sure and you'll be fine
Ok, let's take the stuff out of the box!
Part 2 - The extraction point
Open the .zip containing your ROM's files with WinRAR / 7-Zip and extract the folder "system" somewhere (i recommend to create a folder for your translation project) once the process is done, we can basically do two things: Decompile the apps or decompile the frameworks, the process is the same, but you have to go really really REALLY careful with framework apks, or once you flashed the ROM what you've got is a translated BOOTLOOP. So be careful. With apps you can mostly screw a functionality up, like SMS or Phone, but nothing too messy.
Anyway you can solve the problem with a new flash with the corrected ROM, or the original, untranslated ROM.
Ok let's start with the frameworks: we've usually got 3 differents frameworks and those are
framework-res.apk
blur-res.apk
moto-res.apk
Those apks contain mainly everything written all around the phone, like pop-up messages, status bar, app permissions and a lot of other stuff.
We'll use framework-res.apk.
If there isn't, create a folder in the same folder where you have installed APKM/APKMT, called "place-apk-here-for-modding" without quotes, then copy inside it the framework-res.apk.
Now you have to open the Script.bat file, and once you get into the main window, digit 22 (APKM) or 24 (APKMT) and press enter to select the current project, now digit the number corresponding to the desired apk (it should be 1 if you have only framework-res.apk) and press enter. now digit 9 (APKM/APKMT) and enter and you'll decompile the apk. Now you should have a folder, inside the "projects" folder of APKM/APKMT named just as the decompiled apk. Inside it, you'll find a folder called "res" open it and you'll be right into the core of the translation:
Note: if you get an error after decompiling, try with option 10 (APKM/APKMT), and drag and drop the necessary framework over the prompt when APKM/APKMT ask, press a key, and if you get another error try with another framework (D3 has 3 of them) until you get the job done. If nothing works, probably there's a problem with the apk you want to decompile.
Note 2: You could need to have frameworks installed into folder C:\Users\YourPCUSername\apktool\framework. You can do this either with apktool via cmd or manually copying the 3 frameworks into this folder (create it if needed) and renaming them this way:
- framework-res.apk => 1.apk
- moto-res.apk => 2.apk
- blur-res.apk => 3.apk
Then you should be able to decompile 99% of apks with option 9.
You'll find a bunch of folder, but we are interested in the "values" ones, if you have to translate the app, you'll see something like this:
- values
- values-es
- values-es-rUS
the first folder contains the english files, the second contains the spanish files, and the third contains some other files for spanish variants.
Open the "values" folder and inside it there are some .xml files, we will always use only 3 of those at most:
- strings.xml (the file containing mainly all the text strings of the apk, if you find this, then you have to translate it, if not, just pass over this apk, it doesn't contain text)
- arrays.xml (the file that contains some text data for drop lists, you'll not find this often, but if you find it, translate it)
- plurals.xml (the file that contains plural words, this is very rare to find, but if you want to make good translations, then, translate!!)
Now get back to "res" and create a folder called "values-xx" where xx is your language code, for example i made a values-it folder, but you'll write values-fr, values-de, values-idunno etc.
You'll put here, all the XMLs we're gonna translate now!
Part 3 - Bring out the dictionary!
The game is getting harder, now you have to use your better weapon: Google Translation Toolkit. But first, let's look into XML!
Open the "strings.xml" file with Notepad++, and look at the records structure:
<string name="aerr_application">The application %1$s (process %2$s) has stopped unexpectedly. Please try again.</string>
You have to change ONLY and i repeat ONLY the text between "<string name="aerr_application">" and "</string>"!
Now some rules:
- See that "%1$s" weirdness? that is a jolly word that Android replace with a variable data, in other words DO NOT TOUCH IT! just imagine that you'll see there something like "The application *Temple Run* (process XYZ) has stopped etc. etc.
- If you have to put an apostrophe or some other weird character, always put quotes at the beginning and at the end of the string just like in the translated string down there, it's good to always put them, And GTT (Google Translator Toolkit) does that.
- If the string you have to translate looks like code stuff, probably you should leave it untranslated, something like:
<item>@string/resolutionSummaryWideScreenTV</item>
<item>MOTOCAMSETTING_REVIEW_TIME_4_SEC</item>
see? DON'T TOUCH IT! BAD TRANSLATOR! BAD!
This is the resulting, translated string:
<string name="aerr_application">"L'applicazione %1$s (processo %2$s ) si è fermato in modo imprevisto. Si prega di riprovare."</string>
Ok, now we can translate without detonating the phone, but framework-res has something like 1300 rows of text!
WHOA! let's use GTT!! http://translate.google.com/toolkit/
Once you are on the main screen of the tool, click on the red "Upload" button on the upper left, then in the page you found after, click on "Browse..." and select your file inside your PC.
Set all the stuff down there, like the name, the language and everything else, and click "Upload for translation"...here comes the magic...
The XML is translated! sort of...
You now have to look if GTT has done the work well...let's look into this page:
- You can see that now the entries are divided in boxes, you can click onto the left panes' boxes and edit the content.
- Play a little with the interface, you have to get familiar with it if you want to translate a ROM!
- Look to spaces and returns, GTT mess them, and you should correct the format.
- Text is coloured: i'll tell you what those fancy colours ACTUALLY mean
- Orange: this means you've edited the text into the box
- Red: text coloured in red came right out of Google Translate, and 70% of times, it will be gibberish, so look carefully into it, this will be the work where you'll spend more time.
- Blue: this is a sneaky bastard, it says that he found a "100% matching" translation in his database, but it has a 30% chance to be total nonsense, be careful with it.
- Green: this colour is fine, you probably have translated this in past, or someone did it for you, anyway, it will be 99% correct, if the past translation was correct.
- Brown: this happens rarely, usually where it founds a colon (the symbol ":" ok?? :angel: ) and for some reason, it goes random, usually you need a very little effort to correct it.
- Purple: THIS is a funny one. when purple comes out (usually with a wildcard character like "%1$s") the translator often goes TOTALLY random and write some idiocy. rewrite the text from scratch.
Once you've managed to translate everything, and if you're sure to have completed everything, click (if you want) on "Complete" in the upper right corner of the page, and then we need to download our work, to do that, click on "File" (upper left) and then "Download". Save the .xml file in your values-xx folder, and check one last time with Notepad++ the number of lines, the spaces and the format in general, at this point we're ready for the final part!
Part 4 - Repack everything!
Now the situation is this: you have the "project" folder containing all the decompiled apks folders, with the "values-xx" directory in it, we now have to recompile everything and put apks into the ROM. Let's see how:
- Open APKM/APKMT and select the project you want to recompile
- digit 11(APKM/APKMT)
- Look if you got errors, if yes, look into the log 20(APKM) or 23(APKMT) and see what the problem is, if you look carefully you will identify where is your error log, probably it's a messed tag, or something easy to resolve, correct the issue, and go ahead, restarting from digiting 11 (Compile)
- Press Y and enter
- Press Y and enter (yes, 2 times)
- Now wait for APKM/APKMT to stop spitting lines out and it'll tell you something. Read it, but the substance is: go in the APKM/APKMT folder, look for a "keep" directory, delete the "resource.arsc" file, get back on the APKM/APKMT prompt window, and press a key.
- Once everything is completed, you now have a file called unsignedframework-res.apk (or unsigned*nameoftheapkyouhavecompiled*.apk)
- The next, is the point i still didn't get, but it works...maybe XDA guys can explain better this...anyway, we now have to sign apks...i saw that this shouldn't be necessary, but otherwise i've got a lot of errors and force closes and stuff like that...soooo, at least for D3, sign it!
- We have 2 choice for signing...if you have only a few apks to decompile, you can just select the project and digit 12(APKM) or 13(APKMT) and sign it but if you have translated a whole ROM and you want to sign all the apks at once, create, if not exists, a folder called "place-apk-here-for-signing" and put all the unsigned apks there...you now have to digit 16(APKM) or 18(APKMT) and the apks will all be signed automatically.
- Rename the apks removing the "signed" part from the name.
We're now ready to pack the ROM: i usually create a "system" folder somewhere else that i will put directly into the ROM's zip, but you can do it by hand (boring). I'll show you my method for now:
- create a "system" directory
- inside it, create a "framework" and an "app" folder
- put into the framework one, all the frameworks (easy, huh?) and into the app directory, put all the other apks.
- open the ROM zip and drag and drop the system folder into the ROM in order to overwrite the existing one.
Our freshly translated ROM is ready to be flashed and brick or burn your phone! (ok, no, this is not true...maybe...)
Anyway, download the zip on your phone and flash it with the recovery you want.
I RECOMMEND TO DO THE FIRST TEST ON A SAFESTRAP, AND ONLY IF YOU'RE SURE THE ROM IS SAFE, INSTALL IT ONTO YOUR MAIN SLOT! I'VE WARNED YOU!
Part 5 - Polish your creation!
When the ROM is installed, and if it boot correctly, First install MoreLocale2 or other similar apps, and add, your language, with the correct ISO codes and look around to see if something is untranslated...if yes, go back, to APKM/APKMT and find the apk you need to modify, translate, repack, flash the ROM and again until you've got a perfectly translated ROM!
The tutorial is ended, i hope you liked it, and if you want to correct, critic, ask, or anything, just tell me!
Tips: If you want to avoid the MoreLocale stuff, you can edit the build.prop, into the folder "system" of the ROM you'll find this file, open it with Notepad++ and look for these lines:
ro.product.locale.language=xx
ro.product.locale.region=YY
You have to put here your ISO language code, but i noticed that on D3 it doesn't always works...so, try but i don't guarantee success.
If i remember something, i'll integrate the post
Coming Soon:
Screenshots!
Corrections!

Hi, people i saw that the guide hit 1,000 views and it's a lot of clicks! so i'd like to know if there is something that you would see in this guide, or if you need some more guides, maybe more D3 specific (or less specific! ) i spent a lot of time tweaking and tuning this phone and i can share what i've learned from it! If you want a custom translated rom, i could work on it, especially in Italian or French!
tl;dr -> Tell me what improvements you want to see!

Buongiorno FrankieDedo,
I have read your tutorial and try to translate the Framework res.apk from Minimoto 1.7 into German. (I am Greek just translate it for a German friend)
First i translated the three files (arrays.xml, plurals.xml, strings.xml), put the files into framework-res.apk\res\values-de, recompiled and signed everything without errors.
Then i edit the build.prop ro.product.locale.language = de and ro.product.locale.region = DE
Flashed the rom zip without problems.
After the initial setup i downloaded more local 2 and set it up to german, unfortunately the system itself is still in english (most of the apps are in german now)
Also I have decompiled your framework-res.apk but i cant find your italian values folder.
I've attached my decompiled framework-res.apk, maybe you can help me.
Thank you very much !

michalakis said:
Buongiorno FrankieDedo,
I have read your tutorial and try to translate the Framework res.apk from Minimoto 1.7 into German. (I am Greek just translate it for a German friend)
First i translated the three files (arrays.xml, plurals.xml, strings.xml), (...)
Click to expand...
Click to collapse
I'm looking into this, my framework lacks the Italian translation, you're right, i've uploaded a zip without it, i'll update that too soon.
I don't know why your framework shouldn't work, i give a look at it and it looks ok, it just have some text rows more than the english one, it could be the problem, but i don't think so... Anyway, can you tell me if when you factory reset the phone you see some texts in german and then they disappear?

Yes, at the start setup for 1 sec than it turns to English.
But after a factory reset booting without the SIM, the text at the start setup don't turn to German.
So with SIM the phone recognize the im in Germany and turns the text for 1 sec to German.
Must i change something else in the build.prop ?

I Started over again and with mavRom 4.5 now it works

michalakis said:
I Started over again and with mavRom 4.5 now it works
Click to expand...
Click to collapse
i'm glad you've made it, maybe the problem with the other rom was some missing file or something missing in the decompiling/translation/compiling process... and thanks for letting me know that the minimoto zip doesn't have the translated! as soon as i get home, i'll upload a new file!

Fixed the Italian Minimoto, with translated framework.

FrankieDedo said:
Fixed the Italian Minimoto, with translated framework.
Click to expand...
Click to collapse
is this guide valid only for these 2 roms or i can use it to translate any custom rom of any smartphone?? and another question: if in \system\framework there are framework-res.apk, lidroid-res.apk and twframework-res.apk and the other files are .jar, i must modify only these 3 apks?
thanks in advance for the answers!

Blade.94 said:
is this guide valid only for these 2 roms or i can use it to translate any custom rom of any smartphone?? and another question: if in \system\framework there are framework-res.apk, lidroid-res.apk and twframework-res.apk and the other files are .jar, i must modify only these 3 apks?
thanks in advance for the answers!
Click to expand...
Click to collapse
Sorry for my late answer, :angel: anyway:
I wrote this guide after messing around with Droid 3, but it is good more or less for every rom, so you can translate nearly everything with this method (i heard that for HTC phones things are a little more messy, but i might be wrong)
For the apks to translate: if you translate the frameworks alone you should have translated roughly a 75%-80% of the phone system, but another important apk is the "Settings" one... if you are a maniac like me you can decompile every system app and look for missing language folders...
I'm sure at 99% that you'll always have to touch ONLY apks, and not .jar or external .xml or whatever so, yes go along with your apks
Ciao!

FrankieDedo said:
Sorry for my late answer, :angel: anyway:
I wrote this guide after messing around with Droid 3, but it is good more or less for every rom, so you can translate nearly everything with this method (i heard that for HTC phones things are a little more messy, but i might be wrong)
For the apks to translate: if you translate the frameworks alone you should have translated roughly a 75%-80% of the phone system, but another important apk is the "Settings" one... if you are a maniac like me you can decompile every system app and look for missing language folders...
I'm sure at 99% that you'll always have to touch ONLY apks, and not .jar or external .xml or whatever so, yes go along with your apks
Ciao!
Click to expand...
Click to collapse
grazie per la tua risposta! sei stato molto chiaro!

Related

[HOWTO]: 1% steps on gingerbread

at first, it would be nice if any mod can modify the title to: [HOWTO] 1% battery mod on gingerbread and delete all following posts.
further i'm sorry for my poor english - hopefully everyone here can follow my steps!
the hard thing on changing battery icons on gingerbread is, that there are only 7 steps: 0, 10, 20, 40, 60, 80 and 100... that means you have to edit or replace two xml files (more later).
IMPORTANT: please make a backup of your rom! i'm not responsible if your device won't boot after modding! also it is possible that your google/facebook etc. accounts are deleted after flashing back your modded framework. but you can easily readd them again!
WHAT YOU NEED:
apk manager from here: http://www.multiupload.com/GXW01G6URJ
battery icons or a framework-res.apk with your desired icons
a rooted gingerbread rom
your original framework-res.apk (guide to extract later on)
WHAT YOU GET (IN ATTACHMENT):
stat_sys_xml_dateien.zip (stat_sys_battery.xml and stat_sys_battery_charge.xml with 100 steps)
framework-res.apk (modified by me with circlemod battery (i hope it's okay to use them in here! btw. many thx to devs (was it mdj?) for this icons). THIS FRAMEWORK WAS ONLY TESTED BY ME ON MDJ GINGERBREAD 2.2!!!
screenshot of the circle battery mod on gingerbread
FIRST STEPS:
extract apk manager to a a desired folder and conenct your phone to debug mode
start script.bat and change kompression level to 0 (type 19, afterwards 0)
type in 0 to download framework-res.apk from your phone. it asks for the path, type: /system/framework/framework-res.apk and hit enter
if asked for a name, type framework-res.apk and hit enter and confirm with Y to be your current project
type 9 and hit enter to decompile your framework and wait until it's finished
have a look in the folder "projects" - there will be a folder "framework-res.apk" now.
navigate to the subfolder: res/drawable-hdpi and delete ALL png files with the name stat_sys_battery_X.png and stat_sys_battery_charge_animX.png (while X stands for the according number). do this also with stat_sys_battery_unknown.png and stat_sys_battery_charge_animfull.png (IMPORTANT: delete last two ones only if you have a replacement icon or you will get errors on compiling!!!)
also delete following two xml files in subfolder projects/framework-res.apk/res/drawable: stat_sys_battery_charge.xml and stat_sys_battery.xml
now it gets tricky:
depending on the amount of your custom icons you have on charging, you may have to edit your stat_sys_battery_charge.xml file and delete or add the percentual steps! if you have 100 custom png's for charging animation, you can use the stat_sys_battery_charge.xml i attached (it also includes a stat_sys_battery.xml with 100 steps if you need)
now it's time to paste your modified/downloaded stat_sys_battery_charge.xml and stat_sys_battery.xml into subfolder /res/drawable/ (where you deleted the original of gingerbread before!)
go back to apk manager and type 11 to compile your framework
when it asks "is this a system apk?", type Y for yes. confirm again with Y and let apk manager create a new folder, called "keep". a list of files appears, and after that DON'T CONFIRM!!!
first you have to navigate into this "keep" folder and delete again exactly what you deleted above (stat_sys_battery_X.png, stat_sys_battery_charge_animX.png, stat_sys_battery_unknown.png, stat_sys_battery_charge_animfull.png, stat_sys_battery.xml, stat_sys_battery_charge.xml) and ADDITIONALLY the file resources.arsc
now you can confirm in apk manager to complete the compiling process. as far as i know, these steps with keep folders are needed to include the right id's automatically in public.xml! if any errors occur, feel free to post your log in this thread (see log by typing 21 in apk manager)
flash your new created framework-res.apk by entering 8.
if you didn't anything wrong, you should have your new % battery icons after reboot! as mentioned before, your desktop background maybe messed up and/or your accounts are deleted. you can solve this by just readd accounts and change background again.
Those ID's are hexadecimal numbers (dictated by the 0x prefix), and are sequential:
0 - 17302168
10 - 17302169
100 - 17302170
20 - 17302171
40 - 17302172
60 - 17302173
80 - 17302174
RJackson said:
Those ID's are hexadecimal numbers (dictated by the 0x prefix), and are sequential:
0 - 17302168
10 - 17302169
100 - 17302170
20 - 17302171
40 - 17302172
60 - 17302173
80 - 17302174
Click to expand...
Click to collapse
thx for your explanation! but i found out that it isn't necessary to edit public.xml. on decompiling, it adds automatically the missing lines when png's are listed in stat_sys_battery.xml...
finally i got it working if someone else wants the 1% increments, i can write a little tutorial.
Yea very interested. I can't stand the stock one. I knew how to do all the theming stuff on sd builds using the theme porters. Nand is different though. So please write that up, also will you post your battery mod for gingerbread
HOWTO added in 1st post!
fruchtfliege said:
HOWTO added in 1st post!
Click to expand...
Click to collapse
Thanks for the tutorial. Question though, is this for sd builds or for nand? Or does it not matter?
it is only for nand-builds. on sd-builds it should be similar, but afaik you don't have to adb the framework-res.apk. you should find here a lot of threads about modifying sd-build statusbars, because it is not that hard like on nand builds.
Cool, I'm using nand. Yea through sd builds thing stuff was easy. I couldn't change the compression in the emulator. How were you able to change it? Also is that framework at the bottom the one we use to achieve what the picture looks like?
Background changed and accounts gone as mentioned, but it worked perfectly - well worth it!
How did you change the compression when running the batch file?
Edit: Nevemind im retarded.
When i press the 9 to decompile it it gives me some B.S error Saying could not find C:\place-apk-here-for-modding.... The directory name is invalid. Could someone make this work on JDMS nand build?
Alos when i pull the framework res file from my phone it doesnt show up in "projects" Theres nothing in there. However it does show up in "place-apk-here-for-modding" folder..
Alos when i pull the framework res file from my phone it doesnt show up in "projects" Theres nothing in there. However it does show up in "place-apk-here-for-modding" folder..
Click to expand...
Click to collapse
the adb pulled apk files are stored in "place-apk-here-for-modding" folder, not in projects! a project in this folder will only be created after decompiling an apk!!!
Also is that framework at the bottom the one we use to achieve what the picture looks like?
Click to expand...
Click to collapse
you just get the statusbar at top (in fact only + battery icon). the bottom icons and background are custom with using launcher pro.
Can you think of a certain reason why i keep getting an error when i try to decompile it?
This is the error i get
--------------------------------------------------------------------------
|Wed 01/19/2011 -- 20:11:24.04|
--------------------------------------------------------------------------
'mode' is not recognized as an internal or external command,
operable program or batch file.
'java' is not recognized as an internal or external command,
operable program or batch file.
1631 KB/s (4121004 bytes in 2.466s)
Could Not Find C:\Users\Matt\Desktop\New folder\place-apk-here-for-modding\../pl
ace-apk-here-for-modding/signedframework-res.apk
Could Not Find C:\Users\Matt\Desktop\New folder\place-apk-here-for-modding\../pl
ace-apk-here-for-modding/unsignedframework-res.apk
'java' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
i think you have to install java sdk. without it, the compiling tools are not included, like on jde (i think it's called jde...)
but i'm going to make flashable zips of these files for clockwork mod. only problem is, that i don't know much about linux commands i couldn't get it working. i should start a new thread asking about this.
If you jump on irc you would get your answer in like 5secs. Room is #htc-linux-chat on freenode. Thanks for the suggestion about sdk. That does make sense now that I think about it;p
thank you for the hint. i will ask for help at chat tomorrow. i'm also working on different statusbar colours of gingerbread with original icons. before release i have to get this cwm zip flash thing working!
fruchtfliege said:
at first, it would be nice if any mod can modify the title to: [HOWTO] 1% battery mod on gingerbread and delete all following posts.
Click to expand...
Click to collapse
Just a heads-up mate - you obviously can't delete any posts, but you can change the title. Edit the first post and go into advanced mode to change it.
Good luck with your project
thank you! i have changed the title now.
Hey Fruit Fly, any progress on that cwm zip?
not really. i forgot my hd2 at home (i do theme works at work) and couldn't test the cwm zip files. on sunday evening i can test everything and tell you whats working and what not!
rafpigna from #htc-linux-chat gave me another choice of flashing easy with an adb script (thank you for that). but some users on german android forum told me it's not working. have to bugfix the files first
Yea let me know the outcome;p

[HOW TO] How to Theme your phone (gb roms)

Index
post 1: Introduction
Post 2: Simple image swap
Post 3: Decompiling and recompiling files
Post 4: Image locations in Sense ROMS
Post 8: How to use the kitchen
Post 9: Advanced modification: Add / Remove alarm notification
Post 10: Advanced modification: Add / Remove Location indicator
Introduction
There are several resources available with information about theme creation, however I find that information is usually scattered on many different threads. It is also not always newbie friendly. In this thread I would like to give a quick summary for the newbie to help start making your phone look the way you like it. Before I go into the actual details, I would like to suggest some shortcuts. You don’t always need to do things the hard way. The options that you have are:
Use the Ultimate online Kitchen . For those not familiar, this is an online tool that lets you pick and choose components and then packages them for you into the base files you supply. You can get very far using the kitchen with lots of options for customizing your phone.
Start with the kitchen and add some images. The kitchen is great to get a good baseline without going into code. You don’t have to worry about finding where color definitions sit, or what hex values are good to use. Most of the time, however, we want icons that are not available in the kitchen. The solution a lot of themers are using is to create a good base in the kitchen, then add modifications of their own.
Replace individual images, but keep everything else the same. This is a solution for those who want to manually swap battery files, or create their set of notification items and move it from ROM to ROM. You can use this either on the stock files from your ROM, or on files you generated in the kitchen.
Going into the guts – this is the advanced version. You decompile the files and modify the source code to get what you want. This is the only way to get the non-standard stuff done. Once again, you can start with a stock ROM, or you can run it through the kitchen to do some of the tedious work and then go into the guts.
I will describe the methods for both 3 (post 2) and 4 (post 3). I also have a list of where you can locate icons on the phone in post 3, that I will expand in the future.
Background
System Icons and background images sit in two main files: framework-res.apk (in system/framework) and system-ui.apk (in system/app). Additionally, sense ROMs have com.htc.resources.apk (in system/framework Within these files there is a res directory, and under that you have the folders containing data. Google has guidelines on icon design, although themers usually ignore those in order to get a different from stock look. One thing you would notice is that there are sometimes repeated folders of icons. This is usually baggage from different android versions (2.1, 2.2, 2.3). One thing to remember, it’s usually easy to add images, but you can get into all sorts of trouble if you ake things out.
Each application has its own res folder where the launcher icon and other visuals are kept. There are, however, a lot of applications that reference the framework.apk for visuals. For example the my location in maps, or google talk notification.
There are 2 types of images that you would encounter. Normal icons and images are non-scalable. They take a certain amount of real estate on the phone, and that’s it. Example of these are the battery levels and notification icons. The other type is the .9 images. These are images that are going to be stretched to fit whatever space is needed. An example of that are the menu backgrounds. The .9 images have a special format. The one pixel border around them defines how they stretch and how content is displayed in them. It is highly recommended to follow the standards in order to get repeatable and consistent look. Android SDK has a tool to help with .9 file design: draw9patch.bat.
Important note: The .9 files show the borders ONLY when de-compiled. If you grab a file from the framework directly you will not see that line. It is therefore required to compile the .9 files after you make them. You can use apk manager or ThemePro-JAVA to recompile the framework apk after modifying the files.
Definitions for which image is used where sit in the xml files under the drawable folder. These are compiled xml files, you can’t edit them with a text editor. For this introduction I will not go into modifying xml files, but I’ll describe it in a later post. Each apk also has a resources file that describes what is in there. If you add, remove, or rename files in the apk you will have discrepancy with the resource file and the theme will not work (more likely you will be stuck in an infinite bootup loop). To add, remove, or rename files you have to go through full apk decompile.
Before you start:
Warning: frameworks are highly linked with other files. You can’t just take a framework from one ROM and put it in another. Always keep a backup of the original files ready to be installed (see below), otherwise you may need to re-flash the ROM. Frameworks are also sensitive to compression. DO NOT use winzip to handle the files, it can cause problems with the final apk file.
There are several things you would need before you start
A rooted phone
SDK installed on the computer
A zip handling software other than winzip (winRAR and 7-zip are both good options)
Amend2edify . If you are on a mac you will need auto sign for mac instead
For advanced work - APK manager
These are mostly windows tools, with some support for linux, so if you're on a mac you need to find the equivalent program.
Create a backup
Grab the framewor k-res.apk, com.htc.resources.apk and system-ui.apk from your phone. They are located in the system/framework and system/app folders. You would need them as a starting point for your modification and you need them for a backup
If you plan to modify any other files, grab them and note where you took them from (most likely /system/app for things like dialer, email, etc)
Create a clockwork installation file of the original files (see post below)
Name the installation framework-original.zip, or something else that would be easily recognized in case of trouble, and then copy it to your internal sd card.
Create installation and test it
After you have finished modifying the files, the best way to get them to the phone is through clockwork installation. You can push files to the phone using adb, but in my experience it's not worth it.
Create install file
I am calling the parent folder “main”
Create a folder main\framework
Place your modified files (framework-res.apk and com.htc.resources.apk) in that folder
Create a folder main\app
Place the modified files (system-ui.apk + any other apps you modified) in that folder
Create the following folder tree:main \META-INF\com\google\android
In the android folder create a text file named update-script
Edit the update-script file content “copy_dir PACKAGE:app SYSTEM:app copy_dir
PACKAGE:framework SYSTEM:framework”
From the main folder add the three folders you created to a new zip file
Use amend2edify to convert and sign the zip file you created
WARNING: Do not name your framework file "update.zip"! Do not name your file “PG05IMG.zip”!
Testing
Give the file a name that is easy to recognize and copy it to your internal sd card
Reboot into recovery
Select install zip from card -> choose zip from sdcard
Select the installation of the new framework and confirm the installation
Reboot
If you are stuck in an infinite boot-up cycle reboot back to recovery
You can try to send “adb reboot recovery” to the phone over usb
You can battery pull then use power + volume key to boot into recovery
Install your original framework backup and reboot
hint: if you are like me and have a lot of files, name your test file z_filename.zip That way in recovery you use the up volume and get to it quickly.
Simple image swap
Simple image swap
If all you want to do is swap some images, all you need is a zip handling application (I recommend not using windows built in zip, it does not have the flexibility to properly do everything you need).
Select the apk file you want to modify and open it using a zip program
Inside the opened go to \res\drawable-hdpi\
You can extract all the images from that folder as a starting point
Modify the images you want
Copy the modified images back into the \res\drawable-hdpi\ folder in the apk file
A few things to watch for
Do not try to modify any file that ends in .9.png using this method. You are likely to create weird looking visuals on the phone
If you already know which files you want to copy over (let’s say you have a set of images that you are moving from one ROM to another) you don’t need to extract the images from the apk. Please note, however, that not all base versions use the same file names. Double check the filenames in the new apk before copying over your existing images.
Sense and AOSP roms sometimes use images from different locations (sense may use system-ui.apk for signal and AOSP may use framework-res for signal). If you try changing one place and it doesn’t work, try the other. Over time you will learn what sits where.
Different ROMS and different themes make changes to the xml files, telling the system which images to use. This means that copying files over may not be enough. This is mostly an issue with battery and battery charging, but other status bar animations can be affected. For example, if you start with a stock based rom that only uses 5 levels of battery indication you can copy over 100 images to show accurate progress, but on the phone you will still see only 5 (and probably the wrong 5). Similarly, charge animation can be 5 icons, 30 icons, or 100 icons. It can include the current battery level or not. Copying images from one type of animation to another will result in something that does not make sense on the phone. You have two options to solve this. You can take the full mod way and modify the xml, or you can try to run the framework through the kitchen and select a battery mod that has the behavior you want. After that you can modify the files.
Decompiling and recompiling files
Modifying files by decompile/recompile
What is APK manager?
APK manager is a tool for decompiling / recompiling apk files. If you want to change anything other than images, it is a must have. EDIT: A new thread for APK manager 5 is out, make sure you don't get the old 4.9 version.
The basics
The basic flow when using APK manager is
Place apk file in place-apk-here-for-modding folder
run the Script.bat file
Type 22 and select the file you want to work with
For AOSP based: Type 9 and wait for it to finish decompiling
For Sense based: Type 10. When prompted, drag your com.htc.resources.apk onto the script window, then hit enter
Modify the items you want modified (they will be in the projects folder)
type 11 to recompile
When prompted about system file answer YES
When prompted about copying files over answer NO
Item 6 is where all the magic happens. Go to the projects folder and you will find a sub-folder with the apk name. Inside you have res, where you can replace images and work on xml files.
Bad starting file
This is mostly true for framework files that went through several cycles of modifications. The framework is forgiving to having extra items, or having bad .9 images (see post above about .9 images). Some people may have replaced images without recompiling the framework in a way that breaks the .9 format. The program saves an empty file with the .9.png extensions and a copy of the original without .9 in it. If this happens you will very likely see warning messages during the decompile stage, but you don't see warnings unless you look at the log. This means that you would actually catch it only at recompile. See this post for more details and how to solve this.
Things may not always be "fixable", so the best approach is to get the original framework that is the base for the one you need. Having a clean start can save a lot of headaches later on.
Overwriting your changes
When you recompile, assuming everything worked ok, you are prompted if this is a system file. Most likely you want to say yes. This ensures that the original signature is copied over. You will also be prompted if you want to copy some files over from the original. BE CAREFUL!. There are people who say you reduce the risk of errors if you copy things that didn't change. Personally, if I changed anything that required recompilation (mostly added new images or modified xml files) I always choose not to copy extra files. If you do choose to copy some files over, pay attention to the next step. Do not hit any key until you remove the modified files. You will need to go to the newly created "keep" folder (in the top apk manager directory) and remove any image that you changed and any xml that you modified. Also, if you modified xml files to add new images you need to delete "resources.arsc".
Failed rebuild
APK manager is trying to minimize work by only compiling newly changed items. If you built an apk and realized you have an error, or want to add more changes, I recommend removing the cached build. Go to the projects folder and delete the "build" folder. I've had cases where the new items didn't catch.
Removed items
I highly recommend to leave icons that you do not need. I've had occasions where I removed things that I thought had no more reference, but then ended with endless boot-loops. For example, if you modify the xml to only show 6 out of the 101 battery charge animations, leave the remaining icons in your project.
If you're stuck
Look at the log file. That would usually give you an answer. Also, if you are working on a recent GB ROM you probably need to get the beta 5 version. Version 4.9 will have problems compiling the newer files.
Image loactions in Sense ROMS
Image locations for Sense roms
Framework-res:
1. Progress bar information. Some is in xml files (just color definitions), but there is progressbar_indeterminate*.png that has the progress bar with diagonal lines
2. Spinning processing indicator: spinner_black*.png and spinner_white*.png
3. Most notifications (stat_notify_*.png) including the sync animation (stat_notify_sync*.png)
4. Battery (stat_sys_battery*.png) and battery animation (stat_sys_battery_charge_anim*.png). There are also the stat_sys_battery_unknown.png and stat_sys_battery_charge_animfull.png (this one does not show up on sense)
System-ui:
1. Signal related notifications (Bluetooth, wifi signal, network signals) in stat_sys_data_*.png. Note that connection type is usually named like stat_sys_data_connected_3g.png, but I’ve seen those with different naming conventions
2. Alarm, location, and the “more” stat_notify_alarm.png, stat_notify_more.png, sym_gpsone*.png.
3. GPS: stat_sys_gps_acquiring*.png, although gps on is usually in framework-res (stat_sys_gps_on.png)
Elsewhere:
1. Email and Gmail notifications (in mail.apk and gmail.apk)
2. USB connection (in pcsII.apk)
3. Google voice (in gvoice.apk)
How to use the kitchen
Link: http://uot.dakra.lt/kitchen/
The kitchen's XDA UOT page has all the information on how to get started. I will just give a quick introduction here specific to the TB roms.
When you go to to the web site you have several tabs. go through one at a time and select the modifications you want. The simplest example would be to change the stock battery of the ROM so I'll use that.
1. Select the tab of interest
2. Check the "use this mod" box and the options appear. You can choose the preview option, but don't have to.
3. Once you're done select the File upload tab.
4. In the section Select your rom from kitchen's list, or upload your own files check the "system files" radio button
5. Upload framework-res.apk, SystemUI.apk, and com.htc.resources.apk (for sense ROMs). You will need to extract them from the ROM's installation file if you are on stock view or from the theme install file if you are using a theme. You can also get it from your phone (copy the files to the sdcard using root explorer and then to your computer, or use adb pull if you know how). twframework-res.apk is for Samsung phones only.
IMPORTANT: Some mods require SystemUI.apk and some require framework-res.apk. If you are not sure which one you need upload both. In any case ALWAYS upload com.htc.resources.apk for a sense ROM, without it the kitchen will fail to compile your mod (AOSP based roms don't have the com.htc.resources.apk)
6. Go to the summary page and select "submit work to kitchen"
7. Wait patiently for your files to be ready. It can take a while when the server is busy.
8. Install your modified files and enjoy
Advanced modification: Add / Remove alarm notification
For this modification you will need to decompile SystemUI.apk (see above post).
Go to the SystemUI.apk\smali\com\android\systemui\statusbar\policy folder created by apk manager. Find StatusBarPolicy.smali
search for the text
const-string v1, "alarmSet"
Click to expand...
Click to collapse
There is a line before that that starts with .line and a line after that starts with .line. This is the section you need to change.
Note: The line numbers can vary from ROM to ROM. DO NOT change those two lines. Replace the entire content between them.
Show Alarm Clock:
const-string v1, "alarmSet"
const/4 v2, 0x0
invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
Click to expand...
Click to collapse
Hide Alarm Clock:
const/4 v0, 0x0
const-string v1, "alarmSet"
const/4 v2, 0x0
Click to expand...
Click to collapse
Recompile the apk and install.
Advanced modification: Add / Remove Location indicator
This will add or remove the general location indicator. It does not affect the GPS indicator.
For this modification you will need to decompile SystemUI.apk (see above post).
Go to the SystemUI.apk\smali\com\android\systemui\statusbar\policy folder created by apk manager. Find HtcCdmaStatusBar.smali
search for the text
.method private updateMtGpsIcon()V
Click to expand...
Click to collapse
The section you are interested in is
.method private updateMtGpsIcon()V
.locals 7
.prologue
const/4 v5, 0x3
const/4 v4, 0x1
const/4 v3, 0x0
Click to expand...
Click to collapse
Show location indicator
const/4 v4, 0x1
Click to expand...
Click to collapse
Hide location indicator
const/4 v4, 0x0
Click to expand...
Click to collapse
I am not sure where I have missed it but when I download the newest APK manager and open the zip there isn't a folder that says place apk here or anything like it in any part of the apk manager. Did I miss something in the instructions about this folder being somewhere else?
TDubKong said:
I am not sure where I have missed it but when I download the newest APK manager and open the zip there isn't a folder that says place apk here or anything like it in any part of the apk manager. Did I miss something in the instructions about this folder being somewhere else?
Click to expand...
Click to collapse
They will be in the directory you installed it to, so something like, c://ApkManager/
Sent from my TBolt using my f***king thumbs...
TDubKong said:
I am not sure where I have missed it but when I download the newest APK manager and open the zip there isn't a folder that says place apk here or anything like it in any part of the apk manager. Did I miss something in the instructions about this folder being somewhere else?
Click to expand...
Click to collapse
If it isn't there as a subfolder when you extracted it, it should be created the first time you run the script
Sent from a gingerbread thunderbolt
tsachi said:
For this modification you will need to decompile SystemUI.apk (see above post).
Go to the SystemUI.apk\smali\com\android\systemui\statusbar\policy folder created by apk manager. Find StatusBarPolicy.smali
search for the text
There is a line before that that starts with .line and a line after that starts with .line. This is the section you need to change.
Note: The line numbers can vary from ROM to ROM. DO NOT change those two lines. Replace the entire content between them.
Show Alarm Clock:
Hide Alarm Clock:
Recompile the apk and install.
Click to expand...
Click to collapse
Would this tutorial work for removing the clock and battery from the status bar?
sent from my mecha using XDA Premium App
warmonster said:
Would this tutorial work for removing the clock and battery from the status bar?
sent from my mecha using XDA Premium App
Click to expand...
Click to collapse
This is the file you need, but the changes are different from what I described here. I'll try to look them up and add them
Sent from a gingerbread thunderbolt
tsachi said:
This is the file you need, but the changes are different from what I described here. I'll try to look them up and add them
Sent from a gingerbread thunderbolt
Click to expand...
Click to collapse
thanks man, I want to learn how to do this but right now this looks very confusing. Also I downloaded apk manger but some vgrabber program installs and I cant find apk manger.
warmonster said:
thanks man, I want to learn how to do this but right now this looks very confusing. Also I downloaded apk manger but some vgrabber program installs and I cant find apk manger.
Click to expand...
Click to collapse
Here are the instructions http://forums.miuiandroid.com/showthread.php?5603-Q-Removing-the-clock-from-the-status-bar, .should work on our ROM too, but I haven't tried it yet.
In terms of apk manager, it is a zip file that you extract, should not install anything else. I think you clicked on a wrong download somewhere. I updated the link to the new apk manager 5 thread, try from there.
Awesome write up!!! Just found this this morning while at work. I've been stubbing my toes all weekend through trial and error to accomplish what you've summed up here. Thank you so much! Subscribed for a more thorough read when I get home.
Sent from my ADR6300 using xda premium
Hey my man, I'm trying to use the kitchen from my phone Inspire 4g..and when I try to upload files to kitchen I don't know where it looks for them at in my phone. It will open my upload folder but I can't find it on my phone anywhere? Dose anyone know what parent folder the upload folder is in...
Sent from my Inspire4G using xda premium
Towboat_man said:
Hey my man, I'm trying to use the kitchen from my phone Inspire 4g..and when I try to upload files to kitchen I don't know where it looks for them at in my phone. It will open my upload folder but I can't find it on my phone anywhere? Dose anyone know what parent folder the upload folder is in...
Sent from my Inspire4G using xda premium
Click to expand...
Click to collapse
First, I think it mentions somewhere on the site or on the kitchen XDA page that they are generally not compatible with phone browsers. Not sure what the compatibility issue is, but you may want to look it up. If you do get it to work from the phone you need a way to browse the system folders. If you can't see the /system/ when you browse for files I would suggest using root exlorer (paid) or file expert (free) to first copy the files over to the sdcard, and then go through the web site and grab them from the card. A lot of the basic explorers, especially those that weren't designed for rooted phones, don't have access to the /system/ so that may be your problem. The files are in /system/framework/ and in /system/apps

[GUIDE] A n00b guide to porting themes :P (26/12/11)

Hello A little while ago I managed to learn how to theme totally from scratch. I knew nothing of anything before I started, but now I know how to port themes As I still see myself as a n00b there may be some weird things I've done, but at least I manage to create the themes This might not be the best way to theme, or the easiest, but it works
Overview PNGS
1) Getting the files
2) Getting the images
3) Port
4) Package and Sign
The only programs I've used is 7zip and autosigner download them and install 7zip and extract autosigner to a nice location for example your desktop
Getting the files
The first you need to do (after getting the programs) is to find the file you will mod (edit). This will mostly be the framework-res.apk because this decides most of looks of phone (for example the statusbar). Download the .zip of the rom your going to theme. Open it up (shouldn't require any programs, if does, use 7zip: either drag it onto the 7zip icon or right click and choose open with). Open system -> app and copy the framework-res.apk (or any other apk you would like to theme, for example the settings). Now paste it into an appropriate folder.
Getting the images
Now you need to find the images you want to use in your new theme. Find either an update.zip with a theme or an .apk with a theme chooser theme (if there is both a version for Froyo and GB, use the Froyo version as this will make it easier ) Open it up with 7zip (drag it into the 7zip icon). Now you can do either of two options:
1) You can take the whole drawable-mdpi folder and copy it out. You should probably don’t do this with a Themechooser apk, as they usually don’t have all icons in this folder, as they often lend a few from HDPI.
2) Take only the images you want and copy them to a folder. For example if you want the signal icons, copy the “stat_sys_signal_0” (-4 of course) and copy them out. If you want the statusbar background, copy “statusbar_background”. This way you can mix several themes, take the best of several themes and make your personal theme
When you’re done getting your icons, close the window.
Porting
Now open the Rom’s default framework-res.apk with 7-zip. If you’re going to port a whole theme, delete the /res/drawable-mdpi folder and copy in your own. If you’re going to port just a few icons, open the /res/drawable-mdpi folder and paste your icons. You might want to check if the icons have the same names in the different framework. For example the headset icons can be both “stat_sys_headset” and “stat_notify_headset”. Also if you port from a theme chooser theme, you will have to rename every single .png you port. This is really boring, but necessary. You need to remove the “framework_res” and the “android_systemui” from the beginning of all the names. So “framework_res_activity_title_bar.9.png” needs to be changed to “activity_title_bar.9.png”. Because this is so boring you better keep your renamed icons, so it’s easier to port it to another rom
This is kind of off-topic: my carrier lends network of another carrier. Therefor my phone is allways roaming. This puts a stupid “r” with my signal icons. To avoid this I allways take normal signal icons, copy them, and rename one of the two .pngs from for example “stat_sys_signal_1” to “stat_sys_r_signal_1”. This way I get rid of this stupid “r” and it will always show the normal icons
Packing and signing
Now the porting is done and the next job is to push the new framework to your phone. If you are familiar with adb, you can push it to system/framework on your phone. You don’t need to anything more with the apk before pushing it. Else you can create a flashable .zip for your theme. I’ve attached a .zip with update script (I haven’t created it. Just stole it from one of Elelinux’ add-ons ). Download the zip. Create a folder named system and a folder named framework. First drag the new, modded framework_res.apk to the framework folder, then drag the framework folder into the system folder, before you drag the system folder into the attached zip. If you use Clockworkmod recovery, you can just flash the zip right as it is, but if you use Amon_Ra or want it to be compatible with every recovery because you want to post it, you need to do something.
Unpack autosigner and launch the exe file inside. Drag the .zip into the new window and press sign. It will now appear a new file in the same folder as the file you wanted to sign. Its name is the same, but with “_signed” at the end. You can rename the file as you wish both before and after the signing.
XML Editing:
I decided to add a little section about XML editing as well I really don't know all about this myself, but i can tell how to set it up and some examples to what you can do Even though this may seem really complicated, it's not written in a completely different language, like Java in the smali files, so often it is possible to use logic to get what you want
Tools needed: APK Multi-tool. as well as Java, if you don't have it installed.
Overview:
1) Setting up
2) Examples
3) Finish
Settings up
Download APK Multi-tool and extract/ unzip it to wherever you want ( I have it on my desktop). Now you can place the apk you want to modify (usually the framework_res.apk) in the "Place_apk_for_modding" folder. Then you open the script. If you don't get an error, proceed to b), if you do get an error proceed to a)
a)) If you do get an error where it says something like "java not found" you need to correct the Java path (or install Java if you haven't done that, which you should have) . I had to do this to get it working. First open my computer and click disk C, or D if you have installed Java there. Open programfiles (or whatever it's called in your language) and scroll to the Java folder. Now open the folder there jdk folder or whatever you have there and open the "bin" folder. Look at the top of your window, where it says where on you're computer you are (like Windows: C to the left, and then Programfiles and so on). Right click it and click copy address. Mine is "C:\Program Files\Java\jdk1.7.0_01\bin . Now you can close the window.
Open "My computer" again. On the top bar below the navigationbar, click Sytemoptions (sorry, not really sure what it's called in Englsih, as my computer is Norwegian, please correct me if I'm wrong). On the left click the "advanced" link and in the popup that appears click "environment variables". Scroll down to the "path" variable and edit it. Paste the address you copied and click OK. You should now be able to proceed to b). If you still get an error, please tell me and I'll try to help
b) type 25 and press enter to select current project. Here you will see all the apks in the "Place_apk_for_modding" folder. Select the appropriate number (in this case probably 1) and press enter to continue. Then you hit 9 and enter to decompile it. I cannot really explain it, but it enables you to edit the xmls in the apk. If you try to edit them by using 7Zip, the xmls will be just messed up. When it's done decompiling, you have gotten a new folder in the "projects" folder. In this case it is probably named framework_res.apk. Minimize the script (DON'T CLOSE IT) and you're ready to edit the xmls
Examples on edits:
COMING SOON
Finish:
When you're done editing, open the script again (remember what I said about not closing it? ). Click 11, unless you are editing a non system apk. If you are editing the framework or settings or such, use 11. If you get an error now, you have probably done something wrong, try to see in the log what you have done wrong. Every time I've had an error, I've ended up in bootloop when I've flashed, so it is probably better to just start over. Another tip is to do one thing at the time. For example: you decompile, edit the notification color in pulldown, compile. Take the compiled apk, decompile edit another thing and so on, this makes it easier to not mess up and it also shows what you are doing wrong.
On the "Is this a system apk?" you should probably say y, as I said above. I also usually copy over the files I didn't edit, as this seems safer. Follow the instructions and you should be fine. When you're done and the script is done compiling, you will find a unsigned_**** (for example unsigned_framework-res.apk) in the "place_apk_for_modding" folder. This is your modified apk, and you can try to push it to ur device with an update.zip or adb, if you know how to use that
Well this was the end of my guide for now If there's anything which is unclear or you have other suggestions, feel free to post I've probably forgotten something
Finally after all my attemps to modify the android framework before i have do it correctly. I have changed a couple of things, the lock screen and battery icons so far. The framework I'm modifying is the one on Ele's Gingerbread and i wonder how to get the battery icon percentage 1 by 1 as i saw in some other themes. What i mean is that in the original framework there is only battery icons for 15, 20, 25 and so on, and if i push the 16, 17, 18, 19 they won't work. Is Theme Chooser the one on charge of this? how can i get that? some help please?
(Also tryed to theme a sense rom, but everything was messed up, i guess because of sense or maybe I did something wrong)
So thanks for your guide, really helpfull
Yeah, I've never tried to theme Sense so I don't know. It is probably possible to make icons for every %, but then you'll have to decompile using APK tool, and it is harder. I don't know how. If you want to try, you could try asking a question here
thanks
so funny=))
i'm tried
Great guide helped me a lo thx.
Finally, someone who CAN explain it...
I'm now porting ICS to GB (no cm7), cause I think CM sucks.
mDroidd said:
Finally, someone who CAN explain it...
I'm now porting ICS to GB (no cm7), cause I think CM sucks.
Click to expand...
Click to collapse
Hmm, ICS themes can be made really awesome, if you do some more advanced stuff. For example you want to remap the pulldownbar a bit, and change som text colors. But to do this you need to use a tool like APK multi-tool, and it is a bit more advanced. If you want to, I can create a new section where I show how to this
Thank you.
GUIDE UPDATED! Added a section about XML editing really quick, probably forgotten something and such, so just ask if there is something you don't understand This is for those who are getting used to the PNG editing and want to proceed to something slightly more advanced, for example you 7Tosta
Cheers
BTW: I should've reserved the 2nd post, this is getting messy
Edit: If there's anything specific you want me to add to the EXAMPLES section, tell me

Accidentally deleted a system file?

Figured out you can d/l the bin file (7.2.3, etc) from Amazon, change .bin to .apk. Then find your launcher's "view apk" function. Open wide, then extract the system file you (ahem) mislaid, and breathe. It's how I found the tts file I've been pestering everybody for.
It can be done on a PC, as Amazón lets you download the update on to any device and it is basicaly a zip file....only change .bin to .zip and.... voila!
-
Could it be posible to modify the updates to not unroot the target kindles?
Look at the file atatched. Is a text extracted from inside the classes.dex archive inside IvonaTTS.apk file.
-
It contains two list in alphabetical order of what seems commands of a script language inside Ivona and names of files or variables.
-
All the vox files inside the list are terminated with an "i", not a "v" as the Ivona voices downloaded from Google play.
-
"com.android.settings
com.android.settings.TTS_SETTINGS
com.android.settings.TextToSpeechSettings
com.android.settings.VOICE_INPUT_OUTPUT_SETTINGS
com.android.vending.INSTALL_REFERRER
com.google.intent.action.START_TTS_SERVICE_BETA
com.google.intent.category.TTS_BETA
com.google.tts #com.google.tts.ConfigurationManager
com.google.tts.ITTS
com.google.tts.ITTSCallback
com.google.tts.ITtsBeta
com.google.tts.ITtsCallbackBeta
com.ivona.tts "
-
You see what I see?
I'll have to study it; I'm no programmer for sure. There's something there that would allow a skilled operator to substitute a "v" voice (like Gwyneth) for one of the "i"?
gflorezarroyo said:
It can be done on a PC, as Amazón lets you download the update on to any device and it is basicaly a zip file....only change .bin to .zip and.... voila!
-
Could it be posible to modify the updates to not unroot the target kindles?
Click to expand...
Click to collapse
I think I could do it pretty easily. But without a recovery I'm too chicken.
Sent from my KFOT using Tapatalk 2
BELASCO said:
I'll have to study it; I'm no programmer for sure. There's something there that would allow a skilled operator to substitute a "v" voice (like Gwyneth) for one of the "i"?
Click to expand...
Click to collapse
"i" is the number of beta version, I presume, as the downloaded versons have a "v". The secuence could be "i", now "v", the next "o", then "n" and "a"... And at last the final versión.
-
That does'nt mean they are not compatible, but the program has to know what is looking for, and then is necesary to change the versión in that list and in every place that appeared so it could use newest voices.
It would be easier to change the TTS engine and language on some hidden settings.....
-
I've been vivisecting the various settings menus looking for ideas. Makes me wish I'd studied programming in school instead of redheads & rum.
Anyone reading this who knows how to enable the blocked TTS SETTINGS menu on the KFHD, feel free to speak up. We'll only resent your genius briefly. I managed to recover the Ivona/Salli voice, but I'd rather be hearing Gwyneth.

Building Your Own LG Themes

Introduction
This is going to be a long post! A few weeks ago I started thinking about making my own themes for my LG G5. I had installed some custom roms previously and used substratum a bit but I have always ended up going back to xpirt's Fulmics rom, which doesn't allow this. I started to think how I could do this and have today got to the first stage of being able to change the colours of my phone to precisely what I want, not only for the settings but in some of the stock apps. I thought I would share this with the community and provide some step by step instructions so you can try it yourself. This should work on LG G6, V10, V20 & V30 if you use an app made for these phones but I have no way of testing this so don't hold me to it. This has taken me about 5 full days to work this out and there is still more that I need to do.
I am not in anyway a developer or coder and have very little knowledge of Java so if anything goes wrong here it is likely that I will not be able to help you. I absolutely am a noob at this and do this only for a hobby, using just my common sense and our friend Google to overcome the problems I have come across. Saying that, I will try to offer assistance if I can.
I managed to make my theme from reverse engineering a free LG theme app that was readily available. If you do this method though please consider getting approval from the app developer first. There is a template on here posted by Raafat here. While this was helpful it was only basic and I could not work out exactly what to do. Reverse engineering an app was much easier. Here is how I did it with step by step instructions:
******DISCLAIMER******
I am in not responsible for what you do to your phone. If you decide to try and theme your phone make a backup first or be prepared to do a full reset if anything goes wrong. You do this at your own risk.
1. Programmes
The programmes/software needed for theming are:
• Notepad++
• Apktool
• Android Studio (I used version 2.3 as I was getting an error on re-signing with 3.0)
2. Installing Frameworks Using Apktool:
• Firstly, delete the files in your local temp directory. To do this open ‘Search’ and type in %temp% and delete all files in this folder. You may not be able to delete some of the files. This does not matter
• Next, extract the framework files from your rom/custom rom. For Fulmics 5.5 this was:
Frameworks-res.apk
lge-res.apk
• At a guess I would say that any rom will have these files named exactly as they are above, but I am not sure if these have been altered by xpirt for his rom so you may not be able to use them across other roms.
• Open a command prompt and navigate to the folder where the framework files are kept. This is easiest in a folder called C:/apktool so create a folder in your C:/ drive and place them there. You can of course name the folder or locate it where you want though.
• Use apktool to install the frameworks using this command in the command prompt in C:\apktool
apktool if framework-res.apk
apktool if lge-res.apk
• Once this is done you should find the following files Installed here: C:\Users\[your username]\AppData\Local\apktool\Framework
1.apk
2.apk
• If, like me, you get an error with apktool that says it cannot write to C:\Users\[your username]\AppData\Local\apktool\Framework and instead has placed them in the temp folder then go into the Local folder using the pathway above and create a folder called 'apktool' and then a subfolder called 'framework'. Try the commands again and it should then work.
• You should also find the following files in the C:\apktool folder (if that is the folder you are using). If they are not here you may have to copy and paste them from the apktool github download.
apktool.jar
apktool.bat
• If you have found these files then you are set to go with decoding the theme/app you have chosen as a basis to amend.
3. Decoding APKs Using Apktool
• Download the apk/app you want to use. I used Backup and Restore app from Play to get the app I wanted to use onto my PC. Once you have this on your PC place the main APK/app in the same folder as the apktool.bat and the apktool.jar (for me this this was C:\apktool)
• Point the command prompt at this place and type the following:
apktool d [app name]
• A folder with the name of the app you just decoded will appear in the directory that you use (in this case C:\apktool)
• In this folder you should find another folder called assets. There may be more sub APKs here in subfolders. This subfolder will likely be assets>overlays
• All the sub APKs in here will have to be decoded otherwise you will have different signing keys and the app, once compiled again, will not work. Decode all the sub APKs in this same folder. You will have to copy the following files to the folder you are decoding the sub APKs in. These are:
apktool.jar
apktool.bat
• Decode every sub apk using the command apktool d [sub_apkname]
• You should now have the same number of folders in the drive as the number of sub APKs, if you decoded them all.
4. Changing the Colours and other Themes from the Decoded APKs Using Notepad++
• Many theme APKs will have internal APKs, such as common, settings, phone, systemui, calendar etc, etc. This is what I have worked out so far:
Common: Changes the switches, brightness bar and the text headings in settings, changes swipe left panels in apps such as gallery, changes background, message icon & phone icon colour in contact/phone app, statusbar background, separating lines in settings (some themes do not have these), background bar of setting title (i.e. wireless network, device etc), settings text colour, secondary text (i.e. the text you see under Wifi and Bluetooth which shows you what you are connected to), the headings in apps such as clock where it shows 'Alarm' 'World Clock' 'Timer' etc
System UI: Changes the quick settings tiles & text and the non-heading text in settings
• To change the colour of these you have to amend the colors.xml located in one of the folders in the assets>overlays and then the folder of the overlay you want to change. I used Notepad++ to do this. Navigate to 'res' folder and then usually something like 'values-xxxhdpi-v4'. There is sometimes more than one color.xml file so you may need to look in more than one folder and amend all the color.xml files. The colours are at the end of the lines of text and will be standard Android colour coding, such as ffffffff (white) or 00000000 (black) or any other colours.
5. Building APKs & Signing with Android Studio
• If you are building the sub APKs from an app (these are the ones inside an APK such as common, systemui, phone etc) I found it best to use a different folder. For this I used C:\apktool builder
• Copy and paste the folder from the decoded APK (e.g. the [appname].LGE.common folder) that is in the asset>overlays folder to the apktool builder folder above
• Once you have made the colour amendments it is time to build the amended themes. To do this you will need Android Studio
• Open the splash screen of Android Studio and instead of the 'Open' command use the 'Import Project' command and navigate to the folder you want to import
• When opening Android Studio you have to configure the frameworks otherwise you will not be able to sign the app. This warning should come up automatically. THIS MUST BE DONE FOR IT TO WORK
• Navigate and find your APK in apktool builder and import it. If you do this more than once you will be prompted to overwrite the settings a few times.
• Go to ‘Build’ along the top and choose ‘Generate Signed APK’. If this is the first time it will ask for the Key Store Path. You will need to choose ‘Create New’. Select a place to store this key (I chose C:\apktool Builder) and input the passwords and the other data in the boxes. You must put a two-digit country code in the last box, for example US, UK etc). For ease I kept most of these very simple. For example, password was 'asdfgh'
• Once this has been completed and if there are no errors (warnings are ok) then it will generate a signed sub APK and save it to the location you are in (in this case C:\apktool builder). Copy and paste that sub APK over the one in the C:\apktool folder where the original sub APK was kept.
• Once you have done this then you need to sign the main app APK. Do the same as above and build in Android Studio. If there are no errors it will save it to your directory (in my case C:\apktool\[app name].
• Copy and paste this APK into your phone, apply the theme and it should work.
Everytime you amend a sub apk you will have to re-sign it through Android studio and then re-sign the main app apk. Once you get the hang of it though it is fairly straight forward.
6. Other Things
Nothing else in the app will change at this point. The name, wallpaper jpegs, screenshots and icons will all be the same. I am working on this at the moment but they don't actually need changing that much. The difficult thing for me is how to change the 9.png icon files and still get them to work. Once I have worked this out I will be able to finish it off.
7. Screenshots
Attached are some screenshots of how my phone now looks. I have made a few different apk's with different colours so I can now change this daily if I want a change (see post 2 for updated screenshots).
8. Thanks/Credits
@xpirt - Made it easy to get the framework files I needed for apktool and for a great custom rom!
@Raafat - for giving me the idea and the initial information
@iBotPeaches - for developing apktool.
.
Building Your Own LG Theme
I've been able to fine tune the themes over the past few weeks and have been able to colour the settings icons on the main settings page as well as putting a background behind it. I've also been able to theme the switches initially getting over a problem of the 'off' switch not showing. Here is some updated screenshots of a green/grey&blue theme.
I've also attached the updated blue & red theme from the initial post. I've not fully completed this yet though as I started to concentrate on the green/grey&blue theme as I preferred that.
Could someone make a stock theme just dark? I found one on play store but is not the best thing (it changes system sounds and other things that i don't like) I'd like a full stock theme but dark. Thanks in advance
Help
Can you help me? I tried changing package names in .json file and added new icons in the theme. I don't understand why it is failing on apply. It was running properly with only color change before doing this.
[email protected] said:
Can you help me? I tried changing package names in .json file and added new icons in the theme. I don't understand why it is failing on apply. It was running properly with only color change before doing this.
Click to expand...
Click to collapse
Here is the apk.
I probably won't be able to get round to this until the weekend due to work commitments but will have a look and let you know.
strikerman10 said:
I probably won't be able to get round to this until the weekend due to work commitments but will have a look and let you know.
Click to expand...
Click to collapse
Take your time, and thanks. ?
[email protected] said:
Take your time, and thanks. ?
Click to expand...
Click to collapse
In case you haven't checked the apk I provided earlier, I have found and fixed some package name errors but the result is still same. It get stuck at 90% and then fails. I have changed icons too, is there anything needed to do in public.xml ? New apk is attached below.
strikerman10 said:
I probably won't be able to get round to this until the weekend due to work commitments but will have a look and let you know.
Click to expand...
Click to collapse
Did you took a look at it?

Categories

Resources