new scripts - G1 Android Development

Please emal me at if you have a problem.
Thank you alritewhadeva with chmod
Cp the files to /system/bin.
Then chmod 755 (filenames)
Cleartmp
Clears all files in a chosen directory in a certain amount of days. You can chose the directory and the amount days.
Rename
You can rename all files or selected files.
Rmemptydir
Remove empty directories
Search
Search for files and folders
Grepcat
Is like a combination of egrep and cat.
My version of appstosd
There will be a folder in your sdcard called apps(MK47) and it has all your app from the market(free and also paid). This is good for when you wipe your Dream.
here is the scripts.

Might want to update your OP with the attachment and bold the commands so its easier to read Nice work

mohsinkhan47 said:
Please emal me at [email protected] if you have a problem.
Thank you alritewhadeva with chmod
Cp the files to /system/bin.
Then chmod 755 (filenames)
Cleartmp
Clears all files in a chosen directory in a certain amount of days. You can chose the directory and the amount days.
Rename
You can rename all files or selected files.
Rmemptydir
Remove empty directories
Search
Search for files and folders
Grepcat
Is like a combination of egrep and cat.
Click to expand...
Click to collapse
this can come in handy for the hero roms if u use the facebook feature quite often under the people app. i know i tend to show people certain pics of me or friends and it just eats up internal memory. all i do is clear the cache but if i can use this script to do so it'd save me that lil bit of hassle i have to go thru myself, appreciate the script, just curious tho... anyone know where to find where the albums cache is stored? i kno how to brose thru folders but i much rather have somebody that KNOWS rather than me THINKING i know... lol thanks in advance.

Thanks for the scripts. Can you repost the appstosd? The one you posted was empty.

cx92001 said:
Thanks for the scripts. Can you repost the appstosd? The one you posted was empty.
Click to expand...
Click to collapse
I won't be on a computer until Saturday so gtalk to me at
[email protected] invte me and I will give u the app2sd

