wbspool 1 rok pred
rodič
commit
3bfc06963c
33 zmenil súbory, kde vykonal 1748 pridanie a 19 odobranie
  1. 179 0
      BusinessAirFryer/src/main/assets/lang_config_000.json
  2. 179 0
      BusinessAirFryer/src/main/assets/lang_config_011.json
  3. 179 0
      BusinessAirFryer/src/main/assets/lang_config_017.json
  4. 3 3
      BusinessAirFryer/src/main/assets/lang_config_030.json
  5. 173 0
      BusinessAirFryer/src/main/assets/tuya_config.json
  6. 1 0
      BusinessCommon/src/main/AndroidManifest.xml
  7. 4 0
      BusinessCommon/src/main/java/com/develop/common/bean/TuyaConfig.kt
  8. 46 0
      BusinessCommon/src/main/java/com/develop/common/bean/TuyaEvent.java
  9. 10 1
      BusinessCommon/src/main/java/com/develop/common/data_repo/db/DataFactory.kt
  10. 2 1
      BusinessCommon/src/main/java/com/develop/common/data_repo/db/ModelKit.kt
  11. 1 0
      BusinessCommon/src/main/java/com/develop/common/router/Screens.kt
  12. 98 0
      BusinessCommon/src/main/java/com/develop/common/utils/CommonUtils.kt
  13. 25 0
      BusinessCommon/src/main/java/com/develop/common/utils/ConfigUtils.kt
  14. 61 0
      BusinessCommon/src/main/java/com/develop/common/utils/ScreenWakeUpService.java
  15. 23 0
      BusinessCommon/src/main/java/com/develop/common/utils/TuyaDps.java
  16. 306 0
      BusinessCommon/src/main/java/com/develop/common/utils/TuyaUtils.java
  17. BIN
      BusinessCommon/src/main/res/drawable-xxxhdpi/ic_setting_tuya.png
  18. BIN
      BusinessCommon/src/main/res/drawable-xxxhdpi/splash_logo_017.png
  19. 4 0
      BusinessCommon/src/main/res/values/strings.xml
  20. 8 0
      BusinessCommon/src/main/res/values/themes.xml
  21. 6 2
      BusinessSetting/src/main/AndroidManifest.xml
  22. 27 0
      BusinessSetting/src/main/java/com/develop/setting/ui/SettingMainActivity.kt
  23. 76 0
      BusinessSetting/src/main/java/com/develop/setting/ui/TuyaActivity.kt
  24. 75 0
      BusinessSetting/src/main/res/layout/activity_tuya.xml
  25. 123 5
      BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt
  26. 56 3
      app/build.gradle
  27. 3 1
      app/proguard-rules.pro
  28. 34 0
      app/src/main/java/com/develop/foodcooking/FoodCookingApp.kt
  29. 25 0
      app/src/main/java/com/develop/foodcooking/MainActivity.kt
  30. 3 2
      libBase/src/main/java/com/develop/base/ext/GlobaExt.kt
  31. 10 0
      libThirdPart/build.gradle
  32. 3 1
      libThirdPart/proguard-rules.pro
  33. 5 0
      settings.gradle

+ 179 - 0
BusinessAirFryer/src/main/assets/lang_config_000.json

@@ -0,0 +1,179 @@
+{
+  "langs": [
+    {
+      "name": "Polish(波兰语)",
+      "value": "PL",
+      "icon": "icon_lang_pl",
+      "showName": "Polski",
+      "show": false
+    },
+    {
+      "name": "German(德语)",
+      "value": "DE",
+      "icon": "icon_lang_de",
+      "showName": "Deutsch",
+      "show": false
+    },
+    {
+      "name": "French(法语)",
+      "value": "FR",
+      "icon": "icon_lang_fr",
+      "showName": "Français",
+      "show": true
+    },
+    {
+      "name": "Dutch(荷兰语)",
+      "value": "NL",
+      "icon": "icon_lang_nl",
+      "showName": "Nederlands",
+      "show": false
+    },
+    {
+      "name": "Portuguese(葡萄牙语)",
+      "value": "PT",
+      "icon": "icon_lang_pt",
+      "showName": "Português",
+      "show": false
+    },
+    {
+      "name": "Spanish(西班牙语)",
+      "value": "ES",
+      "icon": "icon_lang_es",
+      "showName": "Español",
+      "show": false
+    },
+    {
+      "name": "Italiano(意大利语)",
+      "value": "IT",
+      "icon": "icon_lang_it",
+      "showName": "Italiano",
+      "show": false
+    },
+    {
+      "name": "English(英语)",
+      "value": "EN",
+      "icon": "icon_lang_en",
+      "showName": "English",
+      "show": true
+    },
+    {
+      "name": "Greek(希腊语)",
+      "value": "GR",
+      "icon": "icon_lang_gr",
+      "showName": "Ελληνικά",
+      "show": false
+    },
+    {
+      "name": "Russian(俄语)",
+      "value": "RU",
+      "icon": "icon_lang_ru",
+      "showName": "Русский",
+      "show": false
+    },
+    {
+      "name": "Romanian(罗马尼亚语)",
+      "value": "RO",
+      "icon": "icon_lang_ro",
+      "showName": "Română",
+      "show": false
+    },
+    {
+      "name": "Finnish(芬兰语)",
+      "value": "FI",
+      "icon": "icon_lang_fi",
+      "showName": "Suomi",
+      "show": false
+    },
+    {
+      "name": "Norsk(挪威语)",
+      "value": "NO",
+      "icon": "icon_lang_no",
+      "showName": "Norsk",
+      "show": false
+    },
+    {
+      "name": "Swedish(瑞典语)",
+      "value": "SE",
+      "icon": "icon_lang_se",
+      "showName": "Svenska",
+      "show": false
+    },
+    {
+      "name": "Danish(丹麦语)",
+      "value": "DK",
+      "icon": "icon_lang_dk",
+      "showName": "Dansk",
+      "show": false
+    },
+    {
+      "name": "Czech(捷克语)",
+      "value": "CZ",
+      "icon": "icon_lang_cz",
+      "showName": "Čeština",
+      "show": false
+    },
+    {
+      "name": "Estonki(爱沙尼亚语)",
+      "value": "EE",
+      "icon": "icon_lang_ee",
+      "showName": "Eesti keel",
+      "show": false
+    },
+    {
+      "name": "Slovak(斯洛伐克语)",
+      "value": "SK",
+      "icon": "icon_lang_sk",
+      "showName": "Slovenčina",
+      "show": false
+    },
+    {
+      "name": "Ukrainian(乌克兰语)",
+      "value": "UK",
+      "icon": "icon_lang_uk",
+      "showName": "Українська",
+      "show": false
+    },
+    {
+      "name": "Arabic(阿拉伯语)",
+      "value": "AR",
+      "icon": "icon_lang_ar",
+      "showName": "العربية",
+      "show": false
+    },
+    {
+      "name": "Lithuanian(立陶宛语)",
+      "value": "LT",
+      "icon": "icon_lang_lt",
+      "showName": "Lietuvių kalba",
+      "show": false
+    },
+    {
+      "name": "Farsi(波斯语)",
+      "value": "IR",
+      "icon": "icon_lang_ir",
+      "showName": "فارسی",
+      "show": false
+    },
+    {
+      "name": "Kazakh(哈萨克语)",
+      "value": "KZ",
+      "icon": "icon_lang_kz",
+      "showName": "Қазақша",
+      "show": false
+    },
+    {
+      "name": "Chinese(中文)",
+      "value": "ZH",
+      "icon": "icon_lang_zh",
+      "showName": "中文",
+      "show": false
+    },
+    {
+      "name": "Japanese(日语)",
+      "value": "JA",
+      "icon": "icon_lang_ja",
+      "showName": "日本語",
+      "show": false
+    }
+  ]
+}

+ 179 - 0
BusinessAirFryer/src/main/assets/lang_config_011.json

