Related
I wrote a small script with help of stericson that will move all your caches to sd card. Right now, it will move caches for following apps;
1)Market
2)browser
3)street view
4)imeem music
5)tune wiki player
all these tutorials used from www.modmygphone.com, i just used all and wrote a script to make my job easier.
This script will make a folder called cache in your sd card, and 5 sub folder, for each apps.
Instructions:
copy the file to your sd card in home directory. make sure you have root.
go to terminal, and type in following commands
#mkdir /data/local/bin
#cp /sdcard/transfer.sh /data/local/bin
#chmod 0755 /data/local/bin/transfer.sh
#transfer.sh
it'll execute itself, if you get any error messages saying "bla bla bla" dir doesnt exist, that is because either you don't have that app installed or you have never used that app before and it doesnt have any cache to transfer.
Leave comments or suggestions. i will make maps work this weekend. i dnt have time right now.
http://rapidshare.com/files/184145725/transfer.sh
i am not responsible if it bricks your phone. I am pretty sure it wont though
thanks for this... btw can you add the steel cache also... will try this scrip as soon as i finish updating my pc.
robpet2 said:
thanks for this... btw can you add the steel cache also... will try this scrip as soon as i finish updating my pc.
Click to expand...
Click to collapse
yes will add more, but those are all for the weekend.
take your time bro...
I probably wont use it my self till after chrome is added.... but the noobs need this bad... lol
Worked. thank you.
Can you upload it somwhere else? I cannot access rapidshare at the moment.
Thanks
Hey Birba, copy and paste the below into notepad, save as transfer.sh
chmod 0777 /data/local/bin/transfer.sh
mkdir /sdcard/cache
rm -R /data/data/com.android.vending/cache
mkdir /sdcard/cache/marketCache
ln -s /sdcard/cache/marketCache /data/data/com.android.vending/cache
rm -R /data/data/com.android.browser/cache/webviewCache
mkdir /sdcard/cache/webviewCache
ln -s /sdcard/cache/webviewCache /data/data/com.android.browser/cache/webviewCache
rm -R /data/data/com.google.android.street/cache
mkdir /sdcard/cache/streetCache
ln -s /sdcard/cache/streetCache /data/data/com.google.android.street/cache
rm -R /data/data/com.imeem.gynoid/cache
mkdir /sdcard/cache/imeemCache
ln -s /sdcard/cache/imeemCache /data/data/com.imeem.gynoid/cache
rm -R /data/data/com.tunewiki.lyricplayer.android/cache/webviewCache
mkdir /sdcard/cache/tunewikiCache
ln -s /sdcard/cache/tunewikiCache /data/data/com.tunewiki.lyricplayer.android/cache/webviewCache
Oh and thank you for this necro, much appreciated for those of us who get hand cramps typing out all these commands on the G1 keyboard
Doesn't it seem like it would be a good idea to copy the cache over before you delete it
I'm a bit of linux noob.. but perhaps instead of deleting you could change it to mv and then you would not need to make the directory on the SD card either
so
rm -R /data/data/com.android.vending/cache
mkdir /sdcard/cache/marketCache
ln -s /sdcard/cache/marketCache /data/data/com.android.vending/cache
would become
mv /data/data/com.android.vending/cache /sdcard/cache/marketCache
ln -s /sdcard/cache/marketCache /data/data/com.android.vending/cache
Sd card myheim!!!
OK please help i have searched all over. I have 2 Questions & Requests:
1. How do I install a script file? I know it automaticlly changes the Registry of the android OS or the Internal/FileSystem whateva its called but how to i install it??? Please help & Be detailed.
2. This is the big one. If a script file does automaticlly change the Internal file system (Android Registry) without using the Abd Shell. Can u please make the upload the script files to "INSTALL & RUN APPS FROM THE SD CARD" its been very difficult using the "adb shell" on my desktop.
Ive tried everything. I even tried to use the "ASTRO" file browser to modify the correct files but evenwith root it wont allow you to modify or switch files.
PLease Help. My SD Card is already perfectly partioned and ready to go.
Thanks, that was an excellent post.
For steel, you can probably add this in the script file:
rm -r /data/data/com.kolbysoft.steel/cache/webviewCache
mkdir /sdcard/cache/steelCache
ln -s /sdcard/cache/steelCache /data/data/com.kolbysoft.steel/cache/webviewCache
-Gus
necromancerr said:
if you get any error messages saying "bla bla bla" dir doesnt exist, that is because either you don't have that app installed or you have never used that app before and it doesnt have any cache to transfer.
Click to expand...
Click to collapse
Would this error cause this to not work properly? In my case, I don't have imeem or tunewiki installed so I don't need these cache's moved. Would this cause a problem?
Also, how do you create a .sh file? I tried deleting these 2 commands myself but I couldn't find a .sh option in the save as drop down menu
Beast84 said:
I don't have imeem or tunewiki installed so I don't need these cache's moved. Would this cause a problem?
Click to expand...
Click to collapse
Nothing bad will happen because their caches won't be moved in the first place.
Beast84 said:
Also, how do you create a .sh file? I tried deleting these 2 commands myself but I couldn't find a .sh option in the save as drop down menu
Click to expand...
Click to collapse
Save as transfer.txt, then rename to transfer.sh
unknown.soul said:
Nothing bad will happen because their caches won't be moved in the first place.
Click to expand...
Click to collapse
Ok so I won't constantly have to dismiss errors on the phone due to this? Also does the script have to stay on the root of my SD or can I delete it after I perform the commands?
unknown.soul said:
Save as transfer.txt, then rename to transfer.sh
Click to expand...
Click to collapse
I tried that but it didn't change the file extension. The original I downloaded says sh file. The one I made still says text document
betawind said:
Hey Birba, copy and paste the below into notepad, save as transfer.sh
chmod 0777 /data/local/bin/transfer.sh
mkdir /sdcard/cache
rm -R /data/data/com.android.vending/cache
mkdir /sdcard/cache/marketCache
ln -s /sdcard/cache/marketCache /data/data/com.android.vending/cache
rm -R /data/data/com.android.browser/cache/webviewCache
mkdir /sdcard/cache/webviewCache
ln -s /sdcard/cache/webviewCache /data/data/com.android.browser/cache/webviewCache
rm -R /data/data/com.google.android.street/cache
mkdir /sdcard/cache/streetCache
ln -s /sdcard/cache/streetCache /data/data/com.google.android.street/cache
rm -R /data/data/com.imeem.gynoid/cache
mkdir /sdcard/cache/imeemCache
ln -s /sdcard/cache/imeemCache /data/data/com.imeem.gynoid/cache
rm -R /data/data/com.tunewiki.lyricplayer.android/cache/webviewCache
mkdir /sdcard/cache/tunewikiCache
ln -s /sdcard/cache/tunewikiCache /data/data/com.tunewiki.lyricplayer.android/cache/webviewCache
Oh and thank you for this necro, much appreciated for those of us who get hand cramps typing out all these commands on the G1 keyboard
Click to expand...
Click to collapse
This will not work because when u save the file it has to be in UNIX format. Android being based on linux needs this format to work. U either have to be in linux to save this file. If in windows u have to use a program called textpad. it is just an evalutation version. buy if you want.
necromancerr said:
This will not work because when u save the file it has to be in UNIX format.
Click to expand...
Click to collapse
Thanks for clearing that up, I actually haven't had the chance to test it out.
Beast84 said:
Ok so I won't constantly have to dismiss errors on the phone due to this? Also does the script have to stay on the root of my SD or can I delete it after I perform the commands?
I tried that but it didn't change the file extension. The original I downloaded says sh file. The one I made still says text document
Click to expand...
Click to collapse
U need to be in linux to save file in sh format. More than saving the file insh format they need to be in unix format. Use either linux or use textpad in windows. It'll work
Beast84 said:
Would this error cause this to not work properly? In my case, I don't have imeem or tunewiki installed so I don't need these cache's moved. Would this cause a problem?
Also, how do you create a .sh file? I tried deleting these 2 commands myself but I couldn't find a .sh option in the save as drop down menu
Click to expand...
Click to collapse
Don't worry abot that. The script will still work. If u ever get imeem, then u'l need to run the script again. Then it'll say that some files and folders already exists but u'll be fine
necromancerr said:
This will not work because when u save the file it has to be in UNIX format. Android being based on linux needs this format to work. U either have to be in linux to save this file. If in windows u have to use a program called textpad. Its a free program.
Click to expand...
Click to collapse
textpad FTW! It is an application that I use ALL the time.
BUT it is not free. It does has an unlimited evaluation, with a very non-intrusive registration reminder thingy. If you use Textpad as much as I do, please pay for it, and support the authors, so we can have more textpad goodness in the future
To save a file in unix format with textpad, go to file->save as, and then there is a "File format" field down at the bottom, where you can choose between PC, Unix and Mac.
JesusFreke said:
textpad FTW! It is an application that I use ALL the time.
BUT it is not free. It does has an unlimited evaluation, with a very non-intrusive registration reminder thingy. If you use Textpad as much as I do, please pay for it, and support the authors, so we can have more textpad goodness in the future
To save a file in unix format with textpad, go to file->save as, and then there is a "File format" field down at the bottom, where you can choose between PC, Unix and Mac.
Click to expand...
Click to collapse
thx for clarification. i dont use that program alot. so i didnt know that. thank you very much.
JesusFreke said:
textpad FTW! It is an application that I use ALL the time.
BUT it is not free. It does has an unlimited evaluation, with a very non-intrusive registration reminder thingy. If you use Textpad as much as I do, please pay for it, and support the authors, so we can have more textpad goodness in the future
To save a file in unix format with textpad, go to file->save as, and then there is a "File format" field down at the bottom, where you can choose between PC, Unix and Mac.
Click to expand...
Click to collapse
And once I change this to Unix, how do I save it as a .sh file? I still don't see the option anywhere. And renaming the file still doesn't change it
EDIT: I think I got it. I had to go into the preferences & manually add .sh as an extension. Is that how you did it JF?
Now that we have root access I was trying to figure out the cause of the "old apps keep reappearing after an update and restart bug."
From the looks of it it seems the /data/boot-cache directory is corrupt. I tried my experiment with Google Sky Map and got the following:
Code:
$ adb shell
$ su
# cd /data/boot-cache
# ls -al *stardroid*
-rw------- system system 3988 2009-10-17 18:36 AndroidManifest.xml
# rm -rf *stardroid*
rm failed for -rf, No such file or directory
# rmdir *stardroid*
rmdir failed for [email protected]@com.google.android.stardroid.apk, Directory not empty
# fsck
fsck: not found
Same thing happens with all the other apps that misbehave when updated.
Do we have any way of running fsck or some other file system repair utility to fix these issues?
Code:
# rm -rf *stardroid*
rm failed for -rf, No such file or directory
# rmdir *stardroid*
rmdir failed for [email protected]@com.google.android.stardroid.apk, Directory not empty
Do we have any way of running fsck or some other file system repair utility to fix these issues?
Click to expand...
Click to collapse
Or you could just empty the directory before you tried to remove it, since whatever 'rm' binary is provided apparently doesn't understand "-rf" and treated it as a filename.
posguy99 said:
Or you could just empty the directory before you tried to remove it, since whatever 'rf' binary is provided apparently doesn't understand "-rf" and treated it as a filename.
Click to expand...
Click to collapse
Seems it doesn't know -rf but works with -r. Let me see if this now fixes the issues.
Keep up the good work man I had this problem multiple times I think it bothered me more than not receiving sms or vvm.
The fix
That is it, you use -r not -rf. So the fix is as follows (I use Astro for getting the following information):
1) Use Astro and backup all your apps to your SD card.
2) The Astro Application Manager/Backup tool will list in red all the apps that it thinks are newer on the SD card than the phone thinks are installed.
3) For each of those apps select them and note the app installed name (first line, called "Name"). Usually com.xxx.xxx, etc.
4) Get a root shell to your phone (follow instructions elsewhere.)
5) cd /data/boot-cache
6) For all the names you generated in step 3 type
Code:
rm -r *<name>*
e.g. taking Google Sky Map as an example this would be
Code:
rm -r *com.google.android.stardroid*
7) Reboot your phone.
8) All apps should now appear in their latest, correct, version.
Google claims this problem is specific to the Hero and SenseUI. Does this cache folder exist on a normal Android build?
is there a chance someone can make an app that would automate this process?
does the issue come back after awhile?
goku14238 said:
does the issue come back after awhile?
Click to expand...
Click to collapse
Anytime you update an app you will see the issue for that app.
This works great. I used it to fix my Handcent which messed up after I upgraded today.
+1 on this. You guys are really killing this phone.
hey,
whenever i flash a new rom i edit the zip to replace keylayouts, apps in /system and /data , bootscreens and some other stuff......
i now want to symlink some directories with a script which will be loaded during rom flash because otherwise i would need a pc to access it through adb...
the script i want FOR NOW (i may use it for other things in the future)
is about symlinking the
/system/customize/resource/bootanimation.zip to /data/local/bootanimation.zip
/system/customize/resource/android_audio.mp3 to /data/local/android_audio.mp3
i can do this through adb as i said but i'd prefer it to be done automatically by a script during flash.... i know the commands to use but i need a way to implement the script into the rom.....
i think it's like the a2sd+ script but i am not sure....
if anyone knows please help me
you need to split open your boot.img and modify the init.rc (the file where services are initialised at Android startup)
See this link for notes on working with the boot.img
you can create the symlinks directly in this file, have a look at the syntax and you should be able to work it out. The ln command doesn't work though, use the format:
Code:
symlink /system/customize/resource/bootanimation.zip /data/local/bootanimation.zip
Or you can create a dummy 'service' which executes a file on your filesystem (like /etc/rc.local) and put your "ln -s" commands in there.
Why not just create a custom update.zip with your changes only, then you can apply it after flashing any rom.
Klutsh said:
Why not just create a custom update.zip with your changes only, then you can apply it after flashing any rom.
Click to expand...
Click to collapse
How would you do this?
Say I wanted an update.zip that would remove plurk and add a certain app. How would I go about creating that?
removing and adding is easy with the update signer app.....i just want to add a script that symlinks directories at boot in order to avoid the use of a pc.....i tried the trick st0kes said and i am waiting for the flashing now to complete and send my feedback
nope it didn't work.....is there any specific place to put the command ????
i put it at the very end of the init.rc file
ok after a lot of reading i created a service which runs a folder with scripts...where i have the script that symlinks the files.....
service myscripts /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/myscript.d
oneshot
Click to expand...
Click to collapse
this is the service code
and here is the code i have into the "bootanimation" script which is inside the myscript.d folder
#!/system/bin/sh
mount /system
mount /data
ln -s /system/customize/resource/bootanimation.zip /data/local/bootanimation.zip
ln -s /system/customize/resource/android_audio.mp3 /data/local/android_audio.mp3
Click to expand...
Click to collapse
what am i doing wrong here ????? please someone with knowledge enlighten me!! the script does not run
damn....it's been a long night and still haven't found a way to do it !!!!!!
i tried all the followings:
1) added a file called "myscript" (it contained two lines with the symlink commands) in init.d folder in order to execute when the boot is complete - FAILED
2) added the same file into another folder and added a service at the bottom of the init.rc file that called it
service myscript /system/etc/myscripts/myscript
oneshot
Click to expand...
Click to collapse
-FAILED
3) added the SYMLINK commands into the init.rc file
a)at the bottom -FAILED
b) before the bootanim, bootsound services -FAILED
c) before the bootcomplete = 1 value in init.rc -FAILED
d) after sysinit execution in init.rc -FAILED
e) before sysinit execution in init.rc - FAILED
f) at the top after some lines of code in init.rc - FAILED
i read that HTC change the boot process and to run custom scripts at boot you must add their commands in "bootcomplete.bravo.rc"
i tried that too but FAILED again....i think this is logical cause these scripts are executed after the boot and just when the phone is gonna show the pin dialog....
i think it's something to do with the init.rc file...but i dunno what else to add....
is there anything i have to mount in order to symlink ???? add busybox to something or anything ??????
PLEASE someone with success at scripting like a2sd+ please help me
Try naming your script
Code:
03BootAnim
and place it in
Code:
/system/etc/init.d
Also don't forget to chmod +x it
how to chmod +x ??? nvm i did it...i am now signing it to try it
in adb
Code:
adb shell chmod +x /system/etc/init.d/03BootAnim
chmod 755 does the same, makes it executable by the system
Klutsh said:
Try naming your script
Code:
03BootAnim
and place it in
Code:
/system/etc/init.d
Also don't forget to chmod +x it
Click to expand...
Click to collapse
hey klutsh i tried what you said but it didn't work...
look i created the file
Code:
03BootAnim
and placed it into the
Code:
/system/etc/init.d
the commands i have into the file are these
Code:
#!/system/bin/sh
ln -s /data/local/bootanimation.zip /system/customize/resource/bootanimation.zip
ln -s /data/local/android_audio.mp3 /system/customize/resource/android_audio.mp3
ok i edited the commands like these but no result too.....
Code:
#!/system/bin/sh
busybox mount /system
busybox mount /data
busybox ln -s /data/local/bootanimation.zip /system/customize/resource/bootanimation.zip
busybox ln -s /data/local/android_audio.mp3 /system/customize/resource/android_audio.mp3
i checked with the
Code:
ls -l /system/etc/init.d
command and the permissions are all the same (they are all enabled i think, -rwxr-xr-x )
i wiped everything, flashed, rebooted but no bootanimation!!! the default android logo with the moving shade appears (i have deleted the animation in the system/customize/resource folder in order for the symlink to work)
what am i doing wrong ???? is there something with the script ?
I'm trying to get this working, and so far it is running before the bootanimation, but I get
Code:
run-parts: can't execute '/system/etc/init.d/03BootAnim': No such file or directory
Yet it is available...
what commands do you have in yours ????
maybe a reboot will fix it o yours since it will rescan ?
edit: hey klutsh i logcated my boot and i see that the symlinks do not work cause it says that /system/customize/resource/bootanimation.zip and android_audio.mp3 directories are read-only file systems
That's the problem then.
Already got a fix that you apply once only to a flashed rom then the boot anim runs from /data/local and can be replaced.
http://www.asificanrememberthat.com/DeLite/BootAmin_to_Data.zip
Flash that after any Sense rom that normally has bootanimation in /system/customize
It will delete the 2 files in /system/customize/resource
flash my own bootanimation to /data/local
create the required symlinks that survive reboot's.
You can then just replace the files in /data/local as needed.
as i see you made it with the update sign and packager isn't it ????
nice idea....
BUT why can't we access /system files through boot ???? is there any way to get root access at booting ???
THANKS YOU VERY MUCH for the great effort you made....
is there a way to implement the update-script into the 03BootAnim in order not to have to flah anything ????
the reson i want this is cause i am cooking my roms on my own and i want them to have all i need inside....not having to flash mod1, mod2 etc
It's a feature of the desire, no write access to /system unless in recovery.
You can just take those bit's from my update-script and add them to your own rom's script.
oh yes...this is what i was asking i have tow update-scripts though, one old and one in the android.new folder
i am using dsixda kitchen....in which should i put it ??? does it matter where is it?
edit: found it....signing to flash
HURRAYYYYYYYYYYYYYYYYYYYYYYY
hey klutsh i thank you a lot.....
it was so easy to do it just copy paste the update-script but we (I) took the hard way of READ-ONLY file system....anw i learned A LOT (if you think that i am reading 15hours constantly about this)
PROBLEM SOLVED
You can delete the android.new folder, it isn't used.
This is a very simple way to do Text2SD if a few steps!
It can be extremely useful to keep all of your texts between flashing roms or nandroids or a general screw up
1) Create a folder on your sdcard, you can name it whatever you want but I decided to name it Text2SD and put it in the data folder.
2) This will move your message database to the folder you chose
Code:
adb shell mv /data/data/com.android.providers.telephony/databases/mmssms.db /mnt/sdcard/*folder*/ (ie /mnt/sdcard/data/Text2SD/)
2b) Verify the file has been moved
Code:
adb shell ls /data/data/com.android.providers.telephony/databases/ (Should return telephony.db)
adb shell ls /mnt/sdcard/*folder*/ (Should return mmssms.db, aside from whatever else you might have in there)
3) This will create a soft symlink from the database file on your sd card to the directory on your phone. It has to be a soft link because a hard link cant cross 2 different drives
Code:
adb shell ln -s mnt/sdcard/Text2SD/mmssms.db /data/data/com.android.providers.telephony/databases/
3b) Verify the file has been linked
Code:
adb shell ls /data/data/com.android.providers.telephony/databases/ (Should return mmssms.db and telephony.db)
4) Reboot just to be sure and enjoy!
Code:
adb reboot
You can apply this to pretty much any other file and have things like bootanimation.zip2sd or build.prop2sd or whatever, I cant think of any good examples right now
Code:
argument explainations
mv: move or rename files (depending on inputs)
ls: list files in a directory
ln: make hard symlink
ln -s: make soft symlink
EDIT- Im having issues with messages force closing even after restoring the original file. You probably shouldnt try this unless you know what your doing
EDIT2- I was able to make it work again by fixing the permissions to rw-rw-rw- when i copied the file back. i cant get the permissions to be set right though since you cant change permissions linux style on fat fs. this can probably be fixed with an ext partition but i dont feel like copying everything off my sd card formatting and copying back on. maybe later or if someone can test
I ran the "fix permissions" through CWM and from everything i've gathered it's ruined the permission on my contacts JPG images. They aren't showing up anymore in the messaging app and so I did a quick google search. I came across this post on an HTC Incredible forum and wondered how I can use it on the Thunderbolt.
I have ADB installed but the Thunderbolt doesn't have the /datadata folder. Can someone look at this and see how to tweak it to fit the Thunderbolt? I'm still not 100% on the TBolt directories and how to apply them to ADB (I'm just learning).
SOLVED!
It appears the ROM Manager fix permissions script messed up the permissions on the thumbnails in the contacts folder. The files were mistakenly permissioned as 771 which meant the jpg thumbnail files were unreadable.
This is what I did to fix it:
Boot into clockworkmod recovery
Go into the mount/umount section
mount /system
mount /data
Connect usb data cable to computer from phone (I use linux so I don't need anything special in the way of drivers)
adb shell
mount /datadata
The above step may take a few seconds to mount
cd /datadata/com.android.providers.contacts
chmod og+rx *
cd files
chmod 664 *.jpg
cd /
umount /datadata
umount /data
exit
Reboot your phone
Once I did that, my thumbnail pictures returned to both the stock messaging app and Handcent.
Click to expand...
Click to collapse