[Q] Odexing and dalvik-cache - Tilt, TyTN II, MDA Vario III Android Development

I have two questions, but they are related, so I thought they could go in one thread:
1. How can I odex the system framework? Odexing the system apps seems to work on the phone, but it freezes when I try to odex the framework. I called the script from userinit.sh instead, but that didn't work either. What is the proper way to do this??
2. For unodexed systems, there is a dalvik cache for data apps in /data/dalvik-cache an also one for system apps and framework in /data/tmpcache/dalvik-cache.
Clear dalvik cache in the boot menu only clears the first one. If the second one was cleared as well, a lot of cases of corruption could be fixed by selecting clear dalvik-cache from the boot menu without needing to wipe data!
The line that does this is line 34 of initrd/./bin/instscripts/cleardalvik
Code:
/bin/rm -Rf /data/dalvik-cache
and "/data/tmpcache/dalvik-cache" needs to be added as well.
Can someone add this, or let me know how and I will do it.

I'll look into question 2 in a bit I can never be arsed with odexing so i'm not very clued up on that, if i'm going to odex a build i usually do it when it is compiled rather then after it is installed. There are others on the forums who odex their builds from a script though so i'm sure someone will be able to help you out.

Ah, so it's a compile option.
I just find that with an odexed build, I never get any "fatal" corruption, I just have to re-enter my email settings in every couple of days, and I can generally use the same build for months without reinstalling.
Then again, 2. might help a bit with this for unodexed builds
Sent from my CyanogenMod Kaiser/Kaiser using XDA App

mmec2 said:
1. How can I odex the system framework? Odexing the system apps seems to work on the phone, but it freezes when I try to odex the framework. I called the script from userinit.sh instead, but that didn't work either. What is the proper way to do this??
Click to expand...
Click to collapse
You might not be following your bootclasspath, which will cause all sorts of nastiness if you try to odex a standing system. The other 2 hangups that I'm aware of would be odexing apks in framework (need big mojo for that. lots of chicken blood.), and odexing files on a seperate partition from where they will run.
To find out what order you need to odex your files in, do:
Code:
echo $BOOTCLASSPATH
and odex in that order first. After those files, you can do the rest in any order.

Just thought i would follow this one up. I pushed your suggestion to git the other day and i have compiled it into a kernel. Whilst testing CM7 yesterday i had to do a hard reboot whilst installing an app and on startup i had data corruption so i cleared the dalvik cache which also cleared /tmpcache and android booted fine so good job on finding that one I've never had success fixing data corruption by clearing dalvik cache before so this is good. Also, it narrowed down what could be the cause of data corruption so i have a few different avenues to explore.

tanimn said:
You might not be following your bootclasspath, which will cause all sorts of nastiness if you try to odex a standing system
Click to expand...
Click to collapse
I was not intentionally following the bootclasspath Actually, I have just had a look at your odexer tool, and I did odex the framework jars in the same order as your program does, but I haven't checked the bootclasspath, so I am probably doing them in the wrong order. Unfortunately, I'm trying out an odexed gingerbread build at the moment, so I can't check whether the bootclasspath was wrong yet. I'll have to flash back and check on Monday! (The bootclasspath order for gingerbread is quite different anyway)
Also, I noticed that you're not zipaligning the apks. Is it not neccessary? Does zip -d take care of that?
The script that I found/modified does a "zipalign -f -v 4" for each apk after removing the classes.dex

scooter1556 said:
Just thought i would follow this one up. I pushed your suggestion to git the other day and i have compiled it into a kernel. Whilst testing CM7 yesterday i had to do a hard reboot whilst installing an app and on startup i had data corruption so i cleared the dalvik cache which also cleared /tmpcache and android booted fine so good job on finding that one I've never had success fixing data corruption by clearing dalvik cache before so this is good. Also, it narrowed down what could be the cause of data corruption so i have a few different avenues to explore.
Click to expand...
Click to collapse
Great! I stumbled on that folder by accident after Gmail.apk and Email.apk stopped working. I knew it was really unlikely that the apks would be corrupted, because system is mounted ro, and clear dalvik didn't work....
Any chance you could upload that kernel?

mmec2 said:
I have two questions, but they are related, so I thought they could go in one thread:
1. How can I odex the system framework? Odexing the system apps seems to work on the phone, but it freezes when I try to odex the framework. I called the script from userinit.sh instead, but that didn't work either. What is the proper way to do this??
Click to expand...
Click to collapse
so the framework-res does not have a classes.dex in it so there is nothing to odex this would be why the script errors out or has no effect, everything else in the framework folder should be able to be odex'd but the framework-res will not

Here you go, this should be the latest .32 kernel with the changes the to dalvik cache wiping

thoughtlesskyle said:
framework-res does not have a classes.dex in it so there is nothing to odex
Click to expand...
Click to collapse
I was only odexing the .jars in /system/framework so that wasn't the problem.
I've been having some problems with gingerbread, and the version I just compiled doesn't work at all, so I have just flashed scoot's 5.5 CM6.1 build and tried odexing it, (before installing any apps) and it all worked!
The last times I tried it crashed every time, but I had been using the build for about a week - maybe last time I already had some data corruption, or an app running in the background caused it to crash.
Oh well, at least I've learnt some more about how Android works!

mmec2 said:
I was not intentionally following the bootclasspath Actually, I have just had a look at your odexer tool, and I did odex the framework jars in the same order as your program does, but I haven't checked the bootclasspath, so I am probably doing them in the wrong order. Unfortunately, I'm trying out an odexed gingerbread build at the moment, so I can't check whether the bootclasspath was wrong yet. I'll have to flash back and check on Monday! (The bootclasspath order for gingerbread is quite different anyway)
Also, I noticed that you're not zipaligning the apks. Is it not neccessary? Does zip -d take care of that?
The script that I found/modified does a "zipalign -f -v 4" for each apk after removing the classes.dex
Click to expand...
Click to collapse
The bootclasspath is different from manufacturer to manufacturer, handset to handset, and sometimes even between different files on the same handset. The most obvious examples of this would be sense and touchwiz, which both rely on a custom bootclasspath.
Zipaligning was removed from version 1.0 of my odexing script as a compatibility check and I never found a pressing reason to add it back in. It is included in the 1.2 beta found later in that thread. As an aside, zip -d does NOT do zipaligning, and in fact often breaks the file alignment.
Even in a perfect environment where dexopt_wrapper completes successfully, the results can still be unuseable. (at least on the epic) Sometimes there is just no way to programmatically replicate the voodoo that is involved in some deodexes...

Related

