Go Back   Android Forums > Android Discussion > Android Applications > Tasker

Find everything you need for the Galaxy S5 and discuss it in our S5 forum!
Have you seen that OnePlus One's awesome camera?? The forum is over here!

test: Reply
 
LinkBack Thread Tools
Old February 4th, 2013, 08:35 PM   #1 (permalink)
ROM Developer
Thread Author (OP)
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,320 Times in 3,994 Posts
Default [Task] [Root] Flash multiple zips at once, via CWM based recovery

I'm a bit fed up of flashing 9 zips every time I upgrade my ROM, so I created this to save me some time and effort. Enjoy.


Contents

Who is this Task for?
What does this Task do exactly?
What do I need to know / understand before using this Task?
The Bash commands
Note to S3 users
Note to Other device users
I want to change this to use a folder of my choice. How?
Download


Who is this Task for?

This Task has been created for root users. In particular, those who use a ClockWorkMod (CWM) based recovery to flash zips. It can be annoying when you upgrade your ROM and then have to flash your favourite theme and all your mods, one after another


What does this Task do exactly?

This Task, when triggered (Homescreen widget), will boot into recovery and flash all the zips (In alphabetical order) one after another in one folder, then boot back into Android. This prevents you in CWM recovery, having to keep going through the menus to choose the install option and browsing to the folder every time.

You can add a widget to the homescreen:

Long press home screen > Add Widget > Task > ZipFlash

WARNING - There is no confirmation on this as yet. Pressing it will immediately boot into recovery. I recommend if you can spare a homescreen to this on its own, please do

Since this flashes in Alphabetical order, its best to start all your zip filenames with "01_" and "02_" in the order you want them flashed. Personally I mostly only change the "01_ROM.zip" file. "02_theme.zip" and "03_Mod.zip" tend to remain the same.

Yes, this task WILL work with Aroma installers. However, do not leave the flashing process unattended. You will still need to ensure you make your Aroma selections as normal. Don't forget to untick the "reboot your device" option at the end of each Aroma instance

For those of you who don't know what Aroma is, it's not really important but it's like an install wizard (similar to windows programs). Once you flash the zip, the Aroma installer wizard takes over. It presents you a nice GUI to install the options of your choice from the mod or rom. This is something the developer, themer etc would have implemented as part of the zip file. Its not something specific to this task


What do I need to know / understand before using this Task?

To use this profile, you need to know the mount points on your phone both in android and recovery.

For example, on the s3 there is an internal and an external SD card.

In android (S3) these are:
internal - /mnt/sdcard
external - /mnt/extSdCard

In CWM recovery (S3) these are:
internal - /data/media
external - /external_sd

First you must decide if you are going to use the Internal or External SD card.

On a phone that has NO external sdcard, you would follow the rationale of the S3's internal sdcard (/mnt/sdcard in android).

Similarly if you have a phone that has NO internal sdcard, you would still follow the rationale of the internal sdcard (/mnt/sdcard in android).

Essentially EVERY device will use /mnt/sdcard for their Storage, whether that's an external Micro SD card or Internal SD card. Only devices that have an internal AND external SD card will need to look into that deeper.

People with root explorers can browse to the root of their device, find the /mnt directory and see what everything is mounted as. You will be able to get everything you need to use for the "in Android" settings. As for recovery, this could vary from device to device so if you don't know, ask in the development thread (Probably XDA) of your device's recovery.

Note. Mount points are case sensitive. /mnt/extsdcard will not work if it's supposed to be /mnt/extSdCard


The bash commands

This task by default uses /mnt/extSdCard/AFLash/zips as the zip folder. You may want to change this to be /mnt/sdcard/folder of your choice later on, as the current default location is my personal folder on the S3 which won't work for all devices

Here is an extract of the task commands (and what it does):

Code:
# Lists contents of Zip folder into a file called "ls"

ls /mnt/extSdCard/AFlash/zips/ls


# Prefixes each line contained within the "ls" file with code that will form part of the install command, in a new file called prefix

sed -e 's#^#install_zip("/external_sd/AFlash/zips/#' /mnt/extSdCard/AFlash/zips/ls > /mnt/extSdCard/AFlash/zips/prefix


# Suffixes each line contained within the "prefix" file to complete the install command, in a new file called "extendedcommand"

sed -e 's/$/");/' /mnt/extSdCard/AFlash/zips/prefix > /mnt/extSdCard/AFlash/zips/extendedcommand


# Removes the last line in "extendedcommand", which is the "ls" file created in step 1

sed -i '$d' /mnt/extSdCard/AFlash/zips/extendedcommand


# deletes the unused ls and prefix files

rm /mnt/extSdCard/AFlash/zip/ls /mnt/extSdCard/AFlash/zip/prefix


# Moves the extendedcommand file so recovery can see it

mv /mnt/extSdCard/AFlash/zips/extendedcommand /cache/recovery


#Boots into recovery

reboot recovery
Before anyone mentions, I know in some places I could have used -i instead of -e and I could have amalgamated some of the commands. I chose not to do that for ease if debugging.


Note to S3 users

If you are happy with using the external SD card and my folder structure for zips, this task can be used unmodified

Note to Other device users

You will most likely need to change the location of the folder you use for Zips. Ensure you know your mount points and decide on a folder to use

See again: What do I need to know / understand before using this Task?


I want to change this to use a folder of my choice. How?

OK, I'll tell you how. I will assume for the purpose of this explanation that you want to change the location to /mnt/sdcard/myzips

Please note, this is where you need to know your recovery mount points. I will write this as an S3 user where the recovery mount point for /mnt/sdcard is /data/media

If you do not know your mount points, see again: What do I need to know / understand before using this Task?


Modifying xml is the best way to go, BEFORE importing it into tasker. Its best to do this on a computer. Use a notepad or text application that has a "Find and replace" function.

Find: /mnt/extSdCard/AFlash/zips
Replace: /mnt/sdcard/myzips

Find: external_sd
Replace: data/media


That's it...


Downloads
Attached Files
File Type: zip ZipFlash.zip (632 Bytes, 28 views)

SUroot is offline  
Last edited by SUroot; February 5th, 2013 at 10:15 AM.
Reply With Quote
The Following 3 Users Say Thank You to SUroot For This Useful Post:
shauny13 (February 5th, 2013), silentwitness (February 5th, 2013), simonwil (February 7th, 2013)
sponsored links
Old February 7th, 2013, 05:02 AM   #2 (permalink)
New Member
 
Join Date: Feb 2013
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks for this - nice job. I just installed the XML task file untouched and it worked fine.

However, it doesn't work for me since flashing a new ROM. It fails at step 6 when trying to copy the file list. I can copy the generated file manually and then boot into recovery and have the installs work.

I have tried re-installing PhilZ recovery and fixed permissions etc but no luck. Your Nandroid backup process still works fine for me.

Any ideas on what I need to do?

I am running Wanamlite 5.7 with Philz latest recovery on an i9300.
simonwil is offline  
Reply With Quote
Old February 7th, 2013, 05:15 AM   #3 (permalink)
ROM Developer
Thread Author (OP)
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,320 Times in 3,994 Posts
Default

Ooh that reminds me, must download 5.7 myself...

So you've upgraded to 5.7 then tried to use the profile but it wont copy to /cache/recovery?

In Step 6 of the Task, ensure "use root" is still ticked. This step needs root to move to /cache.
SUroot is offline  
Reply With Quote
Old February 7th, 2013, 05:22 AM   #4 (permalink)
New Member
 
Join Date: Feb 2013
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default Re: [Task] [Root] Flash multiple zips at once, via CWM based recovery

It is ticked.

BTW - thanks for the quick reply.

Sent from my GT-I9300 using Tapatalk 2
simonwil is offline  
Reply With Quote
Old February 7th, 2013, 05:31 AM   #5 (permalink)
ROM Developer
Thread Author (OP)
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,320 Times in 3,994 Posts
Default

Can you untick it and save, then re tick it and save please? Disable the "Reboot recovery" step and run the task again?
SUroot is offline  
Reply With Quote
Old February 7th, 2013, 06:17 AM   #6 (permalink)
ROM Developer
Thread Author (OP)
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,320 Times in 3,994 Posts
Default

Not sure if this is good news or bad news, but I just upgraded to 5.7 (using teh Task) then I disabled the "reboot recovery", ran the task and confirmed extendedcommands was moved to /cache/recovery successfully.
SUroot is offline  
Reply With Quote
Old February 7th, 2013, 04:35 PM   #7 (permalink)
New Member
 
Join Date: Feb 2013
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default Re: [Task] [Root] Flash multiple zips at once, via CWM based recovery

I installed Perseus Kernel and now it works again.

Sent from my GT-I9300 using Tapatalk 2
simonwil is offline  
Reply With Quote
Old February 7th, 2013, 04:38 PM   #8 (permalink)
ROM Developer
Thread Author (OP)
 
SUroot's Avatar
 
Join Date: May 2010
Location: Riddlesden, West Yorkshire, UK
Posts: 23,926
 
Device(s): SGS3 (Current) HTC Desire (Retired)
Carrier: 3 UK

Thanks: 1,923
Thanked 5,320 Times in 3,994 Posts
Default

Oh ok. I never uninstalled perseus (I untick kernel in Aroma) That's odd though. Wonder what stops it working on that one task when the other does the same.
SUroot is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Discussion > Android Applications > Tasker
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:52 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.