yashsingh1/xdaforums huggingface dataset:
[Hero, G2 Touch Android Development] rfgamaral:
Hi,

So, I'm trying to make my own custom ROM. Nothing too fancy, just a couple of simple and easy modifications to fit my needs but there's somethings I don't know how they work nor I understand them and I need some help. The only thing I was able to achieve as of yet was to remove some apps (I only tried to remove "Learn More" and QuickOffice to be honest-- but it worked). I just removed the .apk and .odex file directly from the .zip file, signed it and flashed it as usual. It worked fine.

Now, a few questions...

1) I also tried to add a few apps, just like in MoDaCo Custom ROM (MCR), to the /data/app folder instead of /system/app. Actually, I just copied all of .apk files from MCR /data/app into my own (with same folder structure of course). But they didn't get installed... I know I'm missing something and I can almost bet it has something to do with the /META-INF/com/google/android/update-script file. I tried countless times to search for some guide, how-to or just a piece of documentation about this file but I can't find anything. I don't want to just change it and see if it works and then screw things up. Can anyone give me some hints about understanding this file? It has to do with the fact that my /data/apps weren't installed, right?

2) I don't use the Gmail app, just the HTC Mail one. Is it safe to delete Gmail.apk and GmailProvider.apk? I believe Gmail.apk will be fine, but the provider one, I guess it's used by the data synchronization thing. Maybe it's ok if I don't sync my mail (that's what I want actually) but maybe there's something else that I'm missing and the system will not work properly, somehow, without the GmailProvider.apk or is it safe to remove it?

3) When we first install a new ROM, starting clean, there's an introductory guide allowing to setup some things initially. One of those is the language. There is a bunch of languages, specially like English (A), English (B), English © where the letters represent other languages. I don't need all that, I only need English (Portugal). Is there anyway I could remove the ones I don't want from the ROM or I would need to dig into the Android source for that?

3.1) How about adding my own language? Is there a way I could do that to my ROM?

NOTE: Funny thing, the Android system is localized on my country's language when I first start the device but as soon as I change it to English, I cannot change it back to Portuguese cause that option doesn't exist. How come the device is in Portuguese when I first start it up after flashing a new ROM? This also happens every time I swap the SIM card, but I can never select Portuguese language by myself. Why?

4) I noticed that after flashing my custom ROM, after booting the device for the first time, the mobile network was active. This is not good... For now I have 1 month free of mobile networking but that won't last forever. I don't want to waste money every time I'm trying a new ROM. Is there anyway to disable this thing from automatically starting up connected when I first boot?

For now that's it...
[Hero, G2 Touch Android Development] mopodo:
1. You need to edit "META-INF/com/google/android/update-script"
[Hero, G2 Touch Android Development] rfgamaral:
That's what I said... :/ But I also said:

If anyone knows anything helpful of course...
[Hero, G2 Touch Android Development] evilxhwnd:
I am also interested in a guide or walk through for making a ROM for the Hero.
[Hero, G2 Touch Android Development] jubeh:
You're missing copy_dir PACKAGE:data DATA:, so you're really not writing /data/app even if it's on the package. If you read through the update-script, you'll see that it starts by formating BOOT: and SYSTEM: and later on writes the contents of /system to SYSTEM: (with copy_dir) and writes the raw boot.img to BOOT: (with write_raw_image).

Add the line to the very end of the permissions settings (but before format and write boot, most likely, before the show_progress line). You also need to set a specific permission after writing anything to /data/app from an update-script, otherwise your market won't be able to install anything (as you'll have changed the permissions for /data/app through the update-script).

In all, your update script will look like this (assuming a regular update-script, not the mcr 2.9 one):

...
symlink toolbox SYSTEM:bin/xxxxyyyy
...
set_perm 0 0 04755 SYSTEM:bin/su
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app
show_progress 0.1 10

show_progress 0.2 0
write_raw_image PACKAGE:boot.img BOOT:
show_progress 0.2 10

It's safe to remove both, though the provider doesn't do much without the app, so it's also safe to leave it there.

Hero roms take their settings from xml files in /system/customize. You'll see a bunch of xmls in there. Some are references to other xmls to be used (mns_map and cid_map), some are default settings (default.xml, COMMON.xml) and some are carrier specific settings (/CID/HTC_*.xml and /MNS/Lan_*.xml). The files are very redundant, and it's hard to tell which one is being used when, though, as a rule, you should understand that Hero loads a default from the /customize folder and then looks at mns_map and cid_map for the file to use inside /CID and /MNS. I'm not yet aware how it chooses the file, but, if you narrow down it's choices, then you can control which ones it uses and modify the settings there. If you crack open the xmls, you'll immediately see the languages defined in there (en_US, en_GB, etc), so removing languages is a matter of deleting the lang/region and adding your own (en_PL?). Again, there's so many xmls in there that it's hard to know which one to use, so either make your own and delete the rest, or edit them all. I'll give you the batch that I use in my /customize, reading through them should help you understand what's going on with those xmls.

Look above, it's because the language is obtained from the carrier and used during first boot, but it's not defined in an xml, so it's unavailable, make it available by adding it to the list.

This I'm not sure about. You could try emptying your /system/etc/apns-conf.xml so that it won't be able to register to any data service (just leave the <apns version="x"> </apns> tags, remove everything in between).

Good luck.
[Hero, G2 Touch Android Development] rfgamaral:
That's what I thought but I'm still missing one thing...

The generic HTC "update.zip" has

format: DATA

for the last line of the update script, which I suppose will delete everything becuse the copy_dir command was executed before.

Should I not use the format data option? Won't that leave traces of a previous installation if I want to start clean? What's the recommendations or suggestions?

What will happen to the data-sync when i tries to sync the data and finds the provider for gmail is not there? Will it simply be ignored? Will there be any errors changing any of the options (specially the gmail one) on the data synchronization settings?

I'm familiar with XML files and have no problems editing them but this whole thing was a little confused specially because there are no documentation and like you said, it's hard to tell which one is which.

I know you kinda suggested that but I'm no seeing how to do it (maybe with the file you attached?) but, how could I start clean, only have default XML files and nothing else, no carrier specific stuff, no bulk, just plain default settings that I can tweak to my own liking.

Any hints on how to do that, or it's hard to tell and you don't know how to do it either?

Unfortunately, this did not work :(
[Hero, G2 Touch Android Development] jubeh:
I've never understood why the default update script does that, but yeah, format DATA: will erase userdata available. It might not be such a bad thing if you hadn't written anything to it before. For a wipe before install, move format DATA: (and, optionally, also add format CACHE: ) right after format SYSTEM: and before you start writing anything to disk. It should give you a clean install without having to wipe from the recovery menu.

I've not tried it yet. Worst case scenario, you'll get the current problem we have with eclair builds (sync will just keep running and eat out battery because it's looking for a service). That's why I'd suggest leaving gmail provider there, it's just a broadcast service, but without an app to receive the data, it'll do nothing. If your concern is data usage due to sync, then you should turn off gmail sync in settings, that way only calendar and contacts are synchronized (although you'll still be using data).

The files I attached are pretty generic. It's meant to replace your /customize folder, not add to it, with the exception being /resources inside /customize, that one I use a lighter version (no footprints) but I didn't include it in the archive for size. I have no carrier stuff there, just settings for language (I think I made it all en_US, replace or add what you need) and layouts for the different scenes, some mail app behaviors (added back the Yahoo! mail and AOL mail options, I think), some footprint, stock, and weather information. Again, it's meant to replace your /customize directory and the smaller amount of files makes it way easier to edit.

Blame the xmls in /customize for that. I mentioned earlier I don't exactly know how the system picks which xmls to use, I think it looks at your carrier, which is then assigned a number (for example, let's assume T-Mobile is given number 238, so xmls with 238 on them will be loaded). Problem is inside those xmls are also apn settings (which I've removed from the files I provided so that the system looks instead for apn settings in apns-conf.xml in /etc).

You could flash your system erasing the whole /customize directory (and removing all mentions of it and it's sub-directories from the update-script so that install doesn't fail). Doing that will give you ALL languages available to the rom, but you'll also lose all your pre-loaded settings (like scenes, weather locations, footprints, stocks) and HTC Setup will take an ungodly amount of time to start (about 4-5 minutes after it's done dexopting) while it builds it's own default settings. It's another route you could take, though. Experiment and you'll eventually hit what you want/need.
[Hero, G2 Touch Android Development] rfgamaral:
OK, I guess I'll have to waste some time testing all this stuff, but I suppose I'll leave that to some other day and do more basic things for now.

But just to be sure, if I use your "customization" I'm basically starting from scratch (clean, defaults) and I can use the "old" customization stuff to understand how am I supposed to configured everything and adapt the clean customization folder to my needs. Right?

This gave me an idea, dunno if it could work...

What if I did that, erase everything inside customize, let the system build its own default settings and then access that directory (through ADB maybe?) and see what the system has created. It should be much more cleaned, without all those carrier XMLs and stuff. Then I could start from there, what do you think?

I have a few more questions about the update-script if you don't mind, but I'm very tired to write them and discuss them now. I'll leave them for another day if you don't mind coming back here and help me out some more.

Thanks for all your help so far :)
[Hero, G2 Touch Android Development] jubeh:
I should probably have mentioned, some of the stuff on those xmls is pretty straightforward (setting language, region, weather, footprints, etc), but a lot of it (setting up default shortcuts, default widgets, system settings) requires working knowledge of android, or at least of how activities are handled and how xmls come into play and how android references the different activities in a package.

On a different note, the xmls are read-only configuration files, actually, anything in system is read-only data (program data, configuration data, resource data), so if you don't have a customize directory the system won't recreate it. What the system does do during normal boot (factory) is to take those carrier-specific settings and apply them to a file(s) in /data where configuration settings are ultimately written/re-written and accessed at will. The xmls are just a database of the settings that will ultimately get picked. When you don't have a /customize directory the system writes the settings straight to -rw enabled /data partition based on things like your current carrier, carrier provided information for locale, etc.

I don't think you can take what's written to /data and use it on a default install package, well, you could, but it's much easier (and a more correct approach) to learn how those xmls in /customize work.
[Hero, G2 Touch Android Development] rfgamaral:
I wouldn't mind doing that if there was some kind of documentation... As it is right now, it's too confusing and there are too many XMLs to begin with...

But if I leave the gmail provider there and do not turn off gmail sync in settings, my e-mail will still be synced right? There's just no Gmail app to view them but they are still going to be downloaded, correct?
[Hero, G2 Touch Android Development] rfgamaral:
Ok, I finally got a change to test the Gmail/GmailProvider thing and it didn't look like there any problems like trying to sync and draining the battery. Actually, if auto-sync was enabled, there was always a message saying the mail was never synced and no matter how many times you check/uncheck it, it wouldn't sync. If auto-sync was disabled, you could press the gmail button many times but nothing happened, no sync at all (of course).

I think this behavior is fine and I can safely delete the Gmail and provider from the phone without worrying that something will go wrong :)

Ok, now my other questions that I said I was going to post later...

As we talked about, you suggested to add a format data and cache right after a format to system. Comparing that to the MoDaCo ROM (and other ROMs too) it's common for them to, instead of formatting data, they do this:

delete DATA:app
delete DATA:init.sh
delete DATA:local
delete DATA:dalvik-cache
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app

Why are they doing this? If they are not formatting, it means there's something inside data that they want to keep. Have any idea what and why?

The other question I had about the update-script is that the following two lines are found in the original HTC update but not on MoDaCo's:

symlink dumpstate SYSTEM:bin/bugreport
symlink dumpstate SYSTEM:bin/dumpcrash

Are they relevant somehow? Should I just ignore and leave them there or remove them just as MCR did, for some reason?

There's a file named build.prop inside the system folder. I've already searched countless times and can't find any proper documentation about this file... It seems it can hold various default properties for the system and it would be nice to know what I can configure there. Maybe I could workaround problem #4 (top of the topic) in this file? Maybe some file in the Android source has comments about the possible properties on this file? Do you have any idea?

One last thing...

I've read about odex and dex files but found it a little confusing... All I know is that original HTC updates come mostly with .apk files and a corresponding .odex file. But most (if not all) custom ROM's, do not have the .odex file but have a classes.dex inside the apk. What's the real difference between the two? And why custom ROMs prefer to have the .dex file instead of the .odex, is it better somehow for some reason? If so, what should I do to "change" the .odex files into classes.dex ones and put them inside the .apk files?
[Hero, G2 Touch Android Development] rfgamaral:
So, to make it clear, I could:

