[Atrix 4G Android Development] sendust7:
I may have fixed the lag in Root Explorer and other apps on ICSROM. No need to continue reading unless you also have this problem.

Not much in the way of Atrix rootin’ guides of late, so I downloaded Chainfire's latest UPDATE-SuperSU-v1.04.zip here: http://xdaforums.com/showthread.php?t=1538053

Direct link: http://download.chainfire.eu/310/SuperSU/UPDATE-SuperSU-v1.04.zip

knowing that…

Chainfire quote: “ZIP does not work on all devices, needs fix. Note that if you are already rooted, installing through Market is by far the easiest way to install SuperSU !”

True to these sage words, the CWM install crashed. And /tmp/recovery.log showed no details.

So I switched to Ubuntu and tried the same thing. Same results.

So I opened the zip and found:

Reference to a /tools directory not contained in the zip

Many lines of code for manual deletion of superuser related files

Temporary rearrangement of heavyweight apps to make room for 2MB of superuser files

Broken update-binary

So I completely re-designed it.

/META-INF/com/google/android/updater-script:
assert(getprop("ro.product.device") == "olympus" || getprop("ro.build.product") == "olympus");

ui_print(" ");
ui_print("Fast Superuser for Atrix 4g ICS!");
ui_print("Initial Release: 21 Feb 2013");
ui_print("sendust7 @ xda-developers");

ui_print("Credits: Chainfire (SuperSU v1.04)");

ui_print(" ");
ui_print(" Removing old superuser files from /system, /cache,");
ui_print(" /data and /preinstall");
package_extract_file("find-rm-su.sh", "/tmp/find-rm-su.sh");
set_perm(0, 0, 0777, "/tmp/find-rm-su.sh");
run_program("/sbin/busybox", "sh", "/tmp/find-rm-su.sh", "/dev/block/mmcblk0p12","/system");
run_program("/sbin/busybox", "sh", "/tmp/find-rm-su.sh", "/dev/block/mmcblk0p15","/cache");
run_program("/sbin/busybox", "sh", "/tmp/find-rm-su.sh", "/dev/block/mmcblk0p16","/data");
run_program("/sbin/busybox", "sh", "/tmp/find-rm-su.sh", "/dev/block/mmcblk0p17","/preinstall");

ui_print(" ");
ui_print(" Mount /system and /data");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");

ui_print(" ");
ui_print(" Extract new superuser files");
package_extract_dir("system", "/system");

ui_print(" ");
ui_print(" Set permissions");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(0, 0, 0644, "/system/app/Supersu.apk");

ui_print(" ");
ui_print(" Unmount /system and /data");
unmount("/system");
unmount("/data");

ui_print(" ");
ui_print(" Done... Reboot and enjoy!");

and…

find-rm-su.sh:

#!/system/bin/sh

# Find and remove all instances of superuser in ROM
# sendust7 @ xda-developers

MOUNT_DEVICE=$1
MOUNT_POINT=$2

if [ -d "${MOUNT_POINT}" ]
then
echo "Directory: ${MOUNT_POINT} exists (OK)"
else
mkdir ${MOUNT_POINT}
fi

mount -t ext4 ${MOUNT_DEVICE} ${MOUNT_POINT}

/sbin/busybox find ${MOUNT_POINT} -name su -exec rm {} \;
/sbin/busybox find ${MOUNT_POINT} -name *[Ss][Uu]per[Ss][Uu]* -exec rm -r {} \;
/sbin/busybox find ${MOUNT_POINT} -name *[Ss][Uu]per[Uu][Ss]* -exec rm -r {} \;

umount ${MOUNT_POINT}

Superuser-Atrix-ICS-v1.0.zip: http://www.mediafire.com/?34tka3vjlfyj8fv

CWM flash and voila... root returns to ICSROM. And Root Explorer now opens in the blink of an eye.

Then I ported Superuser-Atrix-ICS to SD with a few small changes to updater-script:

Superuser-Atrix-ICS-v1.0-SD.zip: http://www.mediafire.com/?6d75i66d02liejh

Superuser-Atrix-ICS-v1.0.zip and Superuser-Atrix-ICS-v1.0-SD.zip are tested working on my dual boot configuration: ICSROM (EMMC) and MROM ICS (SD) --- though I didn’t see any improvement on MROM since root apps already load fast on it.

I have not observed any degradation in performance thus far.

Tips:

A second reboot may be needed to smooth things out.

If adb hangs after entering “su”, look at your phone and see if adb is requesting superuser. This one is easy to miss since we tend to be watching our adb computer screen instead of phone.

ICSROM 146 defaults to “USB connected as mass storage” so you can easily drag-drop files to/from computer. But for development I think it is better to initialize to “Media Device MTP” so apps like Root Explorer can access memory.

You can selectively turn off superuser notifications by going to SuperSU > Apps. This page displays apps that have already requested SU permission. Alternatively you can turn off SU request notifications globally with SuperSU Settings > Show notifications.

Lessons learned: Do what Chainfire says and download/install his SuperSU from Google Play, lol. OR... if you’re curious like me and want to know what’s going on inside the black box, you tear into the zip file and do it the hard way -- After all, that is often how we learn ;)

Enjoy.

Credits: Chainfire (SuperSU)