Thursday, August 27, 2015

Removing files from & repackaging CyanogenMod ROM zip files


The current CM10 + GApps experience on Motorola Xoom is plagued by the size of the CM10 ROM -- there isn't enough space left after flashing the CM10 zip to fully flash the GApps zip. This results in gtalk force-closing while trying to video chat and some other issues.


I've been following a discussion about this on the XDA development forum for Xoom. Here's someone mentioning that he 'removed' some files from the CM10 ROM zip file to reduce it's size: http://forum.xda-developers.com/showthread.php?p=34462283#post34462283


Could someone guide me how to do this?
Is it simply unzipping the file, deleting certain files and re-zipping?
or is there more ? (like signing the file)
To remove apps from the ROM, should the .apk file simply be removed or do apps also have associated files that need to be removed as well?


In the same discussion some people talk about moving certain files from the system partition to the data partition? How could this symlinks information be stored in the ROM zip file? or are they talking about creating the symlinks after flashing the zip?



Thanks



Answer



There are multiple solutions available:


Re-Zip the Image


Advantage: You do it once, and can use the resulting image for multiple devices. That's what I did with CM7.2 for my Milestone 2. Easy enough to do:



  1. create a temporary (empty) folder

  2. unzip the zip file to it

  3. remove unwanted *.apk files from /system/apps (be careful of what you remove, of course)

  4. zip up the directory contents again



Using a graphical ZIP manager (like WinZip or the like), steps would be even easier:



  1. open the zip file with the archive manager

  2. remove the unwanted .apk files

  3. if the ZIP manager requires it, save the manipulated zip


Manually cleanup after flashing, using the shell


This is what ce4 recommended in the comments. It requires you using a terminal emulator on your device:




  1. Flash the image as-is

  2. remove superfluous stuff from the system partition by hand (like rm /system/big/junk/example.mp4)


Manually cleanup after flashing, using other tools


Almost the same as the previous method, but a bit more user-friendly. Disadvantage: this won't do for superflous ringtones and the like:



  1. Flash the image as-is

  2. Use a tool like Titanium Backup or Root Uninstaller to remove unwanted system apps


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...