I can't reach the clutch..
Hi,
I've been looking for a shell search tool for my SE Xperia X10 Android 1.6 phone to search the file system, and this has been the only resource I have found thus far. I have managed to download and copy the scripts to my Android device, but I am unsure on how to execute the .asc scripts on the Android shell.
I was unable to adb push the file to \system\bin. I pushed the file to \data but even mounting the system volume as RW I am unable to mv the scripts to the \system\bin folder.
adb shell
$ su
# mount -o remount,rw /dev/mtdblock3 /system
# mv /data/searh.asc /system/bin
mv /data/searh.asc /system/bin
failed on '/data/searh.asc' - Cross-device link
I tried running the chmod 755 search.asc command anyway, and execute it using ./search.asc, but receive the message:
basename: not found
getopt: not found
[: not found
shift: can't shift that many
Edit: I have now tried this in recovery mode and mounting the /system folder with RW permissions, still no joy.
Could someone please clarify what is required to get these scripts to operate?
I have only dabbled in linux so I am most likely missing something fundamentally obvious here.
Temp-n00b-usr

I managed to find a work around.
I was attempting to locate the Creatouch.apk which was not in /system/app or /data/app. It was infact in /data/app-private. I have manged to pull the .apk for a backup and removed this from the phone now.
I just used the file explorer in Droid Screencast to locate the file by browsing the system.
It would still be handy to be able to search the file system from a PC environment however.

Related

Deleting system sounds

Was just wondering if anyone has deleted ringtones, notification or alarms successfully? `ould love to get rid of them if possible. Tried making a copy of jf rc30, deleting them and amazon apk then installing but didn't work gave me error message.
i removed unused ringtones w/o any issues
If you have JF's RC30 1.31 installed you should be able to just delete them. Astro should let you goto where they are saved and just delete em. You may need to use DroidSans Tweak tools to remount /system as read/write first.
Hmmm, changing to read/write and trying to use Astro gave me "error deleting file"
Any other ideas?
Dharkaron said:
If you have JF's RC30 1.31 installed you should be able to just delete them. Astro should let you goto where they are saved and just delete em. You may need to use DroidSans Tweak tools to remount /system as read/write first.
Click to expand...
Click to collapse
No neither of those work but thanks for the effort to help. I tried those when i first got root. Im gonna try deleting the same way as i did amazon and see if it works.
stats555 said:
No neither of those work but thanks for the effort to help. I tried those when i first got root. Im gonna try deleting the same way as i did amazon and see if it works.
Click to expand...
Click to collapse
Word let me know if this works. I asked in another thread how to do it but no one answered. All I got was the "yes you can delete them" response
I deleted all of my ringtones without any issues. Just use adb shell and remove them. You can also "pull" them first if want to have a backup. In adb shell type "cd /system/media/audio/ringtones". Now you are in the ringtones folder, now type "ls" and then a list of all the ringtones will display. Once you know the name of the one you want to delete just type "rm filename.ogg" and thats it.
BlueBoar said:
I deleted all of my ringtones without any issues. Just use adb shell and remove them. You can also "pull" them first if want to have a backup. In adb shell type "cd /system/media/audio/ringtones". Now you are in the ringtones folder, now type "ls" and then a list of all the ringtones will display. Once you know the name of the one you want to delete just type "rm filename.ogg" and thats it.
Click to expand...
Click to collapse
Worked great thanks!
No problem, that was one of the first things I did was to change all of the ringtones. Couldn't stand the ones that came with it.
BlueBoar said:
No problem, that was one of the first things I did was to change all of the ringtones. Couldn't stand the ones that came with it.
Click to expand...
Click to collapse
Yeah i hear you on that, just a bunch of crap taking up space. I use mp3's for ringtones so no need to waste system space on them! I just learned how to use adb thank god!
Update - deleted most of the ringtones and 4 notifications, freed up 2mb's
BlueBoar said:
I deleted all of my ringtones without any issues. Just use adb shell and remove them. You can also "pull" them first if want to have a backup. In adb shell type "cd /system/media/audio/ringtones". Now you are in the ringtones folder, now type "ls" and then a list of all the ringtones will display. Once you know the name of the one you want to delete just type "rm filename.ogg" and thats it.
Click to expand...
Click to collapse
Sweet worked like a charm! Thanks a bunch
Ok I read how to delete the ringtones but what is ADB Shell? Lke where do i go to type in all those commands?
My phone is rooted JF1.41 with the latest RC33 modded update.
Cargo75 said:
Ok I read how to delete the ringtones but what is ADB Shell? Lke where do i go to type in all those commands?
My phone is rooted JF1.41 with the latest RC33 modded update.
Click to expand...
Click to collapse
You can do it all right from the phone with Terminal.
Type
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
cd /system/media/sounds/(whichever directory you want)
ls
rm (whichever .ogg file you want)
The .ogg files are case sensitive, so beatplunker.ogg isn't the same as BeatPlunker.ogg
Also the .ogg extension has to be at the end of each file you rm.
If you want to save a backup on your sd card I just typed this before I started removing things. Good luck
Code:
cp /system/media/sounds /sdcard
Beast84 said:
You can do it all right from the phone with Terminal.
Type
Code:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
cd /system/media/sounds/(whichever directory you want)
ls
rm (whichever .ogg file you want)
The .ogg files are case sensitive, so beatplunker.ogg isn't the same as BeatPlunker.ogg
Also the .ogg extension has to be at the end of each file you rm.
If you want to save a backup on your sd card I just typed this before I started removing things. Good luck
Code:
cp /system/media/sounds /sdcard
Click to expand...
Click to collapse
wow, thank you!
Cargo75 said:
wow, thank you!
Click to expand...
Click to collapse
No problem. Just figured I'd pass some of the knowledge these fine peeps here have passed on to me
Cargo75 said:
Ok I read how to delete the ringtones but what is ADB Shell? Lke where do i go to type in all those commands?
My phone is rooted JF1.41 with the latest RC33 modded update.
Click to expand...
Click to collapse
In the future, you may what to do this through your PC to prevent carpel tunnel... You can download the Android SDK from here: http://developer.android.com/sdk/1.1_r1/index.html
Extract it to your drive. Navigate to that folder in a command prompt window then "tools". Once there you can run(make sure the G1 is plugged in the usb):
adb remount (remounts the system read/write)
adb shell (this drops you into the shell to interact with your phone)
cd /system/media/audio/
From there you should be able to follow the proceeding directions.
I went and did all this and even went the extra mile and pushed some of my custom mp3's to the file (about 3 meg worth). Is this going to cause problems with updating in the future?
You don't need to remount the system to read/write manually if it already has been done with DroidSans do you?
I usuall y do the mount through Terminal emulator.
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm -r /system/media/audio/ringtones
rm -r /system/media/audio/notifications
bam gone!
I tried to copy and after mounting I typed:
cd /system/media/audio/
ls
then got:
alarms
ringtons
notifications
ui
then I typed: cp /system/media/audio /sdcard
and got this message:
cp: omitting directory '/system/media/audio'
is it something small and dumb that I'm doing or are the files copied?

The proper way to remove a system applications

Dears,
I'm using the last Cyanogen and I would remove some applications that stay in /system/app. I know that I can do this just with:
- rm /system/app/NAME.apk
- rm -r /data/data/NAME
but in this way the application data remains in /data/system/packages.xml: I don't want to manually change this file. Is there a more clean and automatic way to do that?
For the applications in /data/app, I can use 'adb uninstall NAME' but it seems that is not appliable to the ones in /system/app. Even after a 'adb remount'.
Any suggestions?
Just delete them.
anyone knows?
i wanna get rid of the default IM.. and amazon mp3
I repeat myself: Just delete them.
It isn't dangerous or "unclean".
Just be a little aware that some apps might seem superfluous, but actually do things other than the part you see. For example, you can't delete the stock Mms.apk and use ChompSMS as your sole SMS application - the stock app also contains the framework for the device to receive SMSes at all. I would rename files rather than deleting them, i.e.
mv thingyouwanttodelete.apk thingyouwanttodelete.old
rather than
rm thingyouwanttodelete.apk
because you can always then put it back afterwards if you find something doesn't work afterwards.
I think Cyanogen latest rom has the system app's folder as read only. So you would need to remount the drive as Rewriteable to make any changes to the files.
njakobs said:
I think Cyanogen latest rom has the system app's folder as read only. So you would need to remount the drive as Rewriteable to make any changes to the files.
Click to expand...
Click to collapse
what are the steps to remount as rw?
chmod +rw?
farbird said:
what are the steps to remount as rw?
chmod +rw?
Click to expand...
Click to collapse
-bash-3.2$ ./adb remount
remount succeeded
adb remount - remounts the /system partition on the device read-write
adb root - restarts adb with root permissions
You can delete stuff in the update.zip then just resign it. I wouldnt delete any com.**** stuff or htc.**** except widgets(on hero) always copy the update zip before you start editing so you can always add what is needed
Start asking your questions in the right sub-forum (Q&A) (Theme) or even in (General), or i will be forced to ban you for 3 days or till you learn.
Thanks
Thread Trashed!!

Battery manager fix!

This is not my doing or work, I just found it and am sharing it so please don't blame me for stealing or using anyone elses work
This is the script I found in squidlys rom and it is saved in system/xbin, if I can figure out how to post a file on here through the xda app on my phone I can give you guys the files used to run the fix. You can run the command in terminal emulator but im guessing first you may want to create a folder on the sd card named stock and then move the file battery manager to it and then run the script and restart the phone, that's what I did and it worked.
#!/system/bin/sh
if busybox [ -e /sdcard/stock/BatteryReport.apk ];
then
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
busybox cp /sdcard/stock/BatteryReport.apk /system/app
sync
mount -o remount,ro -t yaffs2 /dev/block/mtdblock4 /system
echo 'battery manager fix'
else
echo 'battery manager not fixed'
echo '1) Place battery report App On The SDCard'
echo '2) Turn Off USB Storage'
echo '3) Rerun Script To Try Again'
fi
Sent from my DROID2 using XDA App
Well I can't figure out how to attach a file through the xda app on my phone and I loaded the actual page on my phone and it wont pull up my phones sd card directory so if you want the file I can post them when I get off work but the txt that I posted above is the actual file, I opened it within txt editor and copied it so if you can save it as the same kind of file that is in system/xbin (I don't know the extentions or what kind of files they are) then you could probably do it without my help, the original file name is battmanfix. Thanks for reading
hmm, just looking at the script i'd say it shouldn't work
not sure what squidlys changed in his rom (if it is for droid 2) but the default d2 mount point for /system is /dev/block/mmcblk1p21 and also file system is ext3...
did you test it?
Well I already had the folder on my sd card from the squidly rom and pretty much coppied the file to my xbin in the system folder and ran the command through the terminal emulator and it seemd to work afterwards...there were no errors in the terminal or anything and when I typed in battmanfix it responded with the whole name battery manager fix and I checked my battery manager and it worked... that's exactly what it did with squidlys so idk...
Sent from my DROID2 using XDA App
ok... so here's something funny... Looking at the script, basically all this is doing is replacing (and reactivating) the batteryreport.apk. So... me thinks to myself - "self; what happens if I just try to click on the apk as if I was gonna install it?" obviosly it didn't install, but after doing that, my battery stats were back. Something is obviously happening to where the batteryreport.apk stops syncing with the system, and anything that "reactivates" it allows it to display again...
Just my observations, yours may vary
Well like I said at the begining I just thought it was interesting and I figured id share what I found..and I don't know a whole lot about linux and codes and scripts so thanks for the info and also I didn't write it, just found it..
Sent from my DROID2 using XDA App

[Q] Blur Camera won't install

Alright so here's my problem: After rooting my phone, I started to play around with a couple of camera apps from different ROMs such as MIUI. Me being an idiot though, deleted the stock Blur camera Apk. Using a system dump of the Atrix, 2 I tried to reinstall it, by placing it in system/app. For some reason. It wouldn't install (show up on my app directory). Anybody have any idea as to why this is happening? Any help would be greatly appreciated, because I really need a camera app.that's supports 1080p video. Thanks in advance!!!
farshad525hou said:
Alright so here's my problem: After rooting my phone, I started to play around with a couple of camera apps from different ROMs such as MIUI. Me being an idiot though, deleted the stock Blur camera Apk. Using a system dump of the Atrix, 2 I tried to reinstall it, by placing it in system/app. For some reason. It wouldn't install (show up on my app directory). Anybody have any idea as to why this is happening? Any help would be greatly appreciated, because I really need a camera app.that's supports 1080p video. Thanks in advance!!!
Click to expand...
Click to collapse
Push the sick app via adb. I read somewhere that with apps such as root explorer it doesn't work for some reason. Hope this helps.
Sent from my MB865 using Tapatalk
Yes, always use adb to push system apps. Root Explorer will not work.
Sent from my mAtrix2!!
For some reason i get permission denied whenever i try to push through adb. How do i get around this?
farshad525hou said:
For some reason i get permission denied whenever i try to push through adb. How do i get around this?
Click to expand...
Click to collapse
To copy anything to /system/app, you need root access.
This will be a 2 step process.
1) push the file from your computer to your phone in a directory that the shell has access to, i.e. /data/local for instance.
2) adb shell into the phone and su, remount /system as rw, then cp the file from /data/local/ to /system/bin
That should elimiate the issue with permission denied, with adb push.
jimbridgman said:
To copy anything to /system/app, you need root access, have you rooted the phone?
If you have rooted the phone, this will be a 2 step process.
1) push the file from your computer to your phone in a directory that the shell has access to, i.e. /data/local for instance.
2) adb shell into the phone and su, remount /system as rw, then cp the file from /data/local/ to /system/bin
That should elimiate the issue with permission denied, with adb push.
Click to expand...
Click to collapse
Yes my phone is rooted. How do I remount /system as rw? Then how do i cp the file? Thanks for your help!
I figured out how to push the file with adb, but the app still does not show up. Any other ideas?
farshad525hou said:
Yes my phone is rooted. How do I remount /system as rw? Then how do i cp the file? Thanks for your help!
Click to expand...
Click to collapse
Ok, run EVERYTHING between Code:, and End code from the command line. Just make sure you are in the directory you saved your backup camera.apk to, from your windows command prompt, before you run the commands below.
Code:
adb push BlurCamera.apk /data/local
adb shell
su
mount -o remount, rw /system
cd /data/local
cp BlurCamera.apk /system/app
chown root /system/app/BlurCamera.apk
chgrp root /system/app/BlurCamera.apk
chmod 644 /system/app/BlurCamera.apk
mount -o remount, ro /system
exit
exit
End code
That should hopefully fix it.
jimbridgman said:
Ok, run EVERYTHING between Code:, and End code from the command line. Just make sure you are in the directory you saved your backup camera.apk to, from your windows command prompt, before you run the commands below.
Code:
adb push BlurCamera.apk /data/local
adb shell
su
mount -o remount, rw /system
cd /data/local
cp BlurCamera.apk /system/app
chown root /system/app/BlurCamera.apk
chgrp root /system/app/BlurCamera.apk
chmod 644 /system/app/BlurCamera.apk
mount -o remount, ro /system
exit
exit
End code
That should hopefully fix it.
Click to expand...
Click to collapse
Sadly this didn't work either. I don't know what I'm doing wrong. Btw, thanks for your help so far!
Quick question....is the blurcamera.odex file still in the system/app. If you have deleted it also you will have to replace it as well.
JRW 28 said:
Quick question....is the blurcamera.odex file still in the system/app. If you have deleted it also you will have to replace it as well.
Click to expand...
Click to collapse
I could only find a deodexed system dump
Here ya go, zip has both camera.apk and odex. Try using file explorer again and make sure it is r/w . Hope it helps
http://db.tt/v0FQKpKr
JRW 28 said:
Here ya go, zip has both camera.apk and odex. Try using file explorer again and make sure it is r/w . Hope it helps
http://db.tt/v0FQKpKr
Click to expand...
Click to collapse
Thanks for the files! But once again sadly the file doesn't appear under my app drawer. I tried using adb and root explorer, with no luck. Is there anything I'm missing? Btw, JRW are those files from the atrix 2?
There both straight off of my phone...that's weird cause I have removed both of them trying out various cameras and never had a problem reinstalling them?
Are you rebooting afterwards?
JRW 28 said:
There both straight off of my phone...that's weird cause I have removed both of them trying out various cameras and never had a problem reinstalling them?
Are you rebooting afterwards?
Click to expand...
Click to collapse
Yeah I am. Can you walk me through what you do when you re install the apps? I am really confused. Is there anything that might be interfering?
Go into file explorer and make sure your system folder is r/w along with both the blurcamera.apk and blurcamera.odex.... then drop both of them into system/app and reboot. Wouldn't think anything else would be interfering?
JRW 28 said:
Go into file explorer and make sure your system folder is r/w along with both the blurcamera.apk and blurcamera.odex.... then drop both of them into system/app and reboot. Wouldn't think anything else would be interfering?
Click to expand...
Click to collapse
How do I make sure that BlurCamera.apk and BlurCamera.odex are both r/w?
Im not sure if it really matters on them but long pressing on either of them in file explorer should bring up the permissions and you can change from there. Do the same on your system folder just to double check that the permissions are correct
JRW 28 said:
Im not sure if it really matters on them but long pressing on either of them in file explorer should bring up the permissions and you can change from there. Do the same on your system folder just to double check that the permissions are correct
Click to expand...
Click to collapse
Yeah still no luck... no idea whats wrong
Try pushing them with ADB .....usually that will take care of it

can't remount /system as rw

I think I'm starting to go slightly insane here.
Can't for the life of me mount /system as rw, it's only ro.
Ways I've tried:
- using mount command in terminal emulator
- using rw remount button in total commander
- using adb shell to do the same thhing as terminal emulator
i have supersu and all of the above were granted superuser but still no luck
here's relevant part of console output, but it doesn't do anything.
Code:
D:\Downloads\adt-bundle-windows-x86_64-20131030\sdk\platform-tools>adb shell
[email protected]:/ $ su
su
[email protected]:/ # mount
mount
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
[email protected]:/ # mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system
the directory stays read-only.
the whole reason i'm trying to do this is so i can stick in a boot animation (link) into system/media ...is there an easier way? i've tried 3 different file explorers with super but they all fail because it's not rw.....
and adb cant push to it either because it's rw.......
mount -o rw,remount /dev/block/mmcblk0p25 /system
Or put it in /data/local
-----------------------
Sent via tapatalk.
I do NOT reply to support queries over PM. Please keep support queries to the Q&A section, so that others may benefit
rootSU said:
mount -o rw,remount /dev/block/mmcblk0p25 /system
Or put it in /data/local
Click to expand...
Click to collapse
well after trying some more (the terminal command still didnt want to do anything) i managed to get antek explorer to mount it as rw and was able to copy in the new bootanimation.zip
except that now it's unreadable file-
as in, if i try to open the zip in /system/media it just says cannot read file, if i copy it back out to a different folder it opens fine again.
and the boot animation itself, well, it just plays a tiny one with the word 'android' across it, which i guess is the default if it cant find one.
putting the file into /data/local doesn't change anything (doesnt overwrite the nexus one, doesnt overwrite the little word android)
since i'm new to all this stuff i can think probably i missing something simple, but do i have to somehow initialise new bootanimation or something? its the right file in the right place, dont know why it dont work.......
edit: here's an imgur album showing this stuff, maybe you can spot something there? http://imgur.com/a/l9sXa
edit2: just to test, i installed https://play.google.com/store/apps/details?id=com.klpu.android.bootanimation and it did indeed change the animation. so it's just a problem with doing it manually. unfortunately that app doesn't let you load in a custom one, only the preinstalled ones, so it's not much use to me overall...
DryEagle said:
well after trying some more (the terminal command still didnt want to do anything) i managed to get antek explorer to mount it as rw and was able to copy in the new bootanimation.zip
except that now it's unreadable file-
as in, if i try to open the zip in /system/media it just says cannot read file, if i copy it back out to a different folder it opens fine again.
and the boot animation itself, well, it just plays a tiny one with the word 'android' across it, which i guess is the default if it cant find one.
putting the file into /data/local doesn't change anything (doesnt overwrite the nexus one, doesnt overwrite the little word android)
since i'm new to all this stuff i can think probably i missing something simple, but do i have to somehow initialise new bootanimation or something? its the right file in the right place, dont know why it dont work.......
edit: here's an imgur album showing this stuff, maybe you can spot something there? http://imgur.com/a/l9sXa
edit2: just to test, i installed https://play.google.com/store/apps/details?id=com.klpu.android.bootanimation and it did indeed change the animation. so it's just a problem with doing it manually. unfortunately that app doesn't let you load in a custom one, only the preinstalled ones, so it's not much use to me overall...
Click to expand...
Click to collapse
hint, look at the bootanimation.zip file permissions once you moved it to /system/media
rootSU said:
hint, look at the bootanimation.zip file permissions once you moved it to /system/media
Click to expand...
Click to collapse
thank you!! this solved it!
No worries
-----------------------
Sent via tapatalk.
I do NOT reply to support queries over PM. Please keep support queries to the Q&A section, so that others may benefit

Categories

Resources