[Guide] Edify Script Tutorial - Replacing the Google Market

Search This thread

Blue6IX

Senior Member
May 20, 2011
1,755
1,139
Return to Contents Page - doubleshot Developers Reference

This guide will teach you how to write an Edify script that replaces the Google market with a different version.

Big thanks to charlieb620 for posting the new market .apks with different color schemes, see the thread Here for more market colors.

The Google market is a great example for a guide on how to replace an app, because not only is it a system app but it's one with a lot of dependencies and will teach you how to deal with this. This is also an app you can't just install an .apk file for, you have to take specific steps to install it.

If you were going to just install a new Google market, you would have to:

Stop all apps that require market licensure to work, halt the market processes, delete the old vending.apk. Then you have to delete the market data directory at /data/data/com.android.vending and find the dalvik-cache file that belongs to the market ( system@app@Vending.apk@classes.dex ) and delete that too.

Then you rename the new market .apk file to Vending.apk and use root explorer to copy it into your /system/app directory. Once there, you long-press on the Vending.apk file and select 'permissions' from the menu that pops up.

Change the permissions to read/write for owner, read for group, read for others, and nothing for the bottom 3 check boxes. Now it reads rw-r--r-- like all the other apps in the /system/app directory.

Then you reboot your phone and it should work, but you should clear the whole dalvik-cache in recovery, and you should clear cache in recovery too, so all the dependencies on the market get rebuilt the right way.

Who want's to deal with all that, and still have it maybe not work right?

No, the right way to replace the market is while the system is down, so doing it as an update you flash through clockworkmod is really the correct answer.

I will assume a windows computer from here on out - that's what I have.

Let's walk through this, and start by listing what you need to begin:

1 - A program you can write the script in. notepad++ is preferred.

2 - A tool to sign your update package. This one is the one i've been using. XDA link. Must be in your main directory, C:

3 - The right update-binary file to work with the MT4GS. I attached the one i've been using to this thread. Thank computerkid23 for that. Go into your signing tool and go to:
/update/META-INF/com/google/android/
...and replace the update-binary with the new one. Here also:
  • update-binary
    Download Link
    MD5: f570141f6c8cf7273a58228d0241704d
    Size: 190.04 KB

Or you could hit post 10 of this thread for a flashable zip template file.

4 - Some knowledge of Edify scripting. I wrote up some notes that covers some of it, but also links to other threads around XDA with Edify script information. Read up on it, my link Here

5 - A new market .apk file to play with. Here is where ours came from, and it's called Dark.apk

6 - winrar

7 - A MT4GS phone to test your script on, before releasing it to the community.

Now that that we have that all taken care of, let's get started:

1 - Go to the flashable zip builder folder, go to the update folder, then system, and then make a new folder called app

2 - In this new folder, place the new market.apk and rename it to Vending.apk - the capital V is important.

3 - go back up 2 levels to the update folder, and then go to /META-INF/com/google/android/ and open updater-script in Notepad++

4 - Select all and then delete all the text in the updater-script file. Once done, move on to the next part of the guide.

Writing the script:

Since this is my tutorial, i'm going to pass on a concept that means a lot to me - which is formatting the printed output on the screen during installation to be useful. 23 lines down of 40 characters wide is our window to work with.

We will also be using the printed output to the screen to keep the user updated instead of using a progress bar, it's nice to keep them from thinking their phone froze.

Start out by typing these 3 lines of code:
Code:
ui_print("");
ui_print("MT4GS - Market Update Install");
ui_print("");
The ui_print("") command will print to the screen anything between the quotes in the parenthesis. After about 40 characters it will split your text to a new line, wherever the break happens. Could be in the middle of a word.

The second line is the title of our script. When the script is done running, in clockworkmod 4.0.0.9, this will be at the very top of the screen on the phone.

The third line will print blank, just like the first, and seperates our text output to make it easier to read on the MT4GS screen.