@@ -0,0 +1,179 @@
+{
+  "langs": [
+    {
+      "name": "Polish(波兰语)",
+      "value": "PL",
+      "icon": "icon_lang_pl",
+      "showName": "Polski",
+      "show": false
+    },
+    {
+      "name": "German(德语)",
+      "value": "DE",
+      "icon": "icon_lang_de",
+      "showName": "Deutsch",
+      "show": false
+    },
+    {
+      "name": "French(法语)",
+      "value": "FR",
+      "icon": "icon_lang_fr",
+      "showName": "Français",
+      "show": false
+    },
+    {
+      "name": "Dutch(荷兰语)",
+      "value": "NL",
+      "icon": "icon_lang_nl",
+      "showName": "Nederlands",
+      "show": false
+    },
+    {
+      "name": "Portuguese(葡萄牙语)",
+      "value": "PT",
+      "icon": "icon_lang_pt",
+      "showName": "Português",
+      "show": false
+    },
+    {
+      "name": "Spanish(西班牙语)",
+      "value": "ES",
+      "icon": "icon_lang_es",
+      "showName": "Español",
+      "show": false
+    },
+    {
+      "name": "Italiano(意大利语)",
+      "value": "IT",
+      "icon": "icon_lang_it",
+      "showName": "Italiano",
+      "show": false
+    },
+    {
+      "name": "English(英语)",
+      "value": "EN",
+      "icon": "icon_lang_en",
+      "showName": "English",
+      "show": true
+    },
+    {
+      "name": "Greek(希腊语)",
+      "value": "GR",
+      "icon": "icon_lang_gr",
+      "showName": "Ελληνικά",
+      "show": false
+    },
+    {
+      "name": "Russian(俄语)",
+      "value": "RU",
+      "icon": "icon_lang_ru",
+      "showName": "Русский",
+      "show": false
+    },
+    {
+      "name": "Romanian(罗马尼亚语)",
+      "value": "RO",
+      "icon": "icon_lang_ro",
+      "showName": "Română",
+      "show": false
+    },
+    {
+      "name": "Finnish(芬兰语)",
+      "value": "FI",
+      "icon": "icon_lang_fi",
+      "showName": "Suomi",
+      "show": false
+    },
+    {
+      "name": "Norsk(挪威语)",
+      "value": "NO",
+      "icon": "icon_lang_no",
+      "showName": "Norsk",
+      "show": false
+    },
+    {
+      "name": "Swedish(瑞典语)",
+      "value": "SE",
+      "icon": "icon_lang_se",
+      "showName": "Svenska",
+      "show": false
+    },
+    {
+      "name": "Danish(丹麦语)",
+      "value": "DK",
+      "icon": "icon_lang_dk",
+      "showName": "Dansk",
+      "show": false
+    },
+    {
+      "name": "Czech(捷克语)",
+      "value": "CZ",
+      "icon": "icon_lang_cz",
+      "showName": "Čeština",
+      "show": false
+    },
+    {
+      "name": "Estonki(爱沙尼亚语)",
+      "value": "EE",
+      "icon": "icon_lang_ee",
+      "showName": "Eesti keel",
+      "show": false
+    },
+    {
+      "name": "Slovak(斯洛伐克语)",
+      "value": "SK",
+      "icon": "icon_lang_sk",
+      "showName": "Slovenčina",
+      "show": false
+    },
+    {
+      "name": "Ukrainian(乌克兰语)",
+      "value": "UK",
+      "icon": "icon_lang_uk",
+      "showName": "Українська",
+      "show": false
+    },
+    {
+      "name": "Arabic(阿拉伯语)",
+      "value": "AR",
+      "icon": "icon_lang_ar",
+      "showName": "العربية",
+      "show": false
+    },
+    {
+      "name": "Lithuanian(立陶宛语)",
+      "value": "LT",
+      "icon": "icon_lang_lt",
+      "showName": "Lietuvių kalba",
+      "show": false
+    },
+    {
+      "name": "Farsi(波斯语)",
+      "value": "IR",
+      "icon": "icon_lang_ir",
+      "showName": "فارسی",
+      "show": false
+    },
+    {
+      "name": "Kazakh(哈萨克语)",
+      "value": "KZ",
+      "icon": "icon_lang_kz",
+      "showName": "Қазақша",
+      "show": false
+    },
+    {
+      "name": "Chinese(中文)",
+      "value": "ZH",
+      "icon": "icon_lang_zh",
+      "showName": "中文",
+      "show": false
+    },
+    {
+      "name": "Japanese(日语)",
+      "value": "JA",
+      "icon": "icon_lang_ja",
+      "showName": "日本語",
+      "show": false
+    }
+  ]
+}

+ 179 - 0
BusinessAirFryer/src/main/assets/lang_config_017.json

@@ -0,0 +1,179 @@
+{
+  "langs": [
+    {
+      "name": "Polish(波兰语)",
+      "value": "PL",
+      "icon": "icon_lang_pl",
+      "showName": "Polski",
+      "show": false
+    },
+    {
+      "name": "German(德语)",
+      "value": "DE",
+      "icon": "icon_lang_de",
+      "showName": "Deutsch",
+      "show": false
+    },
+    {
+      "name": "French(法语)",
+      "value": "FR",
+      "icon": "icon_lang_fr",
+      "showName": "Français",
+      "show": false
+    },
+    {
+      "name": "Dutch(荷兰语)",
+      "value": "NL",
+      "icon": "icon_lang_nl",
+      "showName": "Nederlands",
+      "show": false
+    },
+    {
+      "name": "Portuguese(葡萄牙语)",
+      "value": "PT",
+      "icon": "icon_lang_pt",
+      "showName": "Português",
+      "show": false
+    },
+    {
+      "name": "Spanish(西班牙语)",
+      "value": "ES",
+      "icon": "icon_lang_es",
+      "showName": "Español",
+      "show": false
+    },
+    {
+      "name": "Italiano(意大利语)",
+      "value": "IT",
+      "icon": "icon_lang_it",
+      "showName": "Italiano",
+      "show": false
+    },
+    {
+      "name": "English(英语)",
+      "value": "EN",
+      "icon": "icon_lang_en",
+      "showName": "English",
+      "show": true
+    },
+    {
+      "name": "Greek(希腊语)",
+      "value": "GR",
+      "icon": "icon_lang_gr",
+      "showName": "Ελληνικά",
+      "show": false
+    },
+    {
+      "name": "Russian(俄语)",
+      "value": "RU",
+      "icon": "icon_lang_ru",
+      "showName": "Русский",
+      "show": false
+    },
+    {
+      "name": "Romanian(罗马尼亚语)",
+      "value": "RO",
+      "icon": "icon_lang_ro",
+      "showName": "Română",
+      "show": false
+    },
+    {
+      "name": "Finnish(芬兰语)",
+      "value": "FI",
+      "icon": "icon_lang_fi",
+      "showName": "Suomi",
+      "show": false
+    },
+    {
+      "name": "Norsk(挪威语)",
+      "value": "NO",
+      "icon": "icon_lang_no",
+      "showName": "Norsk",
+      "show": false
+    },
+    {
+      "name": "Swedish(瑞典语)",
+      "value": "SE",
+      "icon": "icon_lang_se",
+      "showName": "Svenska",
+      "show": false
+    },
+    {
+      "name": "Danish(丹麦语)",
+      "value": "DK",
+      "icon": "icon_lang_dk",
+      "showName": "Dansk",
+      "show": false
+    },
+    {
+      "name": "Czech(捷克语)",
+      "value": "CZ",
+      "icon": "icon_lang_cz",
+      "showName": "Čeština",
+      "show": false
+    },
+    {
+      "name": "Estonki(爱沙尼亚语)",
+      "value": "EE",
+      "icon": "icon_lang_ee",
+      "showName": "Eesti keel",
+      "show": false
+    },
+    {
+      "name": "Slovak(斯洛伐克语)",
+      "value": "SK",
+      "icon": "icon_lang_sk",
+      "showName": "Slovenčina",
+      "show": false
+    },
+    {
+      "name": "Ukrainian(乌克兰语)",
+      "value": "UK",
+      "icon": "icon_lang_uk",
+      "showName": "Українська",
+      "show": false
+    },
+    {
+      "name": "Arabic(阿拉伯语)",
+      "value": "AR",
+      "icon": "icon_lang_ar",
+      "showName": "العربية",
+      "show": false
+    },
+    {
+      "name": "Lithuanian(立陶宛语)",
+      "value": "LT",
+      "icon": "icon_lang_lt",
+      "showName": "Lietuvių kalba",
+      "show": false
+    },
+    {
+      "name": "Farsi(波斯语)",
+      "value": "IR",
+      "icon": "icon_lang_ir",
+      "showName": "فارسی",
+      "show": false
+    },
+    {
+      "name": "Kazakh(哈萨克语)",
+      "value": "KZ",
+      "icon": "icon_lang_kz",
+      "showName": "Қазақша",
+      "show": false
+    },
+    {
+      "name": "Chinese(中文)",
+      "value": "ZH",
+      "icon": "icon_lang_zh",
+      "showName": "中文",
+      "show": false
+    },
+    {
+      "name": "Japanese(日语)",
+      "value": "JA",
+      "icon": "icon_lang_ja",
+      "showName": "日本語",
+      "show": false
+    }
+  ]
+}

+ 3 - 3
BusinessAirFryer/src/main/assets/lang_config_030.json

@@ -110,7 +110,7 @@
       "value": "CZ",
       "icon": "icon_lang_cz",
       "showName": "Čeština",
-      "show": true
+      "show": false
     },
     {
       "name": "Estonki(爱沙尼亚语)",
@@ -124,7 +124,7 @@
       "value": "SK",
       "icon": "icon_lang_sk",
       "showName": "Slovenčina",
-      "show": true
+      "show": false
     },
     {
       "name": "Ukrainian(乌克兰语)",
@@ -180,7 +180,7 @@
       "value": "HU",
       "icon": "icon_lang_hu",
       "showName": "magyar nyelv",
-      "show": true
+      "show": false
     }
   ]
 }

+ 173 - 0
BusinessAirFryer/src/main/assets/tuya_config.json