HELP NEEDED: Trying to make my own custom ROM!

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...
1. You need to edit "META-INF/com/google/android/update-script"
That's what I said... :/ But I also said:
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?
Click to expand...
Click to collapse
If anyone knows anything helpful of course...
Nazgulled said:
That's what I said... :/ But I also said:
If anyone knows anything helpful of course...
Click to expand...
Click to collapse
I am also interested in a guide or walk through for making a ROM for the Hero.
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?
Click to expand...
Click to collapse
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):
Code:
...
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
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?
Click to expand...
Click to collapse
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.
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?
Click to expand...
Click to collapse
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.
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?
Click to expand...
Click to collapse
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.
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?
Click to expand...
Click to collapse
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.
jubeh said:
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).
Click to expand...
Click to collapse
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?
jubeh said:
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.
Click to expand...
Click to collapse
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?
jubeh said:
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.
Click to expand...
Click to collapse
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?
jubeh said:
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).
Click to expand...
Click to collapse
Unfortunately, this did not work
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?
Click to expand...
Click to collapse
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.
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?
Click to expand...
Click to collapse
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).
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?
Click to expand...
Click to collapse
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.
Unfortunately, this did not work
Click to expand...
Click to collapse
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.
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?
jubeh said:
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.
Click to expand...
Click to collapse
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
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.
jubeh said:
(...)but it's much easier (and a more correct approach) to learn how those xmls in /customize work.
Click to expand...
Click to collapse
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...
jubeh said:
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).
Click to expand...
Click to collapse
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?
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:
Code:
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:
Code:
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?
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:
Code:
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?
Click to expand...
Click to collapse
Yeah, I mentioned on the earlier post that doing "format DATA:" and "format CACHE:" would be the equivalent of running "Wipe data/factory reset" from the recovery menu since you mentioned about making a build that installs fresh. Paul's (MoDaCo) roms are no-wipe, so they preserve that program data and instead format all other directories inside /data that might be problematic during an upgrade; his roms use apps2sd, so he assumes that the user's downloaded apps are in mmcblk0p2 (the memory card's ext partition), so by formatting /data/app, he's only erasing the apps he included in his update package, if the user doesn't use a2sd, well, this erases their downloaded apps (one of the reasons I dislike the current a2sd implementation, it's not suited for all situations). Then he deletes data/init.sh, which is basically a script he includes in /data that runs during a rom's boot and starts things like a2sd, compcache, linux-swap, and other custom rom's "advanced" features. DATA:local is also app storage (I believe) and functions much like in windows' /users/x/application data/local, it can be problematic if not done between builds. Last, he erases /data/dalvik-cache, this is where the temporary application code resides (the extracted classes.dex from inside an apk) for rapid execution (for apks that haven't been pre-odexed). If you wish to make your rom no-wipe, add those lines instead of "format DATA:", but I'd remove "delete DATA:app" since it's a bit problematic for people who don't use a2sd.
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:
Code:
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?
Click to expand...
Click to collapse
dumpstate is a debugging tool that android uses, but I don't know exactly where or how (I think it's an HTC-specific log for their HTCLog.apk). It contains two tools, dumpcrash and bugreport, much like toolbox is a binary that contains all the tools you see symlinked to it in update-script (bin, df, cp, mv, ls, insmod, etc.). It's not a problem at all if you remove it, but it's not a problem either to leave it there. Whenever something is symlinked, though (if it's something you added, for example, busybox tools), you have to make sure that the binary or a link to it or a previous symlink to it doesn't exist, otherwise your update-script will fail (like symlinking toolbox's insmod and then busybox's insmod, or busybox's ping if a ping binary already exists in the target symlink directory (for example /system/bin)).
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?
Click to expand...
Click to collapse
I guess that could work if you modify network type (there's a property somewhere in there about HSXPA, I think), but like you said, there's no documentation so it calls for some experimenting.
Those properties are also overrides, so, for example, if your rom doesn't do adb root (because ro.secure is set to 1 in init.rc), you can add ro.secure=0 in build.prop to enable adb root again.
Most properties are self explanatory, and pretty much, if you can't tell what it is, you probably shouldn't change it (for example, build.fingerprint allows you to change what kind of apps Market presents to you).
I'd say, don't mess around too much with the first batch (default build properties), with the exception of build.fingerprint.
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?
Click to expand...
Click to collapse
The classes.dex files is the dalvik bytecode for the application. It contains everything inside /appnamespace/src and /appnamespace/R if you're working from the source. It's basically all the java code already compiled for the dalvik virtual machine.
Dalvik doesn't do jit, so the classes.dex have to be extracted (if they're not already) and run through the virtual machine in a process called dexopt that produces code that can be much more rapidly excecuted by the dvm (dalvik virtual machine). The extracted code is then placed in /data/dalvik-cache (mentioned earlier) as [email protected]@[email protected]. All this pre-cached code eats away at your space in your /data partition (where you store your system data, like your email, messages, browser cache, and downloaded applications) and can be quite a big chunk of space gone (framework classes specially, since all jars inside /system/framework are nothing but java code, about 20MB for all framework code).
The solution to prevent usage of /data storage on an initial build is to have the code pre-extracted. This is done at compile-time running the created system through an emulator and then creating the odex files, which is almost exactly the same as the *@classes.dex found inside /data/dalvik-cache except that it's much better aligned to the device's memory configuration and offers (marginally) better excecution, plus when the package manager first encounters the apk, it's first step is to check if an .odex of it is available, if it is, then it skips checking and dexopting a classes.dex inside it and proceeds to the next package.
Odex files increase the space in your /system partition (it was already read-only, so it's not like you're missing out on something) so those 20 MB of framework that would have been tossed into your userdata partition are now out of the way into the useless (in an available-storage sense) /system partition so you have more free space for your apps.
There's a tool that can create odex files for apks that don't have them, it's called dexopt-wrapper and it has to be run from a running phone. However, this tool won't strip the (now unnecessary) classes.dex from inside an apk, so it has to be done manually. Removing the classes.dex once you've created an odex is a good idea merely on the basis of space savings. However, once a classes.dex has been odexed, it's very hard (used to be impossible) to turn it back to a classes.dex and place it inside an apk.
Usually, us rom cooks preffer the classes.dex inside the apk because odexes create conflicts when you try to mix and match apps between builds. Since the odex files are tied to the framework where they were created, adding an apk with it's odex to another framework (even one that's only ever-so-slightly different) will be very problematic (the odex code is no longer protected or verified, so the rom won't even boot because it will fail verification for all available packages).
The tool for reverting odex files is called deodexerant by jesus freke. It requires working knowledge of how the system goes through the dexopting process so you can run it in the proper order.
Another thing to know is that even if your /system is pre-odexed, your downloaded apps will still be run through the package manager and have their classes.dex dexopted and placed in /data/dalvik-cache.
Oh, and never, ever put odexes anywhere but /system/framework or /system/app (or /data/app_s if you use a2sd). The package manager currently can't handle odexes in /data/app or /data/app_private (the other two locations where it looks for packages other than /system/app).
In the end, whether to use/have odexes comes down to personal choice (and available space). There's two hero builds, those based in 2.73.405.61 and 2.73.405.66, that have not been pre-odexed, so they're perfect for experimenting, mix/matching, etc...
jubeh said:
Yeah, I mentioned on the earlier post that doing "format DATA:" and "format CACHE:" would be the equivalent of running "Wipe data/factory reset" from the recovery menu since you mentioned about making a build that installs fresh. Paul's (MoDaCo) roms are no-wipe, so they preserve that program data and instead format all other directories inside /data that might be problematic during an upgrade; his roms use apps2sd, so he assumes that the user's downloaded apps are in mmcblk0p2 (the memory card's ext partition), so by formatting /data/app, he's only erasing the apps he included in his update package, if the user doesn't use a2sd, well, this erases their downloaded apps (one of the reasons I dislike the current a2sd implementation, it's not suited for all situations). Then he deletes data/init.sh, which is basically a script he includes in /data that runs during a rom's boot and starts things like a2sd, compcache, linux-swap, and other custom rom's "advanced" features. DATA:local is also app storage (I believe) and functions much like in windows' /users/x/application data/local, it can be problematic if not done between builds. Last, he erases /data/dalvik-cache, this is where the temporary application code resides (the extracted classes.dex from inside an apk) for rapid execution (for apks that haven't been pre-odexed). If you wish to make your rom no-wipe, add those lines instead of "format DATA:", but I'd remove "delete DATA:app" since it's a bit problematic for people who don't use a2sd.
Click to expand...
Click to collapse
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.
jubeh said:
The classes.dex files is the dalvik bytecode for the application. It contains everything inside /appnamespace/src and /appnamespace/R if you're working from the source. It's basically all the java code already compiled for the dalvik virtual machine.
Dalvik doesn't do jit, so the classes.dex have to be extracted (if they're not already) and run through the virtual machine in a process called dexopt that produces code that can be much more rapidly excecuted by the dvm (dalvik virtual machine). The extracted code is then placed in /data/dalvik-cache (mentioned earlier) as [email protected]@[email protected]. All this pre-cached code eats away at your space in your /data partition (where you store your system data, like your email, messages, browser cache, and downloaded applications) and can be quite a big chunk of space gone (framework classes specially, since all jars inside /system/framework are nothing but java code, about 20MB for all framework code).
The solution to prevent usage of /data storage on an initial build is to have the code pre-extracted. This is done at compile-time running the created system through an emulator and then creating the odex files, which is almost exactly the same as the *@classes.dex found inside /data/dalvik-cache except that it's much better aligned to the device's memory configuration and offers (marginally) better excecution, plus when the package manager first encounters the apk, it's first step is to check if an .odex of it is available, if it is, then it skips checking and dexopting a classes.dex inside it and proceeds to the next package.
Odex files increase the space in your /system partition (it was already read-only, so it's not like you're missing out on something) so those 20 MB of framework that would have been tossed into your userdata partition are now out of the way into the useless (in an available-storage sense) /system partition so you have more free space for your apps.
There's a tool that can create odex files for apks that don't have them, it's called dexopt-wrapper and it has to be run from a running phone. However, this tool won't strip the (now unnecessary) classes.dex from inside an apk, so it has to be done manually. Removing the classes.dex once you've created an odex is a good idea merely on the basis of space savings. However, once a classes.dex has been odexed, it's very hard (used to be impossible) to turn it back to a classes.dex and place it inside an apk.
Usually, us rom cooks preffer the classes.dex inside the apk because odexes create conflicts when you try to mix and match apps between builds. Since the odex files are tied to the framework where they were created, adding an apk with it's odex to another framework (even one that's only ever-so-slightly different) will be very problematic (the odex code is no longer protected or verified, so the rom won't even boot because it will fail verification for all available packages).
The tool for reverting odex files is called deodexerant by jesus freke. It requires working knowledge of how the system goes through the dexopting process so you can run it in the proper order.
Another thing to know is that even if your /system is pre-odexed, your downloaded apps will still be run through the package manager and have their classes.dex dexopted and placed in /data/dalvik-cache.
Oh, and never, ever put odexes anywhere but /system/framework or /system/app (or /data/app_s if you use a2sd). The package manager currently can't handle odexes in /data/app or /data/app_private (the other two locations where it looks for packages other than /system/app).
In the end, whether to use/have odexes comes down to personal choice (and available space). There's two hero builds, those based in 2.73.405.61 and 2.73.405.66, that have not been pre-odexed, so they're perfect for experimenting, mix/matching, etc...
Click to expand...
Click to collapse
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
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.
Click to expand...
Click to collapse
Sounds like you got it.
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
Click to expand...
Click to collapse
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).
Thanks once again for taking your time with such complete answers
Click to expand...
Click to collapse
No problem, I get bored at work
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
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...
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.