The ; character tells the phone to read the next line of code.

Next, we'll type in this code:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
ui_print("Removing old market ...");
delete("/system/app/Vending.apk");
unmount("/system");
ui_print("");

The mount command will make a partition ready to do things to. Unmounted partitions can be formatted, for anything else they need to be mounted. The way this mount command is written mounts the /system partition specifically on the MT4GS phone.

Next we print a line saying what we are about to do.

Then we do it, which is to delete the old Vending.apk - this is the market app.

Then we unmount the /system partition, since we are done with it for now. This is a good practice to get into, in my opinion, because you won't forget to unmount the partition when you are done with it and you won't accidentally do something to it while you aren't using it.

Lastly, we print a blank line of text to keep things clean on the output screen. We are up to 5 lines of printed text so far.

Next, we'll type in this code:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/data");
ui_print("Wiping old market data ...");
delete_recursive("/data/data/com.android.vending");
ui_print("");
ui_print("Wiping dalvik-cache ...");
delete_recursive("/data/dalvik-cache");
unmount("/data");
ui_print("");

Again, mounted the /data partition, called for specifically for the MT4GS phone.

Next we print a line saying what we are about to do.

Then we do it, which is to delete the old market /data directory located at /data/data/com.android.vending

Then we print a blank line of text, and another line saying what we are about to do.

Then we do the next thing, which is to wipe the dalvik cache. It's located at /data/dalvik-cache, so we are just going to delete the whole folder. A new one will be generated by Android on the next boot. This is the same as if you did it from the clockworkmod menu.

Then we unmount the /data partition, since we are done with it.

Lastly, we print a blank line. We are up to 9 printed lines so far.

Next, we'll type in this code:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/cache");
ui_print("Wiping cache ...");
delete_recursive("/cache");
unmount("/cache");
ui_print("");

Again, mounted the /cache partition, called for specifically for the MT4GS phone.

Next we print a line saying what we are about to do.

Then we do it, which is to wipe the /cache. We just wipe the whole partition with the delete recursive command, it's the same as if you did this from the clockworkmod menu.

Then we unmount the /cache partition, since we are done with it.

Lastly, we print a blank line. We are up to 11 printed lines so far.

Next, we'll type in this code:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
ui_print("Installing new market ...");
package_extract_dir("system", "/system");
set_perm(0, 0, 0644, "/system/app/Vending.apk");
unmount("/system");
ui_print("");
ui_print("...Finished.");

Again, mounted the /system partition. Notice it's the second time we've mounted the same partition. This time, we are going to put on instead of taking away.

Next we print a line saying what we are about to do.

Then we do it, which is to copy the contents of the /system/app folder included in our script to the /system/app folder on the phone. This puts the new Vending.apk file where it is supposed to be.

Then we set the permissions for the new Vending.apk file, this is a very important step. This makes the permissions description on the file read rw-r--r-- like the rest of the files in the /system/app folder.

Then we unmount the /system partition.

Then we print a blank line, and then the last line which says we are done. This puts us at 14 lines, we still need 9 more.

Since we still ned 9 more lines to fill the output screen so that your script output is all the user sees when it's done, heres what I did:
Code:
ui_print("");
ui_print("New Market application provided by:");
ui_print("");
ui_print("charlieb620 at XDA");
ui_print("");
ui_print("Press your hardware back button, then");
ui_print("select 'reboot system now' from the main");
ui_print("menu to continue.");
ui_print("");

I credited the person who provided the market .apk file, then told the user what to do next now that the script is done.

I am sure you could find a useful way of using any blank space you have, or managing the 23 lines of print you get when it's over.

Reading through my notes thread that I linked should get you set in the right directions for any further information you need about commands or their syntax.

The only thing not covered in-depth yet in any of my guides are permissions as far as this script is concerned, but that's coming. Meantime, you can find the information you need by browsing through XDA.