@@ -0,0 +1,173 @@
+{
+  "licences": {
+    "010D10390020123010100032": {
+      "pid": "dquk8axtyy72c1ap",
+      "uid": "uuid50e9e0c707553116",
+      "ak": "MJhcxmQ6LeZDj1tNu6F5kqK5aQJfpdOb"
+    },
+    "036I21060020123010190004": {
+      "pid": "dquk8axtyy72c1ap",
+      "uid": "uuid168073f63512a624",
+      "ak": "0En6WmDAuDg5NLCJoRNtvB0KkwuxTkhc"
+    },
+    "036I21060020123010190003": {
+      "pid": "dquk8axtyy72c1ap",
+      "uid": "uuid27a0577cc7eeb9b3",
+      "ak": "TAfnHpfr6AeVxYBsGrAfPE3oVwlslH1l"
+    },
+    "036I21060020123010190001": {
+      "pid": "dquk8axtyy72c1ap",
+      "uid": "uuid7893db2e701b853b",
+      "ak": "nlJdxC119wB2r36kxjWjZWSlEEm5Z4DA"
+    },
+    "036I21060020123010190002": {
+      "pid": "dquk8axtyy72c1ap",
+      "uid": "uuid0686e96fe0e49ef4",
+      "ak": "Vvys7wDcOiOeSpAmSCzI0jgB5g7cXr5W"
+    },
+    "011A10390020123010190001": {
+      "pid": "qgdd3xgte8ia75pp",
+      "uid": "uuidcfb66c9f9dcea3dc",
+      "ak": "kKjmiFklQUJxTtfX6gb0HvAIzhLSQwZQ"
+    },
+    "011A10390020123010190004": {
+      "pid": "qgdd3xgte8ia75pp",
+      "uid": "uuidf6bdce9208626720",
+      "ak": "ojPkHIyzW0h0RBVd9zR91krSH6kD4Bq3"
+    },
+    "011A10390020123010190005": {
+      "pid": "qgdd3xgte8ia75pp",
+      "uid": "uuid7752936117877258",
+      "ak": "JuiAfRuH9mPzdLnxQax0A5lR1M15krtb"
+    },
+    "011A10390020123010190006": {
+      "pid": "qgdd3xgte8ia75pp",
+      "uid": "uuid3e8a0406eeb6a1d7",
+      "ak": "lJ7am8gTa2aHrInhXFcSKKVLCm7xMFlH"
+    },
+    "030A10390020123010190001": {
+      "pid": "9op3u0wpf50gbin0",
+      "uid": "uuid87fc4bde71569018",
+      "ak": "snLULDmG12PuGQvl0Y3th86oF1HOnpLf"
+    },
+    "030A10390020123010190002": {
+      "pid": "9op3u0wpf50gbin0",
+      "uid": "uuidf0a1752601f29ce1",
+      "ak": "TIgWTYpAXf8CyiMHCafiFADRm3s97bKI"
+    },
+    "030A10390020123010190003": {
+      "pid": "9op3u0wpf50gbin0",
+      "uid": "uuida901ffc0e9dc637e",
+      "ak": "qj0hVrEnR8qjlr0xmTXf8vdDsVZdxhGz"
+    },
+    "030A10390020123010190004": {
+      "pid": "9op3u0wpf50gbin0",
+      "uid": "uuid45d0dc7820ff91f5",
+      "ak": "WGIlOwvp9VrkBAt5H1z5XvUoGXNjElb7"
+    },
+    "017A20060020123010190001": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuida6f0aa9ac519d121",
+      "ak": "X9Qg32ARni4HjY36AjZByNHHiyiKGp7q"
+    },
+    "017A20060020123010190002": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuida614de446b1ee366",
+      "ak": "AfqDVCmksePcSHyA9eZ9TBcxHMuxQ8xy"
+    },
+    "017A10390020123010190001": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuiddf8c180889b237d4",
+      "ak": "Fazjbb1E7A9pOqb02qj1bbI2rypQPHgo"
+    },
+    "017A10390020123010190002": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuid423714ed76e17194",
+      "ak": "68P4KEAu6ucwxO5xraPoVJjbm0VdaAAm"
+    },
+    "017A21030020123010190001": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuidcce2542317a42ace",
+      "ak": "ZdJhs7kOnrPuyGzI9MfbjAviXLwGZ3u5"
+    },
+    "017A21030020123010190002": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuid3f941111a707d913",
+      "ak": "8WnDXx4RGSPDkYHeSXK42SjuOd0olJcp"
+    },
+    "017A21030020123010190003": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuid4ea902d217a5214b",
+      "ak": "JOEhiBCU7Y0hjGXzQeKT65tUctavCrXl"
+    },
+    "017A21030020123010190004": {
+      "pid": "ley4mnr5nqmtyq6e",
+      "uid": "uuidd66ed40536890f70",
+      "ak": "7hEDpBi08283FeoK1tL2SfTf9ZjLVXeZ"
+    },"000A10390020123010190009": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuide834ae3a35c85891",
+      "ak": "ARhlijghAQJFVDsAbTKbNxe9RgLDAR5b"
+    },
+    "000A10390020123010190010": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuidcc01214733d60dec",
+      "ak": "d8VA2BnPgQoHJL98UcSzMrATvYmFjnck"
+    },
+    "000A21010020123010190001": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid61a37ca17e67cbc3",
+      "ak": "IYWp08bAQSXbvNieoLIQLc0yBV3dHDQu"
+    },
+    "000A21010020123010190002": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuidc6356e02d0dd1bb8",
+      "ak": "AA99M0iNYx0m7oQjvTufuWGg5VLX6kez"
+    },
+    "000A21010020123010190003": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuidb99c97f880409aae",
+      "ak": "SvJO9yi31ExNXnyE77caaCtFZCVri2L7"
+    },
+    "000A20010020123010190001": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuide4ebd69311eab54e",
+      "ak": "96cTOSOPxvvcExlyJJe7NrkLaucr0As2"
+    },
+    "000A21020020123010190001": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid536f6d347c683f57",
+      "ak": "AwIWCkr5a8ECMfYy3xaJW1KIsRlOfmP4"
+    },
+    "000A20020020123010190001": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid695298970165f5de",
+      "ak": "eWzAbm8DZv92F567nWhuedSUzcc9FJVv"
+    },
+    "000A21050020123010190001": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuidccfcbea39afd9db7",
+      "ak": "AsixolEhGRMlREnmEBcAsjoDtbFSJj0Q"
+    },
+    "000A21050020123010190002": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuideb52df92e83c3af1",
+      "ak": "OnWBbmXp4TCIotAXJBie8dCPr0tWNyoK"
+    },
+    "000A10590020123010190001": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid903f6fec79d1eb6c",
+      "ak": "EeAAuxIZ9BlSq3gi7vuJ2QqSmsiRMeOU"
+    },
+    "000A10590020123010190002": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuid50491cb0667dddad",
+      "ak": "uxBrNdezj5T9kD3AMWjBehvfVpRWmlwU"
+    },
+    "000A10590020123010190003": {
+      "pid": "wy8ogbhchnzkmrup",
+      "uid": "uuidf49bd4b6f57750c7",
+      "ak": "l7K3bjZMgNtAt9EA5PAOUapDMlNEjUZD"
+    }
+  }
+}

+ 1 - 0
BusinessCommon/src/main/AndroidManifest.xml

@@ -2,4 +2,5 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.develop.common">
 
+    <uses-permission android:name="android.permission.REBOOT" />
 </manifest>

+ 4 - 0
BusinessCommon/src/main/java/com/develop/common/bean/TuyaConfig.kt

@@ -0,0 +1,4 @@
+package com.develop.common.bean
+
+
+data class TuyaConfig(var licences: Map<String,Map<String,String>>)

+ 46 - 0
BusinessCommon/src/main/java/com/develop/common/bean/TuyaEvent.java

@@ -0,0 +1,46 @@
+package com.develop.common.bean;
+
+
+public class TuyaEvent {
+
+    private String type;
+
+
+    private Integer temp;
+
+    private Integer motorGear;
+
+    private Integer time;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Integer getTemp() {
+        return temp;
+    }
+
+    public void setTemp(Integer temp) {
+        this.temp = temp;
+    }
+
+    public Integer getMotorGear() {
+        return motorGear;
+    }
+
+    public void setMotorGear(Integer motorGear) {
+        this.motorGear = motorGear;
+    }
+
+    public Integer getTime() {
+        return time;
+    }
+
+    public void setTime(Integer time) {
+        this.time = time;
+    }
+}

+ 10 - 1
BusinessCommon/src/main/java/com/develop/common/data_repo/db/DataFactory.kt

@@ -8,6 +8,7 @@ import com.develop.common.R
 import com.develop.common.data_repo.db.entity.DevRecipe
 import com.develop.common.data_repo.db.entity.UserFavoriteRecipes
 import com.develop.common.utils.ConfigUtils
+import com.develop.common.utils.TuyaUtils
 import com.develop.common.widget.EntranceData
 import com.develop.common.widget.EntranceType
 import com.drake.brv.item.ItemHover
@@ -171,8 +172,8 @@ object DataFactory {
 //            R.drawable.ic_setting_folder,
             R.drawable.ic_setting_reset,
             R.drawable.ic_setting_about,
-
             )
+
         val nameList = mutableListOf(
             resource.getString(R.string.language), resource.getString(R.string.wifi),
 //            resource.getString(R.string.sound),
@@ -188,6 +189,14 @@ object DataFactory {
 //            SettingType.STORAGE,
             SettingType.RESTORE_FACTORY_SETTINGS, SettingType.ABOUT
         )
+
+        var tuyaConfig =  ConfigUtils.loadTuyaConfig()
+        if(tuyaConfig != null){
+            settingTypeList.add(SettingType.TUYA)
+            nameList.add(resource.getString(R.string.tuya))
+            resIdList.add(R.drawable.ic_setting_tuya)
+        }
+
         for (i in resIdList.indices) {
             result.add(SettingModel(resIdList[i], nameList[i], settingTypeList[i]))
         }

+ 2 - 1
BusinessCommon/src/main/java/com/develop/common/data_repo/db/ModelKit.kt

@@ -70,7 +70,8 @@ enum class SettingType {
     USER_ACCOUNT,
     STORAGE,
     ABOUT,
-    RESTORE_FACTORY_SETTINGS
+    RESTORE_FACTORY_SETTINGS,
+    TUYA,
 }
 
 enum class CategoryType {

+ 1 - 0
BusinessCommon/src/main/java/com/develop/common/router/Screens.kt

@@ -23,6 +23,7 @@ object Screens {
         const val ABOUT = "$SCHEMA/about"
         const val RESTORE = "$SCHEMA/restore"
         const val HELP = "$SCHEMA/help"
+        const val TUYA = "$SCHEMA/tuya"
     }
 
     object Main {

+ 98 - 0
BusinessCommon/src/main/java/com/develop/common/utils/CommonUtils.kt

@@ -0,0 +1,98 @@
+package com.develop.common.utils
+
+import android.os.Bundle
+import com.blankj.utilcode.util.ToastUtils
+import com.develop.base.ext.navigateTo
+import com.develop.base.util.TopResumedAtyHolder
+import com.develop.common.data_repo.FoodDataProvider
+import com.develop.common.router.Screens
+import com.develop.common.tag.MODE_TYPE
+import com.develop.common.tag.NUMBER_TAG
+import com.develop.common.tag.SOURCE_TAG
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.WorkModes
+import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
+
+object  CommonUtils {
+
+    fun navigateToRemoteRecipe(number:String){
+
+
+        FoodDataProvider.getDatabase().recipeDao().apply {
+
+            val recipeBean = queryRecipe(number)
+            if (recipeBean != null) {
+
+                TopResumedAtyHolder.getCurrentActivity()?.navigateTo(Screens.Cook.COOK_DETAIL) {
+
+
+
+                    withString(
+                        SOURCE_TAG,  "local"
+
+                    )
+                    withString(NUMBER_TAG, number)
+
+                }
+
+            }else{
+
+                TopResumedAtyHolder.getCurrentActivity()?.navigateTo(Screens.Cook.COOK_DETAIL) {
+
+
+
+                    withString(
+                        SOURCE_TAG,  "remote"
+
+                    )
+                    withString(NUMBER_TAG, number)
+
+                }
+
+            }
+
+        }
+
+
+
+    }
+
+
+    fun navigateToAdaptedCooking(){
+
+
+        TopResumedAtyHolder.getCurrentActivity()?.apply {
+
+
+            if(localClassName.indexOf("ModesDetailActivity") != -1){
+                if(CommonUtils.devReady()){
+                    return
+                }else{
+                    finish()
+                }
+            }
+
+        }
+
+
+
+
+
+
+        val bundle = Bundle()
+        bundle.putString(MODE_TYPE, "ADAPTED_COOKING")
+        TopResumedAtyHolder.getCurrentActivity()?.navigateTo(Screens.Cook.COOK_MODES) {
+            with(bundle)
+        }
+    }
+
+    fun devReady():Boolean{
+
+        return TopResumedAtyHolder.getCurrentActivity()?.localClassName?.indexOf("ModesDetailActivity") != -1  && CofarSDK.devInfo().mode.mode === WorkModes.ADAPTED_COOKING
+
+
+    }
+
+
+
+}

+ 25 - 0
BusinessCommon/src/main/java/com/develop/common/utils/ConfigUtils.kt

@@ -6,6 +6,7 @@ import com.azhon.appupdate.util.LogUtil
 import com.develop.base.ext.GlobalApp
 import com.develop.base.ext.getSN
 import com.develop.common.bean.CfConfig
+import com.develop.common.bean.TuyaConfig
 import com.develop.common.bean.WorkMode
 import com.google.gson.Gson
 import org.json.JSONObject
@@ -80,6 +81,30 @@ object ConfigUtils {
         }
     }
 
+    fun loadTuyaConfig(): Map<String,String>? {
+        return try {
+            var sn = getSN()
+
+            var inputStream: InputStream? = null
+            inputStream = GlobalApp().assets.open("tuya_config.json")
+
+
+            val size = inputStream.available()
+            val buffer = ByteArray(size)
+            inputStream.read(buffer)
+            inputStream.close()
+
+            val jsonString = String(buffer, Charset.defaultCharset())
+            val gson = Gson()
+            val cfConfig = gson.fromJson(jsonString, TuyaConfig::class.java)
+            cfConfig.licences.get(sn)
+        } catch (ex: IOException) {
+            ex.printStackTrace()
+            null
+        }
+    }
+
+
     fun getMode(type: String): WorkMode? {
         return loadConfig()?.workModes?.find { it.type == type }?.copy()
     }

+ 61 - 0
BusinessCommon/src/main/java/com/develop/common/utils/ScreenWakeUpService.java

@@ -0,0 +1,61 @@
+package com.develop.common.utils;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.PowerManager;
+import android.os.SystemClock;
+import androidx.annotation.NonNull;
+import androidx.core.app.JobIntentService;
+
+import java.util.Calendar;
+
+public class ScreenWakeUpService extends JobIntentService {
+
+    private static final int JOB_ID = 1001;
+
+    public static void enqueueWork(Context context, Intent work) {
+        enqueueWork(context, ScreenWakeUpService.class, JOB_ID, work);
+    }
+
+    @Override
+    protected void onHandleWork(@NonNull Intent intent) {
+        // Get the desired wake-up time from intent or preferences
+        // For example, let's wake up the screen after 10 seconds from now
+        long wakeUpTimeMillis = SystemClock.elapsedRealtime() + 10000;
+
+        AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
+        if (alarmManager != null) {
+            Intent wakeUpIntent = new Intent(this, ScreenWakeUpReceiver.class);
+            PendingIntent pendingIntent = PendingIntent.getBroadcast(
+                    this, 0, wakeUpIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+            alarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, wakeUpTimeMillis, pendingIntent);
+        }
+    }
+
+    public static class ScreenWakeUpReceiver extends BroadcastReceiver {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            // Acquire a WakeLock to wake up the screen
+            PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
+            PowerManager.WakeLock wakeLock = null;
+            if (powerManager != null) {
+                wakeLock = powerManager.newWakeLock(
+                        PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP,
+                        "MyApp:WakeLock");
+                wakeLock.acquire(5000); // Acquire for 5 seconds
+            }
+
+            // You can also start an activity or show a notification here if needed
+
+            // Release the WakeLock after use
+            if (wakeLock != null && wakeLock.isHeld()) {
+                wakeLock.release();
+            }
+        }
+    }
+}
+

+ 23 - 0
BusinessCommon/src/main/java/com/develop/common/utils/TuyaDps.java

@@ -0,0 +1,23 @@
+package com.develop.common.utils;
+
+public class TuyaDps {
+
+    public static final int WORK_STATE = 101;
+    public static final int CURRENT_PRESSURE_COOKER = 102;
+    public static final int MOTOR_GEAR = 103;
+    public static final int MOTOR_DIRECTION = 104;
+    public static final int SPRAY_WATER = 105;
+    public static final int POT_STATUS = 106;
+    public static final int TARGET_PRESSURE_COOKER = 107;
+    public static final int WIND_SPEED = 108;
+    public static final int DEV_MODE = 109;
+    public static final int POT_CLOVER_STATUS = 111;
+    public static final int REMAIN_TIME_O = 112;
+    public static final int ERROR_CODE = 113;
+    public static final int TY_ERROR_CODE = 13;
+    public static final int RECIPE_NUM = 115;
+    public static final int TARGET_TEMP = 116;
+    public static final int CURRENT_TEMP = 117;
+    public static final int TARGET_TIME = 118;
+    public static final int DEV_READY = 110;
+}

+ 306 - 0
BusinessCommon/src/main/java/com/develop/common/utils/TuyaUtils.java

@@ -0,0 +1,306 @@
+package com.develop.common.utils;
+
+import static android.content.Context.MODE_PRIVATE;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.PowerManager;
+import android.text.TextUtils;
+import android.view.View;
+
+import com.develop.base.util.MMkvUtils;
+import com.develop.base.util.TopResumedAtyHolder;
+import com.develop.common.bean.TuyaEvent;
+import com.google.gson.Gson;
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus;
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.HeatModes;
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.MotorDirections;
+import com.kuyuntech.cofarcooking.device.sdk.eventbus.core.DevInfo;
+import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK;
+import com.tuya.smartai.iot_sdk.DPEvent;
+import com.tuya.smartai.iot_sdk.IoTSDKManager;
+import com.tuya.smartai.iot_sdk.Log;
+import com.tuya.smartai.iot_sdk.UpgradeEventCallback;
+
+import org.greenrobot.eventbus.EventBus;
+import org.json.JSONObject;
+
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class TuyaUtils {
+    public static Context context;
+    public static String version;
+    public static final String TAG = "TUYA";
+    public static  String mPid = "dquk8axtyy72c1ap";
+    public static  String mUid = "uuid50e9e0c707553116";
+    public static  String mAk = "MJhcxmQ6LeZDj1tNu6F5kqK5aQJfpdOb";
+    public static  String qrcodeUrl =  "";
+    public static IoTSDKManager ioTSDKManager = null;
+    
+    public static boolean init = false;
+
+    public static void output(String text) {
+        Log.d(TAG, text);
+    }
+
+
+    public static Integer parse(int e) {
+
+        if(e <= 0){
+            return  0;
+        }
+
+        StringBuilder a = new StringBuilder("1");
+        for (int i = 0; i < e -1; i++) {
+            a.append("0");
+        }
+        return Integer.parseInt(a.toString(),2);
+    }
+
+    public static void  uploadData(){
+        if(ioTSDKManager == null || !init){
+            return;
+        }
+
+        DevInfo info = CofarSDK.devInfo();
+
+        DPEvent[] dpEvents = new DPEvent[]{
+          new DPEvent(TuyaDps.DEV_MODE,(byte) DPEvent.Type.PROP_VALUE,0,0),
+          new DPEvent(TuyaDps.CURRENT_PRESSURE_COOKER,(byte) DPEvent.Type.PROP_VALUE,-1,0),
+          new DPEvent(TuyaDps.TARGET_PRESSURE_COOKER,(byte) DPEvent.Type.PROP_VALUE,-1,-1),
+          new DPEvent(TuyaDps.TARGET_TIME,(byte) DPEvent.Type.PROP_VALUE,info.getTargetTimeBuffer() != -1 ? info.getTargetTimeBuffer() : info.getTargetTime(),0),
+          new DPEvent(TuyaDps.REMAIN_TIME_O,(byte) DPEvent.Type.PROP_VALUE,info.getRemainTime(),0),
+          new DPEvent(TuyaDps.ERROR_CODE,(byte) DPEvent.Type.PROP_VALUE,(int)info.getErrCode(),0),
+          new DPEvent(TuyaDps.TY_ERROR_CODE,(byte) DPEvent.Type.PROP_BITMAP, parse(info.getErrCode()),0),
+          new DPEvent(TuyaDps.WORK_STATE,(byte) DPEvent.Type.PROP_VALUE,info.getStatus(),0),
+          new DPEvent(TuyaDps.MOTOR_GEAR,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getMotorGearBuffer() != -1 ? info.getMotorGearBuffer() : info.getMotorGear()),0),
+          new DPEvent(TuyaDps.MOTOR_DIRECTION,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getMotorDirectionBuffer() != -1 ? info.getMotorDirectionBuffer():info.getMotorDirection()),0),
+          new DPEvent(TuyaDps.SPRAY_WATER,(byte) DPEvent.Type.PROP_VALUE,-1,0),
+          new DPEvent(TuyaDps.WIND_SPEED,(byte) DPEvent.Type.PROP_VALUE,-1,-1),
+          new DPEvent(TuyaDps.TARGET_TEMP,(byte) DPEvent.Type.PROP_VALUE,(int)(info.getTargetTempBuffer() != -1 ? info.getTargetTempBuffer():info.getTargetTemp()),0),
+          new DPEvent(TuyaDps.CURRENT_TEMP,(byte) DPEvent.Type.PROP_VALUE,(int)info.getTemp(),0),
+          new DPEvent(TuyaDps.POT_CLOVER_STATUS,(byte) DPEvent.Type.PROP_VALUE,(int)info.getPotCloverStatus(),0),
+          new DPEvent(TuyaDps.POT_STATUS,(byte) DPEvent.Type.PROP_VALUE,(int)info.getPotStatus(),0),
+          new DPEvent(TuyaDps.DEV_READY,(byte) DPEvent.Type.PROP_VALUE,CommonUtils.INSTANCE.devReady() ? 0 : 1,0),
+        };
+
+
+
+        ioTSDKManager.sendDP(dpEvents);
+    }
+
+    public static void cancelBind(){
+        init = false;
+        if (ioTSDKManager!=null){
+            ioTSDKManager.reset();
+        }
+
+
+
+    }
+
+
+    public static void baseInitSDK(Context ctx,String version) {
+
+        ioTSDKManager = new IoTSDKManager(ctx) {
+            @Override
+            protected boolean isOffline() {
+                //实现自定义网络监测
+                Log.d(TAG, "isOffline: " + super.isOffline());
+                return super.isOffline();
+            }
+        };
+
+        output("固件版本:" + version);
+
+        output("init sdk:" + mPid + "/" + mUid + "/" + mAk);
+
+        //注意:这里的pid等配置读取自local.properties文件,不能直接使用。请填写你自己的配置!
+        ioTSDKManager.initSDK("/sdcard/tuya_iot/", mPid
+                , mUid, mAk, version, new IoTSDKManager.IoTCallback() {
+
+                    @Override
+                    public void onDpEvent(DPEvent event) {
+
+                        TuyaEvent a = new TuyaEvent();
+                        a.setType("test");
+                        EventBus.getDefault().post(a);
+
+                        if (event != null) {
+                            output("收到 dp: " + event);
+
+                            if(event.dpid == TuyaDps.RECIPE_NUM){
+                                CommonUtils.INSTANCE.navigateToRemoteRecipe((String) event.value);
+                            }
+
+                            if(event.dpid == TuyaDps.DEV_READY){
+                                CommonUtils.INSTANCE.navigateToAdaptedCooking();
+                            }
+
+                            if(event.dpid == TuyaDps.WORK_STATE){
+
+                                if(DevStatus.STOP == (int)event.value){
+                                    TuyaEvent e = new TuyaEvent();
+                                    e.setType("stop");
+                                    EventBus.getDefault().post(e);
+                                }
+
+
+                                if(DevStatus.PAUSE == (int)event.value){
+                                    TuyaEvent e = new TuyaEvent();
+                                    e.setType("pause");
+                                    EventBus.getDefault().post(e);
+                                }
+
+
+                                if(DevStatus.RUNNING == (int)event.value){
+                                    TuyaEvent e = new TuyaEvent();
+                                    e.setType("start");
+                                    EventBus.getDefault().post(e);
+                                }
+                            }
+
+
+                            if(event.dpid == TuyaDps.TARGET_TEMP){
+                                CofarSDK.cfgHeat((short) (int) event.value, HeatModes.PU_TONG);
+                                TuyaEvent e = new TuyaEvent();
+                                e.setType("change_temp");
+                                EventBus.getDefault().post(e);
+                            }
+
+                            if(event.dpid == TuyaDps.TARGET_TIME){
+                                CofarSDK.cfgTime( (int) event.value);
+                                TuyaEvent e = new TuyaEvent();
+                                e.setType("change_time");
+                                EventBus.getDefault().post(e);
+                            }
+
+                            if(event.dpid == TuyaDps.MOTOR_DIRECTION){
+                                CofarSDK.cfgMotorDirection((int) event.value == 0 ? MotorDirections.FORWARD:MotorDirections.REVERSE);
+                            }
+
+                            if(event.dpid == TuyaDps.MOTOR_GEAR){
+                                CofarSDK.cfgMotorGear((byte) ((int)event.value & 0xFF));
+                            }
+
+
+
+                        }
+
+
+                    }
+
+                    @Override
+                    public void onReset() {
+
+                        ctx.getSharedPreferences("event_cache", MODE_PRIVATE).edit().clear().commit();
+                        PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);
+                        pm.reboot("");
+
+                    }
+
+                    @Override
+                    public void onShorturl(String urlJson) {
+                        output("shorturl: " + urlJson);
+                        Gson gson = new Gson();
+                        Map d = gson.fromJson(urlJson, Map.class);
+                        String url = (String) d.get("shortUrl");
+                        qrcodeUrl = url;
+                        MMkvUtils.INSTANCE.save("tuya_url",url);
+                        EventBus.getDefault().post(new TuyaUtils());
+                    }
+
+                    @Override
+                    public void onActive() {
+                        output("onActive: devId-> " + ioTSDKManager.getDeviceId());
+                        init = true;
+                    }
+
+                    @Override
+                    public void onFirstActive() {
+                        output("onFirstActive");
+                    }
+
+                    @Override
+                    public void onMQTTStatusChanged(int status) {
+                        output("onMQTTStatusChanged: " + status);
+
+                        switch (status) {
+                            case IoTSDKManager.STATUS_OFFLINE:
+                                // 设备网络离线
+                                break;
+                            case IoTSDKManager.STATUS_MQTT_OFFLINE:
+                                // 网络在线MQTT离线
+                                break;
+                            case IoTSDKManager.STATUS_MQTT_ONLINE:
+                                // 网络在线MQTT在线
+
+                                SharedPreferences sp = ctx.getSharedPreferences("event_cache", MODE_PRIVATE);
+
+                                DPEvent[] events = ioTSDKManager.getEvents();
+
+                                if (events != null) {
+                                    for (DPEvent event : events) {
+                                        if (event != null) {
+                                            output(event.toString());
+                                        }
+                                    }
+                                }
+                                break;
+                        }
+                    }
+
+//                    @Override
+//                    public void onMqttMsg(int protocol, org.json.JSONObject msgObj) {
+//
+//                    }
+                });
+
+        ioTSDKManager.setUpgradeCallback(new UpgradeEventCallback() {
+            @Override
+            public void onUpgradeInfo(String s) {
+                Log.w(TAG, "onUpgradeInfo: " + s);
+
+                output("收到升级信息: " + s);
+
+//                runOnUiThread(() -> upgradeDialog.show());
+
+                ioTSDKManager.startUpgradeDownload();
+            }
+
+            @Override
+            public void onUpgradeDownloadStart() {
+                Log.w(TAG, "onUpgradeDownloadStart");
+
+                output("开始升级下载");
+            }
+
+            @Override
+            public void onUpgradeDownloadUpdate(int i) {
+                Log.w(TAG, "onUpgradeDownloadUpdate: " + i);
+            }
+
+            @Override
+            public void upgradeFileDownloadFinished(int result, String file) {
+                Log.w(TAG, "upgradeFileDownloadFinished: " + result);
+
+                output("下载完成:" + result + " / " + file);
+            }
+        });
+    }
+
+    public static void initSDK(Context ctx,String version) {
+        context = ctx;
+        version = version;
+        //Log.init(ctx, "/sdcard/tuya_log/iot_demo/", 3);
+        baseInitSDK(ctx,version);
+    }
+
+
+}

BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_setting_tuya.png


BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/splash_logo_017.png


+ 4 - 0
BusinessCommon/src/main/res/values/strings.xml

@@ -56,6 +56,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="storage">STORAGE</string>
     <string name="reset">RESTORE FACTORY SETTINGS</string>
     <string name="about">ABOUT</string>
+    <string name="tuya">TUYA</string>
     <string name="weight">WEIGHT</string>
     <string name="local_recipes">Local recipes</string>
     <string name="download">Download</string>
@@ -310,7 +311,10 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="no_net_error">Please connect to Wifi</string>
     <string name="no_login">Veuillez saisir les champs ci-dessus pour vous connecter</string>
     <string name="wrong_captcha">Wrong captcha</string>
+    <string name="sao_ma_pei_wang">Please scan the QR code for network configuration.</string>
+    <string name="cancel_tuya_bind">Cancel Bind</string>
     <string name="frement_010d_stage_first_finish">Place a sheet of plastic wrap at the bottom of the steaming basket, then arrange your yogurt pots. Close the lid and cover with a cloth or a towel.</string>
     <string name="none">None</string>
+
     <string name="please_fill_in_nickname">Please fill in nickname</string>
 </resources>

+ 8 - 0
BusinessCommon/src/main/res/values/themes.xml

@@ -24,6 +24,14 @@
         <item name="android:windowFullscreen">true</item>
     </style>
 