Using Gapps for CR_MOD

The Youtube app on my wife's Slide refuses to work. You open the app and it's just stuck at the at the first screen. I ran fix permissions and that didn't take care of it. She's running CR_MOD and the Youtube version is 1620. I'm running the latest CM6.1 nightly with Youtube version 2.0.26. I'm wondering if I can flash the latest Gapps on her phone or are those only for froyo?
I would like to flash CM6.1 RC1 on her phone, but she needs bluetooth, so I'm stuc.
Sent from my CM6 Slide
the latest will work with out issues
Sweet! I'll try it out then.
Sent from my CM6 Slide
heybobitsme said:
Sweet! I'll try it out then.
Sent from my CM6 Slide
Click to expand...
Click to collapse
Did it work?
I never tried flashing 2.2 gapps onto 2.1 due to the differences.
RavenWulf said:
the latest will work with out issues
Click to expand...
Click to collapse
No, it won't.
Sent from my T-Mobile myTouch 3G Slide using XDA App
@Ace42, no I haven't tried it yet. I have my doubts about it working.
I'm thinking about just pulling the apk out of the ROM and reinstalling it.
Other than that, any ideas?
Edit: actually, if I can remove the wipe script from the ROM I'll just reflash. I tried to do it a while ago with the Android kitchen but it failed to install. Can someone help me out? I just don't have the experience.
Sent from my CM6 Slide
migueltherocker said:
No, it won't.
Sent from my T-Mobile myTouch 3G Slide using XDA App
Click to expand...
Click to collapse
since I had to do a complete wipe of my Slide so my nephew could use it for the next couple of weeks, I tried the 102010 tiny Gapps on SlideMR and CR OTA and it worked on both of them
Well I tried it and it didn't work for me. I flashed tiny gapps and upon reboot the gapps were gone. No Gmail, no Market, no Youtube. Good thing I backed it up.
I flashed the regular 10/20 gapps and they worked for me, I'm on CR MOD, maybe try the regular not tiny.
Sent from my T-Mobile myTouch 3G Slide using XDA App
heybobitsme said:
@Ace42, no I haven't tried it yet. I have my doubts about it working.
I'm thinking about just pulling the apk out of the ROM and reinstalling it.
Other than that, any ideas?
Edit: actually, if I can remove the wipe script from the ROM I'll just reflash. I tried to do it a while ago with the Android kitchen but it failed to install. Can someone help me out? I just don't have the experience.
Sent from my CM6 Slide
Click to expand...
Click to collapse
Did you get it done? I'm still trying to figure out which 'wipe' script you're talking about. In the update-script there are only 3 commands written in it for wipe.
Code:
format SYSTEM:
delete DATA:app
format DATA:
It's easy to edit that. Just open the ROM (don't extract!!), I use 7zip. Go to
HTML:
CR_Mod_1.35.531_OTA.zip\META-INF\com\google\android\update-script
Click and drag that to your desktop. Use notepad or notepad++(best) to open it. Delete the line(s) you want, save it and drag it back into the ROM archive you have opened in 7zip. It will replace the file automatically so don't delete it - trust me on that.
KCRic said:
Did you get it done? I'm still trying to figure out which 'wipe' script you're talking about. In the update-script there are only 3 commands written in it for wipe.
Code:
format SYSTEM:
delete DATA:app
format DATA:
It's easy to edit that. Just open the ROM (don't extract!!), I use 7zip. Go to
HTML:
CR_Mod_1.35.531_OTA.zip\META-INF\com\google\android\update-script
Click and drag that to your desktop. Use notepad or notepad++(best) to open it. Delete the line(s) you want, save it and drag it back into the ROM archive you have opened in 7zip. It will replace the file automatically so don't delete it - trust me on that.
Click to expand...
Click to collapse
No, I haven't yet. Looking at it again, you're right. There's no script, just those commands in the update script. Actually what I want to do is get rid of those commands and take out the radio.img. I've never messed with 7-zip and I'm using Linux Mint 10 anyway (just switched from Ubuntu 10.10 just because ), but I digress. I'll try that with gedit.
To be clear, if I don't want the update script to do something, after opening up with text editor of some sort, in my case gedit, I just delete a line? For example, if I don't want CR_MOD to write the radio.img, I remove the .img, then go into the update script and delete the line
Code:
write_radio_image PACKAGE:radio.img
, correct?
heybobitsme said:
To be clear, if I don't want the update script to do something, after opening up with text editor of some sort, in my case gedit, I just delete a line? For example, if I don't want CR_MOD to write the radio.img, I remove the .img, then go into the update script and delete the line
Code:
write_radio_image PACKAGE:radio.img
, correct?
Click to expand...
Click to collapse
Yeah, gedit should work. I use ubuntu also but I'm booted into vista 64 a lot (girlfriend uses it for college *sigh*).
Anyway, you're correct. Just delete the line you want and it won't execue the command. Also, the standard archive viewer that came stock will work for exploring archives.
Ok, so here's the lines in the update-script I think I want to remove:
Code:
format SYSTEM:,
delete DATA:app, format DATA:, delete SYSTEM:xbin/busybox, delete_recursive SYSTEM:xbin, write_radio_image PACKAGE:radio.img
, those, with the exception of the radio image, will stop the ROM from wiping upon installation, correct? I'm just trying to get a feel for things I've never messed with.
heybobitsme said:
Ok, so here's the lines in the update-script I think I want to remove:
Code:
format SYSTEM:,
delete DATA:app, format DATA:, delete SYSTEM:xbin/busybox, delete_recursive SYSTEM:xbin, write_radio_image PACKAGE:radio.img
, those, with the exception of the radio image, will stop the ROM from wiping upon installation, correct? I'm just trying to get a feel for things I've never messed with.
Click to expand...
Click to collapse
Yeah those would be the lines. I'm not sure why the delete DATA:app or delete SYSTEM:xbin/busybox was included in the update script. The format SYSTEM and DATA lines delete everything but oh well.
KCRic said:
Yeah those would be the lines. I'm not sure why the delete DATA:app or delete SYSTEM:xbin/busybox was included in the update script. The format SYSTEM and DATA lines delete everything but oh well.
Click to expand...
Click to collapse
I don't know why ChiefzReloaded included those lines either. Maybe to make sure there was no problems if people didn't manually wipe. Thanks for the assist. I'll test it out on my Slide to see if it works.
Edit: Meh! Failed to install.
Code:
Failed chown chmod I didn't write it down and Failure at line 22: set_perm 0 0 0777 SYSTEM:xbin/a2sd
Restored my backup. I'll try only deleting the lines that refer to deleting system and data.
Edit 2: That worked. I deleted the lines:
Code:
delete DATA:app
delete SYSTEM:xbin/busybox
delete_recursive SYSTEM:xbin and
write_radio_image PACKAGE:radio.img
from the update script. It didn't automatically wipe and it didn't flash the radio, which is what I wanted to do.
And Youtube appears to work, which was the whole problem in the first place.
Good to hear
Those scripts are a pain sometimes. I've been messing with them and tons of other stuff trying to customize the sense rom's for myself. I just can't get the market to download any apps for some reason, it works, says my download will start shortly but nothing oh well.
KCRic said:
Good to hear
Those scripts are a pain sometimes. I've been messing with them and tons of other stuff trying to customize the sense rom's for myself. I just can't get the market to download any apps for some reason, it works, says my download will start shortly but nothing oh well.
Click to expand...
Click to collapse
Ya, as I said before, I've never needed to mess with update scripts before and it's given me a bit of insight on what's going on. Again, thank you for the assistance.
heybobitsme said:
Well I tried it and it didn't work for me. I flashed tiny gapps and upon reboot the gapps were gone. No Gmail, no Market, no Youtube. Good thing I backed it up.
Click to expand...
Click to collapse
Why would you do that? Why would you flash tiny gapps? You're supposed to use mdpi gapps, that's what is used for every android device except the hdpi devices, like the vibrant or g2. All the gapps zip does is flash the apks. The only app I can see having an issue is the market, since google added auto update in froyo, which might have system dependencies. Correct me if I'm being a total moron here, but for the most part the version of gapps does not matter. Yoh can normally update them through the market anyway, except for the market itself of course.
Sent from my T-Mobile myTouch 3G Slide using XDA App
MusicMan374 said:
Why would you do that? Why would you flash tiny gapps? You're supposed to use mdpi gapps, that's what is used for every android device except the hdpi devices, like the vibrant or g2. All the gapps zip does is flash the apks. The only app I can see having an issue is the market, since google added auto update in froyo, which might have system dependencies. Correct me if I'm being a total moron here, but for the most part the version of gapps does not matter. Yoh can normally update them through the market anyway, except for the market itself of course.
Sent from my T-Mobile myTouch 3G Slide using XDA App
Click to expand...
Click to collapse
Tiny Gapps are for the G1 and mt3g which are both mdpi. They are straight up Gapps whereas the regular Gapps that we flash for CM6 have extra apps like facebook and twitter. I know that Gapps are just an apk package. That's why I wanted to experiment with it.
But, I think you're right about system dependencies. There are updates for Gapps on the market that are only available for froyo.
Sent from my CM6 Slide

