Advertisement
Guest User

install-su.sh

a guest
Aug 9th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.22 KB | None | 0 0
  1. #!/system/bin/sh
  2. #
  3. # SuperSU installer ZIP
  4. # Copyright (c) 2012-2015 - Chainfire
  5. #
  6. # To install SuperSU properly, aside from cleaning old versions and
  7. # other superuser-type apps from the system, the following files need to
  8. # be installed:
  9. #
  10. # API source target chmod chcon required
  11. #
  12. # 7-19 common/Superuser.apk /system/app/Superuser.apk 0644 u:object_r:system_file:s0 gui
  13. # 20+ common/Superuser.apk /system/app/SuperSU/SuperSU.apk 0644 u:object_r:system_file:s0 gui
  14. #
  15. # 17+ common/install-recovery.sh /system/etc/install-recovery.sh 0755 *1 required
  16. # 17+ /system/bin/install-recovery.sh (symlink to /system/etc/...) required
  17. # *1: same as /system/bin/toolbox: u:object_r:system_file:s0 if API < 20, u:object_r:toolbox_exec:s0 if API >= 20
  18. #
  19. # 7+ ARCH/su *2 /system/xbin/su *3 u:object_r:system_file:s0 required
  20. # 7+ /system/bin/.ext/.su *3 u:object_r:system_file:s0 gui
  21. # 17+ /system/xbin/daemonsu 0755 u:object_r:system_file:s0 required
  22. # 17+ /system/xbin/sugote 0755 u:object_r:zygote_exec:s0 required
  23. # *2: su.pie for 17+ x86(_32) only
  24. # *3: 06755 if API < 18, 0755 if API >= 18
  25. #
  26. # 19+ ARCH/supolicy /system/xbin/supolicy 0755 u:object_r:system_file:s0 required
  27. # 19+ ARCH/libsupol.so /system/lib(64)/libsupol.so 0644 u:object_r:system_file:s0 required
  28. #
  29. # 17+ /system/bin/sh or mksh *4 /system/xbin/sugote-mksh 0755 u:object_r:system_file:s0 required
  30. # *4: which one (or both) are available depends on API
  31. #
  32. # 21+ /system/bin/app_process32 *5 /system/bin/app_process32_original 0755 u:object_r:zygote_exec:s0 required
  33. # 21+ /system/bin/app_process64 *5 /system/bin/app_process64_original 0755 u:object_r:zygote_exec:s0 required
  34. # 21+ /system/bin/app_processXX *5 /system/bin/app_process_init 0755 u:object_r:system_file:s0 required
  35. # 21+ /system/bin/app_process (symlink to /system/xbin/daemonsu) required
  36. # 21+ *5 /system/bin/app_process32 (symlink to /system/xbin/daemonsu) required
  37. # 21+ *5 /system/bin/app_process64 (symlink to /system/xbin/daemonsu) required
  38. # *5: Only do this for the relevant bits. On a 64 bits system, leave the 32 bits files alone, or dynamic linker errors
  39. # will prevent the system from fully working in subtle ways. The bits of the su binary must also match!
  40. #
  41. # 17+ common/99SuperSUDaemon *6 /system/etc/init.d/99SuperSUDaemon 0755 u:object_r:system_file:s0 optional
  42. # *6: only place this file if /system/etc/init.d is present
  43. #
  44. # 17+ 'echo 1 >' or 'touch' *7 /system/etc/.installed_su_daemon 0644 u:object_r:system_file:s0 optional
  45. # *7: the file just needs to exist or some recoveries will nag you. Even with it there, it may still happen.
  46. #
  47. # It may seem some files are installed multiple times needlessly, but
  48. # it only seems that way. Installing files differently or symlinking
  49. # instead of copying (unless specified) will lead to issues eventually.
  50. #
  51. # The following su binary versions are included in the full package. Each
  52. # should be installed only if the system has the same or newer API level
  53. # as listed. The script may fall back to a different binary on older API
  54. # levels. supolicy are all ndk/pie/19+ for 32 bit, ndk/pie/20+ for 64 bit.
  55. #
  56. # binary ARCH/path build type API
  57. #
  58. # arm-v5te arm ndk non-pie 7+
  59. # x86 x86 ndk non-pie 7+
  60. #
  61. # x86 x86 ndk pie 17+ (su.pie, naming exception)
  62. # arm-v7a armv7 ndk pie 17+
  63. # mips mips ndk pie 17+
  64. #
  65. # arm64-v8a arm64 ndk pie 20+
  66. # mips64 mips64 ndk pie 20+
  67. # x86_64 x64 ndk pie 20+
  68. #
  69. # Note that if SELinux is set to enforcing, the daemonsu binary expects
  70. # to be run at startup (usually from install-recovery.sh, 99SuperSUDaemon,
  71. # or app_process) from u:r:init:s0 or u:r:kernel:s0 contexts. Depending
  72. # on the current policies, it can also deal with u:r:init_shell:s0 and
  73. # u:r:toolbox:s0 contexts. Any other context will lead to issues eventually.
  74. #
  75. # After installation, run '/system/xbin/su --install', which may need to
  76. # perform some additional installation steps. Ideally, at one point,
  77. # a lot of this script will be moved there.
  78. #
  79. # The included chattr(.pie) binaries are used to remove ext2's immutable
  80. # flag on some files. This flag is no longer set by SuperSU's OTA
  81. # survival since API level 18, so there is no need for the 64 bit versions.
  82. # Note that chattr does not need to be installed to the system, it's just
  83. # used by this script, and not supported by the busybox used in older
  84. # recoveries.
  85. #
  86. # Non-static binaries are supported to be PIE (Position Independent
  87. # Executable) from API level 16, and required from API level 20 (which will
  88. # refuse to execute non-static non-PIE).
  89. #
  90. # The script performs several actions in various ways, sometimes
  91. # multiple times, due to different recoveries and firmwares behaving
  92. # differently, and it thus being required for the correct result.
  93.  
  94. SYSTEMLIB=/system/lib
  95.  
  96. ch_con() {
  97. LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox chcon -h u:object_r:system_file:s0 $1
  98. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox chcon -h u:object_r:system_file:s0 $1
  99. LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon -h u:object_r:system_file:s0 $1
  100. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon -h u:object_r:system_file:s0 $1
  101. chcon -h u:object_r:system_file:s0 $1
  102. LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox chcon u:object_r:system_file:s0 $1
  103. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox chcon u:object_r:system_file:s0 $1
  104. LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon u:object_r:system_file:s0 $1
  105. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon u:object_r:system_file:s0 $1
  106. chcon u:object_r:system_file:s0 $1
  107. }
  108.  
  109. ch_con_ext() {
  110. LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox chcon $2 $1
  111. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox chcon $2 $1
  112. LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon $2 $1
  113. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon $2 $1
  114. chcon $2 $1
  115. }
  116.  
  117. ln_con() {
  118. LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox ln -s $1 $2
  119. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox ln -s $1 $2
  120. LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox ln -s $1 $2
  121. LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox ln -s $1 $2
  122. ln -s $1 $2
  123. ch_con $2
  124. }
  125.  
  126. set_perm() {
  127. chown $1.$2 $4
  128. chown $1:$2 $4
  129. chmod $3 $4
  130. ch_con $4
  131. ch_con_ext $4 $5
  132. }
  133.  
  134. cp_perm() {
  135. rm $5
  136. if [ -f "$4" ]; then
  137. cat $4 > $5
  138. set_perm $1 $2 $3 $5 $6
  139. fi
  140. }
  141.  
  142. toolbox_mount() {
  143. DEV=
  144. POINT=
  145. FS=
  146. for i in `cat /etc/fstab | grep "$1"`; do
  147. if [ -z "$DEV" ]; then
  148. DEV=$i
  149. elif [ -z "$POINT" ]; then
  150. POINT=$i
  151. elif [ -z "$FS" ]; then
  152. FS=$i
  153. break
  154. fi
  155. done
  156. mount -t $FS -o rw $DEV $POINT
  157. mount -t $FS -o rw,remount $DEV $POINT
  158.  
  159. DEV=
  160. POINT=
  161. FS=
  162. for i in `cat /etc/recovery.fstab | grep "$1"`; do
  163. if [ -z "$POINT" ]; then
  164. POINT=$i
  165. elif [ -z "$FS" ]; then
  166. FS=$i
  167. elif [ -z "$DEV" ]; then
  168. DEV=$i
  169. break
  170. fi
  171. done
  172. if [ "$FS" = "emmc" ]; then
  173. mount -t ext4 -o rw $DEV $POINT
  174. mount -t ext4 -o rw,remount $DEV $POINT
  175. mount -t f2fs -o rw $DEV $POINT
  176. mount -t f2fs -o rw,remount $DEV $POINT
  177. else
  178. mount -t $FS -o rw $DEV $POINT
  179. mount -t $FS -o rw,remount $DEV $POINT
  180. fi
  181. }
  182. mount /system
  183. mount /data
  184. mount -o ro /system /system
  185.  
  186. #init.d
  187. echo "/system/etc/init.d: start"
  188. (
  189. echo "/system/etc/init.d: start" > /dev/kmsg
  190. for f in /system/etc/init.d/*;
  191. do
  192. echo "${f}: start" > /dev/kmsg;
  193. /system/bin/sh ${f};
  194. done
  195. echo "/system/etc/init.d: done" > /dev/kmsg
  196. ) &
  197.  
  198. needsu=0
  199. if [ -f /system/xbin/su ]; then
  200.  
  201. aa=$(grep -p -aoi '.\...:SUPERSU' /system/xbin/su)
  202. aa=${aa%:*}
  203. if [ 2\.52 \> $aa ]; then
  204. needsu=1
  205. fi
  206. else
  207. needsu=1
  208. fi
  209. echo "needsu=${needsu}"
  210. if [ $needsu -eq 0 ]; then
  211. exit 0
  212. fi
  213.  
  214. mount -o rw,remount /system
  215. mount -o rw,remount /system /system
  216. mount -o rw,remount /
  217. mount -o rw,remount / /
  218.  
  219. toolbox_mount /system
  220. toolbox_mount /data
  221.  
  222. cat /system/bin/toybox > /system/toybox
  223. chmod 0755 /system/toybox
  224. ch_con /system/toybox
  225.  
  226. cat /system/bin/toolbox > /system/toolbox
  227. chmod 0755 /system/toolbox
  228. ch_con /system/toolbox
  229.  
  230. API=$(cat /system/build.prop | grep "ro.build.version.sdk=" | dd bs=1 skip=21 count=2)
  231. ABI=$(cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi=" | dd bs=1 skip=19 count=3)
  232. ABILONG=$(cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi=" | dd bs=1 skip=19)
  233. ABI2=$(cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi2=" | dd bs=1 skip=20 count=3)
  234. SUMOD=06755
  235. SUGOTE=false
  236. SUPOLICY=false
  237. INSTALL_RECOVERY_CONTEXT=u:object_r:system_file:s0
  238. MKSH=/system/bin/mksh
  239. PIE=
  240. SU=su
  241. ARCH=arm
  242. APKFOLDER=false
  243. APKNAME=/system/app/Superuser.apk
  244. APPPROCESS=false
  245. APPPROCESS64=false
  246. if [ "$ABI" = "x86" ]; then ARCH=x86; fi;
  247. if [ "$ABI2" = "x86" ]; then ARCH=x86; fi;
  248. if [ "$API" -eq "$API" ]; then
  249. if [ "$API" -ge "17" ]; then
  250. SUGOTE=true
  251. PIE=.pie
  252. if [ "$ARCH" = "x86" ]; then SU=su.pie; fi;
  253. if [ "$ABILONG" = "armeabi-v7a" ]; then ARCH=armv7; fi;
  254. if [ "$ABI" = "mip" ]; then ARCH=mips; fi;
  255. if [ "$ABILONG" = "mips" ]; then ARCH=mips; fi;
  256. fi
  257. if [ "$API" -ge "18" ]; then
  258. SUMOD=0755
  259. fi
  260. if [ "$API" -ge "20" ]; then
  261. if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; SYSTEMLIB=/system/lib64; APPPROCESS64=true; fi;
  262. if [ "$ABILONG" = "mips64" ]; then ARCH=mips64; SYSTEMLIB=/system/lib64; APPPROCESS64=true; fi;
  263. if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; SYSTEMLIB=/system/lib64; APPPROCESS64=true; fi;
  264. APKFOLDER=true
  265. APKNAME=/system/app/SuperSU/SuperSU.apk
  266. fi
  267. if [ "$API" -ge "19" ]; then
  268. SUPOLICY=true
  269. if [ "$(LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox ls -lZ /system/bin/toolbox | grep toolbox_exec > /dev/null; echo $?)" -eq "0" ]; then
  270. INSTALL_RECOVERY_CONTEXT=u:object_r:toolbox_exec:s0
  271. fi
  272. fi
  273. if [ "$API" -ge "21" ]; then
  274. APPPROCESS=true
  275. fi
  276. fi
  277. if [ ! -f $MKSH ]; then
  278. MKSH=/system/bin/sh
  279. fi
  280.  
  281. BIN=/sbin/supersu/$ARCH
  282. COM=/sbin/supersu/common
  283. INS=/system/etc/install-recovery.sh
  284. if [ -f /system/etc/install_recovery.sh ]; then
  285. INS=/system/etc/install_recovery.sh
  286. fi
  287.  
  288. chmod 0755 $BIN/chattr$PIE
  289. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/bin/su
  290. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/su
  291. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/bin/.ext/.su
  292. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/sbin/su
  293. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /vendor/sbin/su
  294. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /vendor/bin/su
  295. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /vendor/xbin/su
  296. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/daemonsu
  297. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/sugote
  298. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/sugote_mksh
  299. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/supolicy
  300. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/ku.sud
  301. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/.ku
  302. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/.su
  303. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/lib/libsupol.so
  304. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/lib64/libsupol.so
  305. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/etc/install-recovery.sh
  306. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/bin/install-recovery.sh
  307.  
  308. if [ -f "/system/bin/install-recovery.sh" ]; then
  309. if [ ! -f "/system/bin/install-recovery_original.sh" ]; then
  310. mv /system/bin/install-recovery.sh /system/bin/install-recovery_original.sh
  311. ch_con /system/bin/install-recovery_original.sh
  312. fi
  313. fi
  314. if [ -f $INS ]; then
  315. if [ ! -f "/system/etc/install-recovery_original.sh" ]; then
  316. mv $INS /system/etc/install-recovery_original.sh
  317. ch_con /system/etc/install-recovery_original.sh
  318. fi
  319. fi
  320.  
  321. rm -f /system/bin/su
  322. rm -f /system/xbin/su
  323. rm -f /system/sbin/su
  324. rm -f /vendor/sbin/su
  325. rm -f /vendor/bin/su
  326. rm -f /vendor/xbin/su
  327. rm -f /system/xbin/daemonsu
  328. rm -f /system/xbin/sugote
  329. rm -f /system/xbin/sugote-mksh
  330. rm -f /system/xbin/supolicy
  331. rm -f /system/xbin/ku.sud
  332. rm -f /system/xbin/.ku
  333. rm -f /system/xbin/.su
  334. rm -f /system/lib/libsupol.so
  335. rm -f /system/lib64/libsupol.so
  336. rm -f /system/bin/.ext/.su
  337. rm -f /system/bin/install-recovery.sh
  338. rm -f $INS
  339. rm -f /system/etc/init.d/99SuperSUDaemon
  340. rm -f /system/etc/.installed_su_daemon
  341. rm -f /system/app/Superuser.apk
  342. rm -f /system/app/Superuser.odex
  343. rm -rf /system/app/Superuser
  344. rm -f /system/app/SuperUser.apk
  345. rm -f /system/app/SuperUser.odex
  346. rm -rf /system/app/SuperUser
  347. rm -f /system/app/superuser.apk
  348. rm -f /system/app/superuser.odex
  349. rm -rf /system/app/superuser
  350. rm -f /system/app/Supersu.apk
  351. rm -f /system/app/Supersu.odex
  352. rm -rf /system/app/Supersu
  353. rm -f /system/app/SuperSU.apk
  354. rm -f /system/app/SuperSU.odex
  355. rm -rf /system/app/SuperSU
  356. rm -f /system/app/supersu.apk
  357. rm -f /system/app/supersu.odex
  358. rm -rf /system/app/supersu
  359. rm -f /system/app/VenomSuperUser.apk
  360. rm -f /system/app/VenomSuperUser.odex
  361. rm -rf /system/app/VenomSuperUser
  362. rm -f /data/dalvik-cache/*com.noshufou.android.su*
  363. rm -f /data/dalvik-cache/*/*com.noshufou.android.su*
  364. rm -f /data/dalvik-cache/*com.koushikdutta.superuser*
  365. rm -f /data/dalvik-cache/*/*com.koushikdutta.superuser*
  366. rm -f /data/dalvik-cache/*com.mgyun.shua.su*
  367. rm -f /data/dalvik-cache/*/*com.mgyun.shua.su*
  368. rm -f /data/dalvik-cache/*com.m0narx.su*
  369. rm -f /data/dalvik-cache/*/*com.m0narx.su*
  370. rm -f /data/dalvik-cache/*com.kingroot.kinguser*
  371. rm -f /data/dalvik-cache/*/*com.kingroot.kinguser*
  372. rm -f /data/dalvik-cache/*com.kingroot.master*
  373. rm -f /data/dalvik-cache/*/*com.kingroot.master*
  374. rm -f /data/dalvik-cache/*Superuser.apk*
  375. rm -f /data/dalvik-cache/*/*Superuser.apk*
  376. rm -f /data/dalvik-cache/*SuperUser.apk*
  377. rm -f /data/dalvik-cache/*/*SuperUser.apk*
  378. rm -f /data/dalvik-cache/*superuser.apk*
  379. rm -f /data/dalvik-cache/*/*superuser.apk*
  380. rm -f /data/dalvik-cache/*VenomSuperUser.apk*
  381. rm -f /data/dalvik-cache/*/*VenomSuperUser.apk*
  382. rm -f /data/dalvik-cache/*eu.chainfire.supersu*
  383. rm -f /data/dalvik-cache/*/*eu.chainfire.supersu*
  384. rm -f /data/dalvik-cache/*Supersu.apk*
  385. rm -f /data/dalvik-cache/*/*Supersu.apk*
  386. rm -f /data/dalvik-cache/*SuperSU.apk*
  387. rm -f /data/dalvik-cache/*/*SuperSU.apk*
  388. rm -f /data/dalvik-cache/*supersu.apk*
  389. rm -f /data/dalvik-cache/*/*supersu.apk*
  390. rm -f /data/dalvik-cache/*.oat
  391. rm -rf /data/app/com.noshufou.android.su*
  392. rm -rf /data/app/com.koushikdutta.superuser*
  393. rm -rf /data/app/com.mgyun.shua.su*
  394. rm -rf /data/app/com.m0narx.su*
  395. rm -rf /data/app/com.kingroot.kinguser*
  396. rm -rf /data/app/com.kingroot.master*
  397. rm -rf /data/app/eu.chainfire.supersu-*
  398. rm -rf /data/app/eu.chainfire.supersu.apk
  399.  
  400. mkdir /system/bin/.ext
  401. set_perm 0 0 0777 /system/bin/.ext
  402. cp_perm 0 0 $SUMOD $BIN/$SU /system/bin/.ext/.su
  403. cp_perm 0 0 $SUMOD $BIN/$SU /system/xbin/su
  404. cp_perm 0 0 0755 $BIN/$SU /system/xbin/daemonsu
  405. if ($SUGOTE); then
  406. cp_perm 0 0 0755 $BIN/$SU /system/xbin/sugote u:object_r:zygote_exec:s0
  407. cp_perm 0 0 0755 $MKSH /system/xbin/sugote-mksh
  408. fi
  409. if ($SUPOLICY); then
  410. cp_perm 0 0 0755 $BIN/supolicy /system/xbin/supolicy
  411. cp_perm 0 0 0644 $BIN/libsupol.so $SYSTEMLIB/libsupol.so
  412. fi
  413. if ($APKFOLDER); then
  414. mkdir /system/app/SuperSU
  415. set_perm 0 0 0755 /system/app/SuperSU
  416. fi
  417. cp_perm 0 0 0644 $COM/Superuser.apk $APKNAME
  418. cp_perm 0 0 0755 $COM/install-recovery.sh $INS
  419. ln_con $INS /system/bin/install-recovery.sh
  420. if ($APPPROCESS); then
  421. rm /system/bin/app_process
  422. ln_con /system/xbin/daemonsu /system/bin/app_process
  423. if ($APPPROCESS64); then
  424. if [ ! -f "/system/bin/app_process64_original" ]; then
  425. mv /system/bin/app_process64 /system/bin/app_process64_original
  426. else
  427. rm /system/bin/app_process64
  428. fi
  429. ln_con /system/xbin/daemonsu /system/bin/app_process64
  430. if [ ! -f "/system/bin/app_process_init" ]; then
  431. cp_perm 0 2000 0755 /system/bin/app_process64_original /system/bin/app_process_init
  432. fi
  433. else
  434. if [ ! -f "/system/bin/app_process32_original" ]; then
  435. mv /system/bin/app_process32 /system/bin/app_process32_original
  436. else
  437. rm /system/bin/app_process32
  438. fi
  439. ln_con /system/xbin/daemonsu /system/bin/app_process32
  440. if [ ! -f "/system/bin/app_process_init" ]; then
  441. cp_perm 0 2000 0755 /system/bin/app_process32_original /system/bin/app_process_init
  442. fi
  443. fi
  444. fi
  445. cp_perm 0 0 0744 $COM/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon
  446. echo 1 > /system/etc/.installed_su_daemon
  447. set_perm 0 0 0644 /system/etc/.installed_su_daemon
  448.  
  449. rm /system/toybox
  450. rm /system/toolbox
  451. LD_LIBRARY_PATH=$SYSTEMLIB /system/xbin/su --install
  452.  
  453. mount -o remount,ro /system
  454.  
  455. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement