[PATCH] serious bug in LeeDroids automatic zipalignment - Desire Q&A, Help & Troubleshooting

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.

Related

[Q] Odexing and dalvik-cache

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...

[Q] install apk to sd-ext

hi guys,
i would just like to ask if it is possible to install apk and will automatically moved to sd-ext and not on data\app?
i'm currently on aurora v4.1. Any ideas? Thanks!
The Rom thread says it you need an ext for a2SD so this should already be happening
Sent from my HTC Desire using xda premium
jhannbernas said:
hi guys,
i would just like to ask if it is possible to install apk and will automatically moved to sd-ext and not on data\app?
i'm currently on aurora v4.1. Any ideas? Thanks!
Click to expand...
Click to collapse
It is already on your sd-ext. Check sd-ext/app
thanks for your replies...
i think i got a problem here...
i tried to install an apk (download from pc and transfer to phone and then install) but when i visit the /data/app the apk i install was there.. and when i also visit the /sd-ext/app it was also there with the same size on what is in /data/app..
anyone can help me? do i need to flash some add-ons to make it automatically installed on /sd-ext? i just want to install apps which is automatically installed on /sd-ext and not mind the size of my /data.. what i'm i done wrong??
my details:
ROM: Aurora v4.1
16GB microsd card
sd-ext: 1GB ext4
sdcard is the rest
hboot: cm7/r2
partition via gparted
Thanks!
Not sure about that, Maybe an issue or duplication in the scriopt? Would only expect to see it in one or the other. May be best asking this in teh rom thread to be honest.
I think it's more likely that he's missing the symlink. Do an ls -l, to see the symlink
Droidzone said:
I think it's more likely that he's missing the symlink. Do an ls -l, to see the symlink
Click to expand...
Click to collapse
thanks sir. sorry but what is symlink? where can i do that?
jhannbernas said:
thanks for your replies...
i think i got a problem here...
i tried to install an apk (download from pc and transfer to phone and then install) but when i visit the /data/app the apk i install was there.. and when i also visit the /sd-ext/app it was also there with the same size on what is in /data/app..
anyone can help me? do i need to flash some add-ons to make it automatically installed on /sd-ext? i just want to install apps which is automatically installed on /sd-ext and not mind the size of my /data.. what i'm i done wrong??
my details:
ROM: Aurora v4.1
16GB microsd card
sd-ext: 1GB ext4
sdcard is the rest
hboot: cm7/r2
partition via gparted
Thanks!
Click to expand...
Click to collapse
That just means a2sd is working. The reason you are seeing the app in both data/app and sd-ext/app is because the sd-ext/app folder is symlinked to data/app. In short, what you are seeing in data/app are actually the files in sd-ext/app. Hence, the similar data size of the app.
Sent from my HTC Original Desire using Tapatalk
itachi1706 said:
That just means a2sd is working. The reason you are seeing the app in both data/app and sd-ext/app is because the sd-ext/app folder is symlinked to data/app. In short, what you are seeing in data/app are actually the files in sd-ext/app. Hence, the similar data size of the app.
Sent from my HTC Original Desire using Tapatalk
Click to expand...
Click to collapse
thanks. i got much clearer vision on it.
Ooooh. I thought you said sd-ext/app and sd-ext/data/app.
Silly me
Sent from my HTC Desire using xda premium
so this symlink thing will still occupy space on the data? am i right? thanks!
No. Its symlinked to sd-ext so thats where the space is taken up, however if you browse to /data/app, you can still see the file, even though its on /sd-ext/app
Thats what Symlinking is. Symbolic link. As far as android is concerned, the app will only run from /data/app so it must appear to be in /data/app
rootSU said:
No. Its symlinked to sd-ext so thats where the space is taken up, however if you browse to /data/app, you can still see the file, even though its on /sd-ext/app
Thats what Symlinking is. Symbolic link. As far as android is concerned, the app will only run from /data/app so it must appear to be in /data/app
Click to expand...
Click to collapse
thanks for the brief explanation but i don't understand why my /data size is decreasing as well when i install my app even the app go directly to /sd-ext/data..
Because some app-data is still stored in internal memory. That's how it is. The only thing to "solve" this is using a data2sd rom, which moves completely everthing from internal /data partition to a sd-ext partition.
MatDrOiD said:
Because some app-data is still stored in internal memory. That's how it is. The only thing to "solve" this is using a data2sd rom, which moves completely everthing from internal /data partition to a sd-ext partition.
Click to expand...
Click to collapse
thanks for the advise. i really consider that option.
just to add up, is data2sd different from data2ext?
jhannbernas said:
thanks for the advise. i really consider that option.
just to add up, is data2sd different from data2ext?
Click to expand...
Click to collapse
yes its better
ooppss. my bad.. i really forgot the other thread. please disregard.
Don't ask a question two times:
http://forum.xda-developers.com/showthread.php?t=1320341
how do I symlink an apk that is already installed in data\app
i don't want to use apps like link2sd

