This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# android上でパケットキャプチャ | |
# 参考「Gather packets from your Android without ARP spoofing…」 | |
# http://strazzere.com/blog/?tag=tcpdump | |
adb shell tcpdump -vv -s 0 -w /sdcard/output.cap | |
* tcpdump manページ | |
http://www.tcpdump.org/tcpdump_man.html | |
* iwコマンドで80211関連情報の取得 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# [概要] | |
# adb logcatを繰り返すスクリプト | |
# | |
# [使い方] | |
# 1. adb-choice-device.shと同じディレクトリに配置して下さい | |
# 2. ./Loop_adb_logcat.sh <ログファイルパス> | |
# 3. どの端末でlogcatを実行するか聞かれるので、指定して下さい | |
# | |
# [特徴] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# このスクリプトは他のスクリプトから使われます | |
# | |
# 接続するデバイスのシリアル番号を取得するスクリプト | |
# このスクリプトの標準出力の最後に、選択したデバイスのシリアル番号が出力されます | |
# 使う側は、最後の出力を使ってください | |
BUFIFS=$IFS | |
IFS= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# device上の/systemを書き込み可で再マウントする | |
# 方法1:adbコマンド | |
# | |
adb root # userdebugでは必要、engでは不要 | |
adb remount | |
# 方法2:端末上のシェルでmountコマンド | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 標準出力をlogcatにリダイレクトする | |
adb shell stop | |
adb shell setprop log.redirect-stdio true | |
adb shell start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gdbでデバッグ | |
# 1.セットアップ | |
cd mydroid | |
source build/envsetup.sh | |
chooseproduct <product> // or lunch XX | |
setpaths | |
# 2.端末上でデバッグするプロセスを起動 | |
# 例として、ブラウザ(com.android.browser)を起動する |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* コンパイラ:GCC 4.4.6 | |
* だいぶ適当なので、デバッグ用に | |
*/ | |
void OutputToFile(const char* msg) { | |
if (msg != NULL) { | |
FILE* file = fopen("/sdcard/output.log", "a"); | |
if (file != NULL) { | |
fprintf(file, msg); | |
fclose(file); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 適当なので、デバッグ用に | |
*/ | |
private static String dump(byte[] buf) { | |
String str = new String(); | |
for (int i = 0; i < buf.length; i++) { | |
str = str + Integer.toHexString(buf[i] & 0xff); | |
} | |
return str; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
public class ConfigFileParser { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 動作確認:Android 2.2系 OK | |
* 2.3系 未確認 | |
* 4.0系 未確認 | |
* | |
* TODO | |
* インストール完了待ちとアンインストール完了待ちのタイムアウトが | |
* "infinite"なので、時間で区切りたい。 | |
*/ |
OlderNewer