Skip to content

Commit a8a2f3b

Browse files
committed
improved install su.
add busybox installation
1 parent d3e7ab1 commit a8a2f3b

18 files changed

Lines changed: 493 additions & 14 deletions

files/SuperSu/install-busybox.sh

Lines changed: 358 additions & 0 deletions
Large diffs are not rendered by default.

files/SuperSu/install_su.sh

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/system/bin/sh
2-
32
bb=/data/local/tmp/busybox_file
43
echo mount rw
54
$bb mount -o remount,rw /system
@@ -10,13 +9,41 @@ fi
109
$bb rm /system/bin/ccs-auditd
1110
$bb cp /data/local/tmp/unlock_security_module /system/bin/unlock_security_module
1211
$bb cp /data/local/tmp/device.db /system/etc/device.db
13-
$bb cp /data/local/tmp/SuperSu/ccs-auditd /system/bin/ccs-auditd
1412
chmod 755 /system/bin/unlock_security_module
15-
chmod 755 /system/bin/ccs-auditd
1613

17-
$bb mount -o remount,ro /system
14+
$bb mkdir -p /system/addon.d
15+
#supersu
16+
$bb cp /data/local/tmp/SuperSu/sed/addon.d/99-supersu.sh /system/addon.d/99-supersu.sh
17+
$bb cp /data/local/tmp/SuperSu/sed/bin/.ext/.su /system/bin/.ext/.su
18+
$bb cp /data/local/tmp/SuperSu/sed/bin/ccs-auditd /system/bin/ccs-auditd
19+
$bb cp /data/local/tmp/SuperSu/sed/etc/init.d/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon
20+
$bb cp /data/local/tmp/SuperSu/sed/etc/.installed_su_daemon /system/etc/.installed_su_daemon
21+
$bb cp /data/local/tmp/SuperSu/sed/etc/install-recovery.sh /system/etc/install-recovery.sh
22+
$bb cp /data/local/tmp/SuperSu/sed/etc/install-busybox.sh /system/etc/install-busybox.sh
23+
$bb cp /data/local/tmp/SuperSu/sed/xbin/daemonsu /system/xbin/daemonsu
24+
$bb cp /system/xbin/daemonsu /system/xbin/su
1825

26+
$bb chown 0.0 /system/addon.d/99-supersu.sh
27+
$bb chown 0.0 /system/bin/.ext/.su
28+
$bb chown 0.0 /system/bin/ccs-auditd
29+
$bb chown 0.0 /system/etc/init.d/99SuperSUDaemon
30+
$bb chown 0.0 /system/etc/.installed_su_daemon
31+
$bb chown 0.0 /system/etc/install-recovery.sh
32+
$bb chown 0.0 /system/etc/install-busybox.sh
33+
$bb chown 0.0 /system/xbin/daemonsu
34+
$bb chown 0.0 /system/xbin/su
1935

20-
echo 'mount("/data");' > /cache/recovery/extendedcommand
21-
echo 'install_zip("/data/local/tmp/SuperSu/UPDATE-SuperSU-v1.93.zip");' >> /cache/recovery/extendedcommand
36+
$bb chmod 755 /system/addon.d/99-supersu.sh
37+
$bb chmod 755 /system/bin/.ext/.su
38+
$bb chmod 755 /system/bin/ccs-auditd
39+
$bb chmod 755 /system/etc/init.d/99SuperSUDaemon
40+
$bb chmod 644 /system/etc/.installed_su_daemon
41+
$bb chmod 755 /system/etc/install-recovery.sh
42+
$bb chmod 755 /system/etc/install-busybox.sh
43+
$bb chmod 755 /system/xbin/daemonsu
44+
$bb chmod 755 /system/xbin/su
2245

46+
#install busybox
47+
/data/local/tmp/SuperSu/install-busybox.sh
48+
49+
$bb mount -o remount,ro /system
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/sbin/sh
2+
#
3+
# /system/addon.d/99-supersu.sh (root:root 755)
4+
# During an upgrade, this script backs up SuperSU-related files,
5+
# /system is formatted and reinstalled, then the files are restored.
6+
#
7+
8+
. /tmp/backuptool.functions
9+
10+
list_files() {
11+
cat <<EOF
12+
app/Superuser.apk
13+
xbin/su
14+
xbin/daemonsu
15+
xbin/otasurvival.sh
16+
bin/log
17+
bin/.ext/.su
18+
etc/init.d/99SuperSUDaemon
19+
etc/install-recovery.sh
20+
etc/.installed_su_daemon
21+
.pin
22+
EOF
23+
}
24+
25+
case "$1" in
26+
backup)
27+
list_files | while read FILE DUMMY; do
28+
backup_file $S/"$FILE"
29+
done
30+
;;
31+
restore)
32+
list_files | while read FILE REPLACEMENT; do
33+
R=""
34+
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
35+
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
36+
done
37+
;;
38+
pre-backup)
39+
# Stub
40+
;;
41+
post-backup)
42+
# Stub
43+
;;
44+
pre-restore)
45+
# Nuke the shipped Superuser+su from /system
46+
list_files | while read FILE DUMMY; do
47+
[ -e "$S/$FILE" ] && rm $S/"$FILE"
48+
done
49+
;;
50+
post-restore)
51+
# Stub
52+
;;
53+
esac

files/SuperSu/sed/bin/.ext/.su

110 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/system/bin/sh
2+
/system/xbin/daemonsu --auto-daemon &
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/system/bin/sh
2+
3+
# If you're implementing this in a custom kernel/firmware,
4+
# I suggest you use a different script name, and add a service
5+
# to launch it from init.rc
6+
7+
# Launches SuperSU in daemon mode only on Android 4.3+.
8+
# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
9+
# If you want to force loading the daemon, use "--daemon" instead
10+
11+
/system/xbin/daemonsu --auto-daemon &
12+
13+
# Some apps like to run stuff from this script as well, that will
14+
# obviously break root - in your code, just search this file
15+
# for "install-recovery-2.sh", and if present, write there instead.
16+
17+
/system/etc/install-recovery-2.sh

files/SuperSu/sed/xbin/daemonsu

110 KB
Binary file not shown.

files/SuperSu_forHost/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)