綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[求助] 使用Fastboot刷入刷包

[複製連結] 查看: 1843|回覆: 1|好評: 0
跳轉到指定樓層
樓主
asffsa4841 | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2015-11-30 16:41

馬上加入Android 台灣中文網,立即免費下載應用遊戲。

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x
Recovery的刷包(.zip檔)應該可以把裡面的資料抓出來然後使用Fastboot指令來手動刷入吧?

那要如何使用Fastboot的指令來刷入SuperSU.zip?(不使用Recovery來刷入)

如果把SuperSU.zip中的檔案拆開,要怎麼知道哪些檔案要刷到哪裡、還有要用甚麼指令來刷入檔案到指定的位置??
「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
收藏收藏 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

沙發
sabpprook | 收聽TA | 只看該作者
發表於 2015-11-30 22:59
這是 SuperSU v2.52 的 shell script
既然是 shell script,當然不是餵給 fastboot 吃的指令

  1. #!/sbin/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. OUTFD=$2
  94. ZIP=$3

  95. SYSTEMLIB=/system/lib

  96. ui_print() {
  97.   echo -n -e "ui_print $1
  98. " > /proc/self/fd/$OUTFD
  99.   echo -n -e "ui_print
  100. " > /proc/self/fd/$OUTFD
  101. }

  102. ch_con() {
  103.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox chcon -h u:object_r:system_file:s0 $1
  104.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox chcon -h u:object_r:system_file:s0 $1
  105.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon -h u:object_r:system_file:s0 $1
  106.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon -h u:object_r:system_file:s0 $1
  107.   chcon -h u:object_r:system_file:s0 $1
  108.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox chcon u:object_r:system_file:s0 $1
  109.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox chcon u:object_r:system_file:s0 $1
  110.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon u:object_r:system_file:s0 $1
  111.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon u:object_r:system_file:s0 $1
  112.   chcon u:object_r:system_file:s0 $1
  113. }

  114. ch_con_ext() {
  115.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox chcon $2 $1
  116.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox chcon $2 $1
  117.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon $2 $1
  118.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon $2 $1
  119.   chcon $2 $1
  120. }

  121. ln_con() {
  122.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toybox ln -s $1 $2
  123.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toybox ln -s $1 $2
  124.   LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox ln -s $1 $2
  125.   LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox ln -s $1 $2
  126.   ln -s $1 $2
  127.   ch_con $2
  128. }

  129. set_perm() {
  130.   chown $1.$2 $4
  131.   chown $1:$2 $4
  132.   chmod $3 $4
  133.   ch_con $4
  134.   ch_con_ext $4 $5
  135. }

  136. cp_perm() {
  137.   rm $5
  138.   if [ -f "$4" ]; then
  139.     cat $4 > $5
  140.     set_perm $1 $2 $3 $5 $6
  141.   fi
  142. }

  143. toolbox_mount() {
  144.   DEV=
  145.   POINT=
  146.   FS=
  147.   for i in `cat /etc/fstab | grep "$1"`; do
  148.     if [ -z "$DEV" ]; then
  149.       DEV=$i
  150.     elif [ -z "$POINT" ]; then
  151.       POINT=$i
  152.     elif [ -z "$FS" ]; then
  153.       FS=$i
  154.       break
  155.     fi
  156.   done
  157.   mount -t $FS -o rw $DEV $POINT
  158.   mount -t $FS -o rw,remount $DEV $POINT

  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. ui_print "*****************"
  183. ui_print "SuperSU installer"
  184. ui_print "*****************"

  185. ui_print "- Mounting /system, /data and rootfs"

  186. mount /system
  187. mount /data
  188. mount -o rw,remount /system
  189. mount -o rw,remount /system /system
  190. mount -o rw,remount /
  191. mount -o rw,remount / /

  192. toolbox_mount /system
  193. toolbox_mount /data

  194. if [ -z "$BIN" ]; then
  195.   # TWRP went full retard
  196.   if [ ! -f "/sbin/unzip" ]; then
  197.     ui_print "- BAD RECOVERY DETECTED, NO UNZIP, ABORTING"
  198.     exit 1
  199.   fi
  200. fi

  201. cat /system/bin/toybox > /system/toybox
  202. chmod 0755 /system/toybox
  203. ch_con /system/toybox

  204. cat /system/bin/toolbox > /system/toolbox
  205. chmod 0755 /system/toolbox
  206. ch_con /system/toolbox

  207. API=$(cat /system/build.prop | grep "ro.build.version.sdk=" | dd bs=1 skip=21 count=2)
  208. ABI=$(cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi=" | dd bs=1 skip=19 count=3)
  209. ABILONG=$(cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi=" | dd bs=1 skip=19)
  210. ABI2=$(cat /system/build.prop /default.prop | grep -m 1 "ro.product.cpu.abi2=" | dd bs=1 skip=20 count=3)
  211. SUMOD=06755
  212. SUGOTE=false
  213. SUPOLICY=false
  214. INSTALL_RECOVERY_CONTEXT=u:object_r:system_file:s0
  215. MKSH=/system/bin/mksh
  216. PIE=
  217. SU=su
  218. ARCH=arm
  219. APKFOLDER=false
  220. APKNAME=/system/app/Superuser.apk
  221. APPPROCESS=false
  222. APPPROCESS64=false
  223. if [ "$ABI" = "x86" ]; then ARCH=x86; fi;
  224. if [ "$ABI2" = "x86" ]; then ARCH=x86; fi;
  225. if [ "$API" -eq "$API" ]; then
  226.   if [ "$API" -ge "17" ]; then
  227.     SUGOTE=true
  228.     PIE=.pie
  229.     if [ "$ARCH" = "x86" ]; then SU=su.pie; fi;
  230.     if [ "$ABILONG" = "armeabi-v7a" ]; then ARCH=armv7; fi;
  231.     if [ "$ABI" = "mip" ]; then ARCH=mips; fi;
  232.     if [ "$ABILONG" = "mips" ]; then ARCH=mips; fi;
  233.   fi
  234.   if [ "$API" -ge "18" ]; then
  235.     SUMOD=0755
  236.   fi
  237.   if [ "$API" -ge "20" ]; then
  238.     if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; SYSTEMLIB=/system/lib64; APPPROCESS64=true; fi;
  239.     if [ "$ABILONG" = "mips64" ]; then ARCH=mips64; SYSTEMLIB=/system/lib64; APPPROCESS64=true; fi;
  240.     if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; SYSTEMLIB=/system/lib64; APPPROCESS64=true; fi;
  241.     APKFOLDER=true
  242.     APKNAME=/system/app/SuperSU/SuperSU.apk
  243.   fi
  244.   if [ "$API" -ge "19" ]; then
  245.     SUPOLICY=true
  246.     if [ "$(LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox ls -lZ /system/bin/toolbox | grep toolbox_exec > /dev/null; echo $?)" -eq "0" ]; then
  247.       INSTALL_RECOVERY_CONTEXT=u:object_r:toolbox_exec:s0
  248.     fi
  249.   fi
  250.   if [ "$API" -ge "21" ]; then
  251.     APPPROCESS=true
  252.   fi
  253. fi
  254. if [ ! -f $MKSH ]; then
  255.   MKSH=/system/bin/sh
  256. fi

  257. #ui_print "DBG [$API] [$ABI] [$ABI2] [$ABILONG] [$ARCH] [$MKSH]"

  258. if [ -z "$BIN" ]; then
  259.   ui_print "- Extracting files"

  260.   cd /tmp
  261.   mkdir supersu
  262.   cd supersu

  263.   unzip -o "$ZIP"
  264.   
  265.   BIN=/tmp/supersu/$ARCH
  266.   COM=/tmp/supersu/common
  267. fi

  268. ui_print "- Disabling OTA survival"
  269. chmod 0755 $BIN/chattr$PIE
  270. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/bin/su
  271. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/su
  272. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/bin/.ext/.su
  273. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/sbin/su
  274. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /vendor/sbin/su
  275. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /vendor/bin/su
  276. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /vendor/xbin/su
  277. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/daemonsu
  278. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/sugote
  279. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/sugote_mksh
  280. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/supolicy
  281. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/ku.sud
  282. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/.ku
  283. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/xbin/.su
  284. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/lib/libsupol.so
  285. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/lib64/libsupol.so
  286. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/etc/install-recovery.sh
  287. LD_LIBRARY_PATH=$SYSTEMLIB $BIN/chattr$PIE -ia /system/bin/install-recovery.sh

  288. ui_print "- Removing old files"

  289. if [ -f "/system/bin/install-recovery.sh" ]; then
  290.   if [ ! -f "/system/bin/install-recovery_original.sh" ]; then
  291.     mv /system/bin/install-recovery.sh /system/bin/install-recovery_original.sh
  292.     ch_con /system/bin/install-recovery_original.sh
  293.   fi
  294. fi
  295. if [ -f "/system/etc/install-recovery.sh" ]; then
  296.   if [ ! -f "/system/etc/install-recovery_original.sh" ]; then
  297.     mv /system/etc/install-recovery.sh /system/etc/install-recovery_original.sh
  298.     ch_con /system/etc/install-recovery_original.sh
  299.   fi
  300. fi

  301. rm -f /system/bin/su
  302. rm -f /system/xbin/su
  303. rm -f /system/sbin/su
  304. rm -f /vendor/sbin/su
  305. rm -f /vendor/bin/su
  306. rm -f /vendor/xbin/su
  307. rm -f /system/xbin/daemonsu
  308. rm -f /system/xbin/sugote
  309. rm -f /system/xbin/sugote-mksh
  310. rm -f /system/xbin/supolicy
  311. rm -f /system/xbin/ku.sud
  312. rm -f /system/xbin/.ku
  313. rm -f /system/xbin/.su
  314. rm -f /system/lib/libsupol.so
  315. rm -f /system/lib64/libsupol.so
  316. rm -f /system/bin/.ext/.su
  317. rm -f /system/bin/install-recovery.sh
  318. rm -f /system/etc/install-recovery.sh
  319. rm -f /system/etc/init.d/99SuperSUDaemon
  320. rm -f /system/etc/.installed_su_daemon
  321. rm -f /system/app/Superuser.apk
  322. rm -f /system/app/Superuser.odex
  323. rm -rf /system/app/Superuser
  324. rm -f /system/app/SuperUser.apk
  325. rm -f /system/app/SuperUser.odex
  326. rm -rf /system/app/SuperUser
  327. rm -f /system/app/superuser.apk
  328. rm -f /system/app/superuser.odex
  329. rm -rf /system/app/superuser
  330. rm -f /system/app/Supersu.apk
  331. rm -f /system/app/Supersu.odex
  332. rm -rf /system/app/Supersu
  333. rm -f /system/app/SuperSU.apk
  334. rm -f /system/app/SuperSU.odex
  335. rm -rf /system/app/SuperSU
  336. rm -f /system/app/supersu.apk
  337. rm -f /system/app/supersu.odex
  338. rm -rf /system/app/supersu
  339. rm -f /system/app/VenomSuperUser.apk
  340. rm -f /system/app/VenomSuperUser.odex
  341. rm -rf /system/app/VenomSuperUser
  342. rm -f /data/dalvik-cache/*com.noshufou.android.su*
  343. rm -f /data/dalvik-cache/*/*com.noshufou.android.su*
  344. rm -f /data/dalvik-cache/*com.koushikdutta.superuser*
  345. rm -f /data/dalvik-cache/*/*com.koushikdutta.superuser*
  346. rm -f /data/dalvik-cache/*com.mgyun.shua.su*
  347. rm -f /data/dalvik-cache/*/*com.mgyun.shua.su*
  348. rm -f /data/dalvik-cache/*com.m0narx.su*
  349. rm -f /data/dalvik-cache/*/*com.m0narx.su*
  350. rm -f /data/dalvik-cache/*com.kingroot.kinguser*
  351. rm -f /data/dalvik-cache/*/*com.kingroot.kinguser*
  352. rm -f /data/dalvik-cache/*com.kingroot.master*
  353. rm -f /data/dalvik-cache/*/*com.kingroot.master*
  354. rm -f /data/dalvik-cache/*Superuser.apk*
  355. rm -f /data/dalvik-cache/*/*Superuser.apk*
  356. rm -f /data/dalvik-cache/*SuperUser.apk*
  357. rm -f /data/dalvik-cache/*/*SuperUser.apk*
  358. rm -f /data/dalvik-cache/*superuser.apk*
  359. rm -f /data/dalvik-cache/*/*superuser.apk*
  360. rm -f /data/dalvik-cache/*VenomSuperUser.apk*
  361. rm -f /data/dalvik-cache/*/*VenomSuperUser.apk*
  362. rm -f /data/dalvik-cache/*eu.chainfire.supersu*
  363. rm -f /data/dalvik-cache/*/*eu.chainfire.supersu*
  364. rm -f /data/dalvik-cache/*Supersu.apk*
  365. rm -f /data/dalvik-cache/*/*Supersu.apk*
  366. rm -f /data/dalvik-cache/*SuperSU.apk*
  367. rm -f /data/dalvik-cache/*/*SuperSU.apk*
  368. rm -f /data/dalvik-cache/*supersu.apk*
  369. rm -f /data/dalvik-cache/*/*supersu.apk*
  370. rm -f /data/dalvik-cache/*.oat
  371. rm -rf /data/app/com.noshufou.android.su*
  372. rm -rf /data/app/com.koushikdutta.superuser*
  373. rm -rf /data/app/com.mgyun.shua.su*
  374. rm -rf /data/app/com.m0narx.su*
  375. rm -rf /data/app/com.kingroot.kinguser*
  376. rm -rf /data/app/com.kingroot.master*
  377. rm -rf /data/app/eu.chainfire.supersu-*
  378. rm -rf /data/app/eu.chainfire.supersu.apk

  379. ui_print "- Creating space"
  380. if ($APKFOLDER); then
  381.   if [ -f "/system/app/Maps/Maps.apk" ]; then
  382.     cp /system/app/Maps/Maps.apk /Maps.apk
  383.     rm /system/app/Maps/Maps.apk
  384.   fi
  385.   if [ -f "/system/app/GMS_Maps/GMS_Maps.apk" ]; then
  386.     cp /system/app/GMS_Maps/GMS_Maps.apk /GMS_Maps.apk
  387.     rm /system/app/GMS_Maps/GMS_Maps.apk
  388.   fi
  389.   if [ -f "/system/app/YouTube/YouTube.apk" ]; then
  390.     cp /system/app/YouTube/YouTube.apk /YouTube.apk
  391.     rm /system/app/YouTube/YouTube.apk
  392.   fi
  393. else
  394.   if [ -f "/system/app/Maps.apk" ]; then
  395.     cp /system/app/Maps.apk /Maps.apk
  396.     rm /system/app/Maps.apk
  397.   fi
  398.   if [ -f "/system/app/GMS_Maps.apk" ]; then
  399.     cp /system/app/GMS_Maps.apk /GMS_Maps.apk
  400.     rm /system/app/GMS_Maps.apk
  401.   fi
  402.   if [ -f "/system/app/YouTube.apk" ]; then
  403.     cp /system/app/YouTube.apk /YouTube.apk
  404.     rm /system/app/YouTube.apk
  405.   fi
  406. fi

  407. ui_print "- Placing files"

  408. mkdir /system/bin/.ext
  409. set_perm 0 0 0777 /system/bin/.ext
  410. cp_perm 0 0 $SUMOD $BIN/$SU /system/bin/.ext/.su
  411. cp_perm 0 0 $SUMOD $BIN/$SU /system/xbin/su
  412. cp_perm 0 0 0755 $BIN/$SU /system/xbin/daemonsu
  413. if ($SUGOTE); then
  414.   cp_perm 0 0 0755 $BIN/$SU /system/xbin/sugote u:object_r:zygote_exec:s0
  415.   cp_perm 0 0 0755 $MKSH /system/xbin/sugote-mksh
  416. fi
  417. if ($SUPOLICY); then
  418.   cp_perm 0 0 0755 $BIN/supolicy /system/xbin/supolicy
  419.   cp_perm 0 0 0644 $BIN/libsupol.so $SYSTEMLIB/libsupol.so
  420. fi
  421. if ($APKFOLDER); then
  422.   mkdir /system/app/SuperSU
  423.   set_perm 0 0 0755 /system/app/SuperSU
  424. fi
  425. cp_perm 0 0 0644 $COM/Superuser.apk $APKNAME
  426. cp_perm 0 0 0755 $COM/install-recovery.sh /system/etc/install-recovery.sh
  427. ln_con /system/etc/install-recovery.sh /system/bin/install-recovery.sh
  428. if ($APPPROCESS); then
  429.   rm /system/bin/app_process
  430.   ln_con /system/xbin/daemonsu /system/bin/app_process
  431.   if ($APPPROCESS64); then
  432.     if [ ! -f "/system/bin/app_process64_original" ]; then
  433.       mv /system/bin/app_process64 /system/bin/app_process64_original
  434.     else
  435.       rm /system/bin/app_process64
  436.     fi
  437.     ln_con /system/xbin/daemonsu /system/bin/app_process64
  438.     if [ ! -f "/system/bin/app_process_init" ]; then
  439.       cp_perm 0 2000 0755 /system/bin/app_process64_original /system/bin/app_process_init
  440.     fi
  441.   else
  442.     if [ ! -f "/system/bin/app_process32_original" ]; then
  443.       mv /system/bin/app_process32 /system/bin/app_process32_original
  444.     else
  445.       rm /system/bin/app_process32
  446.     fi
  447.     ln_con /system/xbin/daemonsu /system/bin/app_process32
  448.     if [ ! -f "/system/bin/app_process_init" ]; then
  449.       cp_perm 0 2000 0755 /system/bin/app_process32_original /system/bin/app_process_init
  450.     fi
  451.   fi
  452. fi
  453. cp_perm 0 0 0744 $COM/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon
  454. echo 1 > /system/etc/.installed_su_daemon
  455. set_perm 0 0 0644 /system/etc/.installed_su_daemon

  456. ui_print "- Restoring files"
  457. if ($APKFOLDER); then
  458.   if [ -f "/Maps.apk" ]; then
  459.     cp_perm 0 0 0644 /Maps.apk /system/app/Maps/Maps.apk
  460.     rm /Maps.apk
  461.   fi
  462.   if [ -f "/GMS_Maps.apk" ]; then
  463.     cp_perm 0 0 0644 /GMS_Maps.apk /system/app/GMS_Maps/GMS_Maps.apk
  464.     rm /GMS_Maps.apk
  465.   fi
  466.   if [ -f "/YouTube.apk" ]; then
  467.     cp_perm 0 0 0644 /YouTube.apk /system/app/YouTube/YouTube.apk
  468.     rm /YouTube.apk
  469.   fi
  470. else
  471.   if [ -f "/Maps.apk" ]; then
  472.     cp_perm 0 0 0644 /Maps.apk /system/app/Maps.apk
  473.     rm /Maps.apk
  474.   fi
  475.   if [ -f "/GMS_Maps.apk" ]; then
  476.     cp_perm 0 0 0644 /GMS_Maps.apk /system/app/GMS_Maps.apk
  477.     rm /GMS_Maps.apk
  478.   fi
  479.   if [ -f "/YouTube.apk" ]; then
  480.     cp_perm 0 0 0644 /YouTube.apk /system/app/YouTube.apk
  481.     rm /YouTube.apk
  482.   fi
  483. fi

  484. ui_print "- Post-installation script"
  485. rm /system/toybox
  486. rm /system/toolbox
  487. LD_LIBRARY_PATH=$SYSTEMLIB /system/xbin/su --install

  488. ui_print "- Unmounting /system and /data"
  489. umount /system
  490. umount /data

  491. ui_print "- Done !"
  492. exit 0
複製代碼

評分

參與人數 1碎鑽 +1 幫助 +1 收起 理由
asffsa4841 + 1 + 1 非常讃

查看全部評分

用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則