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