[Q] converting a stock hboot rom to cm7r2

Hi All,
I am attempting to edit leedroid final 2.5 to fit inside a cm7r2 hboot.
I have updated the updater-script and the unpacking of the zip works correctly.
I have symlinked /system/app to /sd-ext/app_s
I have confirmed the presence of apps on my sd-ext partition by checking using adb shell whilst in recovery.
The system size is less than 125MB.
I feel like i am missing something, the rom gets to the end of the the android boot animation and then falls into a loop.
My best guess is that it is related to the smaller cache partition on the cm7r2 hboot.
I can provide logcat prints if anyone has time to help or advise. (i am attempting to learn!)
Cheers
alexs1mmo said:
Hi All,
I am attempting to edit leedroid final 2.5 to fit inside a cm7r2 hboot.
I have updated the updater-script and the unpacking of the zip works correctly.
I have symlinked /system/app to /sd-ext/app_s
I have confirmed the presence of apps on my sd-ext partition by checking using adb shell whilst in recovery.
The system size is less than 125MB.
I feel like i am missing something, the rom gets to the end of the the android boot animation and then falls into a loop.
My best guess is that it is related to the smaller cache partition on the cm7r2 hboot.
I can provide logcat prints if anyone has time to help or advise. (i am attempting to learn!)
Cheers
Click to expand...
Click to collapse
I believe it is supposed to be that you symlink sd-ext/app_s to system/app and not the other way around. Also did you set permissions for sd-ext/app_s?
Sent from my Full Android on Bravo using Tapatalk
Hi,
Cheers for the reply.
I did symlink that /sd-ext/app_s to /system/app that way round and set permissions correctly.
I looked through leedroid 3 HD updater-script to make sure I had these correct.
Still no luck
Cheers
Sent from my HTC Desire using XDA App
did you mount sd ext in init.d?
Yeah, the original rom uses a2sd anyway so that should mean that it is already mounted?
Cheers
Sent from my HTC Desire using XDA App

[SCRIPT][CM7/9] /datadata/ low storage notification lagless fix - init.d script

Hello fellow I9000 users.
tl;dr - This fixes your low storage notification problems just by flashing it on CWM.
Disclaimer
First of all, I'd like to inform you that this post is a compilation of the work done by drafnel on the CyanogenMod forums, revthanki on the XDA-Developers forum, and as such I take little to no credit in it, as all I've done was ask for drafnel to help me in the cleanup code for me to put it in a flashable zip.
Sources:
http://forum.cyanogenmod.com/topic/39718-workaround-for-small-datadata-partition/
http://forum.xda-developers.com/showthread.php?t=1444333
Also, as you should know, you take full responsability should data loss or other kinds of damage occur.
Introduction
Lot's of people have encountered the problem where their /datadata partition fills up and then apps begin force closing. This is often confusing since there is usually a lot of space available on the internal 2GB storage partition. But these are two different partitions on cyanogenmod. The created the datadata partition on the fast internal memory so that apps would start up and run faster (i.e. less lag), but it is only about 170MB (which can't be helped).
One thing that can be done is to move the contents of /datadata onto the 2GB /data partition. That will solve the space problem, but then you have the lag problem. So, what we need is for the files that take up a lot of space to reside on the 2GB partition and the files that are accessed frequently by an app to reside an the fast 170MB partition. The files that are accessed often, or that affect app startup speed are the sqlite database files and the xml preferences files. These reside in the databases and shared_prefs sub-directories in each app directory. Drafnel has written a script to perform these operations.
Requirements
Samsung Galaxy S based phone (GT-I9000, Vibrant, Fascinate, Captivate, etc.)
Kernel that supports init.d scripts
How to use it?
As you would flash a ROM update or a Kernel:
Download the file to your sdcard.
Reboot your phone into CWM.
Choose 'install zip from sdcard', and choose the script from there.
It will run on boot everytime. It's pretty light so your total boot time shouldn't suffer. It will only do the operations if they are needed, and it will clean up after itself. No need to worry about broken links or stale resources.
What it actually does?
On every boot:
Runs a check to see if /data/data is still symlinked to /datadata/
Moves everything that isn't performance critical from /datadata/ to unlinked /data/data/
Cleans up old databases from uninstalled apps
Other stuff to watch out for
Titanium Backup users should tick the Preferences > Troubleshooting settings > Follow all symbolic links option
SlimICS users should follow this procedure
Changelog
11032012 - First working release.
LOL. I posted a request for exactly this script in the mintberry thread a few days ago!
Good work fella, Cheers.
OMG yeah! Was waiting for something like that . Will give it a try next time I'll encounter this problem .
Thanks mate.
Just flashed it. Cheers!
Sent from my GT-I9000 using xda premium
I had HUGE problems with Titanium Backup.
I lose all by backups some weeks ago because symlinked were corrupted after restore!
Njcki said:
I had HUGE problems with Titanium Backup.
I lose all by backups some weeks ago because symlinked were corrupted after restore!
Click to expand...
Click to collapse
According to this post, you can now force TB to follow all symbolic links for backup and restore.
what if i already moved all my apps data to sdcard? do i move it back to internal memory then flash the script, or just flash the script then move the data to internal memory? which is the correct way?
naTrium said:
According to this post, you can now force TB to follow all symbolic links for backup and restore.
Click to expand...
Click to collapse
Thanks! I'll try
AFAIK, if you have moved your apps to the SD card using the regular method (Apps2SD), the script will still work. This is because there's always leftover data on the phone, which then points to /.android_secure/ on the sdcard.
This script only changes the location of some data, but it's transparent to the phone.
If you don't feel safe about it, a full nandroid backup will restore the system to whatever setup you have now. (it also backs up what's mounted on the sdcard)
Well done! I knew I was never going to get round to this I'll close my old thread and redirect people here. Before I do so:
1) does the stock CM9 kernel support init.d scripts? If not stock kernel users will have to follow the manual method.
2) maybe it's worth putting a capitalised warning in your post to get people to set the option in Titanium Backup to follow all symbolic links
I flashed this script already but the low on space notification is still shown. It's definitely not working.
Do I have to create .nodatadata file inside /datadata and reboot now?
Sent from Ice-Cream flavored SGS GT-I9000 using Tapatalk
Free space in datadata folder,
Before flashing the script = 25mb
After flashing the script = 146mb
Definitely works without any lags.. one might experience lags on the first boot but after another reboot all gonna be super smooth like before!
Thanks a lot!!
It deleted some of my apps like Dolphin HD. I'm running CM9, with IcyGlitch Kernel. Oh well, restored.
Gr8 work
Many Thanks,
i have been waiting for this script ever since Darktremor Apps2SD (2010 !!! )
thank you!!!!!!!!!!!!!!
Great Job!
Excellent, it's very smooth like before, thanks a lot.
aha! that's the reason why all my apps suddenly began to lag like hell and some time after that force close. had only 1MB free space on /datadata partition lol. script works like a charm! thx
Sent from my GT-i9000 using xda premium
stfudude said:
I flashed this script already but the low on space notification is still shown. It's definitely not working.
Do I have to create .nodatadata file inside /datadata and reboot now?
Sent from Ice-Cream flavored SGS GT-I9000 using Tapatalk
Click to expand...
Click to collapse
I heard some kernels don't load init.d scripts on ICS, might be related to that.
finally......
before script 11mb and after got 168mb free space! thanks!
really nice stuff

[Q] Getting Gapps on [JUNE 17][4.2.2] PARANOIDANDROID v3.60 | HALO