+    <style name="Splash017Theme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
+        <!-- 这里的trans自己写一个#00000000即可-->
+        <item name="android:windowBackground">@drawable/splash_logo_017</item>
+        <item name="windowNoTitle">true</item>
+        <item name="windowActionBar">false</item>
+        <item name="android:windowFullscreen">true</item>
+    </style>
+
     <style name="Splash010DTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
         <!-- 这里的trans自己写一个#00000000即可-->
         <item name="android:windowBackground">@drawable/splash_logo_010</item>

+ 6 - 2
BusinessSetting/src/main/AndroidManifest.xml

@@ -9,6 +9,9 @@
         tools:ignore="ProtectedPermissions" />
 
     <application>
+        <activity
+            android:name=".ui.TuyaActivity"
+            android:exported="false" android:screenOrientation="landscape" />
         <activity
             android:name=".ui.PowerAnimationActivity"
             android:screenOrientation="landscape" />
@@ -47,9 +50,10 @@
             android:name=".ui.AboutActivity"
             android:launchMode="singleTask"
             android:screenOrientation="landscape" />
-        <activity android:name=".ui.HelpDocsActivity"
+        <activity
+            android:name=".ui.HelpDocsActivity"
             android:launchMode="singleTask"
-            android:screenOrientation="landscape"/>
+            android:screenOrientation="landscape" />
     </application>
 
 </manifest>

+ 27 - 0
BusinessSetting/src/main/java/com/develop/setting/ui/SettingMainActivity.kt

@@ -2,6 +2,7 @@ package com.develop.setting.ui
 
 import android.content.Intent
 import android.graphics.Rect
+import android.net.NetworkInfo
 import android.os.Bundle
 import android.util.Log
 import android.view.LayoutInflater
@@ -11,10 +12,12 @@ import androidx.appcompat.widget.AppCompatTextView
 import androidx.recyclerview.widget.RecyclerView
 import com.develop.base.ext.load
 import com.alibaba.android.arouter.facade.annotation.Route
+import com.blankj.utilcode.util.ToastUtils
 import com.develop.base.ext.navigateTo
 import com.develop.base.ext.resId2Dimension
 import com.develop.base.ext.src
 import com.develop.base.ext.updateText
+import com.develop.base.manager.WifiHelp
 import com.develop.base.util.FileKit
 import com.develop.common.data_repo.db.DataFactory
 import com.develop.common.data_repo.db.SettingModel
@@ -28,6 +31,8 @@ import com.develop.setting.databinding.ActivitySettingMainBinding
 import com.drake.brv.utils.grid
 import com.drake.brv.utils.models
 import com.drake.brv.utils.setup
+import com.kuyuntech.cofarcooking.device.sdk.constant.core.DevStatus
+import com.kuyuntech.cofarcooking.device.sdk.util.core.CofarSDK
 
 
 @Route(path = Screens.Setting.MAIN_SETTING)
@@ -40,6 +45,7 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
+        var ctx = this
         dataList = DataFactory.genSettingModesList(resources)
         binding.tvTitle.updateText(getString(com.develop.common.R.string.settings))
         binding.ivClose.setImageResource( com.develop.common.R.drawable.ic_close)
@@ -106,6 +112,27 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
 
                         SettingType.STORAGE -> {
                             openFileManager()
+                        }
+                        SettingType.TUYA -> {
+
+                            if(CofarSDK.devInfo().status !== DevStatus.STOP.toInt()){
+                                ToastUtils.showShort(getString(com.develop.common.R.string.change_lang_tips))
+                            }else{
+                                if( NetworkInfo.DetailedState.CONNECTED == WifiHelp.Build(ctx).build().getDetailedState()){
+                                    navigateTo(Screens.Setting.TUYA)
+                                }else{
+                                    navigateTo(Screens.Setting.WIFI) {
+                                        val bundle = Bundle()
+                                        bundle.putBoolean(WIFI_FROM_MAIN_SETTING, true)
+                                        with(bundle)
+                                    }
+                                }
+                            }
+
+
+
+
+
                         }
                     }
                 }

+ 76 - 0
BusinessSetting/src/main/java/com/develop/setting/ui/TuyaActivity.kt

@@ -0,0 +1,76 @@
+package com.develop.setting.ui
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import com.alibaba.android.arouter.facade.annotation.Route
+import com.develop.base.ext.updateText
+import com.develop.base.util.ThreadUtils
+import com.develop.common.router.Screens
+import com.develop.common.ui.CommonBindingActivity
+import com.develop.common.utils.QRCodeUtils
+import com.develop.common.utils.TuyaUtils
+import com.develop.setting.databinding.ActivityTuyaBinding
+import com.google.gson.Gson
+import com.tuya.smartai.iot_sdk.*
+import com.tuya.smartai.iot_sdk.IoTSDKManager.IoTCallback
+import kotlinx.serialization.json.Json
+import kotlinx.serialization.json.JsonElement
+import kotlinx.serialization.json.jsonObject
+import org.greenrobot.eventbus.Subscribe
+import org.json.JSONObject
+import java.util.Objects
+import java.util.Observable
+
+
+@Route(path = Screens.Setting.TUYA)
+class TuyaActivity : CommonBindingActivity<ActivityTuyaBinding>() {
+
+    private val TAG = "TUYA"
+
+    var mPid: String? = "dquk8axtyy72c1ap"
+    var mUid: String? = "uuid50e9e0c707553116"
+    var mAk: String? = "MJhcxmQ6LeZDj1tNu6F5kqK5aQJfpdOb"
+
+    var ioTSDKManager: IoTSDKManager? = null
+
+
+    override fun createViewBinding(inflater: LayoutInflater):ActivityTuyaBinding {
+        return ActivityTuyaBinding.inflate(layoutInflater)
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+
+        super.onCreate(savedInstanceState)
+        binding.ivClose.setOnClickListener {
+
+            finish()
+        }
+        binding.tvTitle.updateText(getString(com.develop.common.R.string.tuya))
+
+        if(TuyaUtils.qrcodeUrl != "" && !TuyaUtils.init){
+            ThreadUtils.runOnMainThread {
+                val bitmap = QRCodeUtils.createQRCodeBitmap(TuyaUtils.qrcodeUrl, 500, 500)
+                binding.tuyaQrcode.setImageBitmap(bitmap)
+                binding.tuyaQrcode.visibility = View.VISIBLE
+            }
+        }else{
+                binding.cancelWrapper.visibility = View.VISIBLE
+                binding.cancelBtn.setOnClickListener{
+                    TuyaUtils.cancelBind()
+                }
+        }
+
+
+    }
+
+
+    @Subscribe
+    fun onTuyaStateChange(event:TuyaUtils){
+        println("adasdasd")
+    }
+
+
+
+
+}

+ 75 - 0
BusinessSetting/src/main/res/layout/activity_tuya.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:background="@color/bg_color"
+    android:layout_height="match_parent">
+
+    <ImageView
+        android:id="@+id/iv_close"
+        android:layout_width="@dimen/convert_53px"
+        android:layout_height="@dimen/convert_53px"
+        android:layout_marginStart="@dimen/convert_21px"
+        android:layout_marginTop="@dimen/convert_10px"
+        android:padding="@dimen/convert_15px"
+        android:src="@drawable/ic_close" />
+
+    <androidx.appcompat.widget.AppCompatTextView
+        android:id="@+id/tv_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="@dimen/convert_28px"
+        android:textColor="@color/common_title"
+        android:textSize="@dimen/convert_36px" />
+
+
+
+    <RelativeLayout
+        android:gravity="center"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+            <RelativeLayout
+                android:visibility="invisible"
+                android:id="@+id/cancel_wrapper"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content">
+
+                <LinearLayout
+                    android:id="@+id/cancel_btn"
+                    android:layout_width="wrap_content"
+                    android:paddingEnd="@dimen/convert_24px"
+                    android:paddingStart="@dimen/convert_24px"
+                    android:paddingTop="@dimen/convert_12px"
+                    android:paddingBottom="@dimen/convert_12px"
+                    android:layout_height="wrap_content"
+                    android:background="@drawable/search_stroke"
+                    android:layout_marginEnd="@dimen/convert_24px"
+                    android:layout_centerVertical="true"
+                    android:visibility="visible"
+                    android:orientation="horizontal">
+                    <androidx.appcompat.widget.AppCompatTextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/cancel_tuya_bind"
+                        android:textColor="@color/policy_agree_tip"
+                        android:textSize="@dimen/convert_16px" />
+                </LinearLayout>
+
+
+            </RelativeLayout>
+
+            <ImageView
+                android:visibility="gone"
+                android:background="@color/white"
+                android:id="@+id/tuya_qrcode"
+                android:layout_width="@dimen/convert_300px"
+                android:layout_height="@dimen/convert_300px"></ImageView>
+    </RelativeLayout>
+
+
+
+
+
+</RelativeLayout>

+ 123 - 5
BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt

@@ -21,6 +21,7 @@ import com.develop.base.ext.setGone
 import com.develop.base.ext.setVisible
 import com.develop.base.ext.src
 import com.develop.base.util.ThreadUtils
+import com.develop.common.bean.TuyaEvent
 import com.develop.common.data_repo.db.ModesType
 import com.develop.common.dialog.CancelConfirmDialog
 import com.develop.common.event.CookStepEvent
@@ -383,6 +384,121 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         return super.onKeyUp(keyCode, event)
     }
 
+
+    @Subscribe
+    fun onTuyaEvent(event:TuyaEvent){
+
+         if("start" == event.type){
+             if(DevStatus.PAUSE.toInt() == CofarSDK.devInfo().status){
+                 CofarSDK.confirm()
+                 resumeClick()
+             }else{
+                 startClick()
+             }
+
+         }
+
+        if("stop" == event.type){
+            stopClick()
+        }
+
+        if("pause" == event.type){
+            pauseClick()
+        }
+
+
+        if("change_time" == event.type){
+
+            ThreadUtils.runOnMainThread {
+                //当前调节时间
+                var targetTime = currDevInfo.targetTime
+                if (currDevInfo.remainTime != 0) {
+                    targetTime = currDevInfo.remainTime
+                }
+                if (currDevInfo.targetTimeBuffer != -1) {
+                    targetTime = currDevInfo.targetTimeBuffer
+                }
+
+
+                if (targetTime < 0) {
+                    targetTime = 0;
+                }
+                if (targetTime > currDevInfo.mode.maxTime) {
+                    targetTime = currDevInfo.mode.maxTime
+                }
+                if (targetTime < currDevInfo.mode.minTime) {
+                    targetTime = currDevInfo.mode.minTime
+                }
+                val sec = targetTime % 60
+                val min = ((targetTime / 60) % 60)
+                val hour = (targetTime / 3600)
+                var time = ""
+                if (hour > 0) {
+                    time += if (hour < 10) {
+                        "0${hour}"
+                    } else {
+                        "$hour"
+                    }
+
+                    time += if (min < 10) {
+                        ":0${min}"
+                    } else {
+                        ":${min}"
+                    }
+                } else {
+                    time += if (min < 10) {
+                        "0${min}"
+                    } else {
+                        "$min"
+                    }
+
+                    time += if (sec < 10) {
+                        ":0${sec}"
+                    } else {
+                        ":${sec}"
+                    }
+                }
+                rollTimeEvent(hour, min, sec, time, setByUser = true)
+                currDevInfo.apply {
+                    updateTimeUI(
+                        mode.minTime,
+                        mode.maxTime,
+                        remainTime,
+                        targetTime.toLong(),
+                        true
+                    )
+                }
+                binding.clSetTime.setTimeInternal(
+                    hour,
+                    min,
+                    sec,
+                    changeSetting = true,
+                    setByUser = true
+                )
+            }
+
+        }
+
+
+        if("change_temp" == event.type){
+
+            ThreadUtils.runOnMainThread {
+                updateTempUI(
+                    minTemp.toFloat(),
+                    maxTemp.toFloat(),
+                    if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt()
+                    else currDevInfo.temp.toInt(),
+                    if (currDevInfo.targetTempBuffer.toInt() != -1 ) currDevInfo.targetTempBuffer.toString() else currDevInfo.targetTemp.toString(),
+                    isTempChange
+                )
+            }
+
+        }
+
+
+
+    }
+
     //======================================烹饪设备回调监听==================================\\
 
     @Subscribe
@@ -452,15 +568,15 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
                     maxTemp.toFloat(),
                     if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTemp.toInt()
                     else currDevInfo.temp.toInt(),
-                    currDevInfo.targetTemp.toString(),
+                    if (currDevInfo.targetTempBuffer.toInt() != -1 ) currDevInfo.targetTempBuffer.toString() else currDevInfo.targetTemp.toString(),
                     isTempChange
                 )
                 updateTimeUI(
                     if (currDevInfo.status == DevStatus.STOP.toInt() || userChanging) minTime else 0,
                     maxTime,
-                    if (currDevInfo.status == DevStatus.STOP.toInt()) currDevInfo.targetTime
+                    if (currDevInfo.status == DevStatus.STOP.toInt()) if(currDevInfo.targetTimeBuffer != -1) currDevInfo.targetTimeBuffer else  currDevInfo.targetTime
                     else currDevInfo.remainTime,
-                    currDevInfo.targetTime.toLong(),
+                    if(currDevInfo.targetTimeBuffer != -1) currDevInfo.targetTimeBuffer.toLong() else  currDevInfo.targetTime.toLong(),
                     isTimeChange
                 )
                 var motorGear = currDevInfo.motorGear.toInt()
@@ -912,7 +1028,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
                 binding.llTurboView.visibility = View.VISIBLE
             }
         } else {
-            isWidget = true
+//            isWidget = true
             binding.ivWeight.visibility = View.VISIBLE
             binding.ivTurbo.visibility = View.VISIBLE
         }
@@ -1234,7 +1350,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
             )
 
             if (!userChanging || focusUpdate) {
-                clCookTemp.setConfigValue("--${FoodSdkUtils.parseTemp(targetTemp.toShort())}°C--")
+                clCookTemp.setConfigValue("--${FoodSdkUtils.parseTemp(if (tempBuffer.toInt() != -1) tempBuffer else targetTemp.toShort())}°C--")
                 tempRingView.updateProgress(FoodSdkUtils.parseTemp(currentTemp.toShort()).toInt())
                 tempRingText.text = ("${FoodSdkUtils.parseTemp(currentTemp.toShort()).toInt()}°C")
             }
@@ -1504,6 +1620,8 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         }
     }
 
+
+
     /**
      * 点击恢复操作
      */

+ 56 - 3
app/build.gradle

@@ -41,7 +41,14 @@ android {
                 arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
             }
         }
