2014年11月21日 星期五

解決升級Android 5.0 (Lollipop)遇到的問題 (For Nexus5)

每當看到有人手機收到Lollipop的OTA通知,心中總是羨慕不知道何時可以輪到自己。就在今天早上,願望終於實現了,終於收到了OTA,卻是一連串災難的開始。

OTA下載的檔案在哪裡?


首先,遇到的第一個問題就是TWRP;是的,在上一篇[科技新知][Android] 如何Root Nexus5 (以版本號碼: KTU84P為例)中,就已經把手機的Recovery換成TWRP。

當按下重新啟動並安裝之後,重開機看到TWRP的時候就傻了,因為得要自己選擇要安裝的zip檔案。查了很久,才終於知道OTA下載的檔案都會放在/cache目錄下。當然,你得要Root才看的到。

選了該檔案安裝以為就可以順利了嗎? No no...非經一番寒徹骨、哪得梅花撲鼻香。就讓我們繼續看下去...

TWRP error flashing zip file....


關於這個問題,網路上說是因為SuperSU造成的問題,也提供解法,不過我測試倒是一直失敗。山不轉路轉,就改成手動安裝吧。


注意:按照以下方式會把手機上的資料都刪掉,操作前,請一定要先備份重要資料。

手動安裝Lollipop


首先,請先到這裡下載安裝包,MD5 checksum為761667f1ddaf4e38d4792136df4ab927,點選Link就開始下載囉,檔案名稱為hammerhead-lrx21o-factory-01315e08.tgz

下載完成後,請按照以下步驟

  1. 將檔案解壓縮至adb以及fastboot的相同目錄,預設應該是{Android_SKO}/platform-tools
  2. 手機開機到bootloader (先關機後,同時按Volume - (減少)和電源鍵)
  3. double-click flash_all.bat即可

當然世界沒那麼美好,此時有可能會遇到以下的錯誤訊息
target reported max download size of 1073741824 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
failed to allocate 1005154516 bytes
error: update package missing system.img


解決"failed to allocate 1005154516 bytes"


還好,天無絕人之路,請將目錄下的image-hammerhead-lrx21o.zip,解壓縮在相同目錄,裡面應該包括:android-info.txt、boot.img、cache.img、recovery.img、userdata.img和system.img。

之後,修改flash_all.bat,原始內容如下:
@ECHO OFF
:: Copyright 2012 The Android Open Source Project
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::      http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot flash bootloader bootloader-hammerhead-hhz12d.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.21.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot -w update image-hammerhead-lrx21o.zip

echo Press any key to exit...
pause >nul
exit

修改如下:
@ECHO OFF
:: Copyright 2012 The Android Open Source Project
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::      http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot flash bootloader bootloader-hammerhead-hhz12d.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.21.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash system system.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash userdata userdata.img
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot erase cache
fastboot flash cache cache.img
fastboot reboot 

echo Press any key to exit...
pause >nul
exit

最後,再次雙擊flash_all.bat,應該就搞定啦。接著就可以好好享用棒棒糖啦。

張貼留言