Deodexed & Zipaligned /system for VZW Tab

So, yeah. This is deodexed & zipaligned System. It will overwrite your /system partition so any changes you have made (theme, hosts file, etc...) will be lost. In addition to the deodexed /app and /framework folders this will add a transparent notification bar and ad blocking host file. Why? Cause, I made this for myself, so it's the way I like it. Flash this if you want, I'm not forcing you to. Nor will I be held responsible if it eats your first born or tries (succeeds) to commit suicide. You've been warned. If you just want the deodexed files, I'll leave the manual method below and you can do it the hard way. Maybe I'll get the update-script working at some point, but I don't know. If you're good with the new sytax for CWM's update script, hit me up in IRC, I'm stumped.
Note: As I said, this formats your /system partition. Not your /data partition, so all your apps and such will still be there.
So, Once More
What you get:
Deodexed & zipaligned (ready to theme) system
Transparent Notification Bar
Ad blocking host file
No warranty
No mobileprint apk. I couldn't get it deodexed no matter what I tried and can't be bothered to try anymore. Never used it. Never will.
Nandroid Recovery Method
YOU MUST HAVE CWM RECOVERY INSTALLED
use either the bootstrapper from the market or follow his instructions found HERE be careful and use this at your own risk, it is very beta. I recommend doing a backup from it before you flash this as well.
How To Flash
extract the folder to /sdcard/clockworkmod/backup
Boot in to CWM Recovery go to advanced restore, select restore /system only. Once that is complete clear the cache, reboot. you can then delete your dalvik cache (note: clearing the dalvik cache doesn't work via CWM currently). That's it.
If you have anything go wildly crazy, lemmie know. Also, I doubt it's success on any other carriers version of Tab, but if you feel like it, go ahead, I already gave you responsibility for your own actions. Do what you want with it. If it works though, let us know.
Oh yeah- Download if you feel like it.
ODIN Restore Method
Flash via Odin PDA PDA PDA PDA PDA PDA PDA
If you need any more instructions on how to flash via odin, search.
Download the tar HERE
OLD PITA BORING MANUAL METHOD
FIRST
So, Back up your system first. Wait, yeah, you can't in recovery yet, so seriously people- don't touch this yet unless you know what you're doing since you won't have a supersimplehappynice backup to revert to if you mess up. Only the cold, cold darkness that is Factory Reset.
I haven't been able to manually deodex these successfully yet. If anyone has, please, hook me up and I'll update the package (or I'll update it when I get around to deodexing them).
What are these for???
These files will allow you to theme your Tab, some say it speeds up your system and others say it allows you to get all the ladies and even others think it's a threat to democracy so PROCEED WITH CAUTION.
What do I do with these???
Okay, this isn't hard, but it's easy to get a negative result if you skip a step so keep reading, follow the directions and don't blame me if you are singled out for the 3D imaging system at the airport.
Basically you want to use ADB push or Root explorer to delete the apks/jars/odex/*.* in /system/app and /system/framework and then replace them with the files from the archive (the archive has an app and a framework folder for you, I think you know where each belongs).
Now if you use root explorer to delete everything from /framework, things will get sticky for a minute and you'll get some FC's and such, but I was able to copy all the files over, so just be patient.
Also, remember how I told you to read the directions? KEEP READING OR YOU'LL MISS IMPORTANT STUFFS. So, hi there. You shake the boredom out of between your ears and giving me your full attention again? Good. Now is important. You are really going to want to clear both your normal, and dalvik chache. Otherwise you're going to reboot and your phone is going to be slower than an Audi R8. You can do this with cache cleaner, recovery (if you're running noobln's script) or adb. I used recovery for standard cache and this adb command.
Code:
adb remount
adb shell rm -rf /system/sd/dalvik-cache
Then just reboot and start porting some themes over for me (revolution plzkthx).
A couple of notes:
All these are from a VZW Tab. Will they work on your T-mobile one? Well, find out, if you want, or not. I don't care. Just don't come crying to me if you screw up your phone. I did not put a gun to your head and force you to use these files.
Also, if you screw up your Tab, for the love of the gawds, it's not bricked, calm down.
I suppose you want the download link, huh.
Here you go for the manual files.
Finally, if you like my work, donate to me so I can donate money to devs that make my world easier (and therefore yours).
cheers for the upload
any chance of a deodexed email.apk as it's not in there?
Any screenshots of what the themed versions can potentially look like? Need to weigh up the pro's / con's of being "experimental"
Thanks
Johnston411 said:
cheers for the upload
any chance of a deodexed email.apk as it's not in there?
Click to expand...
Click to collapse
Darn it, I'm sorry, I meant email.apk and not browser.apk. I haven't been able to deodex that apk yet. Sorry I should have it done soon but in the mean time you can use gmail or go back to an odexed FS. Original post updated.
risq said:
Any screenshots of what the themed versions can potentially look like? Need to weigh up the pro's / con's of being "experimental"
Thanks
Click to expand...
Click to collapse
They look exactly the same as on your Tab, just without being odexed. This is not a theme, nor does it change the appearance of any of these applications. It changes the way they function within the OS and allows for the ability to theme.
I mean absolutely zero offense by this, but if you're weighing out the pros/cons of doing this, you probably shouldn't. Just wait a while longer for recovery to be functional, then people will start putting out easily flashable ROMs and themes.
Sorry i misunderstood.
I thought they had been edited / themed already from the initial description..
Its been a long day. Im a risk taker anyways but ill pass for time being.
Keep up the good work.
Sent from my GT-P1000 using XDA App
Johnston411 said:
cheers for the upload
any chance of a deodexed email.apk as it's not in there?
Click to expand...
Click to collapse
Actually, I just got email deodexed.
HERE YOU GO
I'll have the other remaining apks out soon.
very kind.
I want to try it on my dell streak but the odexed email.apk kept force closing.
Let me know if it works.
f.c. as soon as you launch it.
i'll see if it needs any framework stuff added to work tomorrow.
Hi Boushh,
After removing files in both folders it FCs many and froze. It won't reboot now. Let me know what I did wrong. No compliants like you mentioned. Any rescue?
Thanks
Like I said, you'll get that, I was able to copy them over with root explorer between the FC's. If you can not easily do that, plug it in and adb push it.
Added a flashable zip to the first post, happy holidays guys and gals!
I tried the flashable zip with CWM, but it aborts when install.
How can I clear cache & dalvik cache in CWM. There is only with the clear data/factory reset.
Can you tell me the exact error that recovery prints?
I'm almost positive *clear cache* is in the root of recoveries settings and then *clear dalvik cache* is under advanced.
Error is "Installation aborted"
I use the CW Bootstrap recovery, then reboot recovery that purchased from Market for "Bootstrap for Tab".
Select install zip in SD card. Wipe clear cache & in advance for clear dalvik cache. It's still installation aborted.
Okay, I need to change something in the install script, illtry and do it in the next couple hours.
If you ever get the other apk's integrated into the update.zip, I'd be happy to give a test run on my VZW tab.
I did the manual files delete and paste before, but froze the Tab and non bootable anymore. I'm on my second tab, definitely need the update zip for this.
Sent from my SCH-I800 using XDA App
Just an update- I got back from vacation last nightand need a day to recover but I plan in fixing the zip tomorrow.
Also, regarding the mobile print apk, I have tried using every resource possible to deodex it without success so I've given up on it. I blame bad coding, lol.
If any of you care about quadrant scores (which I don't) I was recently asked what I was getting, around 1150-1170. So a bit better I than stock I suppose bit I only deodex for themes really.

[PATCH] serious bug in LeeDroids automatic zipalignment

Hi!
I found a serious bug in LeeDroids automatic zipalignment that potentially damages installed apk files:
The 97zipalign script does not check the return code of zipalign.
So if aligning fails for some reason, the damaged result is used and copied back to /data/app!
This happens for example, if there is not enough free space on /cache.
For Data++ users, /cache is only 5 MB, which is insufficient for quite a few bigger apps like Documents To Go, Angry Birds, Viber or Camscanner!!!
Those apps will be corrupted after the first reboot, causing them to disappear from the laucher!
But also on non-Data++ installations /cache could be full or there could be other reasons for zipalign to fail.
I have added two fixes for that problem:
zipalign-fix.zip contains a patched version, that skips overwriting the original .apk file if zipaligning failed. (The diff is also included.)
cache2sd contains an initscript that bind-mounts /cache to /system/sd/cache. This is necessary for zipalign to work on Data++ installations.
Cheers,
leo
P.S.: I know that this post would better fit to the devel forum but unfortunately I am not allowed to post there... :-(
Hmm, I'm on data++ with a cache of only 5mb. I never get a problem with automatic zipalign, even with big apps like angry birds. In leedroid ROMs the cache is moved to a ramdisk with a few changes in init.rc.
Edit: posted a link to this thread in the leedroid 3.3.x thread...
Sent from my HTC Desire using XDA App
anderl78 said:
Hmm, I'm on data++ with a cache of only 5mb. I never get a problem with automatic zipalign, even with big apps like angry birds. In leedroid ROMs the cache is moved to a ramdisk with a few changes in init.rc.
Edit: posted a link to this thread in the leedroid 3.3.x thread...
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Maybe, however, I've seen a couple of users complaining of missing apps, and their problem being solved by removing the zipalign script, as far as I remember.
It happens on other ROMs too, gonna post the link in related thread. Thanks, I had that issue a couple of times and the only way out was to erase zipalign.
el.mariachi said:
Hi!
***
* zipalign-fix.zip contains a patched version, that skips overwriting the original .apk file if zipaligning failed. (The diff is also included.)
* cache2sd contains an initscript that bind-mounts /cache to /system/sd/cache. This is necessary for zipalign to work on Data++ installations.
Click to expand...
Click to collapse
Please advise:
1. If one has Data++, does one flash zipalign-fix followed by cache2sd, without rebooting in between?
2. Is cache2sd necessary for roms which have ramdisk for cache\ like LeeDroid?
Thank you!
s300pmu1 said:
2. Is cache2sd necessary for roms which have ramdisk for cache\ like LeeDroid?
Thank you!
Click to expand...
Click to collapse
Could it perhaps work on other roms which don't have a ramdisk?
s300pmu1 said:
Please advise:
1. If one has Data++, does one flash zipalign-fix followed by cache2sd, without rebooting in between?
2. Is cache2sd necessary for roms which have ramdisk for cache\ like LeeDroid?
Thank you!
Click to expand...
Click to collapse
Hello!
1. Both zip-files are not flashable. They contain the scripts. If you want to use them, you have to use root explorer... Setting the right permissions should be necessary too...
2. I don't know exactly, but I think not. Init.rc should be executed early enough to prevent us from the described problem. But that's only my guess, could not say exactly - perhaps somebody other know more? If its not as I guess, why my angry birds get zipaligned without problem? ;-)
Sent from my HTC Desire using XDA App
anderl78 said:
Hmm, I'm on data++ with a cache of only 5mb. I never get a problem with automatic zipalign, even with big apps like angry birds. In leedroid ROMs the cache is moved to a ramdisk with a few changes in init.rc.
Click to expand...
Click to collapse
On my LeeDroid V3.3.3 R5, /cache doesn't reside on a ramdisk:
Code:
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev,noatime,nodiratime)
I think you are mixing this up with /app-cache, which in fact is a ramdisk...
Maybe you remounted /cache yourself and that's why large apps don't cause a problem on your installation.
Or maybe your angrybirds version is already zipaligned, so the zipalign check
Code:
zipalign -c 4 "$apk"
will return true (0) and the if clause won't be executed...
btw every app from the market should be zipaligned...even when i built some android apps with ecplise, the exported apk is already zipalign
why someone should create a non zip aligned apk? maybe some themed app from a bad dev? some framework apk from the uot kitchen??
el.mariachi said:
On my LeeDroid V3.3.3 R5, /cache doesn't reside on a ramdisk:
Code:
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev,noatime,nodiratime)
I think you are mixing this up with /app-cache, which in fact is a ramdisk...
Maybe you remounted /cache yourself and that's why large apps don't cause a problem on your installation.
Or maybe your angrybirds version is already zipaligned, so the zipalign check
Code:
zipalign -c 4 "$apk"
will return true (0) and the if clause won't be executed...
Click to expand...
Click to collapse
Hello!
Angry birds is from market...
App cache is right, I'm talking from a other thing.
I looked into it a lil bit. The code in init.rc moves the market download (download cache) to a ramdisk - Nothing more.
The 97zipalign script uses /cache to do its work.
Cause of this, I think you are totaly right. The download cache doesn't affect /cache itself. The space there could be to low. If /cache is to low, zipalign could fail. The error caused by this (you described it in op) could end in unusable app...
I could only say, thanks for this! I will try the scripts, even if I have no problems here.
Sent from my HTC Desire using XDA App
andQlimax said:
btw every app from the market should be zipaligned...even when i built some android apps with ecplise, the exported apk is already zipalign
why someone should create a non zip aligned apk? maybe some themed app from a bad dev? some framework apk from the uot kitchen??
Click to expand...
Click to collapse
Yep, but a few user reported issues with installed apps after a restart. Removing the zipalign script cured it. No comment about devs and not zipaligned apps ;-)
Sent from my HTC Desire using XDA App
Just tested it, works as it should.
Is it ok for you, if I post a flashable zip?
Sent from my HTC Desire using XDA App
anderl78 said:
Just tested it, works as it should.
Is it ok for you, if I post a flashable zip?
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
This would be great if we can have flashable zip. I know I am facing the problems with few of the apps I installed and they will disappear once rebooted.
Looking forward for the flashable zip files to install them on my desire.
anderl78 said:
Just tested it, works as it should.
Click to expand...
Click to collapse
Glad to hear that.
anderl78 said:
Is it ok for you, if I post a flashable zip?
Click to expand...
Click to collapse
Yes, of course. Feel free to create a zip!
Thanks,
leo
el.mariachi said:
Hi!
I found a serious bug in LeeDroids automatic zipalignment that potentially damages installed apk files:
The 97zipalign script does not check the return code of zipalign.
So if aligning fails for some reason, the damaged result is used and copied back to /data/app!
This happens for example, if there is not enough free space on /cache.
For Data++ users, /cache is only 5 MB, which is insufficient for quite a few bigger apps like Documents To Go, Angry Birds, Viber or Camscanner!!!
Those apps will be corrupted after the first reboot, causing them to disappear from the laucher!
But also on non-Data++ installations /cache could be full or there could be other reasons for zipalign to fail.
I have added two fixes for that problem:
zipalign-fix.zip contains a patched version, that skips overwriting the original .apk file if zipaligning failed. (The diff is also included.)
cache2sd contains an initscript that bind-mounts /cache to /system/sd/cache. This is necessary for zipalign to work on Data++ installations.
Cheers,
leo
P.S.: I know that this post would better fit to the devel forum but unfortunately I am not allowed to post there... :-(
Click to expand...
Click to collapse
Would you kindaly take a look at the ACEMOD007 Rom please, it also suffers from the same bug.. but im not a 100% sure what to change.
I also think where /system/sd is the SD CARD, on ACEMOD its on /SDCARD
It was driving me nuts Apps vanishing, until i saw this post
thanks.
flashable zipfile
flashable zipfile containing the fixed zipalign-script and the new cache2sdext-script. Simple flash it in recovery
thanks to el.mariachi for this!
Thanks. Works like a charm
Problem here!
Zipaligning com...apk FAILED (rc:1)
darkpain said:
Problem here!
Zipaligning com...apk FAILED (rc:1)
Click to expand...
Click to collapse
This is, of course, not a problem of the zipalign script.
com...apk is, according to the garbled filename, most likely not a valid apk file and thus zipalign will fail when trying to process it.
The only difference to the old zipalign is that the error is now detected. The old script just silently ignored the return code.
Cheers,
leo
Thanks so much for this! I was going crazy as my installation of Swype would vanish every time I rebooted my phone... flashing this has solved the problem.

[MOD] Xoom: symlink /system/apps to /data for GApps on CM10-based ROMs (11/28 update)

Disclaimer: This mod is provided as is. I am not responsible for you or your actions, I can barely handle myself most days. This will probably kill your dog and frame your spouse, so if your not feeling up for it, maybe sit this out.
What is this?
This addresses the lack of space on the /system partition that has been forcing people to compromise on GApps packages, and generally be subjected to wonky behavior.
How do I install it?
First you must make a nandroid. This is a flashable zip that you apply in recovery *in between* flashing cm10 and GApps. *NOTE* There are -NO- GApps in this download. This is just a shim to make room for them!
How does this work?
It's mostly edify, with a shell script that shouldn't have been necessary, but I got impatient, and hell, it works.
What it does is it will create folder on your /data partition called /data/system.app.
It makes sure that the permissions match the original.
Then it will migrate the *entire* contents of the traditional /system/app folder into the new folder, also preserving the owners, permissions and attributes of files
Finally, it deletes the original, and creates a symlink in its place, so that anything that tries to read, or write, to that folder, will end up on the /data partition.
You can now install a full GApps package, and you'll have a lofty 25MB or so to spare!
Is it safe?
I have tested this on my 4G Stingray using CM10 nightlies and Rogue Recovery as both a clean flash and an upgrade. It works under that configuration. See "Before you download" below for currently known issues.
Is this only for the Stingray?
Yes and no. Yes, I only have that one device that suffers the partition issue, and on which to test this. No, I don't see why it couldn't work for at least one other device. But still probably don't try it unless you really know what you're doing.
Why did you make this?
I wanted to solved this problem, and now it's my gift to you all! Enjoy!
Can I incorporate this in my ROM or on my website or at my grandmother's bingo party?
Knock yourselves out. I hope this ends up being super helpful for everybody.
Something broke and it's all your fault!
Before you download!
Make a nandroid! This is twice that I'm telling you, so I mean it!
As of right now, if you were to factory reset your device, it would be necessary to restore or reflash from recovery. Do not factory reset if you apply this mod! (Thanks runandhide05!)
This mod does not work with TWRP recovery at the moment (But I'm working on it). (Thanks dodgefan67!)
Face unlock currently fails to install. I am working to address this.
Some future version will use addon.d so that you don't have to flash this every time. This will be implemented once the above issues have been dealt with.
The zip file was updated on 11/28 to fix an issue where the shell script had windows-style line endings, causing it not to run in TWRP and possibly some other recoveries.
The download:
http://www.tangerinepulsar.com/files/cm10-xoom-system-symlink-mod-signed.zip
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
the only problem i see here is that you have no way to backup you rom, well, if you run a backup it will say its successful, but you have nothing to get /data/system.app backed up and re symlinked when you restore, and if you preform a factory reset you will loose all of your system apps,
you should look at how EOS symlinks there gapps data at /data/ you have to include addon.d scripts so that if you run a backup it will backup your new folder too, otherwise problems may/will happen.
edit:
for example for the /usr/srec stuff ( google now hotword and talk back files) you have to do something like this
Code:
. /tmp/backuptool.functions
list_files() {
cat <<EOF
EOF
}
case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/$FILE
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/$FILE $R
done
ln -s /data/eos-srec /system/usr/srec
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
runandhide05 said:
the only problem i see here is that you have no way to backup you rom, well, if you run a backup it will say its successful, but you have nothing to get /data/system.app backed up and re symlinked when you restore, and if you preform a factory reset you will loose all of your system apps,
you should look at how EOS symlinks there gapps data at /data/ you have to include addon.d scripts so that if you run a backup it will backup your new folder too, otherwise problems may/will happen.
Click to expand...
Click to collapse
I'll definitely look at incorporating this approach, thanks!
At the time I didn't think that backups were that big of a deal so long as you backed up both system and data, all of the symlinks would still be intact. I did write the edify script in such a way that it allows for an existing /system.app folder to already be there and will re-symlink it. But there are always times when you want to restore one and not the other, or switch ROMs without losing data, and this doesn't handle that at all. I definitely agree that a factory reset would trash you pretty badly, it's not a scenario that I accounted for in any way.
Thanks for the nudge in the right direction, I'll keep working on this.
Thanks for workings on this, very exciting news.
I'll start cranking out eos test builds soon. Then I'll take a look at what kind of gapps solutions are available. One thing for sure is it will be a bare bones package. That means anything that can be acquired from the Store will be.
this is good news indeed. i will try this out on my wifi xoom in the next day or two
i understand about doing a factory reset, but if i just update from one nightly to another (dirty flash) i would have to run this each time as well, correct?
dodgefan67 said:
this is good news indeed. i will try this out on my wifi xoom in the next day or two
i understand about doing a factory reset, but if i just update from one nightly to another (dirty flash) i would have to run this each time as well, correct?
Click to expand...
Click to collapse
You should not have to.
Sent from my Galaxy Nexus using Tapatalk 2
runandhide05 said:
You should not have to.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
doesn't the script actually move the contents of /system/apps though? installing a new version would put apps there right? and overwrite the symlinks?
dodgefan67 said:
doesn't the script actually move the contents of /system/apps though? installing a new version would put apps there right? and overwrite the symlinks?
Click to expand...
Click to collapse
Well it depends on how/if he updated it.
But if its the same as earlier then ya you will need to reflash.
Sent from my Galaxy Nexus using Tapatalk 2
runandhide05 said:
You should not have to.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
dodgefan67 said:
this is good news indeed. i will try this out on my wifi xoom in the next day or two
i understand about doing a factory reset, but if i just update from one nightly to another (dirty flash) i would have to run this each time as well, correct?
Click to expand...
Click to collapse
runandhide05 said:
Well it depends on how/if he updated it.
But if its the same as earlier then ya you will need to reflash.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
I haven't released an update yet. Please reflash per the current instructions. I'll make it obvious when the script has changed.
ok, i used CM10 stable from 11/13/2012 and the official GApps JB package from 10/11/2012
flashed CM10
flashed this mod
flashed gapps
on first boot, i did not get any google account sign on screens, went straight to homescreen, no play store or any google apps installed
reflashed gapps and rebooted and this time i got the play store and google search, but that's it. is there more to gapps? i think they took out gmail, but would expect more for a 90meg file. never really looked at this, i have been using the EOS version of gapps with Zigackly's rom
by the way, according to TB i have 29.4mb left on /system and that is before i remove the other stuff i dont want. so it seems to have worked on a MZ604 wifi device
i will use it this way for a couple of days, restoring some apps and installing things and changing settings and see how it goes. then i will update to a nightly and see how that goes
so far so good
dodgefan67 said:
ok, i used CM10 stable from 11/13/2012 and the official GApps JB package from 10/11/2012
flashed CM10
flashed this mod
flashed gapps
on first boot, i did not get any google account sign on screens, went straight to homescreen, no play store or any google apps installed
reflashed gapps and rebooted and this time i got the play store and google search, but that's it. is there more to gapps? i think they took out gmail, but would expect more for a 90meg file. never really looked at this, i have been using the EOS version of gapps with Zigackly's rom
by the way, according to TB i have 29.4mb left on /system and that is before i remove the other stuff i dont want. so it seems to have worked on a MZ604 wifi device
i will use it this way for a couple of days, restoring some apps and installing things and changing settings and see how it goes. then i will update to a nightly and see how that goes
so far so good
Click to expand...
Click to collapse
I'm a little perturbed about the way that first flash went. If you experience that again, will you please post the log from /cache/recovery prior to the re-flash? I want to make sure that there's not some scenario that I'm not handling properly with just one flash.
BTW, Did you flash it all from recovery or did you use something like ROM Manager or ROM Toolbox to script the recovery actions? Just so I cover my bases.
oscillot said:
I'm a little perturbed about the way that first flash went. If you experience that again, will you please post the log from /cache/recovery prior to the re-flash? I want to make sure that there's not some scenario that I'm not handling properly with just one flash.
BTW, Did you flash it all from recovery or did you use something like ROM Manager or ROM Toolbox to script the recovery actions? Just so I cover my bases.
Click to expand...
Click to collapse
i will do it again and get you the log file. i'm using twrp and did it all from there. i even did each zip one at a time even though twrp lets you do multiple ones in one go
good news and bad, i got the log file but i had to dump it to a plain text file so it is hard to read, but if you search for symlink-mod you will find the section where your mod starts and right after that is where i flashed gapps ***edit***never mind about the formatting, i clicked the attachment below using Chrome and it came up fine
i was able to duplicate my issue. i wiped everything three times and installed a different rom and different gapps package and everything was fine. then i wiped three more times and installed cm10 stable, your mod, then the official jb gapps, rebooted and same thing. no google apps installed. this log file is from right after the first reboot
then i went back and flashed gapps again, rebooted and have the play store
i can put CWM on it and try it with that recovery if you want
Here is the problem, u can not have anything in the /system/app folder.. Nothing at all, so the problem lays that if you try to flash a ROM, then the sy link it will copy everything in system/app to data, remove the directory (system/app) then link it to the new directory in /data. Then you are trying to flash gapps which tries to put stuff in /system/app which that directory does not exist so its going to create it. Which will undo the symlink or will not be able to flash anything to /app.
So for the sy link to work u must flash both rom and gapps, which is where the problem of limited space cause now u won't get all your files over to the /system because not enough room. So to fix this you can do one of several things, one of which would be...
Change the gapps package to where the system apps flash to the new /data directory created by the sysmlink.
So if the new directory is /data/sysapp/ open the gapp package and take all the system/app/ and move it to a new folder on the root of the zip called data then in there create a folder called sysapp and put all the /system/app/ content in there. And remember to update the updater script for the resource "data" "/data" and that "should" fix it
Sent from my Galaxy Nexus using Tapatalk 2
dodgefan67 said:
good news and bad, i got the log file but i had to dump it to a plain text file so it is hard to read, but if you search for symlink-mod you will find the section where your mod starts and right after that is where i flashed gapps ***edit***never mind about the formatting, i clicked the attachment below using Chrome and it came up fine
i was able to duplicate my issue. i wiped everything three times and installed a different rom and different gapps package and everything was fine. then i wiped three more times and installed cm10 stable, your mod, then the official jb gapps, rebooted and same thing. no google apps installed. this log file is from right after the first reboot
then i went back and flashed gapps again, rebooted and have the play store
i can put CWM on it and try it with that recovery if you want
Click to expand...
Click to collapse
Okay, I see a couple of things that are downright strange. To start off, the reason it looks like a flat text file is because the line-breaks are unix-style ('\n') and windows apps generally don't show linebreaks unless they have a carriage return preceding a newline character ('\r\n'). Open files from android in Notepad++ and they'll render much more nicely. Turn on viewing end of line characters and you'll see the difference between the Windows and Unix styles of newlines.
In practice, these are invisible control characters that don't visibly render, except in so far as their introduction of a line-break. '\r' and '\n' are aliases of them used in programming. They are actually the hex values 0A and 0D. But, since they are also characters, unexpected ones will have some kind of effect.
On lines 4066-4067 I see an error in the copy.sh: "/tmp/copy.sh: line 2: '\r' : not found"
There is a stray carriage return in the middle of this log file. There should be none. Line 2 in that file is BLANK. The source *should* have a single unix-newline '\n' and nothing else. I would bet that busybox is trying to interpret it and as a result, the shell script never runs. Nothing is getting copied out of /system/app.
I checked the zip I uploaded, and sure enough, the shell script has windows-style line endings. Oops. I've replaced it with a version that does not, but is identical other than that. So that part is fixed. Not sure why it works in CWM and not in TWRP, as far as I'm concerned, it shouldn't have worked in either. They must have slightly different busybox binaries is all that I can think.
The other issue is that both the deletion of /system/app and the subsequent symlinking both claim to have worked. However it's clear that /system/app was not deleted because if it were, you wouldn't have booted correctly. The symlink couldn't have worked either because you can't symlink a location that has files in it. So what in the world happened here? I'm kind of not sure, especially since those steps each returned 0, or else we wouldn't have gotten the success messages.
The wrinkle that you got *no* gapps after a flash is even stranger. But There is one more bit of interest here. I see an error message on line 4135 "cp: target '/system/app' is not a directory". At this point, this is the gapps trying to install face-unlock. I went ahead and looked in my own log files and here's what I found: "cp: target '/system/app' is not a directory." I never used it, but further inspection confirms, no portion of the face-unlock is installed using my mod, and the reason is the syntax of the gapps install-optional.sh: "cp -a /tmp/face/* /system/". Because /system/app is a symlink, you cannot copy the folder /tmp/face/app over it successfully.
This begs the question, how is it displaying the properties of being both a symlink and NOT a symlink?
I'm going to work on these issues, and I'll probably flash TWRP and test against it as well and try to come up with some answers and a one-size-fits-all solution. In the mean time, I would appreciate it if you could confirm whether you have a /data/system.app directory, and if so, what the contents are. I have a hunch that you'll find the gapp apks (minus face-unlock) in that directory, but none of the system apps. I'm not sure how that would be possible, or what it means, but it makes the most sense from where I'm standing. In the meantime, I'm going to add some notes to the main post.
I'll hopefully get some of this figured out by this weekend.
oscillot said:
Okay, I see a couple of things that are downright strange. To start off, the reason it looks like a flat text file is because the line-breaks are unix-style ('\n') and windows apps generally don't show linebreaks unless they have a carriage return preceding a newline character ('\r\n'). Open files from android in Notepad++ and they'll render much more nicely. Turn on viewing end of line characters and you'll see the difference between the Windows and Unix styles of newlines.
In practice, these are invisible control characters that don't visibly render, except in so far as their introduction of a line-break. '\r' and '\n' are aliases of them used in programming. They are actually the hex values 0A and 0D. But, since they are also characters, unexpected ones will have some kind of effect.
On lines 4066-4067 I see an error in the copy.sh: "/tmp/copy.sh: line 2: '\r' : not found"
There is a stray carriage return in the middle of this log file. There should be none. Line 2 in that file is BLANK. The source *should* have a single unix-newline '\n' and nothing else. I would bet that busybox is trying to interpret it and as a result, the shell script never runs. Nothing is getting copied out of /system/app.
I checked the zip I uploaded, and sure enough, the shell script has windows-style line endings. Oops. I've replaced it with a version that does not, but is identical other than that. So that part is fixed. Not sure why it works in CWM and not in TWRP, as far as I'm concerned, it shouldn't have worked in either. They must have slightly different busybox binaries is all that I can think.
The other issue is that both the deletion of /system/app and the subsequent symlinking both claim to have worked. However it's clear that /system/app was not deleted because if it were, you wouldn't have booted correctly. The symlink couldn't have worked either because you can't symlink a location that has files in it. So what in the world happened here? I'm kind of not sure, especially since those steps each returned 0, or else we wouldn't have gotten the success messages.
The wrinkle that you got *no* gapps after a flash is even stranger. But There is one more bit of interest here. I see an error message on line 4135 "cp: target '/system/app' is not a directory". At this point, this is the gapps trying to install face-unlock. I went ahead and looked in my own log files and here's what I found: "cp: target '/system/app' is not a directory." I never used it, but further inspection confirms, no portion of the face-unlock is installed using my mod, and the reason is the syntax of the gapps install-optional.sh: "cp -a /tmp/face/* /system/". Because /system/app is a symlink, you cannot copy the folder /tmp/face/app over it successfully.
This begs the question, how is it displaying the properties of being both a symlink and NOT a symlink?
I'm going to work on these issues, and I'll probably flash TWRP and test against it as well and try to come up with some answers and a one-size-fits-all solution. In the mean time, I would appreciate it if you could confirm whether you have a /data/system.app directory, and if so, what the contents are. I have a hunch that you'll find the gapp apks (minus face-unlock) in that directory, but none of the system apps. I'm not sure how that would be possible, or what it means, but it makes the most sense from where I'm standing. In the meantime, I'm going to add some notes to the main post.
I'll hopefully get some of this figured out by this weekend.
Click to expand...
Click to collapse
Any new news on this?
A little update on what I tried on my MZ-601 Everest. Any feedback will be welcome
Basically what I did was:
1. Trimmed down the CM10 Stable a little (132MB vs the original 141MB) by removing mainly the wallpapers.
2. Flashed the modified CM10 Stable zip (after a full wipe - factory plus cache).
3. Modified the Mod Script to point to "/data/system/app" (just to satisfy my OCD ) then flashed the zip. On first try it aborted with Status 7 on "Fixing permissions" so I had to manually create the directory "/data/system/app" after which the flash was successful.
4. Modified the GApps package (GApps from 11th Oct) by:
a. Removing the "optional" directory, install script and removing the relevant lines from "updater-script",
b. Moving the "/system/app" directory to "/data/system" and
c. Modifying the "updater-script" to reflect the change.
5. Flashed the GApps zip package which went uneventfully.
6. I now have 51.4MB free in "/system" according to Titanium Backup
PS: I am including the modified "Mod Script" and "updater-script" from GApps package if anyone else wants to try it. Of course you mileage may vary and I cannot claim any responsibility for any loss of data that may occur
UPDATE: Tried it with the CM10.1 nightlies and it works flawlessly. Flashed the nightly over the last nightly, flashed this script then the official gpaps and rebooted. All the settings and customizations retained! Still have some 56MB left in /system

Categories

Resources