Tutorial: How to make Flashable zips

Search This thread
M

Modding.MyMind

Guest
This tutorial will help you to understand the making of a flashable zip or also known as an update zip

Setting up your zip directories:

You will need to create the following folder structure inside of your flashable zip (The flashable zip can be called whatever it is you want it to be. (These subfolders are case sensitive)):

Code:
/META-INF/com/google/android

All flashable zips include this file structure. The final folder, android, will contain two files within it:

Code:
update-binary
updater-script

Note: The update-binary is specific to our devices based on built API mostly, but with other factors as well. It is currently open source and therefore possible to be built on a personal basis. However, to insure you are using the correct one, I can suggest taking it from the most recent OTA available for your device.



Setting up the updater-script:

-- This we can create ourselves, to ensure it works properly we will use Notepad++ for Window Users, and Gedit for those using Linux.

Open the text editor and start a new file, with the following settings for Window Users:

Format: Unix
Encoding: ANSI
Default Language: Normal Text

Save this file as:

File name: updater-script
File type: All types (*.*)

And for Linux users:

Just leave it as is.

You can now edit this file, so from here I will be providing some examples:

Code:
[COLOR="Red"]assert(getprop("ro.product.device") == "k2cl" || getprop("ro.build.product") == "k2cl");[/COLOR]
[COLOR="brown"]ui_print(" ");[/COLOR]
[COLOR="brown"]ui_print("Checking Device");[/COLOR]
[COLOR="brown"]ui_print(" ");[/COLOR]
[COLOR="brown"]ui_print("Success");[/COLOR]
[COLOR="brown"]ui_print(" ");[/COLOR]
[COLOR="green"]show_progress(0.200000, 5);[/COLOR]
[COLOR="brown"]ui_print("Mounting System");[/COLOR]
[COLOR="red"]mount("ext4", "EMMC", "/dev/block/mmcblk0p35", "/system");[/COLOR]
[COLOR="brown"]ui_print(" ");[/COLOR]
[COLOR="green"]show_progress(0.200000, 5);[/COLOR]
[COLOR="brown"]ui_print("Updating System Files");[/COLOR]
[COLOR="red"]package_extract_dir("system", "/system");[/COLOR]
[COLOR="brown"]ui_print(" ");[/COLOR]
[COLOR="green"]show_progress(0.200000, 5);[/COLOR]
[COLOR="brown"]ui_print("unmounting system");[/COLOR]
[COLOR="red"]unmount("/system");[/COLOR]
[COLOR="brown"]ui_print(" ");[/COLOR]
[COLOR="green"]show_progress(0.200000, 5);[/COLOR]
[COLOR="brown"]ui_print("Complete!");[/COLOR]
[COLOR="green"]show_progress(0.200000, 5);[/COLOR]
[COLOR="brown"]ui_print(" ");[/COLOR]
***EMPTY LINE***

Ok, I've color coded this so we can break it down, the lines of code in RED are the actual commands, everything else is for visual appearance.

assert(getprop("ro.product.device") == "k2cl" || getprop("ro.build.product") == "k2cl");
This is checking to see if you are flashing the correct handset, this is not a requirement, but it insures that the flashable zip will only work for the specified device as to not be accidently flashed by others and to help prevent causing any possible damage to those who do not qualify to use that particular zip. Just insert another device name in the place of "k2cl" if you so wish, or remove the command all together.

To explain this a little further, you have told the script to check certain properties within your 'build.prop' file located in your /system folder. The above command ensures the following categories have the correct definitions before proceeding with the flash:
Code:
ro.product.device=
ro.build.product=
ro.product.board=

Take note, that if you apply this to a full rom which result you having to wipe out the system partition before flashing then this will obviously not work, because you also wiped out the build.prop file along with the /system, so the zip will be aborted due to an error by not being able to verify as instructed to do in the syntax.

Here are the main build properties within your build.prop (may slightly vary):

Code:
ro.build.id=
ro.build.display.id=
ro.build.version.incremental=
ro.build.version.sdk=
ro.build.version.codename=
ro.build.version.release=
ro.build.date=
ro.build.date.utc=
ro.build.type=
ro.build.user=
ro.build.host=
ro.build.tags=
ro.product.model=
ro.product.brand=
ro.product.name=
ro.product.device=
ro.product.board=
ro.product.cpu.abi=
ro.product.cpu.abi2=
ro.product.manufacturer=
ro.product.locale.language=
ro.product.locale.region=
ro.wifi.channels=
ro.board.platform=
ro.build.description=
ro.build.fingerprint=
ro.build.characteristics=

To mount a partition you need to use the following syntax. Below, will visually show you what each arguement represents:

Code:
mount("filesystem-type", "partition-type", "device-specific-mountpoint (DSM)", "mount-point");

filesystem-type: "ext4" or "yaffs2" (k2cl is ext4)
partition-type: "EMMC" or "MTD" (k2cl is EMMC)
DSM: Device specific address - this will be your specified partition
mount-point: /system, /data, /userdata, /cache, etc

mount("ext4", "EMMC", "/dev/block/mmcblk0p35", "/system");
This is the specific mount point for the k2cl system partition, if you wish to flash a different partition, data for instance, you can get the mount points for your device by entering the following code over ADB via PC or on our phone via terminal emulator:

Code:
adb shell
mount > /sdcard/PHONENAME_mountinfo.txt
This will place a text file on your sdcard with the mount points for your specific device. (Remember to swap 'PHONENAME' with your device name e.g. 'k2cl', as a means of remembrance and for record keeping).

package_extract_dir("system", "/system");
This command extracts the files you wish to flash from the zip and flashes them to the phone, it is formatted as follows ("package-path", "/destination-path"). So for this example you are telling it to flash everything from the 'system' folder in your zip to the /system partition of your handset. You can obviously change these values for different partitions.

To flash an entire directory:

Code:
package_extract_dir("system", "/system");

To flash a single file:

Code:
package_extract_file("boot.img", "/dev/block/mmcblk0p20");


These commands are structured as follows:

Entire directory: ("zipfileSource", "destination-partition");
Single File: ("file", "device-specific-mountpoint");

This simply unmounts whatever partition you previously mounted.

Shows text in the recovery while the flash is currently taking place. You would just enter what ever text you feel is necessary to be displayed on the screen.

show_progress(0.200000, 5);
Controls what the progress bar in the background is displaying, it is formatted as follows (fragment, seconds).

This is not actually a text, you simply need to leave a blank line at the end of your script before you save it for it to work properly.



Some Additional commands

Deleting folders & files:

You can delete multiple folders or files using just one command, as follows:

To delete files:

Code:
delete("file-path-1", "file-path-2", "file-path-3);

Example:
Code:
delete("/system/bin/su","/system/xbin/su","/system/app/Superuser.apk");

You can list as many file-path's as needed in the script. Three is not its limit.

To delete folders/directories:

Code:
delete_recursive("directory-path-1", "directory-path-2", "directory-path-3");

This is also not limited to three directory-path's.



Setting Permissions:

Set permissions of a file or set of files:

Code:
set_perm(uid, gid, mode, "filepath1", "filepath2")

Example:
Code:
set_perm(0, 0, 06755, "/system/xbin/su");

uid - user id
gid - group id
mode - permission mode
filepath... - file to set permission on

Setting permissions of a directory or a set of directories and all files and folders within them:

Code:
set_perm_recursive(uid, gid, dirmode, filemode, "dirpath1", "dirpath2")

Example:
Code:
set_perm_recursive(0, 0, 0755, 0644, "/system");

uid - user id
gid - group id
dirmode - permission to set to directories contained within the specified directory
filemode - permission to set to files contained within the specified directory
dirpath... - directory to set permission on

You will need to also understand the way file permissions are represented:

Example = drwxrwxrwx

-- Use a Root Explorer to find the UID, GID, and permissions for a file. Permissions are the string that looks like some variation on 'rwxr-xr--' next to each file. Long press and choose "change owner" to get the UID and GID. You just want the number next to "owner" and "group", respectively.

-- If you're replacing a file, look up these settings for the existing copy and use them. If you're adding a file, just find a file that does the same functions and copy what it has (for example, installing an app to /system/app? Just look at these settings for any other app in that directory).

-- MODE is technically a 4-bit string, but the first character can be omitted. There doesn't seem to be any android file permissions with the first character set. For good practice, I think it's safe to assume you can always use a leading 0 unless you know otherwise for something specific. Or, just use a 3-digit MODE, which says to leave those settings as they are (disabled by default). (I.e. 0644=644).

The next 9 characters define the file permissions. These permissions are
given in groups of 3 each.

The first 3 characters are the permissions for the owner of the file or directory.
Example = -rwx------

The next 3 are permissions for the group that the file is owned by.
Example = ----rwx---

The final 3 characters define the access permissions for everyone not part of the group.
Example = -------rwx

There are 3 possible attributes that make up file access permissions.

r -- Read permission. Whether the file may be read. In the case of a
directory* this would mean the ability to list the contents of the
directory.

w -- Write permission. Whether the file may be written to or modified. For
a directory this defines whether you can make any changes to the contents
of the directory. If write permission is not set then you will not be able
to delete rename or create a file.

x -- Execute permission. Whether the file may be executed. In the case of a
directory this attribute decides whether you have permission to enter,
run a search through that directory or execute some program from that
directory

You set these permissions using the following binary based numerical system:
Code:
0:  ---   No Permissions (the user(s) cannot do anything)
1:  --x   Execute Only (the user(s) can only execute the file)
2:  -w-   Write Only (the user(s) can only write to the file)
3:  -wx   Write and Execute Permissions
4:  r--   Read Only
5:  r-x   Read and Execute Permissions
6:  rw-   Read and Write Permissions
7:  rwx   Read, Write and Execute Permissions

Default Linux permissions:

For Files:
"Read" means to be able to open and view the file
"Write" means to overwrite or modify the file
"eXecute" means to run the file as a binary

For Directories:
"Read" means to be able to view the contents of the directory
"Write" means to be able to create new files/directories within the directory
"eXecute" means to be able to "Change Directory" (cd) into the directory

For further understanding on calculating CHMOD permissions, then click on the following link to another thread here on XDA:
CHMOD Permissions - Reference Guide


Here are two examples of using edify scripting to help give a better visual on all of this:

Example 1:
Folders = Green
Files = Black

SuperSU_1.75_Flashable.zip
|--META-INF
|...|--CERT.RSA
|...|--CERT.SF
|...|--MANIFEST.MF
|...|--com
|.......|--google
|...........|--android
|...............|--update-binary
|...............|--updater-script
|--data
|...|--data
|........|--eu.chainfire.supersu
|............|--files
|............|...|--99SuperSUDaemon
|............|...|--install-recovery.sh
|............|...|--otasurvival.sh
|............|...|--supersu.arm.png
|............|...|--supersu.cfg
|............|--shared_prefs
|................|--eu.chainfire.supersu_preferences.xml
|--system
|...|--app
|...|...|--Superuser.apk
|...|--bin
|...|...|--.ext
|...|...|...|--.su
|...|...|--su
|...|--xbin
|.......|--otasurvival.sh
Code:
ui_print("****************************************");
ui_print("*       Created by Modding.MyMind      *");
ui_print("****************************************");
ui_print("*          Rooting your Device         *");
ui_print("****************************************");
ui_print("");

show_progress(1.000000, 0);
ui_print("Mounting filesystems...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
set_progress(0.100000);

# Delete old files that may interfere.
ui_print("Preparing install...");
delete("/data/dalvik-cache/system@app@Superuser.apk@classes.dex","/system/bin/su","/system/xbin/su","/system/app/Superuser.apk","/system/app/Superuser.odex","/data/app/Superuser.apk","/system/xbin/daemonsu","/system/bin/.ext/.su","/system/etc/install-recovery.sh","/system/etc/init.d/99SuperSUDaemon","/system/etc/.has_su_daemon","/system/etc/.installed_su_daemon","/system/app/SuperUser.apk","/system/app/SuperUser.odex","/system/app/superuser.apk","/system/app/superuser.odex","/system/app/Supersu.apk","/system/app/Supersu.odex","/system/app/SuperSU.apk","/system/app/SuperSU.odex","/system/app/supersu.apk","/system/app/supersu.odex");
set_progress(0.200000);

ui_print("Extracting files...");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
set_progress(0.300000);

ui_print("Setting SU permissions...");
set_perm(0, 0, 06755, "/system/bin/su");
set_perm(0, 0, 06755, "/system/bin/.ext/.su");
set_perm(0, 0, 06755, "/system/xbin/otasurvival.sh");
set_progress(0.400000);

ui_print("Symlinking SU Binary for Root...");
symlink("/system/bin/su", "/system/xbin/su");
set_progress(0.500000);

ui_print("Setting SuperSU permissions...");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(1000, 1000, 0755, "/data/data/eu.chainfire.supersu");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/eu.chainfire.supersu/files");
set_perm_recursive(1000, 1000, 0771, 0660, "/data/data/eu.chainfire.supersu/shared_prefs");
set_progress(0.600000);
set_progress(0.800000);

# Unmounting filesystems...
ui_print("Unmounting filesystems...");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
set_progress(0.900000);
ui_print("");

set_progress(1.000000);
ui_print("****************************************");
ui_print("*          Install Complete!           *");
ui_print("****************************************");

Example 2:
Code:
ui_print("****************************************");
ui_print("                                        ");
ui_print("          4.2.2 CCONVERSIONN            ");
ui_print("    Modding.MyMind - XDA Senior Member  ");
ui_print("                                        ");
ui_print("****************************************");
ui_print("");
ui_print("");

#MOUNTING
show_progress(0.1, 0);
ui_print("MOUNTING /system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p35", "/system");
delete_recursive("/system");

#EXTRACTING
ui_print("EXTRACTING SYSTEM FOLDER TO /system");
package_extract_dir("system", "/system");

#SYMLINKING
ui_print("SYMLINKING");
symlink("dumpstate", "/system/bin/dumpcrash");
symlink("toolbox", "/system/bin/cat");
symlink("toolbox", "/system/bin/chmod");
symlink("toolbox", "/system/bin/chown");
symlink("toolbox", "/system/bin/cmp");
symlink("debuggerd", "/system/bin/csview");
symlink("toolbox", "/system/bin/date");
symlink("toolbox", "/system/bin/dd");
symlink("toolbox", "/system/bin/df");
symlink("toolbox", "/system/bin/dmesg");
symlink("toolbox", "/system/bin/getevent");
symlink("toolbox", "/system/bin/getprop");
symlink("toolbox", "/system/bin/hd");
symlink("toolbox", "/system/bin/id");
symlink("toolbox", "/system/bin/ifconfig");
symlink("toolbox", "/system/bin/iftop");
symlink("toolbox", "/system/bin/insmod");
symlink("toolbox", "/system/bin/ioctl");
symlink("toolbox", "/system/bin/ionice");
symlink("toolbox", "/system/bin/kill");
symlink("toolbox", "/system/bin/ln");
symlink("toolbox", "/system/bin/log");
symlink("toolbox", "/system/bin/ls");
symlink("toolbox", "/system/bin/lsmod");
symlink("toolbox", "/system/bin/lsof");
symlink("toolbox", "/system/bin/mkdir");
symlink("toolbox", "/system/bin/mount");
symlink("toolbox", "/system/bin/mv");
symlink("toolbox", "/system/bin/nandread");
symlink("toolbox", "/system/bin/netstat");
symlink("toolbox", "/system/bin/newfs_msdos");
symlink("toolbox", "/system/bin/notify");
symlink("toolbox", "/system/bin/printenv");
symlink("toolbox", "/system/bin/ps");
symlink("toolbox", "/system/bin/renice");
symlink("toolbox", "/system/bin/rm");
symlink("toolbox", "/system/bin/rmdir");
symlink("toolbox", "/system/bin/rmmod");
symlink("toolbox", "/system/bin/route");
symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/setprop");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/sleep");
symlink("toolbox", "/system/bin/smd");
symlink("toolbox", "/system/bin/start");
symlink("toolbox", "/system/bin/stop");
symlink("toolbox", "/system/bin/sync");
symlink("toolbox", "/system/bin/top");
symlink("toolbox", "/system/bin/touch");
symlink("toolbox", "/system/bin/umount");
symlink("toolbox", "/system/bin/uptime");
symlink("toolbox", "/system/bin/vmstat");
symlink("toolbox", "/system/bin/watchprops");
symlink("toolbox", "/system/bin/wipe");
symlink("wiperiface_v02.so", "/system/bin/wiperiface");
symlink("libwiperjni_v02.so", "/system/lib/libwiperjni.so");

#PERMISSIONS
ui_print("SETTING PERMISSIONS TO /system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 06755, "/system/bin/ip");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
show_progress(0.1, 10);

#EXTRACTING
ui_print("INSTALLING boot.img TO mmcblk0p20");
show_progress(0.2, 0);
package_extract_file("boot.img", "/dev/block/mmcblk0p20");
show_progress(0.2, 10);

#UNMOUNTING
ui_print("UNMOUNTING /system");
unmount("/system");
ui_print("****************************************");
ui_print("*        CconversionN Complete!        *");
ui_print("****************************************");

Files to flash:

You now need to create some other folder(s), this needs to be named based on where within the system you are flashing to help keep it simple (you can technically name them whatever, just as long as they are placed in the proper location of your current daily rom); for the sake of this example we are flashing to the system partition, so:

Code:
/META-INF/com/google/android
/system/app

Place whatever files you wish to flash within this file. For example:

Code:
/META-INF/com/google/android
/system/app/nameofapp.apk



Creating your .zip file:

Select both of your top directories and their contents 'META-INF' and 'system' and package them into a .zip file with 7zip or any other method you may currently use, using the following settings:

Archive: name_of_your_file
Archive Format: zip
Compression level: Store
Update mode: Add and replace files

And there you have it, your very own flashable .zip file.



How to sign your flashable zip:

You don't actually need to sign your zip file for it to work as most custom recoveries like, TWRP, now support unsigned zips. For the learning developers and the more cautious among us though, here is how. First, go ahead and place your newly made flashable zip on to your device. I preferably place it on the root of my internal sdcard, though the choice is ultimately yours.

Download the free application on the playstore called, zipsigner. Open it up and select the option for, Choose In/Out....

Go and select your zip, and then select, auto-testkey, under where it says, Key/mode. Once done, proceed to sign it. You will recieve an output zip file with the same name as the previous unsigned zip but with it ending in *-signed.zip. At this point, you are now good and you can either apply your zip to your device, or share your work with others.

There are so many different ways you can go about signing the zip, but for something like a simple flashable zip file, I will normally always go this route.

-- Happy Hunting!!!
 

Attachments

  • flashable_example.zip
    173.1 KB · Views: 60
Last edited:
M

Modding.MyMind

Guest
Please feel free to add on to this tutorial for other things as well. Almost like a grocery list haha. :)

Sent from my C525c using XDA Premium 4 mobile app
 
M

Modding.MyMind

Guest
If useful I will add it to the main post as a reference given the post# link.

Sent from my C525c using XDA Premium 4 mobile app
 
M

Modding.MyMind

Guest
I don't know why, but I feel that I need to include that this process is how one can make many flashable zips like superuser, etc. :)

Just feel some viewers wouldn't consider their imaginations with this tutorial given that it mainly speaks on bootanimation and fonts lol.


Sent from my C525c using XDA Premium 4 mobile app
 
Last edited:
M

Modding.MyMind

Guest
Code:
ui_print("");
show_progress(2,0);
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0);
ui_print("Installing app: com.android.vending");
package_extract_file("com.android.vending-1918e4b9fe5d1bc63e7c86588982b7af.apk", "/system/app/com.android.vending-1.apk");
set_perm(0, 0, 0644, "/system/app/com.android.vending-1.apk");
set_progress(1);
ui_print("Installing app: com.keramidas.TitaniumBackup");
delete("/data/app/com.keramidas.TitaniumBackup.apk");
delete("/data/app/com.keramidas.TitaniumBackup-2.apk");
package_extract_file("com.keramidas.TitaniumBackup.apk", "/data/app/com.keramidas.TitaniumBackup-1.apk");
set_perm(0, 0, 0644, "/data/app/com.keramidas.TitaniumBackup-1.apk");
set_progress(2);
unmount("/data");
unmount("/system");
ui_print("Done !");
ui_print("Will reboot in 5 seconds...");
run_program("/sbin/busybox", "sleep", "5");
run_program("/sbin/reboot");


