Giter Site home page Giter Site logo

tencentyun / iot-device-java Goto Github PK

View Code? Open in Web Editor NEW
46.0 47.0 42.0 100.54 MB

IoT Hub & Explorer 设备端 SDK (Java & Android)

Home Page: https://cloud.tencent.com/product/iotexplorer

CMake 0.15% Java 97.00% AIDL 0.43% GLSL 0.03% Kotlin 2.33% C++ 0.06%

iot-device-java's People

Contributors

archurcode avatar larrytin avatar sevenhhe avatar sundoggynew avatar tonychanchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iot-device-java's Issues

use IoT Hub Android-SDK can't import in the app

Hello tencent,
我按照这个指引:
https://github.com/tencentyun/iot-device-java/blob/master/hub/hub-device-android/docs/zh/%E7%BC%96%E8%AF%91%E7%8E%AF%E5%A2%83%E5%8F%8ASDK%E6%8E%A5%E5%85%A5%E8%AF%B4%E6%98%8E.md
提到的方式:
gradle 工程正式版 SDK 远程构建

在应用模块的 build.gradle 中配置,具体版本号可参考 Latest release 版本

dependencies {
implementation 'com.tencent.iot.hub:hub-device-android:3.3.21'
}

可以编译过;

但是想引用API的时候 import会提示失败;
屏幕截图 2023-04-23 225023

问题: 除了APP部分的Setting.gradle填写上述指引的部分, 这个SDK的引用还需要设置其他地方吗?

如何使用IOT CENTRAL DEMO

你好,请问如何使用IOT CENTRAL DEMO,产品是什么类型的?没有找到有_sys_access_token属性的产品,手动添加提示系统属性,无法添加。

RRPC 通信接口被sdk自动回复了,无法正常进行业务

com.tencent.iot.hub.device.android.core.mqtt.TXMqttConnection#publishRRPCToCloud

    private Status publishRRPCToCloud(Object userContext, String processId, Map<String, String> replyMsg) {
        // 应答topic格式: $rrpc/txd/${ProductId}/${DeviceName}/${messageid}
        String topic  = String.format("$rrpc/txd/%s/%s/%s", mProductId, mDeviceName, processId);
        //TODO 通过replyMsg构建mqtt messge
        MqttMessage message = new MqttMessage();
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("test-key", "test-value"); // for test
            for (Map.Entry<String, String> entrys : replyMsg.entrySet()) {
                jsonObject.put(entrys.getKey(), entrys.getValue());
            }
        } catch (JSONException e) {
            TXLog.e(TAG, e, "pack json data failed!");
        }
        message.setQos(TXMqttConstants.QOS0);
        message.setPayload(jsonObject.toString().getBytes());
        return publish(topic, message ,userContext);
    }

主要是这段代码,这段测试代码是表示当前接口还不可用吗 还是基于什么考虑呢

[BUG] TXWebSocketClient.setMqttConnectOptions具有误导性

/**
* 设置连接配置
*
* @param mqttConnectOptions {@link MqttConnectOptions}
*/
public void setMqttConnectOptions(MqttConnectOptions mqttConnectOptions) {
this.conOptions = mqttConnectOptions;
// 设置密钥之后可以进行 mqtt 连接
String userName = generateUsername();
conOptions.setUserName(userName);
if (secretKey != null && secretKey.length() != 0) {
try {
conOptions.setPassword(generatePwd(userName).toCharArray());
} catch (IllegalArgumentException e) {
Loggor.debug(TAG, "Failed to set password");
}
}
conOptions.setMqttVersion(MqttConnectOptions.MQTT_VERSION_3_1_1);
}

