[Q] Making / editing custom ROM's using Linux - Android Q&A, Help & Troubleshooting

I'm looking for a little bit of help with understanding something.
My ideal place to get to is to eventually provide the community here with custom roms and mods which everyone can enjoy on their devices, just like what all the greats devs do here day in day out.... but before I get there, I'm on a path of discovery. At the minute, I want to take a XDA dev's already pre worked ROM, go in to it and change a few things up.... edit the apps, maybe play with a few apks, change the ringtones etc, and then resign the ROM and flash it to my device.
I've been reading some great tutorials such as http://forum.xda-developers.com/showthread.php?t=1801690 and http://forum.xda-developers.com/showthread.php?t=1843506 which I am finding very helpful, however....
They seem to be geared towards someone working on a windows machine. I dont want to do it in Windows, I want to do it in Linux... I dont wish to use "CygWin" and I would rather do it manually than use a kitchen - I could easily follow these guides in Windows and achieve my stated aim of a slightly modified custom ROM, however, the overall goal here is to acquire knowledge, and enjoy the process as it goes along.
Now, my current understanding under Linux (Mint 13) is that I can download a recovery flashable Zip, go in to it, and just change up some of the files as I desire.... but then I get confused when it comes to repackaging the ROM prior to flashing it to my device. How would I go about doing this?
As a side note, when it seems that all development for these devices is done under Linux / Mac... why do all the newb guides steer you to Windows?

Are you asking how to rezip or how to recompile?
If you're asking about zipping up the folder, go here:
http://forum.xda-developers.com/showthread.php?t=1499885
If you're asking about recompiling, it should state how to do so on the page you got the apktool from.

Hi, thanks for your reply. I guess for now what I am asking is how to get the ROM back to a flashable zip file.
The I believe is that you need to have the ROM signed. The windows tutorials point you to a batch file script that does the signing and creates you an "update.zip" file. What id the alternative to this under linux?
Also, in the post you just provided a link to, someone says that you must also edit an update script to reflect the changes you made, such as any apks removed or added etc, where would I find this?

You need signapk.jar which I believe is included in the android sdk if not just Google and you can find it, once you have that you need a key to sign with, again Google for a testkey.
Then in your terminal you would run:
Code:
java -jar signapk.jar certificate.pem key.pk8 your-update.zip your-signed-update.zip
Sent from my PACman GT-I9100 using xda premium

Excellent, thank you very much.. will play with this later

Related

[Q] Learning to Create ROMs: How Do I Port a ROM from One Device to Another?

