赞
踩
package com.jniunidbg.part7;
import com.github.unidbg.AndroidEmulator;
import com.github.unidbg.Module;
import com.github.unidbg.linux.android.AndroidEmulatorBuilder;
import com.github.unidbg.linux.android.AndroidResolver;
import com.github.unidbg.linux.android.dvm.*;
import com.github.unidbg.linux.android.dvm.api.SystemService;
import com.github.unidbg.memory.Memory;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.UUID;
public class DianPing extends AbstractJni {
private final AndroidEmulator emulator;
private final VM vm;
private final Module module;
private DvmObject SIUACollector;
public FileInputStream fileInputStream;
public InputStreamReader inputStreamReader;
public BufferedReader bufferedReader;
private SimpleDateFormat simpleDateFormat;
DianPing() {
// 创建模拟器实例
emulator = AndroidEmulatorBuilder.for32Bit().setRootDir(new File("target/rootfs")).build();
// 模拟器的内存操作接口
final Memory memory = emulator.getMemory();
// 设置系统类库解析
memory.setLibraryResolver(new AndroidResolver(23));
// 创建Android虚拟机
vm = emulator.createDalvikVM(new File("unidbg-android/src/test/resources/lession2/part7/dazhongdianping.apk"));
vm.setJni(this);
vm.setVerbose(true);
DalvikModule dm = vm.loadLibrary("mtguard", true);
// 加载好的 libhookinunidbg.so对应为一个模块
module = dm.getModule();
// 执行JNIOnLoad(如果有的话)
dm.callJNI_OnLoad(emulator);
SIUACollector = vm.resolveClass("com/meituan/android/common/mtguard/NBridge$SIUACollector").newObject(null);
}
public static void main(String[] args) {
DianPing dp = new DianPing();
System.out.println("call getHWProperty");
dp.getHWProperty();
System.out.println("call getHWStatus");
dp.getHWStatus();
System.out.println("call getHWEquipmentInfo");
dp.getHWEquipmentInfo();
System.out.println("call getExternalEquipmentInfo");
dp.getExternalEquipmentInfo();
System.out.println("call getUserAction");
dp.getUserAction();
System.out.println("call getEnvironmentInfo");
dp.getEnvironmentInfo();
System.out.println("call getEnvironmentInfoExtra");
dp.getEnvironmentInfoExtra();
System.out.println("call getPlatformInfo");
dp.getPlatformInfo();
System.out.println("call getLocationInfo");
dp.getLocationInfo();
System.out.println("call startCollection");
String result = dp.startCollection();
System.out.println(result);
}
public String getHWProperty(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getHWProperty()Ljava/lang/String;").getValue();
System.out.println("getHWProperty:"+ret);
return ret;
}
public String getHWStatus(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getHWStatus()Ljava/lang/String;").getValue();
System.out.println("getHWStatus:"+ret);
return ret;
}
public String getHWEquipmentInfo(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getHWEquipmentInfo()Ljava/lang/String;").getValue();
System.out.println("getHWEquipmentInfo:"+ret);
return ret;
}
public String getExternalEquipmentInfo(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getExternalEquipmentInfo()Ljava/lang/String;").getValue();
System.out.println("getExternalEquipmentInfo:"+ret);
return ret;
}
public String getUserAction(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getUserAction()Ljava/lang/String;").getValue();
System.out.println("getUserAction:"+ret);
return ret;
}
public String getEnvironmentInfo(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getEnvironmentInfo()Ljava/lang/String;").getValue();
System.out.println("getEnvironmentInfo:"+ret);
emulator.set("getEnvironmentInfo", ret);
return ret;
}
public String getEnvironmentInfoExtra(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getEnvironmentInfoExtra()Ljava/lang/String;").getValue();
System.out.println("getEnvironmentInfoExtra:"+ret);
return ret;
}
public String getPlatformInfo(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getPlatformInfo()Ljava/lang/String;").getValue();
System.out.println("getPlatformInfo:"+ret);
return ret;
}
public String getLocationInfo(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "getLocationInfo()Ljava/lang/String;").getValue();
System.out.println("getLocationInfo:"+ret);
return ret;
}
public String startCollection(){
String ret = (String) SIUACollector.callJniMethodObject(emulator, "startCollection()Ljava/lang/String;").getValue();
System.out.println("startCollection:"+ret);
return ret;
}
@Override
public DvmObject<?> getObjectField(BaseVM vm, DvmObject<?> dvmObject, String signature) {
switch (signature){
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->mContext:Landroid/content/Context;":{
return vm.resolveClass("android/content/Context").newObject(null);
}
case "android/content/res/Configuration->locale:Ljava/util/Locale;":{
return vm.resolveClass("java/util/Locale").newObject(Locale.getDefault());
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->batteryHelper:Lcom/meituan/android/common/dfingerprint/collection/utils/BatteryHelper;":{
return vm.resolveClass("com/meituan/android/common/dfingerprint/collection/utils/BatteryHelper").newObject(null);
}
}
return super.getObjectField(vm, dvmObject, signature);
}
@Override
public DvmObject<?> allocObject(BaseVM vm, DvmClass dvmClass, String signature) {
switch (signature){
case "java/lang/StringBuilder->allocObject":{
return dvmClass.newObject(new StringBuilder());
}
case "java/io/File->allocObject":{
return dvmClass.newObject(null);
}
case "java/io/BufferedReader->allocObject":{
return dvmClass.newObject(null);
}
case "java/io/InputStreamReader->allocObject":{
return dvmClass.newObject(null);
}
case "java/io/FileInputStream->allocObject":{
return dvmClass.newObject(null);
}
case "java/text/SimpleDateFormat->allocObject":{
return dvmClass.newObject(null);
}
case "java/util/Date->allocObject":{
return dvmClass.newObject(null);
}
}
return super.allocObject(vm, dvmClass, signature);
}
@Override
public void callVoidMethodV(BaseVM vm, DvmObject<?> dvmObject, String signature, VaList vaList) {
switch (signature){
case "java/lang/StringBuilder-><init>()V":
return;
case "java/io/File-><init>(Ljava/lang/String;)V":{
String filePath = vaList.getObjectArg(0).getValue().toString();
System.out.println("File init:"+filePath);
emulator.set(dvmObject.toString(), filePath);
return;
}
case "java/io/FileInputStream-><init>(Ljava/lang/String;)V":{
String input = vaList.getObjectArg(0).getValue().toString();
if(input.equals("/proc/cpuinfo")){
try {
fileInputStream = new FileInputStream("unidbg-android/src/test/resources/lession2/part7/cpuinfo");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
return;
}
System.out.println("FileInputStream init:"+input);
}
case "java/io/InputStreamReader-><init>(Ljava/io/InputStream;)V":{
inputStreamReader = new InputStreamReader(fileInputStream);
return;
}
case "java/io/BufferedReader-><init>(Ljava/io/Reader;)V":{
bufferedReader = new BufferedReader(inputStreamReader);
return;
}
case "java/io/BufferedReader->close()V":{
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return;
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->safeClose(Ljava/io/Closeable;)V":{
return;
}
case "java/text/SimpleDateFormat-><init>(Ljava/lang/String;Ljava/util/Locale;)V":{
String str = vaList.getObjectArg(0).getValue().toString();
Locale locale = (Locale) vaList.getObjectArg(1).getValue();
simpleDateFormat = new SimpleDateFormat(str, locale);
return;
}
case "java/util/Date-><init>()V":{
return;
}
}
super.callVoidMethodV(vm, dvmObject, signature, vaList);
}
@Override
public DvmObject<?> getStaticObjectField(BaseVM vm, DvmClass dvmClass, String signature) {
switch (signature){
// 主板
case "android/os/Build->BOARD:Ljava/lang/String;":{
return new StringObject(vm, "sdm845");
}
case "android/os/Build->MANUFACTURER:Ljava/lang/String;":{
return new StringObject(vm, "Xiaomi");
}
// 品牌
case "android/os/Build->BRAND:Ljava/lang/String;":{
return new StringObject(vm, "Xiaomi");
}
case "android/os/Build->MODEL:Ljava/lang/String;":{
return new StringObject(vm, "MIX 2S");
}
case "android/os/Build->PRODUCT:Ljava/lang/String;":{
return new StringObject(vm, "polaris");
}
case "android/os/Build->HARDWARE:Ljava/lang/String;":{
return new StringObject(vm, "qcom");
}
case "android/os/Build->DEVICE:Ljava/lang/String;":{
return new StringObject(vm, "polaris");
}
case "android/os/Build->HOST:Ljava/lang/String;":{
return new StringObject(vm, "c3-miui-ota-bd134.bj");
}
case "android/os/Build->ID:Ljava/lang/String;":{
return new StringObject(vm, "QKQ1.190828.002");
}
case "android/os/Build$VERSION->RELEASE:Ljava/lang/String;":{
return new StringObject(vm, "10");
}
case "android/os/Build->TAGS:Ljava/lang/String;":{
return new StringObject(vm, "release-keys");
}
case "android/os/Build->FINGERPRINT:Ljava/lang/String;":{
return new StringObject(vm, "Xiaomi/polaris/polaris:10/QKQ1.190828.002/V12.0.2.0.QDGCNXM:user/release-keys");
}
case "android/os/Build->TYPE:Ljava/lang/String;":{
return new StringObject(vm, "user");
}
case "android/os/Build$VERSION->SDK:Ljava/lang/String;":{
return new StringObject(vm, "29");
}
}
return super.getStaticObjectField(vm, dvmClass, signature);
}
@Override
public DvmObject<?> callObjectMethodV(BaseVM vm, DvmObject<?> dvmObject, String signature, VaList vaList) {
switch (signature){
// copy from jadx
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->checkBuildAttribute(Ljava/lang/String;)Ljava/lang/String;":{
String str = vaList.getObjectArg(0).getValue().toString();
return new StringObject(vm, (str.isEmpty() || str.equalsIgnoreCase("unknown")) ? CommonConstant.Symbol.MINUS : str);
}
case "java/lang/StringBuilder->append(Ljava/lang/String;)Ljava/lang/StringBuilder;":{
StringBuilder stringBuilder = (StringBuilder) dvmObject.getValue();
String arg1 = vaList.getObjectArg(0).getValue().toString();
return vm.resolveClass("java/lang/StringBuilder").newObject(stringBuilder.append(arg1));
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getSysProp(Ljava/lang/String;)Ljava/lang/String;":{
String prop = vaList.getObjectArg(0).getValue().toString();
System.out.println("getSysProp:"+prop);
// abi
if(prop.equals("ro.product.cpu.abi")){
return new StringObject(vm, "arm64-v8a");
}
if(prop.equals("ro.product.cpu.abi2")){
return new StringObject(vm, "");
}
if(prop.equals("ro.build.product")){
return new StringObject(vm, "polaris");
}
if(prop.equals("ro.build.description")){
return new StringObject(vm, "polaris-user 10 QKQ1.190828.002 V12.0.2.0.QDGCNXM release-keys");
}
// root
if(prop.equals("ro.secure")){
return new StringObject(vm, "1");
}
// debug
if(prop.equals("ro.debuggable")){
return new StringObject(vm, "1");
}
// 查看当前手机USB功能角色
if(prop.equals("persist.sys.usb.config")){
return new StringObject(vm, "");
}
if(prop.equals("sys.usb.config")){
return new StringObject(vm, "adb");
}
if(prop.equals("sys.usb.state")){
return new StringObject(vm, "adb");
}
// 基带
if(prop.equals("gsm.version.baseband")){
return new StringObject(vm, "4.0.c2.6-00335-0914_2350_3c8fca6,4.0.c2.6-00335-0914_2350_3c8fca6");
}
if(prop.equals("gsm.version.ril-impl")){
return new StringObject(vm, "Qualcomm RIL 1.0");
}
if(prop.equals("gsm.sim.state")){
return new StringObject(vm, "ABSENT,ABSENT");
}
if(prop.equals("gsm.sim.state.2")){
return new StringObject(vm, "");
}
if(prop.equals("wifi.interface")){
return new StringObject(vm, "wlan0");
}
}
case "android/content/Context->getResources()Landroid/content/res/Resources;":{
return vm.resolveClass("android/content/res/Resources").newObject(null);
}
case "android/content/res/Resources->getConfiguration()Landroid/content/res/Configuration;":{
return vm.resolveClass("android/content/res/Configuration").newObject(null);
}
case "java/lang/StringBuilder->toString()Ljava/lang/String;":{
StringBuilder stringBuilder = (StringBuilder) dvmObject.getValue();
return new StringObject(vm, stringBuilder.toString());
}
case "java/lang/StringBuilder->append(I)Ljava/lang/StringBuilder;":{
StringBuilder stringBuilder = (StringBuilder) dvmObject.getValue();
int i = vaList.getIntArg(0);
return vm.resolveClass("java/lang/StringBuilder").newObject(stringBuilder.append(i));
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getCpuInfoType()Ljava/lang/String;":{
return new StringObject(vm, "arm");
}
case "java/io/BufferedReader->readLine()Ljava/lang/String;":{
String oneLine = null;
try {
oneLine = bufferedReader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("bufferread readLine:"+oneLine);
if(oneLine==null){
return null;
}
return new StringObject(vm, oneLine);
}
case "java/lang/String->substring(I)Ljava/lang/String;":{
String str = dvmObject.getValue().toString();
return new StringObject(vm, str.substring(vaList.getIntArg(0)));
}
case "android/content/Context->getApplicationContext()Landroid/content/Context;":{
return vm.resolveClass("android/content/Context").newObject(null);
}
case "android/content/Context->getSystemService(Ljava/lang/String;)Ljava/lang/Object;":{
StringObject serviceName = vaList.getObjectArg(0);
assert serviceName != null;
if(serviceName.getValue().equals("window")){
return vm.resolveClass("android/view/WindowManager").newObject(null);
}
return new SystemService(vm, serviceName.getValue());
}
case "android/hardware/SensorManager->getDefaultSensor(I)Landroid/hardware/Sensor;":{
return vm.resolveClass("android/hardware/Sensor").newObject(vaList.getIntArg(0));
}
case "android/hardware/Sensor->getName()Ljava/lang/String;":{
int tag = (int) dvmObject.getValue();
System.out.println(tag);
if(tag==1){
return new StringObject(vm, "ICM20690");
}
if(tag==9){
return new StringObject(vm, "gravity Non-wakeup");
}
}
case "android/hardware/Sensor->getVendor()Ljava/lang/String;":{
int tag = (int) dvmObject.getValue();
if(tag==1){
return new StringObject(vm, "qualcomm");
}else if(tag==9){
return new StringObject(vm, "qualcomm");
}
}
case "android/view/WindowManager->getDefaultDisplay()Landroid/view/Display;":{
return vm.resolveClass("android/view/Display").newObject(signature);
}
case "java/lang/StringBuilder->append(C)Ljava/lang/StringBuilder;":{
StringBuilder stringBuilder = (StringBuilder) dvmObject.getValue();
char c = (char) vaList.getIntArg(0);
return vm.resolveClass("java/lang/StringBuilder").newObject(stringBuilder.append(c));
}
// 建议frida hook
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getTotalInternalMemorySize()Ljava/lang/String;":{
return new StringObject(vm, "21379328");
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getTotalExternalMemorySize()Ljava/lang/String;":{
return new StringObject(vm, "124345246");
}
case "android/telephony/TelephonyManager->getSimOperator()Ljava/lang/String;":{
return new StringObject(vm, "46009");
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getAccessSubType()Ljava/lang/String;":{
return new StringObject(vm, "wifi");
}
case "java/util/UUID->toString()Ljava/lang/String;":{
UUID uuid = (UUID) dvmObject.getValue();
return new StringObject(vm, uuid.toString());
}
// 建议frida hook 或者 jnitrace查看
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getDataActivity(Landroid/content/Context;)Ljava/lang/String;":{
return new StringObject(vm, "");
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getEnvironmentInfo()Ljava/lang/String;":{
return new StringObject(vm, (String) emulator.get("getEnvironmentInfo"));
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->isVPN()Ljava/lang/String;":{
return new StringObject(vm, "0");
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->brightness(Landroid/content/Context;)Ljava/lang/String;":{
return new StringObject(vm, "22");
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->systemVolume(Landroid/content/Context;)Ljava/lang/String;":{
return new StringObject(vm, "13");
}
case "java/text/SimpleDateFormat->format(Ljava/util/Date;)Ljava/lang/String;":{
return new StringObject(vm, simpleDateFormat.format(new Date()));
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->appCache(Landroid/content/Context;)Ljava/lang/String;":{
// 计算 APP 缓存目录大小
return new StringObject(vm, "149045277");
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->availableSystem()Ljava/lang/String;":
return new StringObject(vm, "unknown");
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->totalMemory()Ljava/lang/String;":
// 获取存储
return new StringObject(vm, "5905510400");
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getFirstLaunchTime(Landroid/content/Context;)Ljava/lang/String;":{
// 首次安装打开时间
return new StringObject(vm, "1637665296460");
}
case "android/net/wifi/WifiManager->getConnectionInfo()Landroid/net/wifi/WifiInfo;":{
return vm.resolveClass("android/net/wifi/WifiInfo").newObject(signature);
}
case "android/net/wifi/WifiInfo->getSSID()Ljava/lang/String;":
// 获取wifi名
return new StringObject(vm, "CU_TckX");
case "android/telephony/TelephonyManager->getNetworkOperator()Ljava/lang/String;":
return new StringObject(vm, "");
case "java/lang/StringBuilder->append(Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder;":{
StringBuilder stringBuilder = (StringBuilder) dvmObject.getValue();
CharSequence charSequence = (CharSequence) vaList.getObjectArg(0).getValue();
int arg2 = vaList.getIntArg(1);
int arg3 = vaList.getIntArg(2);
return vm.resolveClass("java/lang/StringBuilder").newObject(stringBuilder.append(charSequence, arg2, arg3));
}
// 建议认真补
case "android/net/wifi/WifiInfo->getBSSID()Ljava/lang/String;":{
return new StringObject(vm, "");
}
}
return super.callObjectMethodV(vm, dvmObject, signature, vaList);
}
@Override
public int getStaticIntField(BaseVM vm, DvmClass dvmClass, String signature) {
switch (signature){
case "android/os/Build$VERSION->SDK_INT:I":{
return 29;
}
}
return super.getStaticIntField(vm, dvmClass, signature);
}
@Override
public DvmObject<?> callStaticObjectMethodV(BaseVM vm, DvmClass dvmClass, String signature, VaList vaList) {
switch (signature){
case "java/lang/Integer->toString(I)Ljava/lang/String;":{
int i = vaList.getIntArg(0);
System.out.println("java/lang/Integer->toString:"+i);
return new StringObject(vm, Integer.toString(i));
}
case "java/util/UUID->randomUUID()Ljava/util/UUID;":{
return dvmClass.newObject(UUID.randomUUID());
}
case "java/lang/String->valueOf(I)Ljava/lang/String;":{
return new StringObject(vm, String.valueOf(vaList.getIntArg(0)));
}
}
return super.callStaticObjectMethodV(vm, dvmClass, signature, vaList);
}
@Override
public boolean callBooleanMethodV(BaseVM vm, DvmObject<?> dvmObject, String signature, VaList vaList) {
switch (signature){
// 检测是否有某功能
case "android/content/pm/PackageManager->hasSystemFeature(Ljava/lang/String;)Z":{
String feature = vaList.getObjectArg(0).getValue().toString();
// 加速度传感器
if(feature.equals("android.hardware.sensor.accelerometer")){
return true;
}
// 陀螺仪
if(feature.equals("android.hardware.sensor.gyroscope")){
return true;
}
// wifi
if(feature.equals("android.hardware.wifi")){
return true;
}
if(feature.equals("android.hardware.bluetooth")){
return true;
}
if(feature.equals("android.hardware.bluetooth_le")){
return true;
}
if(feature.equals("android.hardware.telephony")){
return true;
}
if(feature.equals("android.hardware.usb.accessory")){
return true;
}
if(feature.equals("android.hardware.location.gps")){
return true;
}
if(feature.equals("android.hardware.nfc")){
return true;
}
System.out.println("hasSystemFeature:"+feature);
}
// 根据真实情况返回,我这儿乱补的
case "java/io/File->exists()Z":{
String tag = emulator.get(dvmObject.toString());
if(tag.equals("/sys/class/power_supply/battery/voltage_now")){
return true;
}
if(tag.equals("/sys/class/power_supply/battery/temp")){
return false;
}
}
case "java/lang/String->startsWith(Ljava/lang/String;)Z":{
String str = dvmObject.getValue().toString();
String arg =vaList.getObjectArg(0).getValue().toString();
System.out.println("startswith");
System.out.println(str);
System.out.println(arg);
return str.startsWith(arg);
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->isPermissionGranted(Ljava/lang/String;Landroid/content/Context;)Z":{
String permission = vaList.getObjectArg(0).getValue().toString();
System.out.println(permission);
if(permission.equals("android.permission.READ_PHONE_STATE")){
return true;
}
if(permission.equals("android.permission.ACCESS_WIFI_STATE")){
return true;
}
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->getBatteryInfo()Z":{
return true;
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->isAccessibilityEnable()Z":{
return false;
}
case "java/lang/String->equalsIgnoreCase(Ljava/lang/String;)Z":{
String str = (String) dvmObject.getValue();
String arg = vaList.getObjectArg(0).getValue().toString();
return str.equalsIgnoreCase(arg);
}
case "java/lang/String->equals(Ljava/lang/Object;)Z":{
String str = (String) dvmObject.getValue();
Object object = vaList.getObjectArg(0).getValue();
return str.equals(object);
}
}
return super.callBooleanMethodV(vm, dvmObject, signature, vaList);
}
@Override
public int callIntMethodV(BaseVM vm, DvmObject<?> dvmObject, String signature, VaList vaList) {
switch (signature){
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->boolean2Integer(Z)I":{
return vaList.getIntArg(0);
}
case "java/lang/String->compareToIgnoreCase(Ljava/lang/String;)I":{
String str = dvmObject.getValue().toString();
String arg = vaList.getObjectArg(0).getValue().toString();
System.out.println("compareToIgnoreCase");
System.out.println(str);
System.out.println(arg);
return str.compareToIgnoreCase(arg);
}
case "java/lang/String->lastIndexOf(I)I":{
String str = dvmObject.getValue().toString();
return str.lastIndexOf(vaList.getIntArg(0));
}
case "android/view/Display->getHeight()I":{
return 2030;
}
case "android/view/Display->getWidth()I":{
return 1080;
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->uiAutomatorClickCount()I":{
return 0;
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->androidAppCnt(Landroid/content/Context;)I":{
return 0;
}
case "java/lang/String->length()I":{
String str = dvmObject.getValue().toString();
return str.length();
}
case "android/net/wifi/WifiInfo->getRssi()I":{
return 0;
}
}
return super.callIntMethodV(vm, dvmObject, signature, vaList);
}
@Override
public boolean callStaticBooleanMethodV(BaseVM vm, DvmClass dvmClass, String signature, VaList vaList) {
switch (signature){
case "android/text/TextUtils->isEmpty(Ljava/lang/CharSequence;)Z":{
String charSequence = (String) vaList.getObjectArg(0).getValue();
System.out.println("debug");
// return charSequence.isEmpty();
return charSequence.isEmpty();
}
}
return super.callStaticBooleanMethodV(vm, dvmClass, signature, vaList);
}
@Override
public int getIntField(BaseVM vm, DvmObject<?> dvmObject, String signature) {
switch (signature){
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->level:I":{
return 93;
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->scale:I":{
return 100;
}
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->status:I":{
return 3;
}
}
return super.getIntField(vm, dvmObject, signature);
}
@Override
public boolean getBooleanField(BaseVM vm, DvmObject<?> dvmObject, String signature) {
switch (signature){
case "com/meituan/android/common/mtguard/NBridge$SIUACollector->plugged:Z":{
return false;
}
}
return super.getBooleanField(vm, dvmObject, signature);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。