*****DISCLAIMER: Make a full Nandroid backup of your phone before using these scripts. I'm not responsible for damaging or bricking your phone.
DO NOT FLASH THESE ZIP FILES IF YOU DON'T KNOW HOW TO CREATE NANDROID BACKUPS OR RESTORE YOUR DEVICE.*****
What is it:
If you like to add and remove extra files to your roms zip while flashing the roms, this flashable script will help speed up the installation process. This script is to delete unnecessary apps (ie. bloatwares) from roms. The zip file of this script also contain specific folders that you can put in apps, ringtones, etc which will be copied to the phone when flashed.
I created this scipt with my limited knowledge of linux commands for personal uses, they come as flashable zip files that you can flash using custom recoveries such as "CWM" or "TWRP". I received helps from joesmammafat with the commands so thanks to him.
IF YOU FLASHED THIS SCRIPT ON STOCK FIRMWARE, OVER THE AIR UPDATES WILL NO LONGER WORK.
Click to expand...
Click to collapse
Download is in bottom of post.
*****addremovefiles script package*****
ui_print(">>> MOUNTING /SYSTEM PARTITION... <<<");
run_program("/sbin/busybox", "mount", "/system");
ui_print(">>> DELETING APPS... <<<");
#****Essential stock apps****
#delete("/system/app/Browser.apk");
#delete("/system/app/Calendar.apk");
#delete("/system/app/CalendarProvider.apk");
#delete("/system/app/CalendarProvider.odex");
#delete("/system/app/Email.apk");
#delete("/system/app/Exchange2.apk");
#delete("/system/priv-app/CalendarProvider.apk");
#delete("/system/priv-app/CalendarProvider.odex");
#****Essential Google stock apps****
#delete("/system/app/CalendarGoogle.apk");
#delete("/system/app/CalendarGoogle.odex");
#delete("/system/app/EmailGoogle.apk");
#delete("/system/app/EmailGoogle.odex");
#delete("/system/app/Exchange2Google.apk");
#delete("/system/app/Exchange2Google.odex");
#****Google's Extra Keyboards****
delete("/system/app/GoogleHindiIME.apk");
delete("/system/app/GooglePinyinIME.apk");
delete("/system/lib/libjni_googlepinyinime_5.so");
delete("/system/lib/libjni_googlepinyinime_latinime_5.so");
delete("/system/app/iWnnIME.apk");
delete("/system/app/iWnnIME_Kbd_White.apk");
delete("/system/lib/libiwnn.so");
delete("/system/app/KoreanIME.apk");
delete("/system/lib/libjni_koreanime.so");
delete("/system/app/PinyinIME.apk");
delete("/system/lib/libjni_pinyinime.so");
delete("/system/app/OpenWnn.apk");
delete("/system/lib/libwnndict.so");
delete("/system/lib/libWnnEngDic.so");
delete("/system/lib/libWnnJpnDic.so");
#****Roms preloaded apps****
#delete("/system/app/CMFileManager.apk");
#delete("/system/app/SlimFileManager.apk");
delete("/system/app/Apollo.apk");
delete("/system/app/CMWallpapers.apk");
delete("/system/app/DashClock.apk");
delete("/system/app/Development.apk");
delete("/system/app/HoloSpiralWallpaper.apk");
delete("/system/app/HoloSpiralWallpaper.odex");
delete("/system/app/LiveWallpapers.apk");
delete("/system/app/LiveWallpapers.odex");
delete("/system/app/LockClock.apk");
delete("/system/app/MagicSmokeWallpapers.apk");
delete("/system/app/MagicSmokeWallpapers.odex");
delete("/system/app/mGerrit.apk");
delete("/system/app/Microbes.apk");
delete("/system/lib/libmicrobes_jni.so");
delete("/system/app/Music.apk");
delete("/system/app/QuickSearchBox.apk");
delete("/system/app/SlimIRC.apk");
delete("/system/app/SpareParts.apk");
delete("/system/app/SwagPapers.apk");
delete("/system/app/Term.apk");
delete("/system/app/UnicornPorn.apk");
delete("/system/app/VideoEditor.apk");
delete("/system/app/VoiceDialer.apk");
delete("/system/priv-app/VoiceDialer.apk");
#****Google apps (downloadable through PlayStore)***
#delete("/system/app/CloudPrint.apk");
#delete("/system/app/CloudPrint2.apk");
#delete("/system/app/GoogleTTS.apk");
#delete("/system/app/GoogleTTS.odex");
#delete("/system/app/Hangouts.apk");
#delete("/system/app/HPLegacyPlugin.apk");
#delete("/system/app/HPPrintPlugin.apk");
#delete("/system/app/Wallet.apk");
#delete("/system/priv-app/Wallet.apk");
delete("/system/app/Books.apk");
delete("/system/app/Chrome.apk");
delete("/system/app/Currents.apk");
delete("/system/app/Drive.apk");
delete("/system/app/GenieWidget.apk");
delete("/system/app/GenieWidget.odex");
delete("/system/app/Gmail.apk");
delete("/system/app/Gmail2.apk");
delete("/system/app/Gmail2.odex");
delete("/system/app/GMS_Maps.apk");
delete("/system/app/GoogleEars.apk");
delete("/system/app/GoogleEars.odex");
delete("/system/app/GoogleEarth.apk");
delete("/system/app/GooglePlus.apk");
delete("/system/app/Keep.apk");
delete("/system/app/Keep.odex");
delete("/system/app/Magazines.apk");
delete("/system/app/Maps.apk");
delete("/system/app/Music2.apk");
delete("/system/app/Music2.odex");
delete("/system/app/OccamQuickOffice.apk");
delete("/system/app/PlayGames.apk");
delete("/system/app/PlusOne.apk");
delete("/system/app/Quickoffice.apk");
delete("/system/app/QuickOffice.apk");
delete("/system/app/Street.apk");
delete("/system/app/Translate.apk");
delete("/system/app/Videos.apk");
delete("/system/app/VideoEditorGoogle.apk");
delete("/system/app/VideoEditorGoogle.odex");
delete("/system/app/VoiceSearchStub.apk");
delete("/system/app/VoiceSearchStub.odex");
delete("/system/app/YouTube.apk");
#****Google's Accessibility****
#delete("/system/app/talkback.apk");
#delete("/system/priv-app/talkback.apk");
ui_print(">>> DELETING EXTRA MEDIA FILES... <<<");
delete("/system/media/LMprec_508.emd");
delete("/system/media/PFFprec_600.emd");
delete_recursive("/system/media/video/");
#****Essential media files****
#delete("/system/media/bootanimation.zip");
#delete_recursive("/system/media/audio/alarms/");
#delete_recursive("/system/media/audio/notifications/");
#delete_recursive("/system/media/audio/ringtones/");
ui_print(">>> DELETING PICOTTS LANGUAGES... <<<");
#****PicoTTS's non-English languages****
delete("/system/tts/lang_pico/de-DE_gl0_sg.bin");
delete("/system/tts/lang_pico/de-DE_ta.bin");
delete("/system/tts/lang_pico/es-ES_ta.bin");
delete("/system/tts/lang_pico/es-ES_zl0_sg.bin");
delete("/system/tts/lang_pico/fr-FR_nk0_sg.bin");
delete("/system/tts/lang_pico/fr-FR_ta.bin");
delete("/system/tts/lang_pico/it-IT_cm0_sg.bin");
delete("/system/tts/lang_pico/it-IT_ta.bin");
ui_print(">>> EXTRACTING SYSTEM FILES... <<<");
package_extract_dir("system", "/system");
ui_print(">>> UNMOUNTING /SYSTEM PARTITION... <<<");
unmount("/system");
ui_print(">>> FINISHED... <<<");
WHAT IT DO:
--Delete unnecessary apps preloaded by popular roms (CM, AOKP, PA, Slim).
--Delete unnecessary Google apps downloadable from PlayStore (important core Google services are kept).
--Delete unneeded media files from the "/system/media" directory.
--Delete non-English PicoTTS's languages.
--Copy everything from the "system" folder from the zip file to the /system partition of the device.
IMPORTANT:
--The script file is called "updater-script" located in the folder "\META-INF\com\google\android\" of the zip package.
--Some 'delete' commands are commented out with a # sign, this means those lines will not execute. I comment out lines that will delete apps that might be essential for most users. If you want those apps deleted anyway, remove the # sign before the commands.
--This package contain a folder called "system" in it, with a few common subfolders such as "app" and "media". You can add your own APKs, bootanimation and ringtones into the appropriate folders, which will be copied over to your device once you flashed the package.
Google apps:
--Only non-important Google apps are removed, all which are possible to be downloaded from the PlayStore. Important Google apps such as; core Google services, GmsCore, Phonesky, Velvet, Google Launchers are left alone. You will still be able to log into your Google account, sync and use the PlayStore. You can always delete these lines from the script if you want to keep the gapps.
Click to expand...
Click to collapse
F.A.Q.
How do you use this script packages?
This is a flashable zip package that you can flash using custom recoveries such as TWRP. They are meant to be flashed after a factory reset or a clean rom install. Remember you are taking a risk by using them and I'm not responsible for damages to your phone, make a Nandroid backup before flashing them.
How to edit the script file?
Open up the zip file, go into the folder: \META-INF\com\google\android\ and extract the file updater-script and edit it with a text editor. If you are using Windows, I recommend using Notepad++ to edit the script file. While editing it, rename the file to "updater-script.sh", it will be much easier to edit with NotePad++ since the commands will become color coded. Do not use Wordpad or Microsoft Office, the file needs to be in unix format otherwise it will fail to work. Copy the new 'updater-script' back into the zip file when you're done.
I get "E: error executing updater binary in zip" when trying to flash the zips?
Could be for a number of reasons. Your version of custom recovery may not work with these scripts or its 'update-binary' file doesn't work with your device possibly. You may have an encrypted device. Maybe you edit the script, but made a typing or syntax error in the process.
I added an APK into the "/system/app folder/" to flash, but the app doesn't work afterward:
Some apps required "lib" files to work properly, which is located inside the APK itself, they needed to be placed in the '/system/lib' folder. Some apps will simply not work installed in the /system partition and will need to be installed the traditional way.
I flashed your zip files and now my phone is bootlooping / bricked.
Sorry, should have read the warning disclaimer above and made a back up first.
Click to expand...
Click to collapse
>>> DOWNLOAD: see attachment. <<<
MD5 sum
ea3e7d36aacc9dd3dd41e4888335a09a addremovefiles_v1.07.zip
Click to expand...
Click to collapse
Changelog:
v1.07:
-added more apk to be deleted:
HoloSpiralWallpaper, MagicSmokeWallpapers odex
CloudPrint, HPLegacyPlugin (not deleted by default)
GMS_Maps
Quickoffice
Translate
Related
Hi..
I've had problems with Gmail and Maps applications previously with Neophyte ROMs. In that case one of the solutions was removing the apks for these apps from with the /system/app folder of the ROM zip.
My question is:
Is it possible to add our own apks to the custom ROM so that these apks come preinstalled on the ROM when someone flashes it..in a manner, a kind of 2nd generation mod?
Is it possible to add our own system variables and settings files so that the ROM autoinstalls it on First Install? In particular, I'd like to preset my own APN file for the network.
The simple answer is yes.
The entire system folder in the zip file is written to your /system partition, with the full architecture of folders and so on, so any changes made in there will also be on the system, when it is flashed.
There is also a script file, in the META-INF folder, which you can use to run commands to delete or edit something along with the flash, whenever the zip file is flashed. This is a bit more advanced though.
edit: it is the same for the data folder of course, which folders is flashed and where to is also specified in the script file mentioned above.
Thank you!
In that case, for installation of a program like Gmail.apk or Maps.apk, would be as simple as adding the .apk to the /system/app, or would I have to include other files? Would there be dependancies in other folders?
Well the apps have their own data folder on the data partition, but this is for storing changes in settings and so on, and it should be created by the app itself on first boot just like right after you wipe the data partition/factory reset
Thanks..Got some mod modding to do!
So in case I'd want to manually uninstall/manually install an apk, what would be the steps I'd have to go through?
Would there be filesystem config files (like the older Windows versions), or a central database of entries of the likes of the Registry tables of newer Windows? How does Android go about installing a file? Like which folders and files would be modified other than /system/app and /data/app? Any common files with entries? And in case of the latter, whether it would be machine readable or plain text?
I am not sure if someone posted something similar or not.
Anyways.
This ZIP file does not have a KERNEL in it, it is just a ZIP with empty boot and system folder. The META-INF contains a script that will copy everything in boot to your \boot in your ROM and everything in system to your \system in your ROM.
NOTE: It will overwrite any files that have the same file name in the same folder. So, yes, you can use it for other than updating kernel, say copying a file to a specific folder in \system partition, or \boot partition.
Just open with 7-zip, drop zImage file into the boot folder, then drop modules in the system\lib\modules folder. Copy the zip file to your SD, then run Clockwork Recovery, and install the zip.
thanks,
will try this ASAP
LiFE1688 said:
I am not sure if someone posted something similar or not.
Anyways.
This ZIP file does not have a KERNEL in it, it is just a ZIP with empty boot and system folder. The META-INF contains a script that will copy everything in boot to your \boot in your ROM and everything in system to your \system in your ROM.
NOTE: It will overwrite any files that have the same file name in the same folder. So, yes, you can use it for other than updating kernel, say copying a file to a specific folder in \system partition, or \boot partition.
Just open with 7-zip, drop zImage file into the boot folder, then drop modules in the system\lib\modules folder. Copy the zip file to your SD, then run Clockwork Recovery, and install the zip.
Click to expand...
Click to collapse
It doesn't have to be signed?
Code:
ui_print("Welcome to MDJ Kernel Updater");
mount("MTD", "boot", "/boot");
mount("MTD", "system", "/system");
ui_print("Copying zImage...");
package_extract_dir("boot", "/boot");
ui_print("Copying modules...");
package_extract_dir("system", "/system");
unmount("/system");
unmount("/boot");
ui_print("All Done...");
I don't see anything in the updater-script that requires signing.
Actually, original idea and script by Shadiku...
He actually made two scripts.
can i create a folder called androidapp and put the apks in it and install them automatically like we do with the SD roms
it's not working for me.. try to change the kernel to hastarin that support Extended battere..
it says "Instalation aborted "... what happened?
any clue?
edit : can push the Zimage and some other files, but it stuck with the gogogo...
I have 4 computers that I use and 2 of them have adb drivers installed, the other 2(work computers that i am not really allowed to install much on) does not. To be able to push files to my htc desire on the computers that i do not have adb drivers installed I need a flashable zip. I only want to push files such as ringtones, /system apps, bootanimation.zip files and such, i have no intention of changing the framework or the theme and so on. So could anyone point me in the direction of where could i find a ready empty zip file like this or a tutorial in how to make one?
P.S. one of the uses for this is when i am out on a business trip i do not have my personal computer with me, so if brut-maps gets updated i want to be able to push it to the phone without adb.
Hello.
I only have basic knowledge on the subject, so i'm just gonna explain what i do when i need to flash something via flashable .zip.
1) Get a simple flashable .zip used to flash files anywhere on the /system partition.
2) Open it with WinRAR or 7zip or whatever. Navigate to META-INF/com/google/android/. There you will find two files: update-binary and updater-script. You need not touch the binary, because it's the same for all flashable .zips. What you need to do is extract then edit the updater-script, as that tells the recovery what to do with the flashable .zip's contents.
3) Editing the updater-script: let's say we need to create a .zip to flash a new Mail.apk to /system/app. The updater-script's content would need to be:
Code:
show_progress(0.1, 0);
mount("MTD", "system", "/system");
delete("/system/app/Mail.apk");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
unmount("/system");
The "show_progress" lines are self-explanatory. The "mount" command tells the system to mount the /system partition. We then delete the old Mail.apk and tell the recovery where we want to extract the contents of the .zip. After everything's done, we unmount /system.
Add the edited updater-script to the archive, overwriting the original one. Be sure to set your archiver to "Normal" compression level.
4) Creating the proper directory structure: again, let's say we need to flash Mail.apk to /system/app and that we have properly configured the updater-script for this task. We now need to create a folder named "system" (anywhere on the PC), place a subfolder named "app" inside it, then place the new Mail.apk inside the "app" subfolder. We then add the whole structure to the flashable .zip (making sure that there are no other folders in it than "META-INF") and that's that! Again, make sure you use "Normal" compression.
5) Copy the .zip to your SD card, reboot into Recovery and flash the .zip.
6) Enjoy!
thank you very much, that was exactly the kind of information i was looking for.
You're welcome.
Here's a simple flashable .zip i used to replace media_profiles.xml in the /system/etc folder when i didn't have a PC handy and my phone wouldn't boot. You can edit it and use it for your own purpose.
So this is a guide on how to make a flashable zip (a zip file you put on your SD and install it via a custom recovery). I'm going to assume if you want to make a flashable zip it's because you modified an app (or found one on the internet but it's not meant for our device) so I'm not going to explain how to modify an app or anything like that but I will post some resourceful links
*I own a laptop and use Windows so all the information is based on that, please adjust information if you have a different OS. You can also do all of this using a file explorer and text editor on your phone
So, I've attached a flashable zip that is meant for our devices and uses our mount points. I will go through some situations on where you can/should use it.
First, download the attached zip and extract it (7-Zip is free, use stock settings).
Within the extracted folder you will find data, system, and META-INF folder. Go to the base of the end of the META-INF folder structure and open up the updater-script file (I use Notepad++). This dictates what gets "flashed" and the text you see while in recovery. After you open it pay attention to these lines:
ui_print("");
Click to expand...
Click to collapse
-This will display text inside recovery, you want to enter text within the parenthesis and quotations, so if you wanted your text to say
Hey There
Click to expand...
Click to collapse
Your text in updater-script would look like
ui_print("Hey There");
Click to expand...
Click to collapse
And don't forget that semicolon!
OK so that's how you enter custom text that you would see in recovery. Next important lines you'll see are
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/data");
Click to expand...
Click to collapse
This mounts your system (/system) and data (/data) partitions so whatever apps/jars/xml's/boot animations/fonts/etc you flash will end up where you want them to go (as long as you have the appropriate file structure; continue reading on that)
So you want to keep those within your updater-script, even if you are just flashing a system app it will not hurt anything on your set up if /data is mounted.
The next important lines are
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
Click to expand...
Click to collapse
This now extracts whatever you have in your /system and /data folders within your zip into your system so it's important to make sure that you're satisfied with whatever you have in those folders prior to flashing
The last two lines,
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/umount", "/data");
Click to expand...
Click to collapse
simply unmounts the data and system partitions after everything is flashed
Just a note, this should not be used if you are flashing an entire ROM, I will update this with an updater script for this.
So after you modified your files and signed them correctly place them in their appropriate locations. For example, if it is a modified SystemUI.apk you will make a file structure like /system/app/SystemUI.apk, then select both the META-INF folder and system folder, right click and scroll to 7-Zip and select "Add to Archive", use stock settings and select OK. Place your zip on your internal or external SD and flash in recovery
This should be used for modified system files (apps, jars, files (init.d scripts, xmls), boot animations, apns, init.* files, etc), or data files (themed Facebook, Twitter, apps you download from Google Play)
IMPORTANT NOTES:
-If you are going to flash something, make sure the name of the apk's/jar's/files match the original apk's/jar's/files (example: if you are on a TW ROM and flashing a modified Messaging app you or someone else made, the correct name for that app is SecMms.apk). In that example, your apk would be in /system/app/SecMms.apk
-If you are flashing a modified Google Play, Gmail, YouTube, etc (themed, hacked, etc) make sure the app you flashed isn't in /data/app/ so make sure you delete apps that were automatically updated by going to /data/app/ (using a file explorer with root permissions) then flashing it.
-MAKE A BACKUP! Just in case. You can always make a backup of whatever apps your flashing by copy/pasting them onto your SD then make a flashable backup zip just in case something goes wrong
-It won't hurt your system if you have empty folders in your zip. If you're lazy just don't delete the empty /data or /system folders in my example
-Here are some general file locations of common apps that you may be flashing:
Google Play (/system/app/Phonesky.apk)
Messaging App (Touch Wiz) (/system/app/SecMms.apk)
SystemUI (statusbar) (/system/app/SystemUI.apk)
Framework-res (Android Framework) (/system/framework/framework-res.apk)
Gmail (/system/app/Gmail.apk)
Bootanimation (/system/media/bootanimation.zip)
LINKS:
apktool (make sure you Google how to set-up apktool in accordance with your OS)
-Notepad++ (what I use to modify xml's and updater-scripts)
-7-zip (I personally use WinRAR but this is free so...)
-File Explorer (FX) (what I use to create/extract zips on my phone)
**I will add more in the next few days, really late here so I'm going to crash
**reserved for morphs and whatnot
one more I guess
thanks fergie! Good Stuff!
THANK YOU SOOOOOOOOOOOO MUCH FOR THIS!!!!!!!!!
Been looking for something like this since I got my S3!
Thanks for the great tut.
Sent from my SPH-L710 using xda premium
No problem. Any other tips or tutorials anyone want to suggest?
Sent from my SPH-L710 using Tapatalk 2
Hello!
I have installed Jelly King 2.0 on my Wildfire S (S-ON) and I really like it. But I miss the Google Talk app. I know that I could flash another GAPPS zip, but I think that would use too much space. So, how can I install just the Google Talk app without all the other gapps?
Here is what I already tried - and what didn't work:
0. Search for an solution in this Forum
1. Take the talk.apk from gapps and try to install
2. Put the talk.apk in /data/app
3. Put it in /system/app - couldn't move anything into that folder in spite of being root. I guess because of S-ON?
My next approach would be to create a flashable zip with just Google Talk - but I don't know how to do that. Or is there another way?
here you go.
i made zip of gtalk.
just boot to recovery and flash it.
Thanks!
Some more questions:
1. Shouldn't the Talk.apk be in the folder /system/app/ instead of just /app/? (I am comparing to a gapps zip in which it is located there)
2. How can I create such a zip-file myself? I don't know what the META-INF folder should content. Could I just copy this folder from any gapps.zip? And could I take the Talk.apk from there as well? (I would be more comfortable about using the app if I knew its source)
edit:
Okay, I took a look into the files in META-INF...and I think the answer to my first question is in this line of the file "updater-script":
package_extract_dir("app", "/system/app");
Anyway: Where did you get the "update-binary" file from? And I also can't see what the other three files (CERT.SF, CERT.RSA and MANIFEST:RSA) are for as the files they are providing a SHA1-checksum (?) for are not even in the zip-file.
vi!n said:
Thanks!
Some more questions:
1. Shouldn't the Talk.apk be in the folder /system/app/ instead of just /app/? (I am comparing to a gapps zip in which it is located there)
2. How can I create such a zip-file myself? I don't know what the META-INF folder should content. Could I just copy this folder from any gapps.zip? And could I take the Talk.apk from there as well? (I would be more comfortable about using the app if I knew its source)
Click to expand...
Click to collapse
first for your information.
s-on dosent mean you can't install apps in /system/app or anywhere else.i have s-on too.with s-on you can do alot of stuffs.you need s-off to just flashing some radios,dual-boot etc(mostly advanced stuff)
so,s-on isn't problem.probably mostly all people here has s-on.
1. yeah talk.apk is in /system/app & gapps also installed in /system/app.about your gapps zip i need to see it.but might you flashed wrong gapps.
2. you can make flashable zips easily.just you need to put apps,framework,scripts (anything you want in correct order)
then time for meta-inf file.all things in that file remained unchanged except updater-script.
you need to edit updater-script to make zip work..
e.g. you put talk.apk in zip then how phone know where to install and how to ?
so your updater script will like this:
Code:
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("app", "/system/app");
run_program("/sbin/busybox", "umount", "/system");
first line for mount system.
then zip will install contains of app in /system/app
and third line for unmounting system.
i sent you PM which contains more detailes about making zip.
if you need any other help,feel free to tell.
Thanks, that helped a lot! The problem is solved for me now.
I was just editing my last post when you answered - so everything below "edit" can be ignored.
vi!n said:
Thanks, that helped a lot! The problem is solved for me now.
I was just editing my last post when you answered - so everything below "edit" can be ignored.
Click to expand...
Click to collapse
yeah and about other files,they are common in every zip.
update binary is needed so phone can understand updater script.
all in one solution,when we make zip we just need to edit updater script all other files in meta-inf will be as it as.no change at all.just put whole folder in zip.