Monday, December 12, 2016

Android Debug Bridge adb H®¡‡ÈÝng d‡¼Çn s‡È? d‡È´ng cÌÁc l‡Èành c®Á b‡¼£n

Android Debug Bridge adb H®¡‡ÈÝng d‡¼Çn s‡È? d‡È´ng cÌÁc l‡Èành c®Á b‡¼£n


1. K?t n?i: cˆi ??y ?? Drive cho m‡y t’nh (t?i ph?n m?m c‡i adb driver cho t?t c? c‡c d˜ng m‡y t?i ?‰y)
- T?i adb tools: http://www.fshare.vn/file/JXU5TIUE7IPS
- K?t n?i ?i?n tho?i v?i m‡y t’nh, b?t ch? ?? usb debug khi m‡y c˜n b?t ???c, khi m‡y kh™ng kh?i ??ng ???c th“ vˆo recovery.
- N?u k?t n?i b?ng Charge only, ph?i ch?n Usb Debugging trong Developers options.
- Ch?y ADB_Tools



- Ki?m tra xem m‡y ?‹ k?t n?i ???c ch?a b?ng l?nh

adb devices


Tr??c khi ??c ti?p, c?n chœ ?
- Khi ch?nh s?a nh?ng file h? th?ng, c?n remount l?i v?i quy?n read-write (ph?n 3)
- Khi g› ???ng d?n, trong m?i tr??ng h?p t?t nh?t lu™n ph‰n bi?t ch? hoa/th??ng, k? c? ???ng d?n trong Windows.
- N?u trong ???ng d?n c— d?u "c‡ch" (space) th“ ???ng d?n ph?i ?? trong ngo?c kŽp, v’ d?: D:moda.apk (ok); D: om moda.apk (kh™ng ???c); "D: om moda.apk" (ok)
- C— th? kŽo th? file vˆo c?a s? Command Prompt ?? l?y ???ng d?n c?a file ?— lu™n.
- Trong ???ng d?n ??n file ho?c folder, c— th? dng d?u sao "*" ?? ??i di?n cho m?t chu?i k? t? b?t k?, d?u h?i ch?m "?" ?? ??i di?n cho m?t k? t? b?t k?. V’ d? *.apk lˆ ??i di?n cho t?t c? nh?ng file c— ?u™i lˆ .apk. ?i?u nˆy c?n thi?t khi thao t‡c v?i nhi?u file (n?u ch?a r› c— th? xu?ng ph?n 4 ??c v’ d?).
2. L?nh c? b?n
  • Copy file (folder) t? m‡y t’nh vˆo ?i?n tho?i: v’ d? file SystemUI.apk trong th? m?c "D: om mod" vˆo /system/app
adb push "D: om modSystemUI.apk" /system/app

  • L?y file (folder) t? ?i?n tho?i ra m‡y t’nh: v’ d? SystemUI.apk t? /system/app ra D: om mod
adb pull /system/app/SystemUI.apk "D: om mod"

Cˆi file apk tr?c ti?p vˆo ?i?n tho?i: v’ d? cˆi RootExplorer.apk

adb install D:appRootExplorer.apk

N?u trong m‡y c— cˆi RootExplorer r?i mˆ mu?n cˆi ? th“

adb install -r D:appRootExplorer.apk

Cˆi vˆo th? nh? thay v“ b? nh? trong

adb install -s D:appRootExplorer.apk

L?y logcat: v“ lˆ h??ng d?n c? b?n nn m“nh ch? h??ng d?n l?y m?t ki?u. V’ d?: l?y logcat r?i l?u ra file a.txt cng th? m?c ch?a adb

adb logcat > a.txt[.CODE]
G› l?nh xong ??i kho?ng 5s r?i ?n Ctrl + C ?? k?t thœc.
[/LIST][LIST][*]Kh?i ??ng l?i:
[/LIST]
- B“nh th??ng
[CODE]adb reboot

  • - Kh?i ??ng l?i vˆo bootloader
    M‹:
    adb reboot bootloader
    - Kh?i ??ng l?i vˆo recovery
    M‹:
    adb reboot recovery
    - Kh?i ??ng l?i vˆo download mode
    M‹:
    adb reboot download
    3. adb shell: th?c hi?n m?t s? l?nh c? b?n c?a linux
    Vˆo shell:
    M‹:
    adb shell[CODE]
    M?i l?nh d??i ?‰y m“nh n—i ch? ch?y ???c khi b?n ?‹ vˆo shell.
    Chœ ?: m?i l?nh trong shell c— th? ???c dng nhanh t? adb:
    [CODE]adb shell [l?nh_shell][CODE][LIST][*]Di chuy?n ??n th? m?c: v’ d? ??n /system/app
    [CODE]cd /system/app
  • Danh s‡ch file trong th? m?c hi?n hˆnh: v’ d? c‡c file trong /system/app
    M‹:
    ls /system/app
  • Quy?n root, ?? ch?nh s?a h? th?ng, nh? m?y v’ d? d??i mu?n s?a g“ trong /system ??u ph?i dng l?nh nˆy tr??c
    M‹:
    su
  • Mount v?i quy?n read-write: khi mu?n thay ??i g“ trong h? th?ng ph?i dng l?nh nˆy tr??c
    M‹:
    mount -o remount,rw /system
  • Copy: v’ d? /sdcard/a.apk mu?n copy sang /system/app
    M‹:
    cp /sdcard/a.apk /system/app
    N?u mu?n copy v?n file ??y s‡ng /system/app nh?ng ??i tn lu™n thˆnh b.apk
    M‹:
    cp /sdcard/a.apk /system/app/b.apk
  • Move: v’ d? t? /sdcard/a.apk ra /sdcard/external_sd/
    M‹:
    mv /sdcard/a.apk /sdcard/external_sd/
    N?u mu?n move ??i tn lu™n
    M‹:
    mv /sdcard/a.apk /sdcard/external_sd/b.apk
  • Rename: v’ d? /system/app/a.apk sang /system/app/b.apk
    M‹:
    mv /system/app/a.apk /system/app/b.apk
  • Xo‡: v’ d? xo‡ /system/app/a.apk
    M‹:
    rm /system/app/a.apk
    X—a t?t c? c‡c th? trong th? m?c system ko c?n bi?t c— g“ bn trong:
    M‹:
    rm -r /system/
  • T?o th? m?c: v’ d? t?o th? m?c catlog trong /data/
    M‹:
    mkdir data/catlog
  • G? b? m?t ch??ng tr“nh ng??i dng cˆi ??t vˆo: ??n gi?n ch? c?n xo‡ file t??ng ?ng trong /data/app. Nn k?t h?p v?i l?nh ls ?? xem danh s‡ch file
    M‹:
    rm /data/app/UserApp.apk
  • Ch?nh permission: v’ d? /system/app/SystemUI.apk sang 644 (rw-r-r)
    M‹:
    chmod 644 /system/app/SystemUI.apk
  • Tho‡t: t? root ra shell ho?c t? shell ra adb
    M‹:
    exit
4. V’ d? chung:
  • Copy ? file D:modSecPhone.apk t? m‡y t’nh vˆo ?i?n tho?i: