What's new
DroidForums.net | Android Forum & News

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Team D1-MIUI Example MOD

zenulator

Premium Member
Premium Member
Developer
I'm doing this as an example of what a Mod should be.

A good example is the iOS theme. It only updates the necessary parts of the rom that need changing to get the desired effect. EDIT JAMEZELLE: also makes debugging easier

So making an update "mod"

I'll upload a shell update and explain the update script.

Unzip the example.

Inside you will see 3 folders. system data META-INF

system:

system is where you are going to put your extra apps/ringtones/bootanimations

if you want to add an app open up system and make an app directory and drop in your app(s)

if you want to add ringtones from another rom open up system and make a directory called media and drop in the audio directory from the other rom

if you want to add a different bootanimation the open up system and make a directory called media and drop in the bootanimation.zip from another rom or theme.

data:

data is where you want to copy downloaded apps that you don't want on system

if you want to make an add on pack this is prob the best place for extra apps like wireless tether etc...

open data and make a directory called app. drop your apps there.

META-INF:

this holds the update-binary and update-script as well as other information needed if your recovery requires zips to be signed. (not necessary on droid 1 using clockwork recovery)

the update script is the only thing you want to modify. it is located at:

com/google/android/

navigate there and open the update script in a Coding text editor such as gedit or nano in linux or notepad ++ in windows.

It should look something like the following:

Code:
show_progress(0.500000, 0);
mount("MTD", "userdata", "/data");
package_extract_dir("userdata", "/data");
unmount("/data");
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
set_perm(0, 0, 0755, 0644, "/system/app/foo.apk");
set_perm(0, 0, 0755, 0644, "/system/app/foobar.apk");
show_progress(0.100000, 0);
unmount("/system");

This update will copy whatever is in system and data to the rom.

The set_perm part sets correct permissions for any app copied over. Change it accordingly.

After your done rezip the system data and META-INF directories into a new zip and flash away.

If successful upload your results and share it with everyone else.
 

Attachments

This is super helpful and a great reference, thanks. I had previously wondered how to push things into /data/ and this tells me how to do it.
 
I'm so glad to be a good example! ;)

I just thought I would add that if you're doing a theme that changes the shapes of the icons in the launcher, (like the iOS theme does), in order for people to be able to see the changes in the icon shape, the icons that MIUI created on its first boot need to be deleted. This series of commands (placed somewhere in the updater-script...my script for the iOS theme does it right before it does the system stuff) will do that:
Code:
mount("MTD", "userdata", "/data");
delete_recursive("/data/system/customized_icons");
unmount("/data");

This is only useful for themes that change the customized icon shapes like the iOS theme.
 
Awsome explanation! This post should be stickied in the Theme section. I've caught bits and pieces of this info in different threads but I haven't seen anyone break it down as easily as you have Zen. Thanks for your lines to USCChem.

Now if I didn't suck so bad with photoshop I might be able to put a respectable theme together.
 
I am using this code:
mount("MTD", "userdata", "/data");
package_extract_dir("userdata", "/data");
unmount("/data");

But still failing to push a local.prop file into /data/

Any ideas? I can make changes to /system/ work all day long but I cannot push a file into the /data folder.

EDIT: I figured it out!
Correct code should read:

mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
unmount("/data");
 
I am using this code:
mount("MTD", "userdata", "/data");
package_extract_dir("userdata", "/data");
unmount("/data");

But still failing to push a local.prop file into /data/

Any ideas? I can make changes to /system/ work all day long but I cannot push a file into the /data folder.

EDIT: I figured it out!
Correct code should read:

mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
unmount("/data");

And yes, excellent observation, as I was having the self same problem with the file and the script commands in the OP of this thread. Then I had to go back and re-read the PM's between publicanimal and I where we were trying to get this figured out when MIUI was first released. But you and I have it down now, eh publicanimal? Thx, zen, publicanimal, and myself. ;)
 
Back
Top