So I'm trying my luck at ROM creation and am learning as much as I can. One thing I haven't been able to find through Googling etc is how to port a ROM from one device to another, or more specifically what folders/files need to be replaced in a ROM to make it work on another device?
Appreciate any guidance, thanks guys!
PS I'm using DsiXDa's Kitchen, but it "doesn't support any devices besides HTC devices" and I want to port a ROM to a Dell Streak from an HTC Nexus One. Is it even possible and what files can I manually replace to get it to run?
dcogen said:
So I'm trying my luck at ROM creation and am learning as much as I can. One thing I haven't been able to find through Googling etc is how to port a ROM from one device to another, or more specifically what folders/files need to be replaced in a ROM to make it work on another device?
Appreciate any guidance, thanks guys!
PS I'm using DsiXDa's Kitchen, but it "doesn't support any devices besides HTC devices" and I want to port a ROM to a Dell Streak from an HTC Nexus One. Is it even possible and what files can I manually replace to get it to run?
Click to expand...
Click to collapse
I'm looking at a Streak ROM right now, and it looks fairly standard for Android. I would search for 'vendor tree' and/or 'extract-files.sh' to get an idea about what files and settings you might need. That will get you started. You have to swap kernels, that's a given. You'll probably need a few additional things from a stock Streak ROM, like:
files in:
/system/usr/keychars
/system/usr/keylayout
/system/lib/hw
/system/lib/modules
/system/etc
some libs in /system/lib
Probably a few things from /system/bin and /system/xbin
Look at the *.rc files in both the N1 ROM and the stock Streak ROM. They will call binaries and make changes. It's all tied together and is quite complex for such a 'small' thing... Get ready to do some research and testing and don't expect it to just work right away. If it does, your lucky.
I use WinMerge to compare ROMs all of the time. It will give you clues as to what is needed for the ROM to work on your device. And logcat will also point you in the right direction on occasion
Thanks a bunch gnarlyc!
Least I have a starting point now, going to get to Googling and see what I can figure out. And WinMerge is an awesome tool, thanks for that. I'll post back here if anything. Thanks again!
Anyone else have some information to share as well that could help?
EDIT: How do I get WinMerge to work? I installed it and tried to compare the two .zip files and it just shows jibberish in each window?
dcogen said:
EDIT: How do I get WinMerge to work? I installed it and tried to compare the two .zip files and it just shows jibberish in each window?
Click to expand...
Click to collapse
Well, it shouldn't show gibberish. I have it up right now with two init.desirec.rc files from two different ROMs. It's not going to be able to compare .zips though. Only text files and folders. You'll have to unzip those.
There are other programs that do the same thing, like 'N-way folder compare' and 'Beyond Compare' and plain old 'diff' in Linux or cygwin. Find what works best for you.
gnarlyc said:
It's not going to be able to compare .zips though. Only text files and folders. You'll have to unzip those.
Click to expand...
Click to collapse
I actually found that they have a .zip plugin to allow you to compare .zips and I tried to install it but it just isn't working. When I try to unzip them and just select the unzipped folder it opens it in the selector window instead of just using the folder.
I'll keep messing with it, thanks again for the starting point at least

noob who wants to learn

I want to learn how to theme. I've read this guide http://forum.xda-developers.com/showthread.php?t=916814
I Think i understand the process of editing images, I'm not a noob when it comes to photoshop, but i get a little frustrated when it comes to the topic of signing. I have a windows vista system, and section two of this https://docs.google.com/Doc?docid=0AcdxIJRSH9ypZGZzc2pxNDlfMjdnazk4OHNxZA&hl=en states that signing in vista causes bootloops unless you take other steps. The directions for XP seem so straight forward, is there a way to sign without all the hassle that vista seems to cause?
I've been told that if you use another theme for a base, resigning is not needed. I'm a noob at this also, really wanting to learn.
thenaut said:
I want to learn how to theme. I've read this guide http://forum.xda-developers.com/showthread.php?t=916814
I Think i understand the process of editing images, I'm not a noob when it comes to photoshop, but i get a little frustrated when it comes to the topic of signing. I have a windows vista system, and section two of this https://docs.google.com/Doc?docid=0AcdxIJRSH9ypZGZzc2pxNDlfMjdnazk4OHNxZA&hl=en states that signing in vista causes bootloops unless you take other steps. The directions for XP seem so straight forward, is there a way to sign without all the hassle that vista seems to cause?
Click to expand...
Click to collapse
When it comes to basic themeing, you don't need to sign anything....its a matter of extracting and re-zipping the apk without signing it so it keeps its original signature...then you would add all your themed apks in a CWM flashable zip(that isn't signed either).....use APK Manager....it works wonders for theme devs
Mr. Apocalypse said:
When it comes to basic themeing, you don't need to sign anything....its a matter of extracting and re-zipping the apk without signing it so it keeps its original signature...then you would add all your themed apks in a CWM flashable zip(that isn't signed either).....use APK Manager....it works wonders for theme devs
Click to expand...
Click to collapse
Thanks man,
If i'm understanding you correctly you are basically saying that if i take from an existing theme i don't have to sign. but i create my own theme based off of a rom i need to sign it?
EDIT: nevermind, i mixed both responses up and with my question. i'm a little off today
thenaut said:
Thanks man,
If i'm understanding you correctly you are basically saying that if i take from an existing theme i don't have to sign. but i create my own theme based off of a rom i need to sign it?
EDIT: nevermind, i mixed both responses up and with my question. i'm a little off today
Click to expand...
Click to collapse
Ok...let me try to clarify this...if you're new to theme developing, get "signing" out of your head
You would only need to sign an apk if it was being installed...
When you theme, nothing is being "installed", all of the original apks that are in your /system/ directory are replaced with your themed ones while flashing....
YOU NEVER SIGN AN APK THAT IS BEING SENT TO /system/ DIRECTORY
In reality, no themed apks are signed, because they are sent to the /system/ directory....its just a matter of extracting the stock apk, make your mods, and re-zip. As a said above, if you use Apk Manager, this will be a breeze
Mr. Apocalypse said:
Ok...let me try to clarify this...if you're new to theme developing, get "signing" out of your head
You would only need to sign an apk if it was being installed...
When you theme, nothing is being "installed", all of the original apks that are in your /system/ directory are replaced with your themed ones while flashing....
YOU NEVER SIGN AN APK THAT IS BEING SENT TO /system/ DIRECTORY
In reality, no themed apks are signed, because they are sent to the /system/ directory....its just a matter of extracting the stock apk, make your mods, and re-zip. As a said above, if you use Apk Manager, this will be a breeze
Click to expand...
Click to collapse
Thanks, You've helped a lot. can't wait to start. I have to go to work though, so tomorrow, hopefully.
thenaut said:
Thanks, You've helped a lot. can't wait to start. I have to go to work though, so tomorrow, hopefully.
Click to expand...
Click to collapse
If you have any other questions, PM me....i'm always willing to help someone who is willing to learn.
What I do when i want to change something... example I made my own lock screen.
If it was already explained how to do this... im sorry for wasting your and mine time... I only have about 5 minutes so I cant read everything before i post this... but this is what i do when i want to edit the theme.
I put the rom on my computer and extract it... locate the files I need to edit, (they are alwas going to be in the res folder of an extracted .apk and then in a drawable folder.) I take the files i want and I edit them. put them back on my phone... copy the framework-res.apk from systems>framework>framework-res.apk and then put it in a folder i created on my sdcard.
Using Astro File Manager I select my edited files and copy them.... then click on framework-res.apk and select browse and past my edited files into the framework-res.apk then using root explorer I then copy my edited framework-res.apk and paste it back in system>framework>framework-res.apk

[Q] Android Kitchen - by dsixda, HTC Amaze 4G

I want to use the android kitchen to turn our recently leaked ICS update into a rom. On Dsixda's thread, he states that we need to create a file in the kitchen's /tools/edify_defs folder with the properties of our phone, in the templates file, it is kind of unclear for me how to do this.
Can anyone help me create a file for the HTC Amaze 4G? Thanks
HuskyHamburger said:
I want to use the android kitchen to turn our recently leaked ICS update into a rom. On Dsixda's thread, he states that we need to create a file in the kitchen's /tools/edify_defs folder with the properties of our phone, in the templates file, it is kind of unclear for me how to do this.
Can anyone help me create a file for the HTC Amaze 4G? Thanks
Click to expand...
Click to collapse
Sorry if I am reviving a not quite old thread, but it came up when I was searching for the kitchen to download on my new windows install..
If you want to create a rom you don't really need the kitchen, it can do certain things to a rom- deodex, zipalign, install superuser and busybox, etc.. but within a few days of the leak all of that is available. You can pm a developer as I did and get permission to use their files rather than recreate the wheel.
First, just run the zip file thru the kitchen, don't do anything special with it- we have a superuser zip file you can/should just unpack into the final setup.
Find the updater-script and the binaries(in the same folder), this is what tells it what to install and where, fix permissions, install the files needed for SU(look in the superuser zip files updater script for details) etc..
If you want a deodexed rom you can ask to borrow the system/app directory from a rom that already has deodexed theirs. Literally, this is the best way to do it.
What the kitchen IS better for is pulling apart the kernel, putting it back together, unpacking apks.. it has built in scripts which can be a real time saver than typing in backsmali this, smali that-- simply put a file in a folder, type a number, and magically it all happens for you.. but you won't need ANY of that until you get into the advanced stuff.
I don't know if you were still trying to figure it out or not, but at the very least this may give someone who happened across this thread SOME sort of answer-- I get sick of finding more unanswered posts or posts where people reply with "you should search".. I've searched so much I my fingers should be bleeding.

[KITCHEN] A.O.C.P(Android.Optimization.Customization.Program ) ,v0.1 [By Moihack]

Are you tired of all these very long written guides lying around about how to cook your own ROM?
Do you cook a lot of ROMs and just get bored of doing the same things again and again to optimize it?
Are you a beginner who wants to start cooking ROMs but don't know from where to start?
Whatever the reason, cooking an android ROM was never easier in the past.
I wrote this program on Microsoft Visual Studio 2010
Language is VB.NET
Built against NET framework 2 , so it should run on any Windows Machine running XP or newer
It may run on Linux under Wine but DIDN'T TEST
How to use:
1)Download the .zip file attached below
2)Extract to a directory of your choice
3)Open AOCP.exe - please do NOT change/modify/delete any file from the extracted .zip path(unless you know exactly what you are doing) because program may start to misfunction during certain operations
4)After you see the ugly as hell GUI I designed start cooking
4a)click browse to select the ROM .zip file you want to cook/mod
4b)(optional) select an extract path - otherwise the rom will extract at Desktop/AOCP/
5)When finished choosing your mods click apply changes and wait for completion message
6)Close the program
7)After that make a new .zip out of the recently modified rom files (you need a program like 7-zip or WinRar to do this)
8)Flash your OWN cooked ROM and enjoy a really slim and fast system!
Note1: If kitchen deletes an app you want to keep, you can edit appslist.txt with notepad and add at a new line the name of the .apk you want (e.g. Music.apk)
ΝΟΤΕ2: As usual I don't take any responsibility if something bad happens to your phone after flashing a rom made with this software. You have been warned!
Special Thanks:
dsixda for his great rom kitchen, inspiring me to make this (in my opinion) useful tool
Xenova for this GPS thread here : http://forum.xda-developers.com/showthread.php?t=1239713
TheFrankenstain for his all in one build.prop tweak : http://forum.xda-developers.com/showthread.php?t=1510652
forever king for his great build.prop & init.d tweaks collection : http://forum.xda-developers.com/showthread.php?t=1808791
P.S. I also attach the Project Files below because I like the open source ideal very much and in case someone wants to study the source code (although I don't suggest this, since my coding skill are not very good and my code is badly written and explained most of the time )
This looks interesting....gonna have to give it a run
Sent from my HTC Glacier using xda premium
I will try it later thanks
Moihack said:
Are you tired of all these very long written guides lying around about how to cook your own ROM?
Do you cook a lot of ROMs and just get bored of doing the same things again and again to optimize it?
Are you a beginner who wants to start cooking ROMs but don't know from where to start?
Whatever the reason, cooking an android ROM was never easier in the past.
I wrote this program on Microsoft Visual Studio 2010
Language is VB.NET
Built against NET framework 2 , so it should run on any Windows Machine running XP or newer
It may run on Linux under Wine but DIDN'T TEST
How to use:
1)Download the .zip file attached below
2)Extract to a directory of your choice
3)Open AOCP.exe - please do NOT change/modify/delete any file from the extracted .zip path(unless you know exactly what you are doing) because program may start to misfunction during certain operations
4)After you see the ugly as hell GUI I designed start cooking
4a)click browse to select the ROM .zip file you want to cook/mod
4b)(optional) select an extract path - otherwise the rom will extract at Desktop/AOCP/
5)When finished choosing your mods click apply changes and wait for completion message
6)Close the program
7)After that make a new .zip out of the recently modified rom files (you need a program like 7-zip or WinRar to do this)
8)Flash your OWN cooked ROM and enjoy a really slim and fast system!
Note1: If kitchen deletes an app you want to keep, you can edit appslist.txt with notepad and add at a new line the name of the .apk you want (e.g. Music.apk)
ΝΟΤΕ2: As usual I don't take any responsibility if something bad happens to your phone after flashing a rom made with this software. You have been warned!
Special Thanks:
dsixda for his great rom kitchen, inspiring me to make this (in my opinion) useful tool
Xenova for this GPS thread here : http://forum.xda-developers.com/showthread.php?t=1239713
TheFrankenstain for his all in one build.prop tweak : http://forum.xda-developers.com/showthread.php?t=1510652
forever king for his great build.prop & init.d tweaks collection : http://forum.xda-developers.com/showthread.php?t=1808791
P.S. I also attach the Project Files below because I like the open source ideal very much and in case someone wants to study the source code (although I don't suggest this, since my coding skill are not very good and my code is badly written and explained most of the time )
Click to expand...
Click to collapse
good work moihack big thanks ....
Just found this thread, sounds like a funky project!
Do you guys know of an equivalent GUI for Linux?
SecUpwN said:
Just found this thread, sounds like a funky project!
Do you guys know of an equivalent GUI for Linux?
Click to expand...
Click to collapse
Ctrl+alt+t
Sent from my Nexus 4 using xda app-developers app
gazhead said:
Ctrl+alt+t
Click to expand...
Click to collapse
ignore list.

[Q] Modifying smilies in LatinImeGoogle.apk

I've seen previously that you can modify 'more_keys_for_smiley' in LatinIME.apk to modify the predefined smilies in the keyboard ( http://forum.xda-developers.com/showthread.php?p=23362533 ).
I'm trying to do this for LatinImeGoogle.apk.
I've got it decompiled with apktool, but I can't seem to find where 'more_keys_for_smiley' is defined to change it. The only reference to it inside of that apk is in key_styles_common.xml where it has:
<key-style latin:moreKeys="!text/more_keys_for_smiley" latin:backgroundType="functional" latin:keyOutputText=" " latin:keyLabel="" latin:keyLabelFlags="hasPopupHint" latin:styleName="enterKeyStyle" />
Can anyone help me locate more_keys_for_smiley so I can modify it? Does the "!text" refer to a different package?
Thanks in advance for any help.
Ok, thanks to someone's help I was able to figure out that the string is now located in the odex file for the keyboard. I was able to deodex LatinImeGoogle.odex using baksmali and edited the file com/android/inputmethod/keyboard/internal/KeyboardTextsSet.smali. I then used smali to recreate the odex file, but pushing it to my device and rebooting causes the keyboard to not load. Do I need to do anything special with this new odex file?
I tried following tutorials ( http://forum.xda-developers.com/showthread.php?t=1208320 ) and using automatic batch scripts ( http://forum.xda-developers.com/showthread.php?p=31360029 ) for recreating the new odex file and copying the signature from the old one, but I could not get it to work. At best I got the keyboard to load and instantly crash, at worst it wouldn't even load the keyboard upon boot.
Anyone want to offer some advice or take a stab at this?
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
PrettyPistol555 said:
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
Click to expand...
Click to collapse
Yes, you should be able to modify KeyboardTextsSet.smali and then recompile and install the keyboard. I never achieved any success because I'm on an odexed ROM and couldn't get reodexing to work properly.
Tried but no joy, then realized it could be because the apk was from a previous nightly (couple days) than the one currently installed. Crossing my fingers that it's the reason it didn't work.
I'll try again.
sent from my vzw Galaxy Nexus / CM10.1 (nightlies)

Categories

Resources