A first post here, please be gentle with me, and huge thanks to everyone who has made posting here unnecessary until now.
After a long time using CynogenMod 7.1 on my Desire, when I came to switching SIMs on it, I decided to look for a new ROM too because I was having a problem with shortage of app space and I was missing a few features I have become used to on JellyBean.
A look at the options found the one in the title by WoH (development forum link). It separates out the ROM and the Google Apps. I can install the ROM, and I like it a lot. I can't get the Google Apps to install.
Tried: flashing the zip file at http://woh-roms.weebly.com/gapps.html via the recovery menu, and installing a2sd. It has the right MD5 and appears to go OK, but the apps don't appear when the phone is rebooted, or appear in the list of things moved by a2sd. I have made repeated attempts, both with wiping user data before and afterwards, and doing it before rebooting after installing the ROM and after an initial boot with it, all without success.
Tried: reading the instructions there. However I don't have adb installed and because I don't have Google Play, I can't install a file manager that unzips files (the one in the ROM doesn't appear to - no unzip option is given).
Tried: installing the ROM mentioned in the development subforum thread by timvdlinde which does have Google Play. That works, but I am not so keen on the ROM itself. This may be incredibly shallow, but I liked WoH's use of the Nexus boot animation, and the timvdlinde ROM has the Nova launcher which I am not interested in.
The phone: an unlocked, rooted, AMOLED GSM Desire. The recovery is the Clockworkmod ROM Manager one. I don't remember ever changing the hboot settings. There is a sizeable ext4 partition on the SD card and it is being used by a2sd.
lovingboth said:
A first post here, please be gentle with me, and huge thanks to everyone who has made posting here unnecessary until now.
After a long time using CynogenMod 7.1 on my Desire, when I came to switching SIMs on it, I decided to look for a new ROM too because I was having a problem with shortage of app space and I was missing a few features I have become used to on JellyBean.
A look at the options found the one in the title by WoH (development forum link). It separates out the ROM and the Google Apps. I can install the ROM, and I like it a lot. I can't get the Google Apps to install.
Tried: flashing the zip file at http://woh-roms.weebly.com/gapps.html via the recovery menu, and installing a2sd. It has the right MD5 and appears to go OK, but the apps don't appear when the phone is rebooted, or appear in the list of things moved by a2sd. I have made repeated attempts, both with wiping user data before and afterwards, and doing it before rebooting after installing the ROM and after an initial boot with it, all without success.
Tried: reading the instructions there. However I don't have adb installed and because I don't have Google Play, I can't install a file manager that unzips files (the one in the ROM doesn't appear to - no unzip option is given).
Tried: installing the ROM mentioned in the development subforum thread by timvdlinde which does have Google Play. That works, but I am not so keen on the ROM itself. This may be incredibly shallow, but I liked WoH's use of the Nexus boot animation, and the timvdlinde ROM has the Nova launcher which I am not interested in.
The phone: an unlocked, rooted, AMOLED GSM Desire. The recovery is the Clockworkmod ROM Manager one. I don't remember ever changing the hboot settings. There is a sizeable ext4 partition on the SD card and it is being used by a2sd.
Click to expand...
Click to collapse
Repartition your sd-card by using the partitioning guide in my sig.
onknope what
abaaaabbbb63 said:
Repartition your sd-card by using the partitioning guide in my sig.
Click to expand...
Click to collapse
Thanks, but I did that before starting this. I used gparted, ending up with a large FAT32 partition, followed by a smaller ext4 and finally a small swap.
lovingboth said:
Thanks, but I did that before starting this. I used gparted, ending up with a large FAT32 partition, followed by a smaller ext4 and finally a small swap.
Click to expand...
Click to collapse
Theres no need for a swap partition. If you are using PA it will just act as a waste of space, since the rom doesnt utilize it in any way.
Try doing a full wipe and reflash the rom. Then flash these gapps. I can guarantee those work, as i use the same rom with those gapps and everything is fine. After flashing run the a2sd script through terminal.
chromium96 said:
Try doing a full wipe and reflash the rom. Then flash these gapps. I can guarantee those work, as i use the same rom with those gapps and everything is fine. After flashing run the a2sd script through terminal.
Click to expand...
Click to collapse
To quote Napoleon Wilson, you can't argue with a confident man even if that's the file I've been trying - same source, same MD5
OK, I'm about to give it another go.
(And apologies if you don't identify as a man!)
lovingboth said:
To quote Napoleon Wilson, you can't argue with a confident man even if that's the file I've been trying - same source, same MD5
OK, I'm about to give it another go.
(And apologies if you don't identify as a man!)
Click to expand...
Click to collapse
Lol, weird. Im on the same rom and used the same gapps. Everything worked fine.
chromium96 said:
Lol, weird. Im on the same rom and used the same gapps. Everything worked fine.
Click to expand...
Click to collapse
Not for me. I took some photos of the process, which I can put somewhere, but it was...
Repartition the SD card
Boot into recovery
Wipe data
Wipe cache
Install ROM.zip (using the one downloaded from the right place, no reported problems)
Install Gapps.zip (ditto)
Reboot
Notice that the Google apps aren't there
Do the su / mount / a2sd install anyway
Reboot (through saying yes to the third question)
Notice that the progress of the move to the ext4 partition says its moving 59 items, none of which are Google apps
Confirm that the Google apps still aren't there
I'm about to try again with another SD card on the basis of 'why not'
lovingboth said:
Not for me. I took some photos of the process, which I can put somewhere, but it was...
Repartition the SD card
Boot into recovery
Wipe data
Wipe cache
Install ROM.zip (using the one downloaded from the right place, no reported problems)
Install Gapps.zip (ditto)
Reboot
Notice that the Google apps aren't there
Do the su / mount / a2sd install anyway
Reboot (through saying yes to the third question)
Notice that the progress of the move to the ext4 partition says its moving 59 items, none of which are Google apps
Confirm that the Google apps still aren't there
I'm about to try again with another SD card on the basis of 'why not'
Click to expand...
Click to collapse
Go to system/app. Are the google apps installed? What permissions do they have?
abaaaabbbb63 said:
Go to system/app. Are the google apps installed? What permissions do they have?
Click to expand...
Click to collapse
Ah, no they're not.
About sixty are, owned by root, with rw (owner) and r (group and global) permissions.
I am being tempted to bite the bullet, install the ADK on something and try the adb method.
What about /sd-ext/gapps/system/app. Anything there?
chromium96 said:
What about /sd-ext/gapps/system/app. Anything there?
Click to expand...
Click to collapse
Yep, they are there, with what I presume are the right permissions: as above, owned by root, rw-r-r.
Doing some more nosing around, and looking at the alternative installation instructions on woh-roms.weebly.com/gapps.html
$ adb shell ls /sd-ext/gapps/system
app etc framework lib usr
Click to expand...
Click to collapse
Yes, doing
ls /sd-ext/gapps/system
produces that.
# enable extgapps (quotes needed)
$ adb shell "echo x > /sd-ext/gapps/.extgapps"
# gapps dir should look like this (if .extgapps doesnt exist the init script wont run)
$ adb shell ls -a /sd-ext/gapps/
.extgapps system
Click to expand...
Click to collapse
Yes, doing
ls -a /sd-ext/gapps/
produces that.
.extgapps is a zero byte file, rather than one byte containing 'x' as there, but the root explorer instructions would produce a zero byte file, so presumably a) there's no touch command and b) it's the presence of the file that's important, not what it contains.
BUT...
... if I do
logcat -C
(after doing logcat -c, going oops, rebooting, and getting it right )
then the lines that are supposed to be there aren't.
I'll get the email working, email the output to myself and stick it in a pastebin or similar.
pastebin.com/Qtrps3A8 has the whole thing.
At the start, various links are possibly not set up:
I/run-parts( 75): ln: /system/etc/permissions/com.google.android.maps.xml: Out of memory
I/extgapps( 155): Created /system/etc/permissions/com.google.android.maps.xml
Click to expand...
Click to collapse
is just one example, then later
D/AlarmScheduler( 1300): No events found starting within 1 week.
I/Goo Parser( 839): GAPPS: No file, skipping item 0
I/Goo Parser( 839): GAPPS URL: http://goo.im/devs/paranoidandroid/roms/gapps/pa_gapps-full-4.2-20130702-signed.zip
I/AlarmReceiver( 839): gooVer: 3601
Click to expand...
Click to collapse
.. so what file is it looking for, and is this down to trying to do things with the card before it is ready?
What has changed:
The search 'app' has gone from the list - I can see from the logs that it is supposed to be replaced, but here it's just missing.
The browser is now very like Chrome... and I don't remember that being the case.

Categories

Resources