|
@ -97,7 +97,7 @@ proc listDir(filename : string) : seq[FileStat] = |
|
|
let fileNameLen = dirent[12..15].rollBytes.int |
|
|
let fileNameLen = dirent[12..15].rollBytes.int |
|
|
let direntFileName = socket.recvExactly(filenameLen) |
|
|
let direntFileName = socket.recvExactly(filenameLen) |
|
|
|
|
|
|
|
|
dirents = dirents & FileStat(androidFileName: direntFileName, |
|
|
dirents &= FileStat(androidFileName: direntFileName, |
|
|
androidFileMode: fileMode, |
|
|
androidFileMode: fileMode, |
|
|
androidFileSize: fileSize, |
|
|
androidFileSize: fileSize, |
|
|
androidFileModified: fileCreated) |
|
|
androidFileModified: fileCreated) |
|
@ -177,7 +177,7 @@ proc statFile(filename : string) : Option[FileStat] = |
|
|
else: |
|
|
else: |
|
|
none(FileStat) |
|
|
none(FileStat) |
|
|
|
|
|
|
|
|
proc sendFile(buf : string, filename : string) : bool = |
|
|
proc adbSend(buf : string, filename : string) : bool = |
|
|
let stat = filename.statFile |
|
|
let stat = filename.statFile |
|
|
|
|
|
|
|
|
if stat.isSome: |
|
|
if stat.isSome: |
|
@ -252,24 +252,7 @@ proc rebootPhone() : Option[string] = |
|
|
proc listCerts() : string = |
|
|
proc listCerts() : string = |
|
|
makeMsg("shell:ls /etc/*").runCommand.parseAdb.get |
|
|
makeMsg("shell:ls /etc/*").runCommand.parseAdb.get |
|
|
|
|
|
|
|
|
discard execCmd("adb start-server") |
|
|
proc devices() : Option[string] = |
|
|
|
|
|
makeMsg("host:version").runCommand.parseAdb |
|
|
#var devices = makeMsg("host:version").runCommand.parseAdb |
|
|
|
|
|
|
|
|
|
|
|
#if devices.isNone: |
|
|
|
|
|
#quit(1) |
|
|
|
|
|
#else: |
|
|
|
|
|
#echo devices.get() |
|
|
|
|
|
|
|
|
|
|
|
#stdout.write adbPull("/etc/hosts").repr |
|
|
|
|
|
|
|
|
|
|
|
#echo listDir("/etc").map(proc(f: FileStat) : string = f.androidFileName) |
|
|
|
|
|
|
|
|
|
|
|
echo sendFile("YOLO\n", "/storage/7AFD-17E3/testmyshit") |
|
|
discard execCmd("adb start-server") |
|
|
|
|
|
|
|
|
#discard rebootPhone() |
|
|
|
|
|
|
|
|
|
|
|
#echo listCerts() |
|
|
|
|
|
|
|
|
|
|
|
#echo makeMsg("shell:uname -a").runCommand.parseAdb.get |
|
|
|
|
|
#echo makeMsg("shell:ls /system/etc/security/cacerts/*").runCommand.parseAdb.get |
|
|
|
|
|