We have successfully removed the old market, cleared all the temporary files that had old market information, installed the new market in the correct location, and then set the proper permissions for the file.

This script is now a self contained update, where all the user has to do is run this script and then reboot their phone. No need to format this, wipe that, it's all done for them by the script itself.

The last steps in the process to make our zip is to save the file we just edited, which looks like this:
Code:
ui_print("");
uiprint("MT4GS - Market Update Install");
ui_print("");
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
ui_print("Removing old market ...");
delete("/system/app/Vending.apk");
unmount("/system");
ui_print("");
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/data");
ui_print("Wiping old market data ...");
delete_recursive("/data/data/com.android.vending");
ui_print("");
ui_print("Wiping dalvik-cache ...");
delete_recursive("/data/dalvik-cache");
unmount("/data");
ui_print("");
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/cache");
ui_print("Wiping cache ...");
delete_recursive("/cache");
unmount("/cache");
ui_print("");
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
ui_print("Installing new market ...");
package_extract_dir("system", "/system");
set_perm(0, 0, 0644, "/system/app/Vending.apk");
unmount("/system");
ui_print("");
ui_print("...Finished.");
ui_print("");
ui_print("New Market application provided by:");
ui_print("");
ui_print("charlieb620 at XDA");
ui_print("");
ui_print("Press your hardware back button, then");
ui_print("select 'reboot system now' from the main");
ui_print("menu to continue.");
ui_print("");

and then go back to the flashable zip builder folder, and then into the update folder. Select both META-INF and system folders, and zip in winrar. ZIP not RAR. Name your zip New_Market.zip

Now move this zip file up one level, to the main flashable zip folder. Drag it onto the DRAGandDROPsignONLY.bat file in the folder.

Wait until the dos prompt finishes and closes.

Go to the _out folder and get your new ready to install update, called New_Market_Signed.zip

That's it, just get that to the phone and flash in clockworkmod recovery.

Hope this was helpful!

*Unzip the update-binary to use.
*Go to charlieb620's Thread for ready-made install scripts for the rest of the market colors.
 

Attachments

  • update-binary.zip
    122.4 KB · Views: 538
  • Dark_Market_signed.zip
    2.7 MB · Views: 401
Last edited:

nbetcher

Senior Member
Jan 2, 2010
499
115
39
Phoenix, AZ
My goodness... you never cease to amaze me Blue. As a developer I've never had much patience for write-ups, so I can applaud your efforts! Learning the hard way blows (although does yield better lessons sometimes)!

On a side note, I applied the Dark Market update zip thinking that it applied the (regular) market... I wasn't really sure what "Dark" stood for. So I opened it and was surprised to see a - you guessed it - DARK version of the newest Market. Anyways, point being is that I opened it, checked it out, closed it and a few minutes later it was uninstalled and replaced with the regular (newest) Market. I like the regular Market, so it worked out for the best, but just figured I'd let you know. :)
 

Blue6IX

Senior Member
May 20, 2011
1,755
1,139
My goodness... you never cease to amaze me Blue. As a developer I've never had much patience for write-ups, so I can applaud your efforts! Learning the hard way blows (although does yield better lessons sometimes)!

On a side note, I applied the Dark Market update zip thinking that it applied the (regular) market... I wasn't really sure what "Dark" stood for. So I opened it and was surprised to see a - you guessed it - DARK version of the newest Market. Anyways, point being is that I opened it, checked it out, closed it and a few minutes later it was uninstalled and replaced with the regular (newest) Market. I like the regular Market, so it worked out for the best, but just figured I'd let you know. :)

You know, it's funny - one of those little things that's a D'oh! moment.

When I first saw that, I thought you meant you just installed a different (or your stock) version of the market over it.

I browsed the thread again since I directed someone here and when I got to the bottom I just realized you were letting me know Google forced a market update when you connected to them. Funny I didn't read that right sooner.
 

taviaum

Senior Member
Jan 12, 2012
70
4
Hi guys!

If i want to Freeze some app in updater-script, how could I do it?

What codes i have to use?


THanks!
 

cybot_x1024

Senior Member
Jun 24, 2010
279
40
Nairobi
Thank you blue! You might not know it but you just contributed to the cause of adding devs to the forum. :thumbup:

Achievement unlocked: knowledge acquired! :D

sent from a Nokia 3210
 
  • Like
Reactions: Blue6IX
N

nfs1mw

Guest
is there any syntax highlighter + editor for edify script.?
 

Blue6IX

Senior Member
May 20, 2011
1,755
1,139
Template: flashable zip update

Return to Contents Page - doubleshot Developers Reference

is there any syntax highlighter + editor for edify script.?

Not sure, I use notepad++ in windows and while my preference is ever for the lightest weight program notepad++ is too awesome to not use, it's the only editor of that type you need on windows pretty much.

If the regular windows notepad could do this stuff without destroying the files i'd use that instead, so i've never checked into anything that was like that in notepad++.

I taught myself html in a notebook with a pen way back when, and the advantages of writing the code down and typing it in beyond the memory exercise itself is not having to jog back and forth between another document on your screen(s) and keeping the actual machine in use more clutter free.

(that said - syntax highlighting and end-user formatting to code in editors is so nice...)

Besides, if the internet dies tomorrow your physical notebook that takes nothing more then opening up and looking at will still work. Then again, i'm anal about backups.

In linux I just use gedit.

----

Flashable Zip Template:
unsigned template zip download:
  • doubleshot_unsigned_flashable-update_template.zip
    Download Link
    MD5: 7591ff4996f84a394c46ae375c254a4c
    Size: 125.64 KB
    Edit before flashing.

signed template zip download:
  • doubleshot_signed_flashable-update_template.zip
    Download Link
    MD5: afc51c4bf34dcdd76d1d62061fa3ee5b
    Size: 124.25 KB
    Edit before flashing.

Zip Contains:
  • - Empty data folder.
  • - Empty system folder.
  • - Empty sdcard folder.
  • - META-INF folder set up, with the correct update-binary and a template updater-script file.

updater-script template:
  • - wipe cache
  • - wipe dalvik cache
  • - wipe data
  • - wipe system
  • - wipe sdcard
  • - extract whatever ends up in the system, data, sdcard folders.
  • - clean up
Pastebin of updater-script.​
Edit before using, otherwise you will erase everything on the device...

...just delete what you don't want and go from there. I got tired of typing the same stuff in all the time so here ya go.

Compatible with all versions of CWM to date (April 2012) - CWM 4xx Recovery versions don't support format correctly and is why it's not here.

Current CWM is 5xx​

Need to sign it? On windows This one is great.

Want to fill those empty folders? Start with system and this thread:

doubleshot de-odexed system images
 
Last edited:

male6363@hotmail.com

Senior Member
Jul 10, 2010
94
2
ISTANBUL
Is there anybody know this? Or is there anybody know where to ask this question?
in .zip file (for CWM) there is an updater-script file...
I want to delete some files but i dont want to write the exact names of the files... Is there any way to delete some thing like x*.* or t*.apk or talk*.* etc...
for example if i want to delete all the files which starts with "a" letter... How can i do this?

I know
delete("...");
delete_recursive("...");

commands... But i couldn't find out if there is any way to do this?
Thank you for your answers...
 

h311sdr0id

Inactive Recognized Developer
Jul 20, 2011
540
1,108
Thank you for taking the time to write this. I had some questions regarding editing updater-scripts (for a different device) and this helped me out a lot.



-h311s|DR0ID








.
 

seanpr123

Senior Member
Oct 5, 2011
835
145
South Florida
Quick question, for a delete command can you use a wildcard?
Like this:
delete("/system/app/SamsungHub.*");

I only ask because some roms have .apk and some are .odex (for example). Looking to make one script work for any stock rom on my phone.

Also, according to my TWRP log I'm able to mount /system but /data threw an error:
mount: failed to mount /dev/block/mmcblk0p29 at /data: Device or resource busy

Looks right in the partition area:
Symlink_Path: /data/media/0
Symlink_Mount_Point: /sdcard
Primary_Block_Device: /dev/block/mmcblk0p29

Any thoughts why?
 

demkantor

Inactive Recognized Contributor
Nov 10, 2011
6,860
3,765
mpls
I don't know if there is an option for wild card, never tried. But it can't hurt just to throw in a remove line for both options, simple fix

Being you have an emulated SD, when flashing something from data I believe data partition is mounted by default and that's why it says busy. My best guess is you don't need to add the mount data command

Sent from my Nexus 4 using XDA Premium 4 mobile app
 
  • Like
Reactions: seanpr123

Top Liked Posts

  • There are no posts matching your filters.
  • 27
    Return to Contents Page - doubleshot Developers Reference

    This guide will teach you how to write an Edify script that replaces the Google market with a different version.

    Big thanks to charlieb620 for posting the new market .apks with different color schemes, see the thread Here for more market colors.

    The Google market is a great example for a guide on how to replace an app, because not only is it a system app but it's one with a lot of dependencies and will teach you how to deal with this. This is also an app you can't just install an .apk file for, you have to take specific steps to install it.

    If you were going to just install a new Google market, you would have to:

    Stop all apps that require market licensure to work, halt the market processes, delete the old vending.apk. Then you have to delete the market data directory at /data/data/com.android.vending and find the dalvik-cache file that belongs to the market ( system@app@Vending.apk@classes.dex ) and delete that too.

    Then you rename the new market .apk file to Vending.apk and use root explorer to copy it into your /system/app directory. Once there, you long-press on the Vending.apk file and select 'permissions' from the menu that pops up.

    Change the permissions to read/write for owner, read for group, read for others, and nothing for the bottom 3 check boxes. Now it reads rw-r--r-- like all the other apps in the /system/app directory.

    Then you reboot your phone and it should work, but you should clear the whole dalvik-cache in recovery, and you should clear cache in recovery too, so all the dependencies on the market get rebuilt the right way.

    Who want's to deal with all that, and still have it maybe not work right?

    No, the right way to replace the market is while the system is down, so doing it as an update you flash through clockworkmod is really the correct answer.

    I will assume a windows computer from here on out - that's what I have.

    Let's walk through this, and start by listing what you need to begin:

    1 - A program you can write the script in. notepad++ is preferred.

    2 - A tool to sign your update package. This one is the one i've been using. XDA link. Must be in your main directory, C:

    3 - The right update-binary file to work with the MT4GS. I attached the one i've been using to this thread. Thank computerkid23 for that. Go into your signing tool and go to:
    /update/META-INF/com/google/android/
    ...and replace the update-binary with the new one. Here also:
    • update-binary
      Download Link
      MD5: f570141f6c8cf7273a58228d0241704d
      Size: 190.04 KB

    Or you could hit post 10 of this thread for a flashable zip template file.

    4 - Some knowledge of Edify scripting. I wrote up some notes that covers some of it, but also links to other threads around XDA with Edify script information. Read up on it, my link Here

    5 - A new market .apk file to play with. Here is where ours came from, and it's called Dark.apk

    6 - winrar

    7 - A MT4GS phone to test your script on, before releasing it to the community.

    Now that that we have that all taken care of, let's get started:

    1 - Go to the flashable zip builder folder, go to the update folder, then system, and then make a new folder called app

    2 - In this new folder, place the new market.apk and rename it to Vending.apk - the capital V is important.

    3 - go back up 2 levels to the update folder, and then go to /META-INF/com/google/android/ and open updater-script in Notepad++

    4 - Select all and then delete all the text in the updater-script file. Once done, move on to the next part of the guide.

    Writing the script:

    Since this is my tutorial, i'm going to pass on a concept that means a lot to me - which is formatting the printed output on the screen during installation to be useful. 23 lines down of 40 characters wide is our window to work with.

    We will also be using the printed output to the screen to keep the user updated instead of using a progress bar, it's nice to keep them from thinking their phone froze.

    Start out by typing these 3 lines of code:
    Code:
    ui_print("");
    ui_print("MT4GS - Market Update Install");
    ui_print("");
    The ui_print("") command will print to the screen anything between the quotes in the parenthesis. After about 40 characters it will split your text to a new line, wherever the break happens. Could be in the middle of a word.

    The second line is the title of our script. When the script is done running, in clockworkmod 4.0.0.9, this will be at the very top of the screen on the phone.

    The third line will print blank, just like the first, and seperates our text output to make it easier to read on the MT4GS screen.

    The ; character tells the phone to read the next line of code.

    Next, we'll type in this code:
    Code:
    mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
    ui_print("Removing old market ...");
    delete("/system/app/Vending.apk");
    unmount("/system");
    ui_print("");

    The mount command will make a partition ready to do things to. Unmounted partitions can be formatted, for anything else they need to be mounted. The way this mount command is written mounts the /system partition specifically on the MT4GS phone.

    Next we print a line saying what we are about to do.

    Then we do it, which is to delete the old Vending.apk - this is the market app.

    Then we unmount the /system partition, since we are done with it for now. This is a good practice to get into, in my opinion, because you won't forget to unmount the partition when you are done with it and you won't accidentally do something to it while you aren't using it.

    Lastly, we print a blank line of text to keep things clean on the output screen. We are up to 5 lines of printed text so far.

    Next, we'll type in this code:
    Code:
    mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/data");
    ui_print("Wiping old market data ...");
    delete_recursive("/data/data/com.android.vending");
    ui_print("");
    ui_print("Wiping dalvik-cache ...");
    delete_recursive("/data/dalvik-cache");
    unmount("/data");
    ui_print("");

    Again, mounted the /data partition, called for specifically for the MT4GS phone.

    Next we print a line saying what we are about to do.

    Then we do it, which is to delete the old market /data directory located at /data/data/com.android.vending

    Then we print a blank line of text, and another line saying what we are about to do.

    Then we do the next thing, which is to wipe the dalvik cache. It's located at /data/dalvik-cache, so we are just going to delete the whole folder. A new one will be generated by Android on the next boot. This is the same as if you did it from the clockworkmod menu.

    Then we unmount the /data partition, since we are done with it.

    Lastly, we print a blank line. We are up to 9 printed lines so far.

    Next, we'll type in this code:
    Code:
    mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/cache");
    ui_print("Wiping cache ...");
    delete_recursive("/cache");
    unmount("/cache");
    ui_print("");

    Again, mounted the /cache partition, called for specifically for the MT4GS phone.

    Next we print a line saying what we are about to do.

    Then we do it, which is to wipe the /cache. We just wipe the whole partition with the delete recursive command, it's the same as if you did this from the clockworkmod menu.

    Then we unmount the /cache partition, since we are done with it.

    Lastly, we print a blank line. We are up to 11 printed lines so far.

    Next, we'll type in this code:
    Code:
    mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
    ui_print("Installing new market ...");
    package_extract_dir("system", "/system");
    set_perm(0, 0, 0644, "/system/app/Vending.apk");
    unmount("/system");
    ui_print("");
    ui_print("...Finished.");

    Again, mounted the /system partition. Notice it's the second time we've mounted the same partition. This time, we are going to put on instead of taking away.

    Next we print a line saying what we are about to do.

    Then we do it, which is to copy the contents of the /system/app folder included in our script to the /system/app folder on the phone. This puts the new Vending.apk file where it is supposed to be.

    Then we set the permissions for the new Vending.apk file, this is a very important step. This makes the permissions description on the file read rw-r--r-- like the rest of the files in the /system/app folder.

    Then we unmount the /system partition.

    Then we print a blank line, and then the last line which says we are done. This puts us at 14 lines, we still need 9 more.

    Since we still ned 9 more lines to fill the output screen so that your script output is all the user sees when it's done, heres what I did:
    Code:
    ui_print("");
    ui_print("New Market application provided by:");
    ui_print("");
    ui_print("charlieb620 at XDA");
    ui_print("");
    ui_print("Press your hardware back button, then");
    ui_print("select 'reboot system now' from the main");
    ui_print("menu to continue.");
    ui_print("");

    I credited the person who provided the market .apk file, then told the user what to do next now that the script is done.

    I am sure you could find a useful way of using any blank space you have, or managing the 23 lines of print you get when it's over.

    Reading through my notes thread that I linked should get you set in the right directions for any further information you need about commands or their syntax.

    The only thing not covered in-depth yet in any of my guides are permissions as far as this script is concerned, but that's coming. Meantime, you can find the information you need by browsing through XDA.

    We have successfully removed the old market, cleared all the temporary files that had old market information, installed the new market in the correct location, and then set the proper permissions for the file.

    This script is now a self contained update, where all the user has to do is run this script and then reboot their phone. No need to format this, wipe that, it's all done for them by the script itself.

    The last steps in the process to make our zip is to save the file we just edited, which looks like this:
    Code:
    ui_print("");
    uiprint("MT4GS - Market Update Install");
    ui_print("");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
    ui_print("Removing old market ...");
    delete("/system/app/Vending.apk");
    unmount("/system");
    ui_print("");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/data");
    ui_print("Wiping old market data ...");
    delete_recursive("/data/data/com.android.vending");
    ui_print("");
    ui_print("Wiping dalvik-cache ...");
    delete_recursive("/data/dalvik-cache");
    unmount("/data");
    ui_print("");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/cache");
    ui_print("Wiping cache ...");
    delete_recursive("/cache");
    unmount("/cache");
    ui_print("");
    mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/system");
    ui_print("Installing new market ...");
    package_extract_dir("system", "/system");
    set_perm(0, 0, 0644, "/system/app/Vending.apk");
    unmount("/system");
    ui_print("");
    ui_print("...Finished.");
    ui_print("");
    ui_print("New Market application provided by:");
    ui_print("");
    ui_print("charlieb620 at XDA");
    ui_print("");
    ui_print("Press your hardware back button, then");
    ui_print("select 'reboot system now' from the main");
    ui_print("menu to continue.");
    ui_print("");

    and then go back to the flashable zip builder folder, and then into the update folder. Select both META-INF and system folders, and zip in winrar. ZIP not RAR. Name your zip New_Market.zip

    Now move this zip file up one level, to the main flashable zip folder. Drag it onto the DRAGandDROPsignONLY.bat file in the folder.

    Wait until the dos prompt finishes and closes.

    Go to the _out folder and get your new ready to install update, called New_Market_Signed.zip

    That's it, just get that to the phone and flash in clockworkmod recovery.

    Hope this was helpful!

    *Unzip the update-binary to use.
    *Go to charlieb620's Thread for ready-made install scripts for the rest of the market colors.
    1
    wow you really put a lot of work into your write ups lol =D. good job.
    1
    I don't think I've appreciated a single post on xda more than this one. Thank you. This is the kind of thing I love.
    1
    Thank you blue! You might not know it but you just contributed to the cause of adding devs to the forum. :thumbup:

    Achievement unlocked: knowledge acquired! :D

    sent from a Nokia 3210
    1
    I don't know if there is an option for wild card, never tried. But it can't hurt just to throw in a remove line for both options, simple fix

    Being you have an emulated SD, when flashing something from data I believe data partition is mounted by default and that's why it says busy. My best guess is you don't need to add the mount data command

    Sent from my Nexus 4 using XDA Premium 4 mobile app