Was playing on my phone earlier and wanted to share this to expands some minds out there for those trying to learn and or understand.
 
Last edited:
M

Modding.MyMind

Guest
*Link removed by me*

Comes prepared with OTA su survival, su binary (root), system installation, latest stable busybox as of now.


Sent from my C525c using XDA Premium 4 mobile app
 
Last edited:
M

Modding.MyMind

Guest
supersu is fixed. Can flash and gain root. I permanently unrooted my device for the official test and success. The initial problem I had was in the script... A stupid (") mark.... Spent hours looking for the problem and it came down to one " mark... But, I found it and its up and going. :) even tested it on my girlfriends HTC Evo Design 4g as she too needed root now for certain things - success.

My apologies for the past problems and delays.

Here is the code used for the su and busybox flash zip. The quotation in red is what was initially missing and overlooked for hours before I found it.

Code:
 ui_print("****************************************");
ui_print("* Created by Modding.MyMind *");
ui_print("****************************************");
ui_print("");
ui_print("");

show_progress(1.000000, 0);
ui_print("Mounting filesystems...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
set_progress(0.100000);

# Delete old files that may interfere.
ui_print("Preparing install...");
delete("/data/dalvik-cache/system@app@Superuser.apk@classes.dex", [COLOR="Red"][B]"[/B][/COLOR]/system/bin/su","/system/xbin/su","/system/app/Superuser.apk","/data/app/Superuser.apk");
set_progress(0.200000);

ui_print("Extracting files...");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
set_progress(0.300000);

ui_print("Setting SU Binary permissions");
set_perm(0, 0, 06755, "/system/bin/su");
set_progress(0.400000);

ui_print("Symlinking SU Binary for Root");
symlink("/system/bin/su", "/system/xbin/su");
set_progress(0.500000);

ui_print("Setting SuperSU permissions");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(1000, 1000, 0755, "/data/data/eu.chainfire.supersu");
set_perm_recursive(1000, 1000, 0755, 0755, "/data/data/eu.chainfire.supersu/lib");
set_perm_recursive(1000, 1000, 0771, 0600, "/data/data/eu.chainfire.supersu/cache");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/eu.chainfire.supersu/cache/com.android.renderscript.cache");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/eu.chainfire.supersu/requests");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/eu.chainfire.supersu/logs");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/eu.chainfire.supersu/files");
set_perm_recursive(1000, 1000, 0771, 0660, "/data/data/eu.chainfire.supersu/shared_prefs");
set_progress(0.600000);

