芙烈達工具

public class FridaUtils
extends Object implements AutoCloseable

java.lang.Object
com.android.sts.common.FridaUtils


AutoCloseable 下載 frida 和腳本並將其推送到裝置並在完成後進行清理

概括

公共方法

void close ()
static FridaUtils withFrida (ITestDevice device, IBuildInfo buildInfo)

找出我們需要的 Frida 二進位文件,並在需要時下載它。

ByteArrayOutputStream withFridaScript (String fridaJsScriptContent, int pid)

在給定進程上傳並執行 frida 腳本。

公共方法

關閉

public void close ()

投擲
DeviceNotAvailableException
TimeoutException

與芙烈達

public static FridaUtils withFrida (ITestDevice device, 
                IBuildInfo buildInfo)

找出我們需要的 Frida 二進位文件,並在需要時下載它。

參數
device ITestDevice :使用 Frida 的設備

buildInfo IBuildInfo :測試設備建置資訊(來自 test.getBuild())

退貨
FridaUtils AutoCloseable FridaUtils 對象,可用於執行 Frida 腳本

投擲
DeviceNotAvailableException
UnsupportedOperationException
IOException

與FridaScript

public ByteArrayOutputStream withFridaScript (String fridaJsScriptContent, 
                int pid)

在給定進程上傳並執行 frida 腳本。

參數
fridaJsScriptContent String :Frida JS 腳本的內容。注意:這不是檔名

pid int : 附加 Frida 的進程的 PID

退貨
ByteArrayOutputStream包含 frida 指令的 stdout 和 stderr 的 ByteArrayOutputStream

投擲
DeviceNotAvailableException
FileNotFoundException
IOException
TimeoutException
InterruptedException