+        ndk {
+            abiFilters 'armeabi-v7a'
+        }
+
+        packagingOptions {
+            pickFirst 'lib/armeabi-v7a/libc++_shared.so'
 
+        }
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         kapt {
@@ -55,7 +62,40 @@ android {
     }
     flavorDimensions "platform"
     productFlavors {
-        brand010D {
+
+        brand000ATuya {
+            dimension "platform"
+            applicationId "com.develop.foodcooking"
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashTheme")
+
+        }
+
+        brand011ATuya {
+            dimension "platform"
+            applicationId "com.develop.foodcooking"
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashTheme")
+
+        }
+
+        brand017ATuya {
+            dimension "platform"
+            applicationId "com.develop.foodcooking"
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashTheme")
+
+        }
+
+        brand030ATuya {
+            dimension "platform"
+            applicationId "com.develop.foodcooking"
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+            resValue("string", "app_theme", "@style/SplashTheme")
+
+        }
+
+        brand036ITuya {
             dimension "platform"
             applicationId "com.develop.foodcooking"
             buildConfigField("String", "UpdatePlatform", "\"night\"")
@@ -67,20 +107,24 @@ android {
             applicationId "com.develop.foodcooking"
             buildConfigField("String", "UpdatePlatform", "\"normal\"")
             resValue("string", "app_theme", "@style/SplashTheme")
+            buildConfigField("String", "UpdatePlatform", "\"036I\"")
+            resValue("string", "app_theme", "@style/Splash036IDTheme")
         }
 
-        brand030A {
+        brand010D {
             dimension "platform"
             applicationId "com.develop.foodcooking"
             buildConfigField("String", "UpdatePlatform", "\"normal\"")
             resValue("string", "app_theme", "@style/SplashTheme")
         }
 
-        brand036I {
+        brand030A {
             dimension "platform"
             applicationId "com.develop.foodcooking"
             buildConfigField("String", "UpdatePlatform", "\"036I\"")
             resValue("string", "app_theme", "@style/SplashTheme")
+            resValue("string", "app_theme", "@style/Splash036IDTheme")
+            buildConfigField("String", "UpdatePlatform", "\"normal\"")
         }
 
     }
@@ -111,12 +155,21 @@ android {
         release {
             minifyEnabled false
             productFlavors.brand010D.signingConfig signingConfigs.release
+            productFlavors.brand000ATuya.signingConfig signingConfigs.release
             productFlavors.brand030A.signingConfig signingConfigs.release
+            productFlavors.brand011ATuya.signingConfig signingConfigs.release
+            productFlavors.brand036ITuya.signingConfig signingConfigs.release
+            productFlavors.brand030ATuya.signingConfig signingConfigs.release
+            productFlavors.brand017ATuya.signingConfig signingConfigs.release
             productFlavors.brand036I.signingConfig signingConfigs.release
             productFlavors.brand000A.signingConfig signingConfigs.release
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }
     }
+
+
+
+
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8

+ 3 - 1
app/proguard-rules.pro

@@ -18,4 +18,6 @@
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
-#-renamesourcefileattribute SourceFile
+#-renamesourcefileattribute SourceFile
+-keep class com.tuya.smartai.iot_sdk.** {*;}
+-keep class com.tencent.mars.** {*;}

+ 34 - 0
app/src/main/java/com/develop/foodcooking/FoodCookingApp.kt

@@ -18,12 +18,14 @@ import com.develop.base.ext.isNightTheme
 import com.develop.base.ext.setIsBrand036I
 import com.develop.base.ext.setNightTheme
 import com.develop.base.util.MMkvUtils
+import com.develop.common.bean.TuyaEvent
 import com.develop.common.data_repo.FoodDataProvider
 import com.develop.common.data_repo.net.Api
 import com.develop.common.data_repo.net.converter.SerializationConverter
 import com.develop.common.data_repo.net.interceptor.FoodRequestInterceptor
 import com.develop.common.food_sdk.GlobalDevEvent
 import com.develop.common.food_sdk.SerialPortUtils
+import com.develop.common.utils.TuyaUtils
 import com.develop.common.utils.compat.RecyclerViewCompat
 import com.develop.common.utils.compat.ShapeableImageViewCompat
 import com.develop.common.utils.compat.SmartRefreshLayoutCompat
@@ -50,6 +52,9 @@ import java.util.concurrent.TimeUnit
 
 
 class FoodCookingApp : BaseApp() {
+
+
+
     companion object {
         init {
             Config.getInstance().skinMode = Config.SkinMode.REPLACE_ALL
@@ -117,6 +122,8 @@ class FoodCookingApp : BaseApp() {
                     .build()
             )
         }.start()
+
+
     }
 
 
@@ -187,10 +194,37 @@ class FoodCookingApp : BaseApp() {
         CofarSDK.unregister(this)
     }
 
+    @SuppressLint("InvalidWakeLockTag")
+    @Subscribe
+    fun onTuyaEvent(event: TuyaEvent){
+
+        TuyaUtils.uploadData()
+        heartBeatInterval?.cancel()
+        val pm = getSystemService(POWER_SERVICE) as PowerManager
+
+        if (mWakeLock == null) {
+            mWakeLock = pm.newWakeLock(
+                PowerManager.SCREEN_BRIGHT_WAKE_LOCK or PowerManager.ON_AFTER_RELEASE or PowerManager.ACQUIRE_CAUSES_WAKEUP,
+                "tag"
+            );
+            mWakeLock?.setReferenceCounted(false);
+            mWakeLock?.acquire()
+        }
+
+        mWakeLock?.release()
+        mWakeLock = null
+        val intent = Intent()
+        intent.action = "android.intent.action.SS_DEVICE_TOUCH"
+        sendBroadcast(intent)
+
+
+    }
+
     @SuppressLint("InvalidWakeLockTag")
     @Subscribe
     @Synchronized
     fun globalCoverEvent(event: DevStatusEvent) {
+        TuyaUtils.uploadData()
         heartBeatInterval?.cancel()
         val devInfo = event.devInfo;
         val pm = getSystemService(POWER_SERVICE) as PowerManager

+ 25 - 0
app/src/main/java/com/develop/foodcooking/MainActivity.kt

@@ -13,10 +13,21 @@ import com.develop.base.util.MMkvUtils
 import com.develop.common.router.Screens
 import com.develop.common.tag.FIRST_IN
 import com.develop.common.ui.CommonBindingActivity
+import com.develop.common.utils.ConfigUtils
+import com.develop.common.utils.TuyaUtils
 import com.develop.foodcooking.databinding.ActivityMainBinding
+import com.tuya.smartai.iot_sdk.BuildConfig
+import com.tuya.smartai.iot_sdk.DPEvent
+import com.tuya.smartai.iot_sdk.IoTSDKManager
+import com.tuya.smartai.iot_sdk.Log
+import com.tuya.smartai.iot_sdk.UpgradeEventCallback
 import org.alee.component.skin.service.ThemeSkinService
 
 class MainActivity : CommonBindingActivity<ActivityMainBinding>() {
+
+
+
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         if (MMkvUtils.getBool(FIRST_IN)) {
@@ -24,11 +35,25 @@ class MainActivity : CommonBindingActivity<ActivityMainBinding>() {
         } else {
             navigateTo(Screens.Setting.ANIMATION)
         }
+//        this.initSDK()
+        //初始化涂鸦
+       var tuyaConfig =  ConfigUtils.loadTuyaConfig()
+        if(tuyaConfig != null){
+            TuyaUtils.mAk = tuyaConfig.get("ak")
+            TuyaUtils.mPid = tuyaConfig.get("pid")
+            TuyaUtils.mUid = tuyaConfig.get("uid")
+            TuyaUtils.initSDK(this,"1.0.0")
+        }
+
         finish()
     }
 
     override fun createViewBinding(inflater: LayoutInflater): ActivityMainBinding {
         return ActivityMainBinding.inflate(inflater)
+
     }
 
+
+
+
 }

+ 3 - 2
libBase/src/main/java/com/develop/base/ext/GlobaExt.kt

@@ -190,6 +190,9 @@ fun getSN(): String {
     var serial: String
 
 
+
+//    return "000A21050020123010190002"
+
     //通过反射获取sn号
     try {
         val c = Class.forName("android.os.SystemProperties")
@@ -202,8 +205,6 @@ fun getSN(): String {
     } catch (e: java.lang.Exception) {
         serial = "unknown"
     }
-    //TODO 暂时写死
-    //return "000A50370020123010100029"
     return serial
 }
 

+ 10 - 0
libThirdPart/build.gradle

@@ -16,6 +16,12 @@ android{
         abortOnError false
         ignoreWarnings true
     }
+
+    packagingOptions {
+        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+
+    }
+
 }
 
 dependencies {
@@ -94,6 +100,10 @@ dependencies {
     compile 'com.github.a-voyager:AutoInstaller:v1.0'
     api 'net.lingala.zip4j:zip4j:2.11.5'
 
+    api 'com.tuya.smart:tuyasmart-iot_sdk:1.0.8-rc.1'
+    api 'com.tencent.mars:mars-xlog:1.2.3'
+//    api 'cn.yipianfengye.android:zxing-library:2.2'
+
 
 
 }

+ 3 - 1
libThirdPart/proguard-rules.pro

@@ -18,4 +18,6 @@
 
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
-#-renamesourcefileattribute SourceFile
+#-renamesourcefileattribute SourceFile
+-keep class com.tuya.smartai.iot_sdk.** {*;}
+-keep class com.tencent.mars.** {*;}

+ 5 - 0
settings.gradle

@@ -3,6 +3,8 @@ pluginManagement {
         maven { url 'https://jitpack.io' }
         maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
         maven { url 'https://maven.aliyun.com/repository/public' }
+        maven { url 'https://maven-other.tuya.com/repository/maven-releases/'}
+        maven { url 'https://maven-other.tuya.com/repository/maven-snapshots/'}
         gradlePluginPortal()
         google()
         mavenCentral()
@@ -14,6 +16,9 @@ dependencyResolutionManagement {
         maven { url 'https://jitpack.io' }
         maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
         maven { url 'https://maven.aliyun.com/repository/public' }
+        maven { url 'https://maven-other.tuya.com/repository/maven-releases/'}
+        maven { url 'https://maven-other.tuya.com/repository/maven-snapshots/'}
+        maven { url 'https://dl.bintray.com/tuyasmartai/sdk' }
         google()
         mavenCentral()
     }