ui_print("Setting busybox permissions");
set_perm(0, 0, 0755, "/system/xbin/busybox");
set_progress(0.700000);

ui_print("Symlinking busybox");
symlink("/system/xbin/busybox", "/system/xbin/[", "/system/xbin/[[", "/system/xbin/ash", "/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename", "/system/xbin/blkid", "/system/xbin/bunzip2", "/system/xbin/bzcat", "/system/xbin/bzip2", "/system/xbin/cal", "/system/xbin/cat", "/system/xbin/chat", "/system/xbin/chattr", "/system/xbin/chgrp", "/system/xbin/chmod", "/system/xbin/chown", "/system/xbin/chroot", "/system/xbin/chrt", "/system/xbin/cksum", "/system/xbin/clear", "/system/xbin/comm", "/system/xbin/cp", "/system/xbin/crond", "/system/xbin/crontab", "/system/xbin/cut", "/system/xbin/date", "/system/xbin/dd", "/system/xbin/depmod", "/system/xbin/devmem", "/system/xbin/df", "/system/xbin/diff", "/system/xbin/dirname", "/system/xbin/dmesg", "/system/xbin/dnsd", "/system/xbin/dnsdomainname", "/system/xbin/dos2unix", "/system/xbin/du", "/system/xbin/echo", "/system/xbin/egrep", "/system/xbin/env", "/system/xbin/ether-wake", "/system/xbin/expand", "/system/xbin/expr", "/system/xbin/fakeidentd", "/system/xbin/fbset", "/system/xbin/fdflush", "/system/xbin/fdformat", "/system/xbin/fdisk", "/system/xbin/fgrep", "/system/xbin/find", "/system/xbin/fold", "/system/xbin/free", "/system/xbin/freeramdisk", "/system/xbin/fsck", "/system/xbin/fsync", "/system/xbin/ftpd", "/system/xbin/ftpget", "/system/xbin/ftpput", "/system/xbin/fuser", "/system/xbin/getopt", "/system/xbin/grep", "/system/xbin/groups", "/system/xbin/gunzip", "/system/xbin/gzip", "/system/xbin/hd", "/system/xbin/head", "/system/xbin/hexdump", "/system/xbin/hostid", "/system/xbin/hostname", "/system/xbin/httpd", "/system/xbin/hwclock", "/system/xbin/id", "/system/xbin/ifconfig", "/system/xbin/ifenslave", "/system/xbin/inetd", "/system/xbin/inotifyd", "/system/xbin/insmod", "/system/xbin/install", "/system/xbin/ionice", "/system/xbin/iostat", "/system/xbin/ip", "/system/xbin/ipaddr", "/system/xbin/ipcalc", "/system/xbin/iplink", "/system/xbin/iproute", "/system/xbin/iprule", "/system/xbin/iptunnel", "/system/xbin/kill", "/system/xbin/killall", "/system/xbin/killall5", "/system/xbin/less", "/system/xbin/ln", "/system/xbin/logname", "/system/xbin/losetup", "/system/xbin/ls", "/system/xbin/lsattr", "/system/xbin/lsmod", "/system/xbin/lsof", "/system/xbin/lsusb", "/system/xbin/lzop", "/system/xbin/lzopcat", "/system/xbin/md5sum", "/system/xbin/microcom", "/system/xbin/mkdir", "/system/xbin/mkdosfs", "/system/xbin/mke2fs", "/system/xbin/mkfifo", "/system/xbin/mkfs.ext2", "/system/xbin/mkfs.vfat", "/system/xbin/mknod", "/system/xbin/mkswap", "/system/xbin/modinfo", "/system/xbin/modprobe", "/system/xbin/more", "/system/xbin/mount", "/system/xbin/mountpoint", "/system/xbin/mt", "/system/xbin/mv", "/system/xbin/nameif", "/system/xbin/nanddump", "/system/xbin/nandwrite", "/system/xbin/nc", "/system/xbin/netstat", "/system/xbin/nice", "/system/xbin/nmeter", "/system/xbin/nohup", "/system/xbin/nslookup", "/system/xbin/ntpd", "/system/xbin/od", "/system/xbin/patch", "/system/xbin/pgrep", "/system/xbin/pidof", "/system/xbin/ping", "/system/xbin/ping6", "/system/xbin/pkill", "/system/xbin/pmap", "/system/xbin/powertop", "/system/xbin/printenv", "/system/xbin/printf", "/system/xbin/ps", "/system/xbin/pscan", "/system/xbin/pwd", "/system/xbin/rdate", "/system/xbin/rdev", "/system/xbin/readahead", "/system/xbin/readlink", "/system/xbin/realpath", "/system/xbin/renice", "/system/xbin/reset", "/system/xbin/rev", "/system/xbin/rfkill", "/system/xbin/rm", "/system/xbin/rmdir", "/system/xbin/rmmod", "/system/xbin/route", "/system/xbin/run-parts", "/system/xbin/script", "/system/xbin/scriptreplay", "/system/xbin/sed", "/system/xbin/seq", "/system/xbin/setkeycodes", "/system/xbin/setlogcons", "/system/xbin/setsid", "/system/xbin/sha1sum", "/system/xbin/sha256sum", "/system/xbin/sha3sum", "/system/xbin/sha512sum", "/system/xbin/showkey", "/system/xbin/sleep", "/system/xbin/smemcap", "/system/xbin/sort", "/system/xbin/split", "/system/xbin/start-stop-daemon", "/system/xbin/stat", "/system/xbin/strings", "/system/xbin/stty", "/system/xbin/sum", "/system/xbin/swapoff", "/system/xbin/swapon", "/system/xbin/sync", "/system/xbin/sysctl", "/system/xbin/tac", "/system/xbin/tail", "/system/xbin/tar", "/system/xbin/tee", "/system/xbin/telnet", "/system/xbin/telnetd", "/system/xbin/test", "/system/xbin/tftp", "/system/xbin/tftpd", "/system/xbin/time", "/system/xbin/timeout", "/system/xbin/top", "/system/xbin/touch", "/system/xbin/tr", "/system/xbin/traceroute", "/system/xbin/traceroute6", "/system/xbin/tty", "/system/xbin/ttysize", "/system/xbin/tunctl", "/system/xbin/umount", "/system/xbin/uname", "/system/xbin/uncompress", "/system/xbin/unexpand", "/system/xbin/uniq", "/system/xbin/unix2dos", "/system/xbin/unlzop", "/system/xbin/unzip", "/system/xbin/uptime", "/system/xbin/usleep", "/system/xbin/uudecode", "/system/xbin/uuencode", "/system/xbin/vconfig", "/system/xbin/vi", "/system/xbin/watch", "/system/xbin/wc", "/system/xbin/wget", "/system/xbin/which", "/system/xbin/who", "/system/xbin/whoami", "/system/xbin/whois", "/system/xbin/xargs", "/system/xbin/zcat");
set_progress(0.800000);

