linux安卓抓log

app

batterysecret   cpp名字?

adb shell logcat|findstr batterysecret

adb shell getprop ro.product.name

int xm_is_eu_model(void)
{
    int rc = 0, fd;
    int is_eu_model = 0, bytes = 0;
    char buffer[32] = {0,};

    if (property_get("ro.product.name", product_name, NULL) > 0) {
        KLOG_ERROR(LOG_TAG,"test product_name: '%s'", product_name);
        if (!strncmp(product_name, "dada_global", strlen("dada_global"))) {
            KLOG_ERROR(LOG_TAG,"xm_is_eu_model: dada_global.\n");
            is_eu_model = 3;

        } else if (!strncmp(product_name, "dada", strlen("dada"))) {
            KLOG_ERROR(LOG_TAG,"xm_is_eu_model: dada_cn.\n");
            is_eu_model = 6;
        } else if (!strncmp(product_name, "dada_eea", strlen("dada_eea"))) {
            KLOG_ERROR(LOG_TAG,"xm_is_eu_model: dada_eea.\n");
            is_eu_model = 9;
        }
    }

    if (is_eu_model) {
        fd = open(IS_EU_MODEL_PATH, O_RDWR);
        if (fd < 0) {
            KLOG_ERROR(LOG_TAG,"Unable to open: '%s'", IS_EU_MODEL_PATH);
            return fd;
        }
        bytes = snprintf(buffer, sizeof(buffer), "%d\n", 1);
        rc = write(fd, &buffer, bytes);
        if (fd < 0) {
            KLOG_ERROR(LOG_TAG,"Unable to write: '%s'", IS_EU_MODEL_PATH);
            close(fd);
            return rc;
        }
        KLOG_ERROR(LOG_TAG,"xm_is_eu_model: set is_eu_model true.\n");
        close(fd);
    }

    return is_eu_model;
}

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值