벽람항로 매크로 만들어보려했으나 겜이 취향이 아니여서 조금 찾아본 정보 공유합니다
adb.exe shell "grep adid_key /data/data/com.google.android.gms/shared_prefs/adid_settings.xml"
광고아이디 가져오는 명령어
adb.exe shell "sed -i 's/[이전]/[변경]/g' /data/data/com.google.android.gms/shared_prefs/adid_settings.xml"
광고아이디 변경하는 명령어(ex 123412 -> 123512 [s/412/512/g])
adb.exe shell getevent
adb 내 일어나는 이벤트 기록
adb.exe shell input swipe x1 y1 x2 y2 duration
x1,y1 에서 x2,y2로 드래그
adb.exe shell input text 'bulabula'
텍스트 bulabula 입력
nox의 경우 sed 기본명령어가 없을거니까 busybox sed 이렇게 사용하세요
이거면 대충 매크로 구성하실수있을거고
그리고 adb 스크린샷 찍고, 스크린샷을 문자열로 추출한것을 불러와 c# 바이트배열에 담기
private static byte[] repair(byte[] encoded)
{
System.IO.MemoryStream baos = new System.IO.MemoryStream();
for (int i = 0; i < encoded.Length; i++)
{
if ((i + 2) < encoded.Length && encoded[i] == 0x0d && encoded[i + 1] == 0x0d && encoded[i + 2] == 0x0a)
{
//continue;
i++;
}
else
{
baos.WriteByte(encoded[i]);
}
}
try
{
baos.Close();
}
catch (System.IO.IOException)
{
}
return baos.ToArray();
}
var start = new System.Diagnostics.ProcessStartInfo()
{
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardOutput = true,
FileName = @adb_path,
Arguments = string.Format("-s {0} shell screencap -p", adb_deviceinfo)
};
pro.StartInfo = start;
pro.Start();
var stream = pro.StandardOutput.BaseStream;
List<byte> data = new List<byte>(1024);
int read = 0;
byte[] imgdata;
do
{
byte[] buf = new byte[1024];
read = stream.Read(buf, 0, buf.Length);
for (int i = 0; i < read; i++)
{
data.Add(buf[i]);
}
} while (read > 0);
if (data.Count == 0)
{
Console.WriteLine("fail");
return null;
}
imgdata = repair(data.ToArray());
마지막으로 imgdata 배열 을 비트맵으로 변환해서 사용하시면 됩니다.