Option A) Add format DATA and format CACHE to my ROM and this would make my ROM to automatically wipe everything and start clean.

Option B) I could not add anything (no formats and no deletes) and warn the users to explicitly perform a wipe before flashing.

Option C) Add delete DATA:local and DATA:dalvik-cache and have a no-wipe ROM where the apps would be preserved from the last ROM, right?

Ok, I don't use a2sd and for now have no intention in doing so. My best guess is to start with option A for now and maybe opt by using some app to backup everything and restore everything back after flashing a wipe ROM. Or I could go with option C and everything could work fine but there's a chance I could run into some issues in the long run.

Well, I'm currently basing my ROM on 2.73.405.38 as the .66 one has "test" on the name and it feels like a beta version, which I'd rather not use. The .38 version uses .odex files for most of the packages (only a few has classes.dex inside) and I guess I'll leave them like that. If future ROMs, like that .66 one, comes with classes.dex vs .odex files, well, then I'll just leave it like that...

That looks like a very important thing in Android apps and at the same time something that I should be very knowledgeable about before messing with it, so I'll just stay put :)

Thanks once again for taking your time with such complete answers :)
[Hero, G2 Touch Android Development] jubeh:
Sounds like you got it.

Test only refers to the build being signed with test-keys instead of release-keys. In my testing, it makes no difference whatsoever for a rooted user, and there's many theories floating around about signatures, I haven't researched signatures a whole lot because test-keys have worked fine enough for me, so I'm not so sure, but they seem to be working fine for all.

The reason those releases are un-odexed (and signed with test-keys) is because of the problem with odexes I mentioned earlier. When HTC is testing their rom packages and they need to make, say, a framework change, all the apps with odexes would fail as the framework has changed, so, for testing purposes, it's best to leave the apks and jars in the build full (with classes.dex inside). Once you know your build is solid and you won't be changing much, it's safer to odex the whole thing (sort of like me, I'm waiting for the final release of eclair for ADP1 so I can put out a Dream rom odexed and fully working).

No problem, I get bored at work :eek:
[Hero, G2 Touch Android Development] rfgamaral:
So, version .66 is not beta or anything? I know MoDaCo has his latest ROM based on that and you're saying they are only different in the signing key, still, it's somewhat a "leaked" build, not quite "official".

But hey, if others are using it without any issues, maybe I should be using it too :)
[Hero, G2 Touch Android Development] rfgamaral:
On second thought...

1) I can't find a pre-rooted .66 version and I don't know how to root it :/

2) There's lots of files in system/xbin that I don't see referenced anywhere (not even in the update-script) and I don't know what should I do with them.

I'm finding it much more confusing to base my ROM on .66 than on .38...
[Hero, G2 Touch Android Development] jubeh:
It is a beta, of sorts, but between it and the final shipping product there's not much difference. It's just much, much easier to work with it.

1.) The simplest form of root is to change ro.sercure to 0 in default.prop in the boot ramdisk. Adding a su binary/Superuser.apk is optional, those you can pull from one of paul's builds.

2.) The system/xbin is added to the boot classpath in the boot ramdisk in init.rc. The only mention of it in in update-script is the permissions for the whole folder and then just a couple permissions for some tools, not all of them.
[G1 Q&A, Help & Troubleshooting] Markos:
I'm new with android and have been reading all day. I want to downgrade my HTC Dream so I can root it. I have a Dutch phone with the following firmware:

Firmwareversie 1.6

Smalbandversie 62.50S.20.17U_2.22.19.26I

Kernel versie 2.6.29-00479-g3c7df37 android-build@apa26 #19

Build-nummer DRC92

What do I have to do to downgrade it? I followed this tutorial but it fails right in the beginning.

http://wiki.cyanogenmod.com/index.php/Full_Update_Guide_-_G1/Dream_Firmware_to_CyanogenMod

I should use RC7 because I have a dutch phone? When I format my sd-card to fat32 in windows and put the RC7 file on it (DREAIMG.NBH) and go to the bootloader I will get the following message:

what am I doing wrong? Please help me.

(I also get the same error when I use the RC29)

Some extra info out of the rainbow screen:
[G1 Q&A, Help & Troubleshooting] red.Wood:
If I'm not mistaken, yes you should use RC7.
[G1 Q&A, Help & Troubleshooting] B-man007:
you need to make a goldcard

follow this guide

http://xdaforums.com/showthread.php?t=547557
[G1 Q&A, Help & Troubleshooting] daantjuhh:
Hey, ik heb hetzelfde probleem, ook met DRC92, en in mijn rainbow screen staat precies hetzelfde. Is het je al gelukt om te downgraden? Ik heb die goldcard-methode ook al geprobeerd, maar tevergeefs ...
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Fab985:
CM-XOR TEAM IS PROUD TO PRESENT:

CM-XOR Fab985 HTC SENSE WM 6.5.3

HTC SENSE 2.1 | HTC SENSE 2.5 | Wm 6.5.3 | 28008 | OEM 1.90

HTC SENSE 2.1 ON LINE! | HTC SENSE 2.5 ON LINE!

|SCREENS|DOWNLOAD|FEATURES|ARCHIVE|

​

Performe an hard reset after the flash

I'm not responsable of any damage to your device

PLEASE use HARD-SPL

THANKS TO:

Ervius/bepe for visualkitchen and tools

Udk for Custom Ruu

Olinex for Hard-spl

Da_g for sharing sys

Rotastrains for 2.5 landscape

All CM-XOR TEAM

My testers

sorry if i've forgot someone

This is my last Tp2 rom, i'm moving to HD2 :cool:
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Fab985:
screens & video

​
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Fab985:
DOWNLOAD​

CM-XOR Fab985 HTC SENSE 2.1

CM-XOR Fab985 HTC SENSE 2.5 Landscape work
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Fab985:
FEATURES:

OEMDrivers 1.90

SYS/XIP 28008

HTC SENSE 2.1 /2.5 Land

INTERNET:

Live + Messenger NEW!

MSFacebook

Condivisione Internet

Internet Explorer

Skyfire

Youtube

Opera 10 beta 2

MULTIMEDIA:

Album

Jblend

Booster Audio

Streaming Media

Fotocamera

Immagini e Video

Windows Media

TOOLS:

Clean Ram

Activesync

Task Manager from X2

OFFICE TOOLS:

Adobe reader

Contatti

Attività

Calcolatrice

E-mail

Sms

Note

Calendario

OFFICE MOBILE:

Word

Excel

One

PowerPoint
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Fab985:
ARCHIVE​

CM-XOR Fab985 HTC SENSE 2.1 WM6.5 v1.0
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] bluieorbluee:
looks great man!
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Mil3:
T..t..tt..t..ttt...today?:D I can't wait to try it!
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] vikramdhani:
well looking forward to this release :)
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] llllllllll:
Any update on this release?
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] muttim86:
Great work, my PRO2 need this rom NOW :D

EDIT: NO HTCMessage client!!
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Fab985:
CM-XOR Fab985 HTC SENSE 2.1 ONLINE

CM-XOR Fab985 HTC SENSE 2.1 ONLINE!!!!!!
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] muttim86:
When you release the rom with the sense of 2.5? :rolleyes:
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] Fab985:
CM-XOR Fab985 HTC SENSE 2.5 NO LAND !!!!!!!!!!

CM-XOR Fab985 HTC SENSE 2.5 NO LAND ONLINE!!!!!!!

Added some screens
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] muttim86:
You are faster than light! thanks friend for your masterpieces!
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] SMADA_MUSIK:
ok don't kill me for this question but is this a CDMA ROM?
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] davidebeatrice:
Hi Fab985

thx for yor work...

but...office not working at all in 2.5 no land version...:(
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] jojordy:
Good job.

Some little questions:

Videocall working?

If yes, the images of the video call are misaligned?

(there is a little black line over the image?)

Thx
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] TheAgent1982:
WWE version

Looks promising and great ROM!

Any chance for WWE version?
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] VizagDude:
How about a WWE version of this ROM?
[Touch Pro2, Tilt 2 Windows Mobile ROM Development] rvashi:
WWE version PLEASE! :)