[Q] clean up contacts many 'null' entries - Droid Incredible Q&A, Help & Troubleshooting

I'm thinking since the phone is unix based, there ought to be a way
using a shell script to delete the entries with the first name 'null'
or 'unnamed' & no other data fields (all empty records).
I guess, in BSD or Linux I would use something like
#!/bin/sh
cat file-name | sed -e 's/(null|unnamed)//d' > file-name2
mv file-name2 file-name
but i don't know where the data are or what format they are in?
Could anyone suggest a good way to delete the empty contacts?
I have about 1000 real contacts and so far 3000 empties and growing.
Ideally I would like to change all records from 'google' to 'pc/phone'.
I do not use google for sync/backup. I backup to the sd card and
then copy it to a pc for archive.
Thanks

Related

Anyone got JIT running on hero?

I've been working on getting jit working in the hero, but have hit a wall... I can get my legend ROM to boot and run the setup wizard fine, except that as soon as sense comes along, the entire phone crashes
I'm using the libdvm.so from the g1 thread (the one called something to do with donuts )
I've tried this on my own ROM, benhaam's legendary alpha and RaiderX303's Rom. So I've tried an odexed and unodexed ROM, but both behave the same...
I know the cdma guys got this working, anyone got any suggestions on what I've missed?
I just tried this on vanillain some weeks ago and it was working out of the box, but never got it working on any senseroms
Got it working on HeroDroid 0.3, but it force closes on unlocking by sliding (double-hitting menu button works) and on screen switching, again, by sliding (works if you use pinch-to-zoom out, then selecting the screen you want). Everything else works smooth and fast, but these two problems are an extreme pain in the ass
I've made a JIT build, but there are still too many stability issues to use it in production (everyday use).
Thanks all. Guess this is one for my vanilla roms in future...
Anyone heard any more about dalvik turbo (the commercial product)?
Supposedly, it is for OEMs and manufacturers. I expect the company wants their product licensed by phone manufacturers such as HTC and Motorola (that would be a simple means of collecting recurring revenue). Although it would be nice if they offered it in the Marketplace.
Let me say that the library could work on many ROMs on many Android Devices that use similar processors.
This library may or may not work, I didn't compile it only figured out that it works on CyanogenMOD based on 1.6. since you are able to get booted it seems you are good to go.
Since the update of CyanogenMOD 4.2.15.x the library loops FCs, checking further revealed that some dex files of /data/dalvik-cache were relocated to /cache/dalvik-cache (you can check his wiki page on moving dalvik-cache).
Haven't found where the script is doing this yet and haven't asked either but we have a work around that basically moves the dex files to either /data/dalvik-cache or /system/sd/dalvik-cache (for apps2sd users) remove the /cache/dalvik-cache folder and create a symbolic link there instead.
Code:
ln -s /data/dalvik-cache /cache/dalvik-cache
or
Code:
ln -s /system/sd/dalvik-cache /cache/dalvik-cache
or both
Code:
ln -s /system/sd/dalvik-cache /data/dalvik-cache
ln -s /system/sd/dalvik-cache /cache/dalvik-cache
replace /data/dalvik-cache with /system/sd/dalvic-cache or vice versa (you really just want to get them in one location where ever your dex files are located should be your target.)
FYI, clearing your dex files seems to resolve stability issues.
Good luck, let me know if it works via a PM.
BTW the hack is called "Dusted Donuts"
anon2122 said:
the one called something to do with donuts
Click to expand...
Click to collapse
The cause (I think) is that binding /cache/dalvik-cache to /data/dalvik-cache or to /dev/block/mmcblock4 is failling with this library or apps2sd is causing it.
anon2122 said:
I've been working on getting jit working in the hero, but have hit a wall... I can get my legend ROM to boot and run the setup wizard fine, except that as soon as sense comes along, the entire phone crashes
I'm using the libdvm.so from the g1 thread (the one called something to do with donuts )
I've tried this on my own ROM, benhaam's legendary alpha and RaiderX303's Rom. So I've tried an odexed and unodexed ROM, but both behave the same...
I know the cdma guys got this working, anyone got any suggestions on what I've missed?
Click to expand...
Click to collapse
licknuts said:
Let me say that the library could work on many ROMs on many Android Devices that use similar processors.
This library may or may not work, I didn't compile it only figured out that it works on CyanogenMOD based on 1.6. since you are able to get booted it seems you are good to go.
Since the update of CyanogenMOD 4.2.15.x the library loops FCs, checking further revealed that some dex files of /data/dalvik-cache were relocated to /cache/dalvik-cache (you can check his wiki page on moving dalvik-cache).
Haven't found where the script is doing this yet and haven't asked either but we have a work around that basically moves the dex files to either /data/dalvik-cache or /system/sd/dalvik-cache (for apps2sd users) remove the /cache/dalvik-cache folder and create a symbolic link there instead.
Code:
ln -s /data/dalvik-cache /cache/dalvik-cache
or
Code:
ln -s /system/sd/dalvik-cache /cache/dalvik-cache
or both
Code:
ln -s /system/sd/dalvik-cache /data/dalvik-cache
ln -s /system/sd/dalvik-cache /cache/dalvik-cache
replace /data/dalvik-cache with /system/sd/dalvic-cache or vice versa (you really just want to get them in one location where ever your dex files are located should be your target.)
FYI, clearing your dex files seems to resolve stability issues.
Good luck, let me know if it works via a PM.
BTW the hack is called "Dusted Donuts"
The cause (I think) is that binding /cache/dalvik-cache to /data/dalvik-cache or to /dev/block/mmcblock4 is failling with this library or apps2sd is causing it.
Click to expand...
Click to collapse
Cheers for the info. I will take a look tonight on a build without A2SD (I've got one handy for this kind of thing...)
So, to confirm, I could quickly test this by pushing the libdvm.so file to the usual place (on a ROM with no A2SD) immediately after flashing it (ie. not booted after installing the ROM)
That should then, as far as I understand, do it. I take it that if I wipe dalvik cache before the install of the test ROM, there is no need to re-wipe the dalvik cache (no dex files should have been created)?
Then, I do 'ln -s /data/dalvik-cache /cache/dalvik-cache' to pop a redirect on the data folder?
Please let me know if I'm reading this right before I go and try it again, as I'd hate to try it and find out I was doing it wrong...
Cheers
just wanted to say, would be nice if you could keep the updates coming to this thread, as i am following it as well. just because of the reference to pm. thanks
kendong2 said:
just wanted to say, would be nice if you could keep the updates coming to this thread, as i am following it as well. just because of the reference to pm. thanks
Click to expand...
Click to collapse
No worries. I'll post anything on here, as I'm sure it's not just us that want to know if it works. I'm not doing anything hero related tonight, but maybe friday...
Must do some other work
It's Sense that's making issues..
rolle3k said:
It's Sense that's making issues..
Click to expand...
Click to collapse
Yup. I've not got time to flash tonight, but have you looked at some of the stuff posted by 'licknuts' on page 1? He suggests a couple of commands that should keep the optimised dex files in the right place using symlinks.
anon2122 said:
Yup. I've not got time to flash tonight, but have you looked at some of the stuff posted by 'licknuts' on page 1? He suggests a couple of commands that should keep the optimised dex files in the right place using symlinks.
Click to expand...
Click to collapse
Well, I was experimenting with that dalvik library on my own. Of course you have to clear the dalvik cache, it's just Sense that does not like to operate with jit enabled.
You can use jit without problems if you disable Sense and use androids default lockscreen, which is in my opinion much cooler anyway.
Interesting. How is it, stability-wise in vanilla config?
(I am considering releasing an 'add-on' unofficial update.zip for a couple of roms to make them vanilla with jit, but only if its really stable. I was thinking villain 3.4 and legendary 1.2
As small incremental updates that just remove the rosie & lockscreen and push the new libdvm.
Open question @all:
Any views in this? Would you want this as an add-on to existing roms if stable? Would you usr it? Suggestions welcome. Obviously this is just an idea. Would need to test and consult devs first...
anon2122 said:
Interesting. How is it, stability-wise in vanilla config?
(I am considering releasing an 'add-on' unofficial update.zip for a couple of roms to make them vanilla with jit, but only if its really stable. I was thinking villain 3.4 and legendary 1.2
As small incremental updates that just remove the rosie & lockscreen and push the new libdvm.
Open question @all:
Any views in this? Would you want this as an add-on to existing roms if stable? Would you usr it? Suggestions welcome. Obviously this is just an idea. Would need to test and consult devs first...
Click to expand...
Click to collapse
I would def. use it. I was playing around with it (managed it to open some applications/browse) and it was very fast. You can feel how much better it works.
the work around I posted is really catered specifically for CyanogenMOD 4.2.15.x based with Android 1.6 with some eclair bits thrown in but could work on older Android versions. Our work around was to deal with dex files being in two locations and it seemed that binding the two directories would break caused by the library or apps2sd script.
If you know where you dex files are for a particular ROM are located , easiest to try and put them in one location IF THEY ARE SPLIT up and create a symbolic link pointing to the single location, it might not be needed at all, I just don't have a Hero to test with and our Hero ROMs are brutal to run run with our G1s because of lack of memeory.
As for a Hero ROM if the dex files are in one location I think it should be good. Set the permissions, owner and group on the file.
##back up your original file incase it don't workout
cp /system/lib/libdvm.so /sdcard/dusted-donuts/bak/
## install from where ever you extracted from
cp -f /sdcard/dusted-donuts/lib/libdvm.so /system/lib/
## set owner permissions
chown 0:0 /system/lib/libdvm.so
chmod 644 /system/lib/libdvm.so
##only make a symbolic link if you had to move dex files from a different location..
ln -s /data/dalvik-cache /sdcard/sd/dalvik-cache
just an example.
This may be your best option for older Android builds.
Grab the vmlibs.zip extract the files and don't use the build.prop and copy the additional files as so back up your original files first incase it don't work.
assuming you extracted the files to a newly created /sdcard/vmlibs directory
cp -f /sdcard/vmlibs/bin/dalvikvm /system/bin/
cp -f /sdcard/vmlibs/libdvm.so /system/lib/
cp -f /sdcard/vmlibs/libdhelper.so /system/lib/
rm -f /data/dalvik-cache/*
Booting is slow like 5-10 minutes and if previously your tried the libdvm.so file and got the device to but and FCs, you may just need to find and additional work around.
these commands are for recovery console and terminal. might be a typos in there.
anon2122 said:
Cheers for the info. I will take a look tonight on a build without A2SD (I've got one handy for this kind of thing...)
So, to confirm, I could quickly test this by pushing the libdvm.so file to the usual place (on a ROM with no A2SD) immediately after flashing it (ie. not booted after installing the ROM)
That should then, as far as I understand, do it. I take it that if I wipe dalvik cache before the install of the test ROM, there is no need to re-wipe the dalvik cache (no dex files should have been created)?
Then, I do 'ln -s /data/dalvik-cache /cache/dalvik-cache' to pop a redirect on the data folder?
Please let me know if I'm reading this right before I go and try it again, as I'd hate to try it and find out I was doing it wrong...
Cheers
Click to expand...
Click to collapse
Been playing around with it now.
I had to remove the Hero Lockscreen by doing the following
Code:
# adb remount
# adb shell rm system/app/HtcLockScreen.apk
And I also had to disable Sense.
Once you did that, you can use JIT altho you will lack of the Sense Home screen.
Hmm, nice job. Give this this a try for the screen lock, have had similar issues with varrying apps and this seems to fix them especially when trying various Launcher.apk replacements. Really looking to clear the app settings found in /data/data somewhere the name does not have to match the app name so you may need to hunt for it in /data/data.
mount data for read write and backup your HtcLockScreen.apk to sdcard somwhere.
Code:
******optional**********
killall android.process.acore
***********************
rm -f /system/app/HtcLockScreen.apk
rm -f /data/dalvik-cache/*HtcLockScreen*
rm -fr /data/data/*HtcLockScreen*
cp -f /sdcard/backup/app/HtcLockScreen.apk /system/app/
chown 0:0 /system/app/HtcLockScreen.apk
chmod 644 /system/app/HtcLockScreen.apk
reboot
/sdcard/backup/app (replace the path with the location of a backup of the file.)
rolle3k said:
Been playing around with it now.
I had to remove the Hero Lockscreen by doing the following
Code:
# adb remount
# adb shell rm system/app/HtcLockScreen.apk
And I also had to disable Sense.
Once you did that, you can use JIT altho you will lack of the Sense Home screen.
Click to expand...
Click to collapse
Installed libdvm.so on aHero 0.4, a vanilla rom, everything works fine.

relocate_apps.sh - When size matters [final] [2010-08-17]

I've made a script that relocates all your apps into an EXT2 filesystem in /sdcard/andboot/apps.img.
Advantages
- Get a LOT of space for apps even if everything else is running in NAND
- Never need to reinstall apps when upgrading (as long as the release has this script)
- Dual boot, for example, Eclair in NAND, Froyo on SD-card, but share the same apps.
- Wipe data (all settings) but keep all the apps stays (but not their settings)
Disadvantages
- Propably a bit slower than keeping everything in NAND
- If you intend to keep apps when when upgradring/switching releases then odex:ing your Market apps is not a good idea when using this.
Attached is an update that should work on any Android build (for our devices). The script in the update is only used once to create /sdcard/andboot/apps.img. Once it exist, the init script in the new initrd.gz (included in the attached NBH for NAND users) will automaticly mount /sdcard/andboot/apps.img to /data/app on boot no matter what Android build you are using.
Instructions
1a. Flash the attached kernel (but configure it first if needed with Loserskaters NBH editor) (NAND Users)
1b. Replace andboot\initrd.gz (HaRET users)
2. Apply attached update (adds relocate_apps.sh to /system/bin)
3. Do this in a terminal:
$su
#relocate_apps.sh 256 (for 256Mb storage, the choice is yours)
<wait until it finishes>
That's it. Upon the next boot your old apps in /data/app will be deleted to free up space.
To uninstall, delete the apps.img file on the SD-card, then wipe your data.
I've done some testing and it seems to work fine. I'm currently dual booting VaniljEclair (NAND) and Fresh Froyo (SD-card instal) and they share the same apps. Works fine for me but I cannot guarantee that it is without bugs.
Known limitations
- Won't work with apps that installs to /data/app-private (like some banking apps) so you have to reinstall them if you switch build or wipe your data.
- You can't remove the SD-card without powering off the phone since your apps are now stored on it.
kallt_kaffe said:
I've made a script that relocates all your apps into EXT2 filesystem in /sdcard/andboot/apps.img.
Advantages
- Get a LOT of space for apps even if everything else is running in NAND
- Never need to reinstall apps when upgrading (as long as the release has this script)
- Dual boot, for example, Eclair in NAND, Froyo on SD-card, but share the same apps.
- Wipe data (all settings) but keep all the apps stays (but not their settings)
Disadvantages
- Propably a bit slower than keeping everything in NAND
- If you intend to keep apps when when upgradring/switching releases then odex:ing your Market apps is not a good idea when using this.
Attached is an update for VaniljEclair RLS10b but it could tweaked into any release if you know what you are doing ("/system/bin/relocate_apps.sh boot" needs to be executed early, could be done either in a userinit.sh if the build has one or set up as a run-once service in sysinit.rc)
Instructions
$su
#relocate_apps.sh 256 (for 256Mb storage, the choice is yours)
<wait until it finishes>
That's it. The final version will delete your old apps on the next reboot to free up space in /data but this experimental version does not do that.
THIS IS AN EXPERIMENTAL SCRIPT. USE IT AT YOUR OWN RISK.
Click to expand...
Click to collapse
Interesting....so to get it work on fresh froyo I need to add this line /system/bin/relocate_apps.sh boot into userinit.sh?
Also when could we expect the version that deletes apps from system after moving them to sd?
-Arturo- said:
Interesting....so to get it work on fresh froyo I need to add this line /system/bin/relocate_apps.sh boot into userinit.sh?
Click to expand...
Click to collapse
Not anymore, the new version has that part in the initrd.gz so it will work in ANY build without modifications once you've relocated your apps.
Also when could we expect the version that deletes apps from system after moving them to sd?
Click to expand...
Click to collapse
Right now.
If this works as well as it seems to do I will push my changes to the bootenv and tinboot repo's so that all new kernels will have support for this. I will also include the relocate_apps.sh script in next VaniljEclair release and push it to Fresh Froyo.
While I have never needed more space on /data I still find this very useful as I now only need to reinstall one single app (my banking app) when I reinstall my phone (which I do quite often).
btw, I'm using a 512Mb image for /data/apps right now I don't think I will ever come close to fill it up.
kaffe, can we put apps (only apps, data still on NAND) on a second ext2 partition instead ext2 filesystem? I think it will be faster.
kallt_kaffe said:
Not anymore, the new version has that part in the initrd.gz so it will work in ANY build without modifications once you've relocated your apps.
Click to expand...
Click to collapse
Just a quick question, i know i could just try it and find out for myself but with the new kernel, does it mount /data/app normally if the apps.img does not exist??
EDIT::
Just realised that it must do this for it to work the first time but i'm guessing at the minute there is no way to revert back to apps on the /data partition without wiping and starting a fresh.
Hi..thanks for the app.
I follow direction unitl the app.img was mounted and saw the msg saying /data will be deleted after reboot, but after reboot the internal memory is still the same. Any idea?
ps. I am running your 2.1 built (on polaris) so I didn't follow your step1, so maybe that is why it didn't work?
Cookiekaikai said:
Hi..thanks for the app.
I follow direction unitl the app.img was mounted and saw the msg saying /data will be deleted after reboot, but after reboot the internal memory is still the same. Any idea?
ps. I am running your 2.1 built (on polaris) so I didn't follow your step1, so maybe that is why it didn't work?
Click to expand...
Click to collapse
Are you saying you didn't flash the kernel provided?? If so the apps.img on the sdcard will not be mounted. You need to modify the kernel NBH with the NBH editor to work with Polaris, flash it and try again. Sorry if i misunderstood and you have already done this.
Can the kernel file you attached be used for vogue at 320x240 res?
edit: actually, if it's not too much trouble...could you explain how to get this working on a vogue froyo nand 320x240? Thanks!
kallt_kaffe said:
Not anymore, the new version has that part in the initrd.gz so it will work in ANY build without modifications once you've relocated your apps.
Right now.
If this works as well as it seems to do I will push my changes to the bootenv and tinboot repo's so that all new kernels will have support for this. I will also include the relocate_apps.sh script in next VaniljEclair release and push it to Fresh Froyo.
While I have never needed more space on /data I still find this very useful as I now only need to reinstall one single app (my banking app) when I reinstall my phone (which I do quite often).
btw, I'm using a 512Mb image for /data/apps right now I don't think I will ever come close to fill it up.
Click to expand...
Click to collapse
Ok seems to be working fine for me with 512 image. Will report back in a few days.
scooter1556 said:
Are you saying you didn't flash the kernel provided?? If so the apps.img on the sdcard will not be mounted. You need to modify the kernel NBH with the NBH editor to work with Polaris, flash it and try again. Sorry if i misunderstood and you have already done this.
Click to expand...
Click to collapse
I didn't flash the kernel because the file name says FROYO but I am running eclair. However I am pretty sure the file was created and mounted as well.
I do know how to use NBH editor but just want to be sure that the kernel is safe even if I am running eclair.
Thanks for the reply
UPDATE: never mind I forgot you can select eclair as type. I will report back once I am done with the rest of the steps. THX!
Cookiekaikai said:
I didn't flash the kernel because the file name says FROYO but I am running eclair. However I am pretty sure the file was created and mounted as well.
I do know how to use NBH editor but just want to be sure that the kernel is safe even if I am running eclair.
Thanks for the reply
Click to expand...
Click to collapse
Yes it's safe.i think Kalt has made all the required changes to make kernel work on both froyo and eclair.
Kalt I'm wondering about something.I've already created the image for apps but I'm not sure what's going to happen when I instal new applications.will they automatically be moved to the image or do I have to run the script after ever installation off apk file?
tuannam said:
kaffe, can we put apps (only apps, data still on NAND) on a second ext2 partition instead ext2 filesystem? I think it will be faster.
Click to expand...
Click to collapse
It would propably be a little bit faster but it will be a lot more complicated to make and perhaps even more complicated to use. We allready have a de facto standard with this partitioning:
part 1 - FAT32
part 2 - system
part 3 - data
part 4 - swap
Now, not many uses swap on SD-card so we could propably say partition 4 should be used for this, right? But then we also would need to now that partition 4 really is ext2 and is having apps on it before we mount it. And it is also quite complicated for most people to partition their SD-cards in the first place.
So basicly, what I'm saying is that it propably could make small difference in performance but I'm not convinced it would be worth it. The way it works now is pretty safe as it won't do anything unless /sdcard/andboot/apps.img exist and setting it up is a simple one-liner in the terminal.
On the other hand an advanced user could set up their own apps on ext2-partition manually and add some lines to userinit.sh that mounts it.
So I don't know, at least I don't have any plans to add it at the moment. Perhaps someone could add it later if the advantages turns out to be big enough to make it worth it.
EDIT: Another aspect is that /data/app is only written to when installing, all other accesses should be only reads. All writing to /data is still in NAND so I really think the performance penalty is minimal. I haven't been able to tell the difference myself.
scooter1556 said:
Just a quick question, i know i could just try it and find out for myself but with the new kernel, does it mount /data/app normally if the apps.img does not exist??
EDIT::
Just realised that it must do this for it to work the first time but i'm guessing at the minute there is no way to revert back to apps on the /data partition without wiping and starting a fresh.
Click to expand...
Click to collapse
Your logic is correct.
Cookiekaikai said:
UPDATE: never mind I forgot you can select eclair as type. I will report back once I am done with the rest of the steps. THX!
Click to expand...
Click to collapse
If you are using the latest VaniljEclair then use a Froyo kernel. With the latest version of the libcamera.so the Froyo kernel can and should be used to get the extra 11Mb of memory.
-Arturo- said:
Yes it's safe.i think Kalt has made all the required changes to make kernel work on both froyo and eclair.
Kalt I'm wondering about something.I've already created the image for apps but I'm not sure what's going to happen when I instal new applications.will they automatically be moved to the image or do I have to run the script after ever installation off apk file?
Click to expand...
Click to collapse
As long as you have the new kernel and have run the script once then everything you install will end up i apps.img.
I must be doing something wrong. I flashed the new kernel, performed the update then ran the script(saw the /data/app copied screen and was told after reboot it would take effect, but internal memory is still going down after reboot).
UPDATE: after doing some PD I found the app.img disappeared from andboot. Not sure what is going on but i am recreating another one now.
Played around with this, and I think it's working on my vogue... ~60mb free on phone. Performance isn't too bad. Thanks!
kallt_kaffe said:
As long as you have the new kernel and have run the script once then everything you install will end up i apps.img.
Click to expand...
Click to collapse
Kalt I have a feeling that the script messes up compcache(it could also be the new cell location patch) My sd card is not recognized after restart of the system with compcache enabled. I remember that we had already suffered with this problem and you fixed it by adding 120 s delay to the script. I've notice that with apk image the system takes a bit more time to boot and load widgets in comparison to apks on nand. Could that be the problem? I would like to increase the delay in compcache script to maybe 180 seconds or so to see if it fixes the issue.
What should i change in this script to change the delay time?
Does this 2>&1 stands for 120 seconds?
Code:
#!/system/bin/sh
#
# Compcache manager
#
#
# Change these variables to tweak the compcache
#
opts= # Use default (25% of the avaliable RAM (~23-24Mb))
#opts='disksize_kb=16384' # 16Mb compcache
#opts='disksize_kb=32768' # 32Mb compcache
#opts='backing_swap=/dev/block/mmcblk0p4' # compcache (default size 15% of available RAM) + backing swap (on SD card)
#opts='backing_swap=/dev/block/mmcblk0p4 memlimit_kb=32768' # 32Mb compcache + backing swap (on SD card)
# Swappiness
swappy=30
case "$1" in
start)
sleep 120
insmod /system/lib/modules/lzo_compress.ko >/dev/null 2>&1
insmod /system/lib/modules/lzo_decompress.ko >/dev/null 2>&1
insmod /system/lib/modules/xvmalloc.ko >/dev/null 2>&1
insmod /system/lib/modules/ramzswap.ko $opts >/dev/null 2>&1
swapon /dev/block/ramzswap0
sysctl -w vm.swappiness=$swappy
;;
stop)
swapoff /dev/block/ramzswap0
;;
enable)
setprop persist.service.compcache 1
echo "Compcache will be enabled in 120 seconds."
;;
disable)
setprop persist.service.compcache 0
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
Thanks
-Arturo- said:
Kalt I have a feeling that the script messes up compcache(it could also be the new cell location patch) My sd card is not recognized after restart of the system with compcache enabled. I remember that we had already suffered with this problem and you fixed it by adding 120 s delay to the script. I've notice that with apk image the system takes a bit more time to boot and load widgets in comparison to apks on nand. Could that be the problem? I would like to increase the delay in compcache script to maybe 180 seconds or so to see if it fixes the issue.
What should i change in this script to change the delay time?
Does this 2>&1 stands for 120 seconds?
Code:
#!/system/bin/sh
#
# Compcache manager
#
#
# Change these variables to tweak the compcache
#
opts= # Use default (25% of the avaliable RAM (~23-24Mb))
#opts='disksize_kb=16384' # 16Mb compcache
#opts='disksize_kb=32768' # 32Mb compcache
#opts='backing_swap=/dev/block/mmcblk0p4' # compcache (default size 15% of available RAM) + backing swap (on SD card)
#opts='backing_swap=/dev/block/mmcblk0p4 memlimit_kb=32768' # 32Mb compcache + backing swap (on SD card)
# Swappiness
swappy=30
case "$1" in
start)
sleep 120
insmod /system/lib/modules/lzo_compress.ko >/dev/null 2>&1
insmod /system/lib/modules/lzo_decompress.ko >/dev/null 2>&1
insmod /system/lib/modules/xvmalloc.ko >/dev/null 2>&1
insmod /system/lib/modules/ramzswap.ko $opts >/dev/null 2>&1
swapon /dev/block/ramzswap0
sysctl -w vm.swappiness=$swappy
;;
stop)
swapoff /dev/block/ramzswap0
;;
enable)
setprop persist.service.compcache 1
echo "Compcache will be enabled in 120 seconds."
;;
disable)
setprop persist.service.compcache 0
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
Thanks
Click to expand...
Click to collapse
How about the line "sleep 120".
I've experienced some strange things with this so far. I installed a new app this morning. Some hours later I got a freeze and pin-reset my phone. The new app was gone... The .apk is no longer in apps.img, not even in lost+found. The system however believes it is still installed and I cannot reinstall it.
I have now added the "sync" flag when mounting the sdcard in /init and I'll give it another try. With a little luck it might prevent it from happening again.
I attached the new NBH and initrd.gz here if anyone else experienced the same problem and want to give it another try.

[Q]How to make a script to put dalvik on sd-ext

Hi, I'm a noob not only to Android but to Linux either. I'm aware this is probably a very old question, but I can't find a topic in wich is explained how to do this manually.
I'm using amarullz a2sd on Sandvold ICS beta 0.6.1.1, and it works fine, like most of you know, is magic works this way:
- system apps and data on nand
- apps and data on ext4
- all dalvik on nand.
So I get lot of space and very little lag.
The problem is: dalvik grows, and grows very fast, and worst of all, the system can't understand why at some point the internal memory have lot of space but it can't ever save the temp install file, or create the dalvik for a new app.
All this problems flush into the famigerate "invalid package file" error, for whose everyone has a different solution.
So we get: dalvik saturate nand = Android go crazy = users go crazy and make any sort of assertion on how to solve this (someone suggest a full wipe everytime this happen XD ).
The solution may be simple and obvious to all of you, but I'm a noob so let's pretend this is a great step for humanity: insert manually a script to put the dalvik too on ext4, on top of the pre-esistent amarullz one.
I googled some time and I come to this script that to me seems the best way:
Code:
su
cp -pr /data/dalvik-cache /system/sd
rm -r /data/dalvik-cache
ln -s /system/sd/dalvik-cache /data/dalvik-cache
(Ok I'm aware the cp is not necessary, but this way I have not to bother about rains of FC until I reboot and system recreate dex files).
That seems to do the magic... but here my two questions:
1) Simple matter: how to make this permanent on reboot? I have to insert it in a text file in init.d? the number on the file name count for the order of execution in respect to other scripts?
2) Not so simple (for me): why "/system/sd" ? I thought the path to the ext4 is "/sd-ext", so the correct dir is not something like "/sd-ext/my-dalvik" ??
If this is right, the correct script must be this way:
Code:
su
cp -pr /data/dalvik-cache /sd-ext/my-dalvik
rm -r /data/dalvik-cache
ln -s /sd-ext/my-dalvik /data/dalvik-cache
(Clearly the cp and rm parts will not be present in the boot script).
Am I right?
DISCLAIMER:
- I'm not discussing if amarullz is good or bad, every post on this subject will be ignored. I like it, I just want to change this thing.
- Posts that invite me to not install tons of apps and live a life of abnegation will be ignored as well.
- Sorry for my english
- Sorry if I'm verbose: I just want to be clear on the explanation.

[MOD] Android MTP <-> Mass Storage

Today i found how to change from Android MTP <-> Mass Storage and i want to share it with you....
rom android ICS supports MTP.
Let's modify the way the Mass Storage Gingerbread.
overlay / frameworks / base / core / res / xml / storage_list.xml is
<StorageList Xmlns:android="http://schemas.android.com/apk/res/android">
<! - Removable is not set in nosdcard product ->
<Storage android: mountPoint = "/ mnt / sdcard"
android: storageDescription = "@ string / storage_usb"
android: primary = "true"
android: emulated = "true"
android: mtpReserve = "100" />
</ StorageList>
Replace as follows.
<StorageList Xmlns:android="http://schemas.android.com/apk/res/android">
<! - Removable is not set in nosdcard product ->
<Storage android: mountPoint = "/ mnt / sdcard"
android: storageDescription = "@ string / storage_internal"
android: primary = "true"
android: emulated = "false"
android: allowMassStorage = "true" />
</ StorageList>
init. [PRODUCT_NAME]. rc
Delete the relevant portions of fuse.
on post-fs-data
# We will remap this as / mnt / sdcard with the sdcard fuse tool
mkdir / data / media 0775 media_rw media_rw
chown media_rw media_rw / data / media
on fs
mount ext4 ...
mount ext4 ...
mount ext4 ...
setprop ro.crypto.fuse_sdcard true
# / Sdcard
export EXTERNAL_STORAGE / mnt / sdcard
mkdir / mnt / sdcard 0000 system system
symlink / mnt / sdcard / sdcard
# Create virtual SD card at / mnt / sdcard, based on the / data / media directory
# Daemon will drop to user / group system / media_rw after initializing
# Underlying files in / data / media will be created with user and group media_rw (1023)
service sdcard / system / bin / sdcard / data / media 1023 1023
class late_start
init. [PRODUCT_NAME]. usb.rc
on property: sys.usb.config = mtp
write / sys/class/android_usb/android0/enable 0
.
.
setprop sys.usb.state $ sys.usb.config
on property: sys.usb.config = mtp, adb
.
.
start adbd
Replace the mass_storage mtp.
And vold.fstab create
# # Vold 2.0 Generic fstab
# # - San Mehat ([email protected])
# #
# # # # # # # # # # # # # # # # # # # # # # #
# # Regular device mount
# #
# # Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
# # Label - Label for the volume
# # Mount_point - Where the volume will be mounted
# # Part - Partition # (1 based), or 'auto' for first usable partition.
# # <sysfs_path> - List of sysfs paths to source devices, must start with '/' character
# # Flags - (optional) Comma separated list of flags, must not contain '/' character
# # # # # # # # # # # # # # # # # # # # # #
dev_mount sdcard / mnt / sdcard auto [vfat mount to node] nonremovable, encryptable
And in BoardCongig.mk or device.mk vold.fstab adds a sentence to copy.
PRODUCT_COPY_FILES + = \
device/hardkernel/odroida4/vold.fstab: system / etc / vold.fstab \
.
changes to the mass_storage persist.sys.usb.config = mtp.
# Set default USB interface
PRODUCT_DEFAULT_PROPERTY_OVERRIDES + = \
persist.sys.usb.config = mass_storage
With this modification, the ICS can also view the screen of Gingerbread.
http://2.bp.blogspot.com/-_9MoNaQ_E...hILKRpQBfP8/s320/device-2012-02-09-161336.png
Source
http://translate.googleusercontent....e.html&usg=ALkJrhgLPt0s-kDOWu4TtP7Tbdw4Vvxu5g
.
wow looks really great. Can you share files you describe ?
Excuse me sir this step is for adb?
Thx^^
Sent from my GT-I9300 using xda premium
Hello,
Does it work to the intern memory of Galaxy S3 ?!
Please make a cwm zip.
Sent from my GT-I9300 using XDA
okpc said:
Please make a cwm zip.
Click to expand...
Click to collapse
+1 please!
winwiz said:
+1 please!
Click to expand...
Click to collapse
+1 too...
Woooowww!! Make a flashable zip.. you would be a hero!
sent from Omega S3-siyah-OC-UV
+1 too please.
As soon as possible mate. I flashed the latest samsung rom and cause of that it deleted my backups (what a dumb i am ) on my internal sd-card. And now im not able to recover them, thats why i need ur fix so badly.
hi really looking forward to flashable zip for CWM...are you working n it or just have to wait for ROM cookers? THX if this will wor youre superhero waiting for this badly since bought SGS3
You should better ask for the cwm zip to the orginal dev of this mod. See bottom of first post...
I asked the original developer for all of us. Now lets hope for a quick response.
my apologist to every one
i am sorry for all i am a developer i just want to share this information and i kept the source if any of sgs3 kernel developers can help that set
there is two parts of modification first one on storage_list.xml in the framework-res.apk i do it but the second one in two files under root need to be change by kernel builder i cant do it the files name is init.smdk4x12.rc and init.smdk4x12.usb.rc
my apologist to every one
thanks for understanding
hani1980 said:
i am sorry for all i am a developer i just want to share this information and i kept the source if any of sgs3 kernel developers can help that set
there is two parts of modification first one on storage_list.xml in the framework-res.apk i do it but the second one in two files under root need to be change by kernel builder i cant do it the files name is init.smdk4x12.rc and init.smdk4x12.usb.rc
my apologist to every one
thanks for understanding
Click to expand...
Click to collapse
It's ok mate, nobody is a pro here
Somebody might help
From the link attached, I don't think this mod is to enable UMS on internal SD on the S3. And I personally believe that it can't be done just as it was the case in the Galaxy Nexus. This is because the shared storage structure introduced in the Galaxy Nexus and Samsung followed that in S3. What happened is that the /data and /sdcard mount points are in the same partition. However, UMS requires that the partition to be mounted as UMS cannot be mounted by any other app. Therefore, you cannot just unmount /data so that you will get UMS on /sdcard; Android won't be able to function. This is a design choice made by Google and I don't think we will ever get UMS on sdcard. (If there was a way, Galaxy Nexus would be able to do it already)
Anyway, if you Google Translate the very last sentence.
이렇게 수정하면 ICS에서도 Gingerbread의 화면을 보실 수 있습니다.
Click to expand...
Click to collapse
You will get
With this modification, the ICS can also view the screen of Gingerbread.
Click to expand...
Click to collapse
I think this is just a mod that will show the Gingerbread UMS screen on ICS. That's it.
As fas as I know, the is no way to put a device in UMC (Mass Storage Device) if the internal sdcard is a subtree of the data partition, which is the case for Galaxy S3 and Galaxy Nexus. What are you trying to do exactly?
Ok u tell, its maybe not possible to mount the internal sd as a mass storage device. So please tell me, how can i restore my deleted backup of my previous firmware that i made with CWM. Is there a way with any software to restore these files?
Max One said:
Ok u tell, its maybe not possible to mount the internal sd as a mass storage device. So please tell me, how can i restore my deleted backup of my previous firmware that i made with CWM. Is there a way with any software to restore these files?
Click to expand...
Click to collapse
I don't understand what you try to do. Do you want to downgrade the android version? If not, just factory resetting from menu will leave you factory settings.
If you need to install another rom, flash it from CWM from where you did the backup.
If you want to restore the backup, what do you want to restore, the firmware (rom) that is not needed because with factory reset is enough; the data or the sdcard?
I mean, after a factory reset, what are you missing exactly?
scandiun said:
I don't understand what you try to do. Do you want to downgrade the android version? If not, just factory resetting from menu will leave you factory settings.
If you need to install another rom, flash it from CWM from where you did the backup.
If you want to restore the backup, what do you want to restore, the firmware (rom) that is not needed because with factory reset is enough; the data or the sdcard?
I mean, after a factory reset, what are you missing exactly?
Click to expand...
Click to collapse
Let me try to explain You. I made a backup of my whole system and saved them on the internal sd card because i have no external sd card yet. 2 days later i decided to flash the latest firmware. Perhaps i made a factory reset before or after flashing the latest firmware, tbh i dunno cant remember well. Now i want to switch back/restore to my original firmware which i backed up. The problem is, i cant restore them because the factory reset erased my backup files.
If i were able to mount my internal sd Card as a mass storage, it will be no problem to restore the deleted backup files.
But now I wanna know, is there a way to restore my deleted backup files on my internal sd-card from (recognized in windows as) a aportable storage/device?
Max One said:
Let me try to explain You. I made a backup of my whole system and saved them on the internal sd card because i have no external sd card yet. 2 days later i decided to flash the latest firmware. Perhaps i made a factory reset before or after flashing the latest firmware, tbh i dunno cant remember well. Now i want to switch back/restore to my original firmware which i backed up. The problem is, i cant restore them because the factory reset erased my backup files.
If i were able to mount my internal sd Card as a mass storage, it will be no problem to restore the deleted backup files.
But now I wanna know, is there a way to restore my deleted backup files on my internal sd-card from (recognized in windows as) a aportable storage/device?
Click to expand...
Click to collapse
1) Is not possible to put the internal sdcard of the SGS3 on mass storage device, because the sdcard directory is a subdirectory of the data partition. Not possible at all.
2) Some say that flashing or factory restoring deletes also sdcard, other say that not, so the only way is to check by yourself.
3) Did you check with file managers like Total Commander that the folder sdcard/clockworkmod/backup doesn't exist? Or you never knew where it was stored in the first place?
4) If the backup is not there, and since you can't use mass storage, the only way to try to recover data is use android size tools, like Hexamob Recovery or Undelete, but you need rooted device.
Provided that you can recover files, choose of course to recover them to an external sdcard. After that, make md5 checksum of all files and see if matches nandroid.md5
Links:
http://www.galaxynexusforum.com/forum/galaxy-nexus-help/866-wiping-clears-sdcard-directory.html
http://www.droidforums.net/forum/galaxy-nexus-development/187972-wiping-phone-no-sdcard.html
http://www.droidforums.net/forum/ga...ctory-reset-not-erasing-internal-storage.html

Backup & Restore Apps + Data of RESTRICTED Profile

Ok, so my tablet wouldn't install the latest JSS15J update. So I had to manually install it. In the process, it wiped out my entire tablet. I have a main profile and a restricted secondary profile (my son's. It's my son's tablet). How do I get all the apps + data backed up (from a restricted profile) and restored (to a restricted profile)?
I've tried Titanium Backup and MyBackupPro (both root). I got close a few times, but I CANNOT get the APK's + data off a restricted profile, flash the Nexus 7 upgrade, then install APK's + data again successfully.
If I use Titanium backup while logged into the main profile, it backup up the data from the main profile only. Nothing from the restricted profiles (game saves, settings, etc.)
I've spent the day trying to get this done! I've been going back and forth between NANDROID backups, trying different things.
i'm not sure, as i don't use profiles.
BUT, what I can suggest for the future is:
Create a new folder on your internal and call it R Tita. Backup [for giggles], then backup your sons apps to the second folder, keep yours in the original. Just before you restore, change the backup / restore folder appropriately.
teh roxxorz said:
i'm not sure, as i don't use profiles.
BUT, what I can suggest for the future is:
Create a new folder on your internal and call it R Tita. Backup [for giggles], then backup your sons apps to the second folder, keep yours in the original. Just before you restore, change the backup / restore folder appropriately.
Click to expand...
Click to collapse
I've tried that. I played around all day with it. You also can't easily move backup files from one place to the other. Then even when you do it (with Root Explorer), it still doesn't work for some reason. On top of everything else, it's hard to make backups as TB says there's no storage space left even though there's over 20GB. That's while trying to save it in all different place. Emulation 0, Emulation 10, legacy, Sdcard.... etc...
froggydoddy said:
I've tried that. I played around all day with it. You also can't easily move backup files from one place to the other. Then even when you do it (with Root Explorer), it still doesn't work for some reason. On top of everything else, it's hard to make backups as TB says there's no storage space left even though there's over 20GB. That's while trying to save it in all different place. Emulation 0, Emulation 10, legacy, Sdcard.... etc...
Click to expand...
Click to collapse
You should just do all the backups in the /storage/legacy directory.
Though I don't see any reason why TB should have issues restoring that, should work. Have you verified your backups are good within the app?
I wasn't even able to create the backup anywhere due to that "no storage" issue. Then finally when I was able to create one somehow, I wasn't able to restore from it.
I've emailed the makers of TB to ask if they are planning on adding that functionality (backing up restricted profiles)
Sent from my Nexus 7 using XDA Premium HD app
froggydoddy said:
I wasn't even able to create the backup anywhere due to that "no storage" issue. Then finally when I was able to create one somehow, I wasn't able to restore from it.
I've emailed the makers of TB to ask if they are planning on adding that functionality (backing up restricted profiles)
Sent from my Nexus 7 using XDA Premium HD app
Click to expand...
Click to collapse
What ever came of this? I too would like to know how to backup data from a restricted profile.
The apks aren't necessary, as the primary user is the one who's allowed to installed apps anyway, but the data itself is what's important.
Did the TB team ever respond to you?
bounti said:
What ever came of this? I too would like to know how to backup data from a restricted profile.
The apks aren't necessary, as the primary user is the one who's allowed to installed apps anyway, but the data itself is what's important.
Did the TB team ever respond to you?
Click to expand...
Click to collapse
I found a way to do it. It's not very easy, I'm afraid. You need root, busybox, and pretty good familiarity with the command line (adb shell or terminal emulator on the device itself. However with this much typing, I really recommend adb shell...)
App data for other than the main user is stored at
/data/user/XX/com.the.application/
where XX is a number. My restricted user was numbered "10".
so to backup, just make a tar archive of that directory:
Code:
cd /data/user/XX
tar cf /sdcard/whatevername.tar com.the.application
to restore,
Code:
cd /data/user/XX
tar xf /sdcard/whatevername.tar
but, this probably only works for the very same user, because the file ownerships need to match.
So if it's not the same user, you need to fix the ownership of the restored files, but not the "lib" symlink.
With the games (the different angry birds...) I cared about had the folders cache, databases, files and shared_prefs. If there are other folders, you need to need to include them too (I'm not sure what folders there can be).
So to fix the ownership of all those, before extracting the backup (the tar xf command), first see who the owner is:
Code:
cd /data/user/XX
ls -ld com.the.application
it says something like
Code:
drwxr-x--x u11_a89 u11_a89 2013-09-12 23:14 com.the.application
here the u11_a89 is the important value.
Then, do the above tar xf command, and run
Code:
cd /data/user/XX/com.the.application
chown uXX_aYY:uXX_aYY .
find cache databases files shared_prefs | xargs chown uXX_aYY:uXX_aYY
Where uXX_aYY obviously is the value the ls command showed before.
By the way, this way you can also copy data from one user to another, e.g. from the main user (who can use titanium backup etc) to the restricted user or the other way around.
Sorry if I'm not very clear.. maybe someone could make a more understandable guide from this.
Disclaimer: I tried this on a rooted stock 4.3 nexus 7 (2012). But I think it's the same on any android 4.3 based device. Also, I really only did this with the angry birds games, I don't know if other apps need other tricks. (well except Bad Piggies is different, the data is /sdcard/Android/data/com.rovio.BadPiggies, and it can be copied with a file manager, without root.)
Thanks. Based on this I wrote a perl script to fix up all the user/group names after restoring the entire data directory; you may need to change u11 to u10 or whatever the restricted user is on your tablet.
Code:
#! /usr/bin/perl -w
# Script to fix ownership of data directories on restore of Android
# restricted profile.
open (LS, "adb shell \"su -c 'ls -l /data/data'\" |") || die "Failed: $!\n";
while (<LS>) {
(undef, $owner, $group, undef, undef, $dir) = split(' ');
$owner =~ s/u0/u11/;
$group =~ s/u0/u11/;
system ("adb", "shell", "su -c \"cd data/user/11/$dir && find . \! -type l -print0 | xargs -t -0 chown $owner:$group\"");
}
froggydoddy said:
Ok, so my tablet wouldn't install the latest JSS15J update. So I had to manually install it. In the process, it wiped out my entire tablet. I have a main profile and a restricted secondary profile (my son's. It's my son's tablet). How do I get all the apps + data backed up (from a restricted profile) and restored (to a restricted profile)?
I've tried Titanium Backup and MyBackupPro (both root). I got close a few times, but I CANNOT get the APK's + data off a restricted profile, flash the Nexus 7 upgrade, then install APK's + data again successfully.
If I use Titanium backup while logged into the main profile, it backup up the data from the main profile only. Nothing from the restricted profiles (game saves, settings, etc.)
I've spent the day trying to get this done! I've been going back and forth between NANDROID backups, trying different things.
Click to expand...
Click to collapse
How did you get root to work on restricted profiles? In this mode, AFAIK root doesn't work.
EDIT: Just tried creating a restricted profile and assigned rooted apps like Titanium Backup - it complained no root was found, even though the tablet is rooted.
lanwarrior said:
How did you get root to work on restricted profiles? In this mode, AFAIK root doesn't work.
EDIT: Just tried creating a restricted profile and assigned rooted apps like Titanium Backup - it complained no root was found, even though the tablet is rooted.
Click to expand...
Click to collapse
I'm not sure if this works in a restricted user account. But to get TiB to work in a secondary user account, I had to go into the SuperUser app from the primary user account. Open the settings and select the "Wnable mult-user" checkbox. This is in Chainfire's Super User app. Not sure if other SU apps have this or not.
jicama said:
Thanks. Based on this I wrote a perl script to fix up all the user/group names after restoring the entire data directory; you may need to change u11 to u10 or whatever the restricted user is on your tablet.
Code:
#! /usr/bin/perl -w
# Script to fix ownership of data directories on restore of Android
# restricted profile.
open (LS, "adb shell \"su -c 'ls -l /data/data'\" |") || die "Failed: $!\n";
while (<LS>) {
(undef, $owner, $group, undef, undef, $dir) = split(' ');
$owner =~ s/u0/u11/;
$group =~ s/u0/u11/;
system ("adb", "shell", "su -c \"cd data/user/11/$dir && find . \! -type l -print0 | xargs -t -0 chown $owner:$group\"");
}
Click to expand...
Click to collapse
Just wanted to say your script worked wonderfully. Thanks. Unfortunately, though, Clash of Clans still opened up as if it were a new install . Anyway, good job!
hondoslack said:
Just wanted to say your script worked wonderfully. Thanks. Unfortunately, though, Clash of Clans still opened up as if it were a new install . Anyway, good job!
Click to expand...
Click to collapse
Perhaps Clash of Clans keeps its data on sdcard like Bad Piggies?
viljoviitanen said:
Perhaps Clash of Clans keeps its data on sdcard like Bad Piggies?
Click to expand...
Click to collapse
Yeah, I thought that too, but couldn't find it. I'll take another look when I get home, maybe I can find a definitive answer and post back.
hondoslack said:
Yeah, I thought that too, but couldn't find it. I'll take another look when I get home, maybe I can find a definitive answer and post back.
Click to expand...
Click to collapse
Did you find anything on this? I'm trying to backup CoC on a restricted profile as well.
Edit: found these instructions and they worked great! http://forum.xda-developers.com/showpost.php?p=51352083&postcount=4
Sorry, totally forgot to reply. IIRC, those were the exact same steps I ended up stumbling upon. Glad you found a solution.

Categories

Resources