setMqttConnectOptions中,无论传入的mqttConnectOptions是否设置了用户名和密码都会被覆盖掉,导致使用过程中输入与输出的不对等,文档和注释中并无此方面描述,需要补充或者修改

    /**
     * 设置连接配置
     *
     * @param mqttConnectOptions {@link MqttConnectOptions}
     */
    public void setMqttConnectOptions(MqttConnectOptions mqttConnectOptions)  {
        this.conOptions = mqttConnectOptions;

        if(conOptions.getUserName() != null && conOptions.getUserName().length() != 0){// 如果已经设置了用户名和密钥则不会继续创建
            // 设置密钥之后可以进行 mqtt 连接
            String userName = generateUsername();
            conOptions.setUserName(userName);
            if (secretKey != null && secretKey.length() != 0) {
                try {
                    conOptions.setPassword(generatePwd(userName).toCharArray());
                } catch (IllegalArgumentException e) {
                    Loggor.debug(TAG, "Failed to set password");
                }
            }
        }
        conOptions.setMqttVersion(MqttConnectOptions.MQTT_VERSION_3_1_1);
    }

Potential secutiry vulnerabilities in the shared libraries which ai-face-sdk depends on. Can you help upgrade to patch versions?

Hi, @SundoggyNew , @archurcode , I'd like to report a vulnerability issue in com.tencent.iot.thirdparty.android:ai-face-sdk_6.3.2.156.

Issue Description

com.tencent.iot.thirdparty.android:ai-face-sdk_6.3.2.156 directly or transitively depends on 54 C libraries (.so) cross many platforms(such as arm64-v8a, armeabi-v7a). However, I noticed that some C libraries are vulnerable, containing the following CVEs:

libYTUtils.so from C project libjpeg-turbo(version:1.5.0) exposed 1 vulnerabilities:
CVE-2018-14498
libimisensor.so from C project libpng(version:1.5.12) exposed 9 vulnerabilities:
CVE-2014-9495, CVE-2013-7354, CVE-2013-7353, CVE-2017-12652, CVE-2015-8472, CVE-2016-10087, CVE-2016-3751, CVE-2015-0973, CVE-2015-8540

Suggested Vulnerability Patch Versions

libjpeg-turbo has fixed the vulnerabilities in versions >=2.1.0
libpng has fixed the vulnerabilities in versions >=1.6.37

Java build tools cannot report vulnerable C libraries, which may induce potential security issues to many downstream Java projects.
Could you please upgrade the above shared libraries to their patch versions?

Thanks for your help~
Best regards,
Helen Parr

冲突

implementation 'com.tencent.iot.hub:hub-device-android:3.3.22'

Duplicate class org.slf4j.impl.StaticMarkerBinder found in modules jetified-logback-android-3.0.0-runtime (com.github.tony19:logback-android:3.0.0) and jetified-slf4j-reload4j-1.7.36 (org.slf4j:slf4j-reload4j:1.7.36)

无法和客户的应用共存

hi ,之前公司android设备上用了这个iot sdk(Cloud应用),客户自己也开发了一个应用(应该是用到了同一个sdk),导致客户的程序受到影响,具体表现为网络隔一段时间刷新了客户的应用程序,除此之外没什么其他异常,现在我们的应用无法和客户的应用共存,这对我们来说很重要,这个mqtt服务在设备固有参数不变的情况下,存在了这样的问题,经过了多次测试

网络隔一段时间刷新了客户的应用程序,是否是收到了下发Topic消息时刷新的,这里建议判断一下是自己订阅的Topic的消息才做对应业务上的刷新处理。

客户自己开发的程序我不清楚 我这里呢也定义了一个topic,但是基于这个协议,我不可能去干涉别人的topic吧,如果他一直保持现在topic,没有对其他topic进行区分,那么我改了,似乎也没什么用,因为每个应用应该对自己的tipic进行处理,不处理别人的

有没有可能是客户订阅了你们的topic

这个就不得而知了

Originally posted by @archurcode in #5 (comment)

不同的应有用同一个sdk会导致消息混乱吗

hi ,之前公司android设备上用了这个iot sdk(Cloud应用),客户自己也开发了一个应用(应该是用到了同一个sdk),导致客户的程序受到影响,具体表现为网络隔一段时间刷新了客户的应用程序,除此之外没什么其他异常,现在我们的应用无法和客户的应用共存,这对我们来说很重要,这个mqtt服务在设备固有参数不变的情况下,存在了这样的问题,经过了多次测试

频繁上下线

网络连接状态下,把网线拔掉,或者4G掉线了,物联网平台显示离线之后,再恢复网络,这时候就会频繁上下线

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.