[HOWTO] Odex /system/app - Desire Android Development

A quick guide for how to odex any rooted Desire Rom's /system/app/
The attached scripts should ignore any existing odex'd apk's
Depending on your base Rom you should gain ~20-50MB free internal space
***** DO A NANDROID BACKUP BEFORE DOING ANY OF THIS *****
Requirements:
Rooted de-odexd Rom (Partial or Full)
Working ADB on Win/Lin/Mac
SD Card in Desire with ~200MB Free space.
Guide:
Extract the attached zip to your desktop
Open CMD Window/Terminal and CD to Desktop
While your phone is booted normally
Push the odex folder to /data
Code:
adb push odex /data/odex
Run odex.sh
Code:
adb shell chmod 755 /data/odex/odex.sh
adb shell /data/odex/odex.sh
This will copy all none odexd apk's to /sdcard/app and odex them, your phone will reboot to recovery once done.
In your custom recovery select
Code:
partitions menu
> mount /system
> mount /data
> mount /sdcard
Once all partitions are mounted, in your CMD Window/Terminal
Code:
adb shell /data/odex/appupdate.sh
adb shell rm -r /data/odex
This will clear out all none odex's APK's and move the odexd ones from SD back to /system/app/
For good measure clear you dalvik-cache and reboot.
Thanks to Paul OBrien for the base script's.

thanks for posting... will try this later this weekend and follow up with my results!

exelent job ,just on time
for free up my memory

Thanks for this, excellent post. I'll be using this once the ROMs settle down a bit, annoying as f**k changing every day

This is great ! Thanks Just used it on my Hero
Can you add a framework odexer too ?

Thank you for this.
Sent from my HTC Desire using XDA App

Nice guide, i'll try this afternoon...thanks soo much

Man I've asked 2-3 developers & I PM'd a few people, but none replied regarding odexing.
You work is highly appreciated, thank you.

robocik said:
This is great ! Thanks Just used it on my Hero
Can you add a framework odexer too ?
Click to expand...
Click to collapse
Odexing the framework after it's been flashed has caused a few FC's for me, so I have left it out.

what does actually do for the phone/app?

it saves space on data partition.

Tip for windows:
Use 0777 instead of +x
adb-windows shell chmod 0777 /data/odex/odex.sh
It said "bad mode" to me..

Klutsh said:
Odexing the framework after it's been flashed has caused a few FC's for me, so I have left it out.
Click to expand...
Click to collapse
Ok, thanks again, great tool

What about a script for odexing before flashing!?

nerdo said:
What about a script for odexing before flashing!?
Click to expand...
Click to collapse
+1, odexing then adding the odexed apps to the update.zip will be much better.

I'm looking to see if this would be possible.
If it is I know it will only be on Linux/Mac

It would help if the cooks didn't insist on de-ODEXing the ROMs. The official release was ODEX'd.

marinierb said:
It would help if the cooks didn't insist on de-ODEXing the ROMs. The official release was ODEX'd.
Click to expand...
Click to collapse
They do it to allow easy themes and patches to be easily applied to apk's, that way not breaking the odex.
I agree though that an odex rom is faster and also gives more space on the internal memory.

Hi!
I am doing it from windows and getting the following error while running the odex.sh
zip error: Nothing to do! (./ApplicationsProvider.apk)
Unable to open './ApplicationsProvider.apk' as zip archive
failed on './ApplicationsProvider.apk.new' - No such file or directory
Unable to create './AppSharing.odex': File exists
zip warning: name not matched: classes.dex
My phone is still connected to the laptop so the SD is not available.

@lept0n
You answered your own question.
You need to have the SD card mount in the phone for this to work as it moves all the apk's that need odexing to SD as we don't have write access to /system when the phone is booted to android.

Related

new scripts

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.

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

updae script to remove apks

im getting tired of having to pull apks every time i flash a new rom. i found a thread that said that you can add a few lines to the update script to remove the apks prior to boot. how do you do that? when i added the lines in the thread i got a wrong digest meta-inf/comgoogle/android/update-script verification failed instillation aborted
i think my issue is i unpacked my signed zip modded the updatescript and rezipped it.
anyone have a better way to remove those apk, not one by one!
please if you could detailed instructions
recognize_atm said:
anyone have a better way to remove those apk, not one by one!
Click to expand...
Click to collapse
Why would you need to modify the ROM? You *do* realize that if you were going to go to the trouble of modifying the ROM to add removing things via the update script, you could just remove what you wanted removed in the first place?
No, of course you don't.
please if you could detailed instructions
Click to expand...
Click to collapse
Gods, that's what adb and a batch file (or a shell script, if you think you should be using Linux) are for.
you can create a .bat file to run and remove all the apks you dont want. here is mine
RemoveApp.bat said:
cd C:\android-sdk-windows\tools
adb remount
adb shell rm system/app/Facebook.apk
adb shell rm system/app/Gallery3DMT.apk
adb shell rm system/app/GenieWidget.apk
adb shell rm system/app/HtcFacebook.apk
adb shell rm system/app/HtcTwitter.apk
adb shell rm system/app/SocialNetworkProvider.apk
adb shell rm system/app/Sprint_TVWidget.apk
adb shell rm system/app/Sprint_TV.apk
adb shell rm system/app/Sprint_Nscar.apk
adb shell rm system/app/Sprint_NFL.apk
adb shell rm system/app/Stock.apk
adb shell rm system/app/com.htc.TwitterWidget.apk
adb shell rm system/app/Flickr.apk
adb shell rm system/app/FriendStream.apk
adb shell rm system/app/com.htc.FriendStreamWidget.apk
Click to expand...
Click to collapse
posguy99 said:
Why would you need to modify the ROM? You *do* realize that if you were going to go to the trouble of modifying the ROM to add removing things via the update script, you could just remove what you wanted removed in the first place?
No, of course you don't.
God, that's what adb and a batch file (or a shell script, if you think you should be using Linux) are for.
Click to expand...
Click to collapse
your username suits you well... minus the 99.
don't be mean like that man.
I figured it out thanxs
Yea its best to make a seperate update.zip with an edited script that you can flash any time with any rom. So if you flash a new rom, you can then flash the update.zip. Mine would remove a bunch of apps and install a theme and a bootscreen after installing a new rom.
I also see that you got it, but yea you have to resign the zip after you change something in it.
And to the posguy.. If you are NO where near a computer, you can always run the .zip file with the edited script. Comes in handy if you download a rom from your phone, like a rom from DamageControls Updater or just on the web.
Yes i know you can do a terminal, but thats just long and dumb. Make a update script.
Jus10o said:
Make a update script.
Click to expand...
Click to collapse
Yes, that's a good idea. Of course, that's not what the OP thought he should do, he thought he should modify the script in the original ZIP file.
Jus10o said:
And to the posguy.. If you are NO where near a computer, you can always run the .zip file with the edited script. Yes i know you can do a terminal, but thats just long and dumb. Make a update script.
Click to expand...
Click to collapse
my point! thats why i wanted to edit the script. i know how to do it with the terminal/ .bat file. but i cant figure out how to get the zip to work
recognize_atm said:
my point! thats why i wanted to edit the script. i know how to do it with the terminal/ .bat file. but i cant figure out how to get the zip to work
Click to expand...
Click to collapse
Here is a update zip that removes some apps already.. Its my old one.
If you edit any of the lines then you must re-sign the .zip.
If you cant figure it out, or just want someone to sign it really quick. Post your .zip here and I will sign it for you so it will be flashable.
View attachment update.zip
hey thanks... i normailly sign zips using the old fresh kitchen but it doesnt seem to sign roms and im guessing zips that have meta-inf already in them cant get signed thru kitchen. i think i might be wrong, but ho do you sign your zips?
recognize_atm said:
hey thanks... i normailly sign zips using the old fresh kitchen but it doesnt seem to sign roms and im guessing zips that have meta-inf already in them cant get signed thru kitchen. i think i might be wrong, but ho do you sign your zips?
Click to expand...
Click to collapse
http://androidforums.com/developer-101/8665-how-signing-roms.html