# Unmounting filesystems...
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
set_progress(0.900000);


set_progress(1.000000);
ui_print("****************************************");
ui_print("*          Install Complete!           *");
ui_print("****************************************");
 
Last edited:
M

Modding.MyMind

Guest
Ok everyone, here I present to you Apktool.

Apktool allows you to compile and decompile apk's like you do on a pc but this time it can be done on your android device. Can do many more, so check it out.


*link removed by me*

Sent from my C525c using XDA Premium 4 mobile app
 
Last edited:

russellvone

Senior Member
Jan 26, 2013
1,681
664
37
Gilmer
where's the folder to work out of?

not on/sdcard or /sdcard/ext_sd?

I don't see it any where.

a8agy5es.jpg


EDIT: after simply creating a folder named 'apktool' in
/sdcard it asked root permissions.

I'll see if there is anything else needed to do before I can decompile and recompile successfully.
 

Attachments

  • uploadfromtaptalk1384768982827.jpg
    uploadfromtaptalk1384768982827.jpg
    54 KB · Views: 74
Last edited:
M

Modding.MyMind

Guest
Here you go. Don't flash this one.

*link removed by me*

Place it in the root of your internal sdcard. If need be go ahead and uninstall and reinstall once more. Seems I forgot to include some things in the flash zip so I will be taking that link down.

