Sunday, July 6, 2014

Hướng dẫn flash về ROM Stock đơn giản

Đầu tiên : Tải rom Stock 4.1.2 về : https://www.androidfilehost.com/?fid=23212708291675843
Sau đó đổi tên file thành : PN07IMG.zip cop vào thẻ nhớ ngoài
Vào H-Boot bằng cách : Giữ phím nguồn và phím volume- đến khi nào nó hiện ra bảng H-Boot tự nó sẽ quét file trong thẻ nhớ nếu đã đúng tên và file nó sẽ tự động chạy về rom Stock cho mình. Quá trình chạy kiểm tra file 1 lượt xong quá trình kiểm tra nó sẽ hỏi có muốn updating ko thì ấn phím volume+ để chấp nhận. máy sẽ khởi động lại và tự vào HBoot chạy nốt , ra uông cốc nước trà quay lại máy đã xong.


Lưu ý: Number Software 2.15.970 phải làm theo cách dưới đây để về 4.1.2 :
Chuẩn bị
HTL22 2.15.970.1 run_root_shell (http://www.androidfilehost.com/?fid=23212708291675550)
HTL22 2.15.970.1 OTA firmware.zip (http://www.androidfilehost.com/?fid=23125694133306288)
HTL22 1.05.970.2 RUU (http://www.androidfilehost.com/?fid=23212708291675843)
HTL22 2.15.970.1 FakeFeeback app của fio1 (http://t.co/SIiFXHA6So)

Java Development Kit JDK: cài xong nhiều lúc phải thêm path vào environment (nếu windows) hoặc thêm đường dẫn vào $PATH của Linux. Test bằng lênh: jdb

Cách downgrade:
Gõ lệnh ADB:

adb install -r Fake.apk
adb shell am start -D -a android.intent.action.MAIN -n com.htc.feedback/android.app.Activity
Sau đó:
adb jdwp
XXXX
adb forward tcp:8600 jdwp:XXXX
XXXX là process id của jdwp (chuỗi số)

Sau đó mở 1 shell khác và dùng jdb (trong Java development kid)
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8600
> threads
グループsystem:
  (java.lang.Thread)0xc1412f4190 <8> FinalizerWatchdogDaemonは条件を待機中です
  (java.lang.Thread)0xc1412f3fe0 <7> FinalizerDaemon        は条件を待機中です
  (java.lang.Thread)0xc1412f3e78 <6> ReferenceQueueDaemon  は条件を待機中です
  (java.lang.Thread)0xc1412f3d88 <5> Compiler              は条件を待機中です
  (java.lang.Thread)0xc1412f2440 <3> Signal Catcher        は条件を待機中です
  (java.lang.Thread)0xc1412f2360 <2> GC                    は条件を待機中です
グループmain:
  (java.lang.Thread)0xc140eeac10 <1> main                  は実行中です
  (java.lang.Thread)0xc1412f7498 <10> Binder_2              は実行中です
  (java.lang.Thread)0xc1412f72b8 <9> Binder_1              は実行中です
quan trọng nhất là cái địa chỉ của thread main (dòng thứ 3 từ dưới lên). Ở đây là0xc140eeac10 (lưu ý là mỗi máy một khác)

Trong cửa sổ JDB này gõ lệnh (nhớ thay cho đúng địa chỉ)
> thread 0xc140eeac10
Nó sẽ hiện 1main[1],gõ:
<1> main[1] stop in android.os.MessageQueue.next()
Quay về cửa sổ ADB, gõ lệnh
adb shell am start --activity-clear-task -a android.intent.action.MAIN -n com.htc.feedback/android.app.Activity
Bên JDB, gõ thêm lệnh (dòng trên thôi)
<1> main[1] print java.lang.Runtime.getRuntime()
java.lang.Runtime.getRuntime() = "java.lang.Runtime@4193d910"
Chmod file /dev/msm_acdb cho run_root_shell
<1> main[1] print java.lang.Runtime.getRuntime().exec("chmod 666 /dev/msm_acdb")
Quay lại bên ADB, đánh lệnh:
adb shell ls -l /dev/msm_acdb
crw-rw-rw- system  audio    10,  52 2013-11-07 22:25 msm_acdb
Để ý mục đầu của msm_acdb phải là crw-rw-rw- thì là okay

Bây giờ copy run_root_shell để temproot:
adb push run_root_shell /data/local/tmp/
adb shell chmod 755 /data/local/tmp/run_root_shell
adb shell
$ ./data/local/tmp/run_root_shell
Sau đó thực hiện dòng lệnh
# dd if=/dev/block/mmcblk0p19 of=/sdcard/p19
# exit
adb pull /sdcard/p19
Dùng 1 thằng binary editor (vi du như: http://frhed.sourceforge.net/en/) sửa file p19 này:
[​IMG]

Tại gần địa chỉ 0x000000A0 sửa 2.15.970.1 thành 1.0.000.1 (lưu ý là chỉ thay số thôi, tuyệt đối ko chèn thêm ký tự nào khác).

Thành như thế này:
[​IMG]

Sau đó push qua ADB và reboot:
adb push p19mod /sdcard/
adb shell
$ ./data/local/tmp/run_root_shell
# dd if=/sdcard/p19mod of=/dev/block/mmcblk0p19
# reboot bootloader
Máy đang bị S-ON
Nếu máy đang S-ON thì sẽ bị lỗi nếu flash RUU ở trên trong bootloader (lỗi HBOOT). Để đánh lừa quá trình check này thì cần dùng file firmware.zip dính kèm ở trong OTA file (giải nén ra là thấy).
Flash file này qua RUU trước:
fastboot oem rebootRUU
fastboot flash zip firmware.zip
sending 'zip' (40429 KB)...
OKAY [  2.918s]
writing 'zip'...
(bootloader) adopting the signature contained in this image...
(bootloader) signature checking...
(bootloader) zip header checking...
(bootloader) zip info parsing...
(bootloader) checking model ID...
(bootloader) checking custom ID...
(bootloader) checking main version...
(bootloader) checking hboot version...
(bootloader) start image[hboot] unzipping for pre-update check...
(bootloader) start image[hboot] flushing...
(bootloader) signature checking...
(bootloader) [RUU]WP,hboot,0
(bootloader) [RUU]WP,hboot,99
(bootloader) [RUU]WP,hboot,100
(bootloader) ...... Successful
FAILED (remote: 90 hboot pre-update! please flush image again immediately)
finished. total time: 12.663s
KHOAN KHÔNG KHỞI ĐỘNG. Lúc này có thể flash ROM được:
fastboot flash zip rom.zip
 
sending 'zip' (863212 KB)...
OKAY [ 30.130s]
writing 'zip'...
(bootloader) adopting the signature contained in this image...
(bootloader) signature checking...
(bootloader) rom parsing start ...
(bootloader) rom parsing finish ...
(bootloader) zip header checking...
(bootloader) zip info parsing...
(bootloader) checking model ID...
(bootloader) checking custom ID...
(bootloader) checking main version...
(bootloader) checking hboot version...
(bootloader) start image[boot] unzipping & flushing...
(bootloader) [RUU]UZ,boot,0
(bootloader) [RUU]UZ,boot,12
(bootloader) [RUU]UZ,boot,22
(bootloader) [RUU]UZ,boot,35
......略
(bootloader) ...... Successful
OKAY [369.387s]
finished. total time: 399.517s
 
fastboot reboot
Hoàn tất downgrade

Nguồn: 
http://choimobile.vn/threads/htc-j-one-htl22-update-rom-unlock-bootloader-s-off-recovery.22714/#post-412153
http://www.tinhte.vn/threads/update-htc-j-one-htl22-htc-one-japan-s-off-unlock-bootloader-root-unlock-sim-rom-cook.2153149/page-15

0 comments :

Post a Comment