วันพุธที่ 9 กันยายน พ.ศ. 2558

adb command 3 iq5.3 mod2g capture-the-screen



http://stackoverflow.com/questions/13984017/how-to-capture-the-screen-as-fast-as-possible-through-adb
เครดิตจากเวป

มาเพิ่ม Internal storageให้เป็น 2GB กันครับ  iQ 5.3
http://droidfriend.com/forums/index.php?topic=2712.0



Calling Android services from ADB shell
Many android automation recipes contain references to the "service call" command: 
# service
Usage: service [-h|-?]
    service list
    service check SERVICE
    service call SERVICE CODE [i32 INT | s16 STR] ...
Options:
  i32: Write the integer INT into the send parcel.
  s16: Write the UTF-16 string STR into the send parcel.


The command is indeed very useful. But the problem is that the calling "CODES" are android version specific and recipes often get out dated sometimes even after a minor version update. I am frequently being asked to update those codes for my recipes. I decided to share a small bash script I have been using to look up service codes for specific Android versions: 
#!/bin/bash
ADBShell () { adb ${2+-s }$2 shell "$1" | tr -d '\r'
}
GetAndroidVersion () {
    local ALL_TAGS=$(wget -qO - "$GOOGLE_SOURCE/$REPO/+refs/tags/?format=text" | \
    tr -d '^{}' | cut -d/ -f3 | sort -u | grep -vE -- '-(cts|sdk)-' | grep -v "_r0")
    TAG=${1:-$(ADBShell 'getprop ro.build.version.release')}
    echo -e "ANDROID_SERIAL=$ANDROID_SERIAL\nro.build.version.release=$TAG" 1>&2
    TAG=$(echo "$ALL_TAGS" | grep -- "android-${TAG//./\.}" | head -n 1)
    echo -e "TAG=$TAG" 1>&2
    [ "-$TAG" != "-"  ] && return 0
    echo -e "TAG not valid!\n\nList of valid tags: "$ALL_TAGS 1>&2
    exit 1
}
GetServicePackageName () {
    SERVICE_PACKAGE=$(ADBShell 'service list' | grep "\s$1: \[" | head -n 1 | tr '[]' '""' | cut -d\" -f2)
    echo -e "SERVICE=$1\nSERVICE_PACKAGE=$SERVICE_PACKAGE" 1>&2
}
GetGoogleSourceFile () {
    #echo -e "\t\E[31mdownloading\E[0m $GOOGLE_SOURCE/$REPO/+/$1/$2" 1>&2
    [ "-$1" == "-" ] && return 1
    wget -qO - "$GOOGLE_SOURCE/$REPO/+/$1/$2?format=text" | base64 -d
}
GetAllServices () {
    ALL_SERVICES=$(GetGoogleSourceFile "$TAG" "Android.mk" | tr -d ' \\\t' | grep "\.aidl$" | \
    sort -u | grep -v "^gen:")
}
ParseServiceAIDL () {
    GetGoogleSourceFile "$TAG" $(echo "$ALL_SERVICES" | grep "${SERVICE_PACKAGE//.//}\.aidl$" | head -n 1) | \
    tr -d '\n\r' | gcc -P -E - | tr '{};' '\n\n\n' | grep -v ^$ | sed -e '1,/interface\s/ d' | cat -n
}
AbortIfExecutableMissing () {
    BIN=($@)
    MISSINGBIN=$(for B in ${BIN[@]}; do [ "$(which $B 2>/dev/null)-" == "-" ] && echo $B; done)
    [ "${MISSINGBIN}-" == "-" ] && return 0
    echo -e "Can't find the following executables: "$MISSINGBIN
    exit 1
}
AbortIfExecutableMissing "adb wget gcc tr sed awk cut grep basename dirname head base64"
GOOGLE_SOURCE="https://android.googlesource.com"
REPO="platform/frameworks/base"
GetAndroidVersion
GetAllServices
GetServicePackageName $1
ParseServiceAIDL
exit 0

This script checks the Android version of your phone and the java package name of the service you specified as a parameter. Then the script downloads the service AIDL file for your phone's Android version from https://android.googlesource.com and parses it. So obviously it only works for the standard Android services it can find the source code for.

This is how I usually run the script. For example let's find out the calling code for "getCallState()" method of the "phone" service. I usually have multiple phones connected to my system so I need to specify which one to use by setting the ANDROID_SERIAL variable first. If you have just a single phone connected you can skip that part: 
~$ ANDROID_SERIAL=XXXXXXXXXX ./get_android_service_call_numbers.sh phone | grep getCallState
ANDROID_SERIAL=XXXXXXXXXX
ro.build.version.release=4.4.4
TAG=android-4.4.4_r1
SERVICE=phone
SERVICE_PACKAGE=com.android.internal.telephony.ITelephony
    32 int getCallState()


10|shell@android:/ $ dumsys iphonesubinfo2
dumsys iphonesubinfo2
/system/bin/sh: dumsys: not found
127|shell@android:/ $ dumsys iphonesubinfo
dumsys iphonesubinfo
/system/bin/sh: dumsys: not found
127|shell@android:/ $ dumpsys iphonesubinfo2
dumpsys iphonesubinfo2
Phone Subscriber Info:
  Phone Type = GSM
  Device ID = 866389014717292



D:\mobile>adb shell am start http://www.kapook.com
Starting: Intent { act=android.intent.action.VIEW dat=http://www.kapook.com }

D:\mobile>adb shell am force-stop com.android.chrome

D:\mobile>adb shell am start -a android.intent.action.MAIN -c android.intent.cat
egory.HOME

am start -a android.intent.action.VIEW "sms:numberhere" -e "sms_body" "hello"


svc wifi disable

1 ความคิดเห็น:

  1. balance wheel, with miu miu replica handbags 48 hours of power reserve, vibration frequency of 21600bph. All the plywood are decorated with Geneva stripes, appreciate its desert is definitely spoiled for choice, only when wearing replica rolex discount Patek Philippe, you can understand why you just take care of it for the next generation.This special watch is replica breitling watches sale very easy to.

    ตอบลบ