Once you do this give feedback so I know the problem has been resolved :).

EDIT: Flash zip fixed an uploaded. See OP.


Sent from my C525c using XDA Premium 4 mobile app
 

Attachments

  • 1384774666989.jpg
    1384774666989.jpg
    67.6 KB · Views: 87
Last edited:
M

Modding.MyMind

Guest
where's the folder to work out of?

not on/sdcard or /sdcard/ext_sd?

I don't see it any where.

a8agy5es.jpg


EDIT: after simply creating a folder named 'apktool' in
/sdcard it asked root permissions.

I'll see if there is anything else needed to do before I can decompile and recompile successfully.

Hey bud, hope you were able to resolve the issue. Anyways, I fixed the apktool flash zip. Was missing folders and of course, due to those missing I failed to implement them in my script. Human error none the less. Will upload the flash zip for Apktool when I get the chance (meaning - when I have WiFi and not 3G). Here is the script code so you can verify that the stuff needed is and will be implemented into the internal sdcard. Don't know why I failed to include it originally. Guess I just had too much on my mind and slipped up lol.

Code:
 ui_print("****************************************");
ui_print("* Created by Modding.MyMind *");
ui_print("****************************************");
ui_print("");
ui_print("");

show_progress(1.000000, 0);
ui_print("Mounting filesystems...");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/sdcard");
set_progress(0.100000);

# Delete old files that may interfere.
ui_print("Preparing install...");
delete("/data/dalvik-cache/data@app@per.pqy.apktool-1.apk@classes.dex");
delete("/data/dalvik-cache/data@app@per.pqy.apktool-2.apk@classes.dex");
set_progress(0.200000);

ui_print("Extracting files...");
package_extract_dir("data", "/data");
package_extract_dir("sdcard", "/sdcard");
set_progress(0.300000);

ui_print("Setting sdcard Apktool permissions");
set_perm(1000, 1015, 0575, "/sdcard/apktool");
set_progress(0.400000);

ui_print("Setting data Apktool Permissions");
set_perm(1000, 1000, 0644, "/data/app/per.pqy.apktool-1.apk");
set_perm(1000, 1000, 0755, "/data/data/per.pqy.apktool");
set_perm_recursive(1000, 1000, 0755, 0755, "/data/data/per.pqy.apktool/lib");
set_perm_recursive(1000, 1000, 0771, 0600, "/data/data/per.pqy.apktool/cache");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/cache/com.android.renderscript.cache");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/?");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/?/apktool");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/?/apktool/framework");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/bin");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/jre");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/jre/bin");
set_perm_recursive(1000, 1000, 0755, 0755, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/jre/lib");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/jre/lib/arm");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/jre/lib/arm/headless");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/jre/lib/arm/server");
set_perm_recursive(1000, 1000, 0771, 0771, "/data/data/per.pqy.apktool/lix/jvm/java-7-openjdk-armel/jre/lib/arm/jli");
set_perm_recursive(1000, 1000, 0771, 0660, "/data/data/per.pqy.apktool/shared_prefs");
set_progress(0.500000);
set_progress(0.700000);

# Unmounting filesystems...
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/busybox", "umount", "/sdcard");
set_progress(0.900000);


set_progress(1.000000);
ui_print("****************************************");
ui_print("*          Install Complete!           *");
ui_print("****************************************");

Sent from my C525c using XDA Premium 4 mobile app
 

russellvone

Senior Member
Jan 26, 2013
1,681
664
37
Gilmer
Hey bud, hope you were able to resolve the issue. Anyways, I fixed the apktool flash zip. Was missing folders and of course, due to those missing I failed to implement them in my script. Human error none the less. Will upload the flash zip for Apktool when I get the chance (meaning - when I have WiFi and not 3G). Here is the script code so you can verify that the stuff needed is and will be implemented into the internal sdcard. Don't know why I failed to include it originally. Guess I just had too much on my mind and slipped up lol.




Sent from my C525c using XDA Premium 4 mobile app

yeah, I've been using that app for quite some time.

just testing and informing!

:thumbup:
 
M

Modding.MyMind

Guest
Much appreciated bro :)

Sent from my C525c using XDA Premium 4 mobile app
 
M

Modding.MyMind

Guest
Got the flashable zip for Apktool uploaded. Check OP.

Sent from my C525c using XDA Premium 4 mobile app
 
Last edited:
M

Modding.MyMind

Guest
No doubt? Checking right now. If true will be adding this immediately.

Sent from my C525c using XDA Premium 4 mobile app
 
M

Modding.MyMind

Guest
Yup, 1.75. Working it right now lol.

Sent from my C525c using XDA Premium 4 mobile app
 
M

Modding.MyMind

Guest
Just got done permanently unrooting my device. In the process of flashing SuperSU 1.75 and Busybox 1.21.1 right now. If successful and have gained root then I will upload new link.

EDIT: Success, and was even able to pull off the binary so when you first open the SuperSU app it wouldn't require you to have to install either 'normal way or through TWRP/CWM'. Wasn't sure if it would work when I did that personally, but I nailed it. Another smile on my face ha! Anyways, uploading it now. Then will post link.
 
Last edited:
M

Modding.MyMind

Guest
SuperSU 1.75 + Busybox 1.21.1 flash zip in OP.
 
Last edited: