frida调用
imei.js
setImmediate(function() { //prevent timeout Java.perform(function(){ console.log("start hook...."); Java.choose("com.sprd.vsimservice.VSIMInterfaceService", { onMatch: function (instance) { console.log("VSIMInterfaceService Found."); var imei = instance.sendATCmdNative(1, "AT+CGSN"); console.log("imei=" + imei); }, onComplete: function () { } }); }); });
工程模式中提供了下发at命令的接口,通过IATUtils.java中的
sendATCmd(String cmd, String serverName)可以实现。
读IMEI的AT命令
IATUtils.sendATCmd(“AT+SPIMEI?”, “atchannel0”);
IATUtils.sendATCmd(“AT+SPIMEI?”, “atchannel1”);
写
IATUtils.sendATCmd(‘AT+SPIMEI=0,”353957100590169″‘, “atchannel”);
IATUtils.sendATCmd(‘AT+SPIMEI=1,”353957100590169″‘, “atchannel”);