writing update-script file

I would like to copy additional files into the /data/app/ folder with an update.zip file. My script will successfully add to /system/app/ folder but not /data/app/. I've seen code to delete and then add a whole new /data/app/ folder but I would like to keep whatever is in there already, just add and remove specific files in it. This is what I've been using but it fails. Can this be done?
Code:
show_progress 0.200000 0
delete DATA:app/com.facebook.katana.apk
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app
diordnahero said:
I would like to copy additional files into the /data/app/ folder with an update.zip file. My script will successfully add to /system/app/ folder but not /data/app/. I've seen code to delete and then add a whole new /data/app/ folder but I would like to keep whatever is in there already, just add and remove specific files in it. This is what I've been using but it fails. Can this be done?
Code:
show_progress 0.200000 0
delete DATA:app/com.facebook.katana.apk
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app
Click to expand...
Click to collapse
While not necessarily my forte, do you happen to be running apps2sd? My guess is that the partition on the SD card hasn't mounted yet, and thus, the file(s) can't be accessed to delete.
yes I am.
Though my update script works to write and delete to /system/.. folders just fine. The update-script files I have looked at delete the whole folder first and then create/copy the new one, then correct permissions. I can't find anything specific to delete/adding individual files though.
diordnahero said:
yes I am.
Though my update script works to write and delete to /system/.. folders just fine. The update-script files I have looked at delete the whole folder first and then create/copy the new one, then correct permissions. I can't find anything specific to delete/adding individual files though.
Click to expand...
Click to collapse
The system folder is not part of apps2sd, so that would make sense.
I'm still thinking this is your issue. I'm wondering if there is a way to mount via an update script?
JsChiSurf said:
The system folder is not part of apps2sd, so that would make sense.
I'm still thinking this is your issue. I'm wondering if there is a way to mount via an update script?
Click to expand...
Click to collapse
I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcard when in recovery to do a backup of google ****s.
zippy-man said:
I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcard when in recovery to do a backup of google ****s.
Click to expand...
Click to collapse
I saw this syntax referenced in another thread, that you can use in an update script:
run_program PACKAGE:script.sh
I'm assuming this is what Cyanogen is doing?
That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.
Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...
JsChiSurf said:
I saw this syntax referenced in another thread, that you can use in an update script:
run_program PACKAGE:script.sh
I'm assuming this is what Cyanogen is doing?
That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.
Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...
Click to expand...
Click to collapse
yup, I've done that before. Very handy. that'll get the job done
I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcar
Click to expand...
Click to collapse
I saw this syntax referenced in another thread, that you can use in an update script:
run_program PACKAGE:script.sh
I'm assuming this is what Cyanogen is doing?
That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.
Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...
Click to expand...
Click to collapse
Yep. You just create whatever script you want and add that to the update script and it will run it. I have used it for many things but have not used a script to mount the sd card.
If you get a hold of the script that cm wrote you could pull out the party that mounts the sd card and use that to write to data if it its located on the sd card.
-------------------------------------
Sent from my HTC Hero
Awsome! Great stuff.
I found this but have not tried it yet as there hasn't been need to update anything lately.

Custom Window Animations +

I was experimenting with the framework-res.apk and there i get a folder named anim. So I put some anim files from many ROM's of Galaxy i9000's anim files in i5801 and it works.
So I uploaded it here, If U want, than U can grab it from here.
It's really very cool.
How to :
if you want to use these animations:
1. Download the file in zip format.
2. Just extract the framework-res.apk from the zip file.
3. Now put the framework-res.apk into /sdcard.
4. Now do backup of framework-res.apk and copy it into /sdcard/external_sd or wherever you want.
5. Now put the framework-res.apk in /system/framework using root explorer. Sorry I don't know how to push it using ADB
6. It can only be possible if the phone is rooted.
7. Make sure the /system/framework space is this much enough to copy the file.
8. Now reboot the device and feel the changes.
~_^
Bounce >>>> http://www.multiupload.com/F0I5CR04GM
Flip >>>>>>> http://www.multiupload.com/71OK1YA4XF
Fold >>>>>> http://www.multiupload.com/Z1NZFZFBQ9
Flying >>>>> http://www.multiupload.com/4QMTZVEV4M
Original >>>> http://www.multiupload.com/RUQZ9IBPL1
It will work on any 2.2 Froyo
Nice find Will definately check it out this evening!
Now trying it, the bource version, will report back soon.
EDIT: I Cant boot any more.. JPF
booted. JPF Clean. Works, very nice. Thank you.
Can you upload the original framework-res.apk from jpf?
EDIT1: Dont Need it anymore, reflashed the phone with jpf
EDIT2: After Reflash works without problems!
EDIT3: Original File is also here, sry hevent seen it.
can u make update.zip files? pls
TFS.....
thx
it's working nice with my modded livewallpapers firmware too!
Can you put some screens there?
And can someone inform me if it is a succes on JPF-rom?
Thanks
ilendemli said:
Can you upload the original framework-res.apk from jpf?
EDIT1: Dont Need it anymore, reflashed the phone with jpf
EDIT2: After Reflash works without problems!
EDIT3: Original File is also here, sry hevent seen it.
Click to expand...
Click to collapse
before you copy the framework-res.apk you have to remount system with adb shell:
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
and after you can owerwrite the framework-res.apk in system folder with root explorer
i know, that was not the problem, my problem was the custom kernel by gsam
I was wondering: How did you change the framework-res.apk and resigned it without having problems ? I tried to change the battery artwork, and all i get is FC..
Gsam101 said:
I was wondering: How did you change the framework-res.apk and resigned it without having problems ? I tried to change the battery artwork, and all i get is FC..
Click to expand...
Click to collapse
I used just simple method.....
Extract the .apk on my desktop and I do changes on the /res/anim folder.
And that's it !!!..... and i don't think that anybody getting any error due to it.
--------------------------------------------------
Current Device = Samsung GT-i5801
JPF Clean ROM FroYo + JPB Kernel and some perf tweaks.
madhuranand007 said:
I used just simple method.....
Extract the .apk on my desktop and I do changes on the /res/anim folder.
And that's it !!!..... and i don't think that anybody getting any error due to it.
--------------------------------------------------
Current Device = Samsung GT-i5801
JPF Clean ROM FroYo + JPB Kernel and some perf tweaks.
Click to expand...
Click to collapse
nice job
thx
TiBiSMART said:
nice job
thx
Click to expand...
Click to collapse
Thanks TiBi
I have a problem with Root Explorer! It ocurred as:
I copy a file, and I can to paste it in System/framework, but when I try paste it the Root Explorer don´t permit me to paste and says me this message:
"The paste operation failed. Would you like to send diagnostic information to the developer to assist with fixing the problem?"
WHY?
Thx 4 all! =)
fersago said:
I have a problem with Root Explorer! It ocurred as:
I copy a file, and I can to paste it in System/framework, but when I try paste it the Root Explorer don´t permit me to paste and says me this message:
"The paste operation failed. Would you like to send diagnostic information to the developer to assist with fixing the problem?"
WHY?
Thx 4 all! =)
Click to expand...
Click to collapse
"before you copy the framework-res.apk you have to remount system with adb shell:
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
and after you can owerwrite the framework-res.apk in system folder with root explorer"
Yaffs2 are u sure? I think system is rfs
Download SGS toolbox or mount /system rw from market and no more problem mounting as rw.
The right command is
busybox mount -o remount,rw /system

Categories

Resources