Ver código fonte

初始化仓库

carlos 1 mês atrás
commit
895a126f96
100 arquivos alterados com 2887 adições e 0 exclusões
  1. 30 0
      .gitignore
  2. 3 0
      .idea/.gitignore
  3. 1 0
      .idea/.name
  4. 6 0
      .idea/compiler.xml
  5. 10 0
      .idea/deploymentTargetSelector.xml
  6. 19 0
      .idea/gradle.xml
  7. 6 0
      .idea/kotlinc.xml
  8. 10 0
      .idea/migrations.xml
  9. 7 0
      .idea/misc.xml
  10. 6 0
      .idea/vcs.xml
  11. 92 0
      README.md
  12. BIN
      SikeyCommonService.apk
  13. BIN
      XPCommonService.apk
  14. 1 0
      app/.gitignore
  15. 133 0
      app/build.gradle
  16. BIN
      app/libs/ota-sdk-20230913.aar
  17. BIN
      app/libs/udid-1.2.jar
  18. BIN
      app/libs/xplibcommon.aar
  19. 21 0
      app/proguard-rules.pro
  20. 24 0
      app/src/androidTest/java/com/xplora/commonservice/ExampleInstrumentedTest.kt
  21. 223 0
      app/src/main/AndroidManifest.xml
  22. 20 0
      app/src/main/assets/aws_iot/cacert.crt
  23. 20 0
      app/src/main/assets/aws_iot/client.cert.pem
  24. 27 0
      app/src/main/assets/aws_iot/client.private.key
  25. BIN
      app/src/main/assets/aws_iot/p12.keystore
  26. 20 0
      app/src/main/assets/aws_iot_test/cacert.development.crt
  27. 20 0
      app/src/main/assets/aws_iot_test/client.cert.development.pem
  28. 27 0
      app/src/main/assets/aws_iot_test/client.private.development.key
  29. 20 0
      app/src/main/assets/aws_iot_test_new/cacert.crt
  30. 20 0
      app/src/main/assets/aws_iot_test_new/client.cert.pem
  31. 27 0
      app/src/main/assets/aws_iot_test_new/client.private.key
  32. BIN
      app/src/main/assets/aws_iot_test_new/p12.keystore
  33. BIN
      app/src/main/assets/aws_iot_test_new/test_new.p12
  34. 75 0
      app/src/main/assets/config.xml
  35. BIN
      app/src/main/assets/my.keystore
  36. 7 0
      app/src/main/assets/readme.txt
  37. BIN
      app/src/main/assets/test.keystore
  38. BIN
      app/src/main/assets/test_new.keystore
  39. 121 0
      app/src/main/java/com/sikey/commonservice/BaseApplication.kt
  40. 36 0
      app/src/main/java/com/sikey/commonservice/MainActivity.kt
  41. 78 0
      app/src/main/java/com/sikey/commonservice/model/Apn.kt
  42. 405 0
      app/src/main/java/com/sikey/commonservice/model/Const.kt
  43. 53 0
      app/src/main/java/com/sikey/commonservice/model/MqttMessage.kt
  44. 15 0
      app/src/main/java/com/sikey/commonservice/model/NotificationDetails.kt
  45. 39 0
      app/src/main/java/com/sikey/commonservice/model/database/AlarmDbEntity.kt
  46. 3 0
      app/src/main/java/com/sikey/commonservice/model/database/BaseDbEntity.kt
  47. 134 0
      app/src/main/java/com/sikey/commonservice/model/database/ChatDbDbEntity.kt
  48. 84 0
      app/src/main/java/com/sikey/commonservice/model/database/ContactDbDbEntity.kt
  49. 37 0
      app/src/main/java/com/sikey/commonservice/model/database/GoplayContentDbDbEntity.kt
  50. 15 0
      app/src/main/java/com/sikey/commonservice/model/database/MusicDbDbEntity.kt
  51. 38 0
      app/src/main/java/com/sikey/commonservice/model/database/SilentDbDbEntity.kt
  52. 16 0
      app/src/main/java/com/sikey/commonservice/model/database/StepDbDbEntity.kt
  53. 31 0
      app/src/main/java/com/sikey/commonservice/model/database/WeatherDbDbEntity.kt
  54. 3 0
      app/src/main/java/com/sikey/commonservice/model/http/BaseRequest.kt
  55. 32 0
      app/src/main/java/com/sikey/commonservice/model/http/BaseResponse.kt
  56. 17 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/AddFriend.kt
  57. 19 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/Alarm.kt
  58. 10 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/DeviceWristwatchBinding.kt
  59. 11 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/DeviceWristwatchExchange.kt
  60. 13 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/GetBlockUnknownCall.kt
  61. 29 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/GetWristwatchContactPerson.kt
  62. 64 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/PositionIot.kt
  63. 15 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/SKUpload.kt
  64. 19 0
      app/src/main/java/com/sikey/commonservice/model/http/sk/SchoolMode.kt
  65. 21 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/AlarmList.kt
  66. 27 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/ContactList.kt
  67. 18 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/EmojiList.kt
  68. 9 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/GetApnData.kt
  69. 17 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/GetWifi.kt
  70. 31 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/Init.kt
  71. 21 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/ReportPushResult.kt
  72. 19 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/SilentList.kt
  73. 17 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/UploadBatteryPercent.kt
  74. 14 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/UploadCallLog.kt
  75. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/UploadIccid.kt
  76. 17 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/WatchModelInfo.kt
  77. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/DeleteMsg.kt
  78. 32 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetMsg.kt
  79. 23 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetMsgList.kt
  80. 20 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetMsgState.kt
  81. 23 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetUnreadCount.kt
  82. 42 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/SendMsg.kt
  83. 12 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/SetMsgRead.kt
  84. 26 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/content/GetContent.kt
  85. 9 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/content/ReportContentDownloadStatus.kt
  86. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/FirmwareVersion.kt
  87. 25 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/Guardians.kt
  88. 15 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/SOS.kt
  89. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/XCoin.kt
  90. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/file/Upload.kt
  91. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/friend/Add.kt
  92. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/friend/Code.kt
  93. 50 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/location/Cell.kt
  94. 22 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/location/Gps.kt
  95. 35 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/location/Multi.kt
  96. 8 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/location/TrackingStatus.kt
  97. 14 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/log/Save.kt
  98. 25 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/power/SavingMode.kt
  99. 13 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/power/Set.kt
  100. 14 0
      app/src/main/java/com/sikey/commonservice/model/http/xplora/status/Get.kt

+ 30 - 0
.gitignore

@@ -0,0 +1,30 @@
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx

+ 3 - 0
.idea/.gitignore

@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml

+ 1 - 0
.idea/.name

@@ -0,0 +1 @@
+SikeyCommon

+ 6 - 0
.idea/compiler.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel target="17" />
+  </component>
+</project>

+ 10 - 0
.idea/deploymentTargetSelector.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="deploymentTargetSelector">
+    <selectionStates>
+      <SelectionState runConfigName="app">
+        <option name="selectionMode" value="DROPDOWN" />
+      </SelectionState>
+    </selectionStates>
+  </component>
+</project>

+ 19 - 0
.idea/gradle.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+          </set>
+        </option>
+        <option name="resolveExternalAnnotations" value="false" />
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>

+ 6 - 0
.idea/kotlinc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="KotlinJpsPluginSettings">
+    <option name="version" value="1.8.20-Beta" />
+  </component>
+</project>

+ 10 - 0
.idea/migrations.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectMigrations">
+    <option name="MigrateToGradleLocalJavaHome">
+      <set>
+        <option value="$PROJECT_DIR$" />
+      </set>
+    </option>
+  </component>
+</project>

+ 7 - 0
.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 92 - 0
README.md

@@ -0,0 +1,92 @@
+# XPCommonService
+
+
+
+## Getting started
+
+To make it easy for you to get started with GitLab, here's a list of recommended next steps.
+
+Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
+
+## Add your files
+
+- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
+- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
+
+```
+cd existing_repo
+git remote add origin http://192.168.111.132/app-group/frontend/xplora/xpcommonservice.git
+git branch -M main
+git push -uf origin main
+```
+
+## Integrate with your tools
+
+- [ ] [Set up project integrations](http://192.168.111.132/app-group/frontend/xplora/xpcommonservice/-/settings/integrations)
+
+## Collaborate with your team
+
+- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
+- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
+- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
+- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
+- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
+
+## Test and Deploy
+
+Use the built-in continuous integration in GitLab.
+
+- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
+- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
+- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
+- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
+- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
+
+***
+
+# Editing this README
+
+When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
+
+## Suggestions for a good README
+Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
+
+## Name
+Choose a self-explaining name for your project.
+
+## Description
+Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
+
+## Badges
+On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
+
+## Visuals
+Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
+
+## Installation
+Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
+
+## Usage
+Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
+
+## Support
+Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
+
+## Roadmap
+If you have ideas for releases in the future, it is a good idea to list them in the README.
+
+## Contributing
+State if you are open to contributions and what your requirements are for accepting them.
+
+For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
+
+You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
+
+## Authors and acknowledgment
+Show your appreciation to those who have contributed to the project.
+
+## License
+For open source projects, say how it is licensed.
+
+## Project status
+If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

BIN
SikeyCommonService.apk


BIN
XPCommonService.apk


+ 1 - 0
app/.gitignore

@@ -0,0 +1 @@
+/build

+ 133 - 0
app/build.gradle

@@ -0,0 +1,133 @@
+plugins {
+    id 'com.android.application'
+    id 'org.jetbrains.kotlin.android'
+}
+
+apply plugin: 'kotlin-kapt'
+
+android {
+    compileSdk 32
+
+    defaultConfig {
+        applicationId "com.sikey.commonservice"
+        minSdk 27
+        targetSdk 32
+        versionCode 1
+        versionName "1.0"
+
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+    }
+    buildFeatures {
+        viewBinding = true
+        buildConfig = true
+    }
+    buildTypes {
+        debug {
+            minifyEnabled false
+            zipAlignEnabled false
+            shrinkResources false
+            buildConfigField "boolean", "LOGGER_DEBUG", "true"
+        }
+        release {
+            buildConfigField "boolean", "LOGGER_DEBUG", "false"
+            minifyEnabled true
+            zipAlignEnabled true
+            shrinkResources true
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+
+    kapt {
+        arguments {
+            arg("room.schemaLocation", "$projectDir/schemas".toString())
+        }
+    }
+    packagingOptions {
+        resources {
+            excludes += ['META-INF/DEPENDENCIES']
+        }
+    }
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_17
+        targetCompatibility JavaVersion.VERSION_17
+    }
+
+    namespace 'com.sikey.commonservice'
+    lint {
+        baseline = file("lint-baseline.xml")
+    }
+
+    applicationVariants.all { variant ->
+        def outputFileDir = "..\\"
+        variant.outputs.all {
+            def fileName = outputFile.name.replace(outputFile.name, "SikeyCommonService.apk")
+            outputFileName = fileName
+        }
+        variant.getAssembleProvider().configure() {
+            it..doLast {
+                File out = new File(outputFileDir)
+                copy {
+                    variant.outputs.forEach { output ->
+                        copy {
+                            from output.outputFile
+                            into out
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+//Add this to get SystemProperties
+String SDK_DIR = System.getenv("ANDROID_SDK_HOME")
+
+if (SDK_DIR == null) {
+    Properties properties = new Properties()
+    properties.load(new FileInputStream(project.rootProject.file("local.properties")))
+    SDK_DIR = properties.get('sdk.dir')
+}
+//Add this to get SystemProperties end
+
+dependencies {
+    implementation files('libs\\udid-1.2.jar')
+    implementation files('libs\\ota-sdk-20230913.aar')
+    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
+    implementation 'com.google.android.material:material:1.4.0'
+    implementation 'androidx.appcompat:appcompat:1.4.2'
+    implementation 'androidx.core:core-ktx:1.7.0'
+    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
+    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
+    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
+    implementation 'androidx.activity:activity-ktx:1.4.0'
+    implementation 'androidx.fragment:fragment-ktx:1.4.1'
+    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+    testImplementation 'junit:junit:4.13.2'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+
+    //retrofit
+    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
+    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
+    implementation 'com.squareup.retrofit2:retrofit-converters:2.5.0'
+    implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.10'
+    implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
+    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
+    //gson
+    implementation 'com.google.code.gson:gson:2.9.0'
+    //kotlin coroutines
+    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
+    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0"
+    //room
+    def roomVersion = "2.4.2"
+    implementation("androidx.room:room-runtime:$roomVersion")
+//    annotationProcessor("androidx.room:room-compiler:$roomVersion")
+    implementation("androidx.room:room-ktx:$roomVersion")
+    // To use Kotlin annotation processing tool (kapt)
+    kapt("androidx.room:room-compiler:$roomVersion")
+
+    //Add this to get SystemProperties
+    compileOnly(files("${SDK_DIR}/platforms/android-24/data/layoutlib.jar"))
+}

BIN
app/libs/ota-sdk-20230913.aar


BIN
app/libs/udid-1.2.jar


BIN
app/libs/xplibcommon.aar


+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 24 - 0
app/src/androidTest/java/com/xplora/commonservice/ExampleInstrumentedTest.kt

@@ -0,0 +1,24 @@
+package com.sikey.commonservice
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+    @Test
+    fun useAppContext() {
+        // Context of the app under test.
+        val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+        assertEquals("com.intellif.commonservice", appContext.packageName)
+    }
+}

+ 223 - 0
app/src/main/AndroidManifest.xml

@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:sharedUserId="android.uid.system">
+
+    <!-- android:sharedUserId="android.uid.system" -->
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
+    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
+    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.READ_CALL_LOG" />
+    <uses-permission android:name="android.permission.CALL_PHONE" />
+    <uses-permission
+        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
+        tools:ignore="ScopedStorage" /> <!-- suppress DeprecatedClassUsageInspection -->
+    <uses-permission android:name="android.permission.GET_TASKS" /> <!-- system permissions -->
+    <uses-permission
+        android:name="android.permission.WRITE_SETTINGS"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.REBOOT"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.PACKAGE_USAGE_STATS"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.READ_LOGS"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.WRITE_MEDIA_STORAGE"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.DELETE_CACHE_FILES"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.ACCESS_CACHE_FILESYSTEM"
+        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+        android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME"
+        tools:ignore="ProtectedPermissions" /> <!-- self permissions -->
+    <uses-permission android:name="com.xplora.provider" />
+    <uses-permission android:name="com.xplora.receiver" />
+    <uses-permission android:name="android.permission.READ_SMS" />
+    <uses-permission android:name="android.permission.RECEIVE_SMS" />
+
+    <permission
+        android:name="com.xplora.receiver"
+        android:protectionLevel="signature" />
+
+    <queries>
+        <package android:name="com.xplora.WatchCommonProvider" />
+        <package android:name="com.xplora.WatchContactProvider" />
+        <package android:name="com.xplora.WatchChatProvider" />
+    </queries>
+
+    <application
+        android:name=".BaseApplication"
+        android:allowBackup="true"
+        android:defaultToDeviceProtectedStorage="true"
+        android:directBootAware="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:persistent="true"
+        android:priority="-1000"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:supportsRtl="true"
+        android:theme="@style/Theme.XploraWatch"
+        android:usesCleartextTraffic="true">
+
+        <activity
+            android:name=".ui.activity.ForceUpdateActivity"
+            android:exported="false"
+            android:launchMode="singleInstance"
+            android:theme="@style/Theme.XploraWatch.DisableSwipeDismiss" />
+        <activity
+            android:name=".ui.activity.SosActivity"
+            android:exported="false"
+            android:launchMode="singleInstance"
+            android:sharedUserId="android.uid.phone"
+            android:theme="@style/Theme.XploraWatch.DisableSwipeDismiss" />
+        <activity
+            android:name=".MainActivity"
+            android:exported="true"
+            android:launchMode="singleInstance">
+
+            <!-- test activity, open this only for debug -->
+<!--                            <intent-filter>
+                            <action android:name="android.intent.action.MAIN" />
+                            <category android:name="android.intent.category.LAUNCHER" />
+                        </intent-filter>-->
+        </activity>
+        <activity android:name=".utils.permission.PermissionActivity" />
+        <activity
+            android:name=".ui.activity.OtaCheckActivity"
+            android:exported="true"
+            android:launchMode="singleInstance">
+<!--            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>-->
+        </activity>
+        <activity android:name=".ui.activity.OtaInstallOverNightActivity" />
+        <activity
+            android:name=".ui.activity.EmptyActivity"
+            android:launchMode="singleInstance"
+            android:theme="@style/Theme.XploraWatch.EmptyAty" />
+        <activity
+            android:name=".ui.activity.DiagnosticToolActivity"
+            android:exported="true">
+<!--            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>-->
+        </activity>
+
+        <activity android:name=".ui.activity.DiagnosticRunningActivity"
+            android:theme="@style/Theme.XploraWatch.DisableSwipeDismiss"
+            android:exported="true"/>
+
+        <activity android:name=".ui.activity.DiagnosticAttentionActivity"
+            android:theme="@style/Theme.XploraWatch.DisableSwipeDismiss"
+            android:exported="true"/>
+
+        <activity android:name=".ui.activity.RoamingAlertActivity"
+            android:theme="@style/Theme.XploraWatch.DisableSwipeDismiss"
+            android:exported="true"/>
+
+        <receiver
+            android:name=".modules.callbacks.BootReceiver"
+            android:exported="true">
+            <intent-filter>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
+            </intent-filter>
+        </receiver>
+        <receiver
+            android:name=".modules.callbacks.LocalReceiver"
+            android:exported="true"
+            android:permission="com.xplora.receiver">
+            <intent-filter>
+                <action android:name="com.xplora.action.ADD_FRIEND" />
+                <action android:name="com.xplora.action.POWER_STATUS" />
+                <action android:name="com.xplora.action.SILENT_BEGIN" />
+                <action android:name="com.xplora.action.SILENT_END" />
+                <action android:name="com.xplora.action.REFRESH_CHAT_LIST" />
+                <action android:name="com.xplora.action.RESET_STEP" />
+                <action android:name="com.xplora.action.ALARM" />
+                <action android:name="com.xplora.action.OTA" />
+                <action android:name="com.xplora.action.OTA_CHECK" />
+                <action android:name="com.xplora.action.DELETE_CONTENT" />
+                <action android:name="com.xplora.action.POSITION" />
+                <action android:name="com.xplora.action.LIVE_TRACKING" />
+            </intent-filter>
+        </receiver>
+        <receiver
+            android:name=".modules.callbacks.NotificationReceiver"
+            android:enabled="true"
+            android:exported="true"
+            tools:ignore="ExportedReceiver">
+            <intent-filter>
+                <action android:name="com.xplora.notification.Chat" />
+                <action android:name="com.xplora.notification.Missed_call" />
+                <action android:name="com.xplora.notification.Ringtone" />
+                <action android:name="com.xplora.notification.Watchface" />
+                <action android:name="com.xplora.notification.Music_Downloading" />
+                <action android:name="com.xplora.notification.Music_Downloaded" />
+                <action android:name="com.xplora.notification.Diagnostic" />
+                <action android:name="com.xplora.notification.ChatFail" />
+            </intent-filter>
+        </receiver>
+        <receiver
+            android:name=".modules.callbacks.CallStatusReceiver"
+            android:enabled="true"
+            android:exported="true"
+            tools:ignore="ExportedReceiver">
+            <intent-filter>
+                <action android:name="com.xplora.call_log" />
+                <action android:name="com.xplora.call.sos" />
+            </intent-filter>
+        </receiver>
+        <service android:name=".modules.service.MusicDownloadService"
+            android:exported="false"
+            android:permission="android.permission.BIND_JOB_SERVICE"/>
+
+        <!-- 是否测试模式 -->
+        <meta-data
+            android:name="ISTEST"
+            android:value="0" />
+        <!-- 是否周末检测 -->
+        <meta-data
+            android:name="ISWEEKCHECK"
+            android:value="0" />
+        <!-- 设置协议版本 -->
+        <meta-data
+            android:name="RSOTA_PROTOCOL_ID"
+            android:value="A1.0" />
+        <!-- 设置渠道 -->
+        <meta-data
+            android:name="RSOTA_CHANNEL_ID"
+            android:value="Snapdragon2500" />
+        <!-- 设置APPID值 ks9uh5u1i2xgttk1teqgfmia   zhangyue1234567890123456 -->
+        <meta-data
+            android:name="RSOTA_APP_ID"
+            android:value="q6rebe6ew6flnfkhz3xsjc0s" />
+    </application>
+
+</manifest>

+ 20 - 0
app/src/main/assets/aws_iot/cacert.crt

@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
+ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
+b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
+MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
+b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
+ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
+9O6II8c+6zf1tRn4SWiw3te5djgdYZ6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yhxb1V8UN
+mOzl5hTUXSEI1REF93BSumDbwkQuLj2qZ1SaLmfVNJaNPJYtIae+9AiouIefzJWy
+w7wMJzq7SQNX/M4X510Fn9DPl8hwMRG4Cgcr8b3flVm3gScP0XbEL12s2hOnYhfB
+NZ/dr5jUAp/HXmfS8bCuhwKBgQCLNy4n6PwiNA9VCW8310JbFiOpwJ4bhdVWLRsb
+WEkdmIVtPTm961Xplji2k5KBPtuQo1Es+qNJOIGkljXjiCTIulKZErbmxr/lCINe
+fd3EqVwK0sfRV5stP94IY2EQvalVsS2EiP+ok4kYOmjlIw1Ox8cpDAFgdM9Yn9DI
+PCB2LwKBgDRmhuVtRgUnyd0R7Uuo4VE6aGNJ63YcahhGlXRp0Malg+Lak/70EQRV
+ZtjceMreabYjWEA7pMsx1DcXsBghQCtgwvBaL8/G+PbbqvGfqt7kRnq7l/x4YoXi
+Mr66yDB+GpzTVnNm5WdtSmXfvljxXKG+jOBvK7D3GOiMTWi2JV7C
+-----END RSA PRIVATE KEY-----

BIN
app/src/main/assets/aws_iot/p12.keystore


+ 20 - 0
app/src/main/assets/aws_iot_test/cacert.development.crt

@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
+ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
+b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
+MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
+b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
+ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
+9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
+IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
+VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
+93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
+jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
+AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
+A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
+U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
+N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
+o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
+5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
+rqXRfboQnoZsG4q5WTP468SQvvG5
+-----END CERTIFICATE-----

+ 20 - 0
app/src/main/assets/aws_iot_test/client.cert.development.pem

@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDWjCCAkKgAwIBAgIVAPkvIDNm2HOlhDE8z45CbewzFE5QMA0GCSqGSIb3DQEB
+CwUAME0xSzBJBgNVBAsMQkFtYXpvbiBXZWIgU2VydmljZXMgTz1BbWF6b24uY29t
+IEluYy4gTD1TZWF0dGxlIFNUPVdhc2hpbmd0b24gQz1VUzAeFw0yMjAyMjgxMzAy
+NDVaFw00OTEyMzEyMzU5NTlaMB4xHDAaBgNVBAMME0FXUyBJb1QgQ2VydGlmaWNh
+dGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDmdWWnPS1kuRfBVl64
+Uxj/++QQcon5ACNkWy+VrArc9pCDGVWmeRvzOzm/D9NgNTenuPXYLRdESNDHcP+w
+/8oDwD3YtfdQQTOJ6cQCLrCx3ME8ExkbQycBGCwBf66/ObaWXiFSSlQs7j3VvXcM
+teujstRQvJQVgG2XpVdqUIXbGdogwjIjp9PBe2HRqyrF9jZVFODiA1DcliYJX4mP
+62IchCDS7vpPOJ0RaZ9WKYMVLuSdECHzfKwIMAM53/9cySNLH8jag9Cx/wgrEADx
+dE8DV9o9uoanWVv+iVh5B3t4oAZL4LF4fqF9X2NUHMbLMhVWD50PLxieUw3gOLn5
+2MzbAgMBAAGjYDBeMB8GA1UdIwQYMBaAFCogox/RwpD42tPT0CEj1yPTPo9PMB0G
+A1UdDgQWBBQAxGwzSNkkSE95dCH+3fXzZ338ITAMBgNVHRMBAf8EAjAAMA4GA1Ud
+DwEB/wQEAwIHgDANBgkqhkiG9w0BAQsFAAOCAQEAJTqQRDYFuoTAACUfEkBNftFI
+7Pw8A2zLnOq5dko/I3WuJ04NKld4SOSHjEjms3uOZgooeOeMU+dYk68JKAYrplIi
+iExQWDmJTG8kzyw7589V8A4HkUSFtK071LMU92lHSvHb8V0mOO/2kWtBS/b22r63
+O4Ahp13VSVyqwsFa/52INXmDifafqp9hDgSThs64fH2P4Wl6icsit7kqa4utLSJY
+m/LsddQlE4WwNtTT8So0TYm/TfYH8I3QShSmXer4gSWXdSBkten1p0i6a82pzORZ
+88vt3IvCN7x0uTCiylmjzZqaBYWu0XmptnWfhj4jOA6FHooMsHocngiMuiqGXA==
+-----END CERTIFICATE-----

+ 27 - 0
app/src/main/assets/aws_iot_test/client.private.development.key

@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEA5nVlpz0tZLkXwVZeuFMY//vkEHKJ+QAjZFsvlawK3PaQgxlV
+pnkb8zs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Ma1e1hlbMMKMnPH9fIxlFSSzhXJfja8kR
+9ZoYmjGBv3dooole20Sk7OkD/WnnFGM0yhDFuvbOjizGVcKYr2nsnxV9uetkPLQs
+SDV1Q9NUhpOwA4WX6uxrf3tXAoGAConqWVlzpcHfrpDEuYAeqvwNJtXyAX2il1XK
+Bu6XU84tHuf4FR58dGkCXmljccpKwofCit0xz7a0A04Tjfc5F6rIa8DFse2y1whI
+l7Mx93N1WsOjKWcKFb6vHw9M+ehKQPeHm7SjqV2fse+PJx77gZkVpa/W13F58TLS
+/Vt3FV8CgYBYmkopAKM/9QZYFyK0PVd7l5xRtqoLNqscrvRbESmzXM2Tjv8vM8ZR
+LmVOAiQQXLeDzLG0PbMszuCnWW8vV1nz2/bX2HVYfvqiSAMbly5r6d72pTQ8dkNm
+XKVRj346Rnnan07sRb8/zRc7yw8DOfBd5thkgmJMPR0I+1iJM/POKg==
+-----END RSA PRIVATE KEY-----

BIN
app/src/main/assets/aws_iot_test_new/p12.keystore


BIN
app/src/main/assets/aws_iot_test_new/test_new.p12


+ 75 - 0
app/src/main/assets/config.xml

@@ -0,0 +1,75 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<map>
+    <!-- 自动适配模式 -->
+    <string name="auto_adapter_mode">false</string>
+    <!-- 是否转接属性 -->
+    <string name="transfer_prop">false</string>
+    <!-- 是否使用https -->
+    <string name="is_https">true</string>
+    <!-- 是否测试模式 -->
+    <string name="is_test">false</string>
+    
+    <!-- 升级包存储路径,data/sdcard/other -->
+    <string name="up_storage_partition">data</string>
+    <!-- 是否使用写command方式安装,该设置与升级包存储路径对应配置,即:data:false,其他:true -->
+    <string name="install_mode_command">false</string>
+    <!-- 屏幕横竖屏设置,true/false -->
+    <string name="screen_orientation_vertical">true</string>
+    <!-- 固件版本property属性值 -->
+    <string name="property_firmware_version">ro.build.id</string>
+    <!-- 设备机型property属性值 -->
+    <string name="property_model">ro.product.name</string>
+    <!-- 设备品牌property属性值 -->
+    <string name="property_brand">ro.product.manufacturer</string>
+    
+    <!-- 特殊下载路径 -->
+    <string name="other_app_mount_path">/data/ota_package</string>
+    <!-- recovery模式下特殊特殊路径的识别路径) -->
+    <string name="other_recovery_mount_path">/data/ota_package</string>  
+    
+    <!-- sdCard下载路径 -->
+    <string name="sdcard_app_mount_path">/mnt/sdcard</string>
+    <!-- recovery内置sd卡识别路径) -->
+    <string name="sdcard_recovery_mount_internal_path">/data/media/0</string>  
+    <!-- recovery外置sd卡识别路径 -->
+    <string name="sdcard_recovery_mount_external_path" />
+    <!-- 本地升级 内置sd卡识别根目录 -->
+    <string name="sdcard_internal_root_path">/mnt/sdcard</string>
+    <!-- 本地升级 外置sd卡识别根目录 -->
+    <string name="sdcard_external_root_path" />
+
+    
+    <!-- 是否自动下载的默认值 -->
+    <string name="auto_download">true</string>
+     <!-- 是否AB模式 -->
+    <string name="is_ab_mode">false</string>
+    <!-- 是否开启广播 -->
+    <string name="is_broadcast_enable">false</string>
+    <!-- 自动检查更新周期的默认值(单位:正数:天,负数:小时) -->
+    <string name="auto_check_cycle_selected">1</string>
+    <!-- 自动检查更新周期的默认选项值(0:永不)(单位:正数:天,负数:小时) -->
+    <string name="auto_check_cycle_options">|1|7|14|0|</string>    
+    <!-- 低内存报警阀值(单位:MB) -->
+    <string name="memory_low_threshold">100</string>
+    <!-- 是否检测低电量 -->
+    <string name="battery_low_detect">true</string>
+
+    <!-- 服务器HTTPS URL -->
+    <string name="ota_serverl_https_url">https://fota.redstone.net.cn:7100/service/request</string>
+    <string name="ota_report_https_url">https://fota.redstone.net.cn:7100/service/report</string>
+    
+    <!-- 是否开启安装前校验SHA1值 -->
+    <string name="verify_package_sha1">true</string>
+    <!-- 是否显示拷贝日志选项 -->
+    <string name="copy_recovery_log">false</string>
+    <!-- 是否显示本地升级功能选项 -->
+    <string name="have_local_update">false</string>
+    <!-- 强制升级 -->
+    <string name="key_force_update">true</string>
+    
+    <!-- 检查下载进度的间隔时间 (单位 ms) -->
+    <string name="ui_progress_refresh_interval_time">1000</string>
+    <!-- 刷新进度条的间隔大小 (单位 KB) -->
+    <string name="ui_progress_refresh_interval_size">200</string>
+    
+</map>

BIN
app/src/main/assets/my.keystore


+ 7 - 0
app/src/main/assets/readme.txt

@@ -0,0 +1,7 @@
+1、创建p12
+openssl pkcs12 -export -in .\client.cert.pem -inkey .\client.private.key -out test_new.p12 -name test_new -password pass:sikey2022
+
+2、转化为jks
+keytool -importkeystore -destkeystore p12.keystore -srckeystore .\test_new.p12 -srcstoretype PKCS12 -srcstorepass sikey2022 -deststorepass sikey2022
+
+3、使用KeyStoreExplorer工具,把加密类型转为BKS格式

BIN
app/src/main/assets/test.keystore


BIN
app/src/main/assets/test_new.keystore


+ 121 - 0
app/src/main/java/com/sikey/commonservice/BaseApplication.kt

@@ -0,0 +1,121 @@
+package com.sikey.commonservice
+
+import android.Manifest
+import android.annotation.SuppressLint
+import android.app.Application
+import android.content.Context
+import android.content.Intent
+import android.content.IntentFilter
+import android.net.ConnectivityManager
+import android.os.Handler
+import android.os.Looper
+import android.os.SystemProperties
+import android.provider.Settings
+import com.sikey.commonservice.model.Config.INIT_URL
+import com.sikey.commonservice.model.Config.INIT_URL_TEST
+import com.sikey.commonservice.model.LocalActions.ACTION_SIM_STATE_CHANGED
+import com.sikey.commonservice.model.infobean.AwsIotConfig
+import com.sikey.commonservice.model.infobean.PositionInfoBean
+import com.sikey.commonservice.model.infobean.ServerInfo
+import com.sikey.commonservice.modules.OtaManager
+import com.sikey.commonservice.modules.OtaManager.initOta
+import com.sikey.commonservice.modules.WatchStateChangeImpl
+import com.sikey.commonservice.modules.WatchStateChangeImpl.onBootCompleted
+import com.sikey.commonservice.modules.callbacks.*
+import com.sikey.commonservice.modules.callbacks.CallLogObserver.Companion.callLogUri
+import com.sikey.commonservice.modules.callbacks.SmsObserver.Companion.smsUri
+import com.sikey.commonservice.modules.database.DatabaseManager.CHAT_TABLE
+import com.sikey.commonservice.modules.database.DatabaseManager.GOPLAY_CONTENT_TABLE
+import com.sikey.commonservice.utils.Logger
+import com.sikey.commonservice.utils.permission.PermissionActivity
+
+class BaseApplication : Application() {
+
+    override fun onCreate() {
+        super.onCreate()
+        Logger.d(TAG, "on application create: ${Thread.currentThread()}")
+        globalContext = applicationContext
+        Settings.Global.getInt(globalContext.contentResolver, "init_url", 0).let {
+            isTest = it == 1
+            Logger.d(TAG, "init_url : $it , isTest: $isTest")
+        }
+
+        serverInfo = ServerInfo(
+            initUrl = if (isTest) {
+                INIT_URL_TEST
+            } else {
+                INIT_URL
+            },
+            serverUrl = if (isTest) {
+                INIT_URL_TEST
+            } else {
+                INIT_URL
+            }
+        )
+        checkPermission()
+        val netReceiver = NetStateChangeReceiver
+        netReceiver.registerObserver(stateObserver)
+        netReceiver.registerObserver(otaNetStateObserver)
+        registerReceiver(netReceiver)
+        registerObserver()
+        if (SystemProperties.getInt("sys.boot_completed", 0) == 1) {
+            onBootCompleted()
+        }
+        initOta()
+    }
+
+    private fun registerReceiver(receiver: NetStateChangeReceiver) {
+        val filter = IntentFilter()
+        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION)
+        registerReceiver(receiver, filter)
+
+        val systemInfoFilter = IntentFilter()
+        systemInfoFilter.addAction(Intent.ACTION_BATTERY_CHANGED)
+        systemInfoFilter.addAction(Intent.ACTION_TIME_CHANGED)
+        systemInfoFilter.addAction(ACTION_SIM_STATE_CHANGED)
+        val systemInfoReceiver = SystemInfoReceiver()
+        registerReceiver(systemInfoReceiver, systemInfoFilter)
+    }
+
+    private fun registerObserver() {
+        contentResolver.registerContentObserver(
+            CHAT_TABLE, true, ChatDbObserver(Handler((Looper.myLooper()!!)))
+        )
+        contentResolver.registerContentObserver(
+            callLogUri, true, CallLogObserver(Handler((Looper.myLooper()!!)))
+        )
+        contentResolver.registerContentObserver(
+            smsUri, true, SmsObserver(Handler((Looper.myLooper()!!)))
+        )
+        contentResolver.registerContentObserver(
+            GOPLAY_CONTENT_TABLE, true, GoplayDbObserver(Handler(Looper.myLooper()!!))
+        )
+    }
+
+    private fun checkPermission() {
+        val intent = Intent(this, PermissionActivity::class.java)
+        intent.putExtra(PermissionActivity.EXTRA_PERMISSIONS, permissionListTmp)
+        startActivity(intent)
+    }
+
+    companion object {
+        private const val TAG = "BaseApplication"
+
+        @SuppressLint("StaticFieldLeak")
+        lateinit var globalContext: Context
+        val stateObserver: WatchStateChangeImpl by lazy { WatchStateChangeImpl }
+        val otaNetStateObserver: OtaManager by lazy { OtaManager }
+        var isTest: Boolean = false
+        lateinit var serverInfo: ServerInfo
+        val iotConfig = AwsIotConfig()
+        val positionInfo = PositionInfoBean()
+        var token:String = ""
+
+        private val permissionListTmp = arrayOf(
+            Manifest.permission.ACCESS_WIFI_STATE,
+            Manifest.permission.WRITE_EXTERNAL_STORAGE,
+            Manifest.permission.READ_EXTERNAL_STORAGE,
+            Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS
+        )
+    }
+}

+ 36 - 0
app/src/main/java/com/sikey/commonservice/MainActivity.kt

@@ -0,0 +1,36 @@
+package com.sikey.commonservice
+
+import android.annotation.SuppressLint
+import android.app.Activity
+import android.os.Bundle
+import android.widget.Button
+import android.widget.TextView
+import com.sikey.commonservice.modules.service.diagnostic.DiagnosticService
+import kotlinx.coroutines.DelicateCoroutinesApi
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import org.w3c.dom.Text
+import java.io.File
+
+class MainActivity : Activity() {
+
+    @OptIn(DelicateCoroutinesApi::class)
+    @SuppressLint("CheckResult", "SetTextI18n", "RemoteViewLayout")
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_main)
+        val btn1 = findViewById(R.id.btn_1) as Button
+        val text = findViewById(R.id.tv_content) as TextView
+        var file: File? = null
+        btn1.setOnClickListener {
+/*            GlobalScope.launch {
+                file = DiagnosticService.uploadLogs()
+                file?.let {
+                    if(it.exists()) {
+                        text.text = "${it.absolutePath} : ${it.length()}"
+                    }
+                }
+            }*/
+        }
+    }
+}

+ 78 - 0
app/src/main/java/com/sikey/commonservice/model/Apn.kt

@@ -0,0 +1,78 @@
+package com.sikey.commonservice.model
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.database.BaseDbEntity
+
+data class ApnSms(
+    @SerializedName("id") val id: String,
+    @SerializedName("pkg") val pkg: String,
+    @SerializedName("data") val data: String
+)
+
+data class ApnIds(
+    @SerializedName("_id")
+    var _id: Long = -1
+):BaseDbEntity()
+
+data class ApnData(
+    @SerializedName("name")
+    var name: String = "",
+    @SerializedName("mcc")
+    var mcc: String = "",
+    @SerializedName("mnc")
+    var mnc: String = "",
+    @SerializedName("apn")
+    var apn: String = "",
+    @SerializedName("user")
+    var username: String = "",
+    @SerializedName("password")
+    var password: String = "",
+    @SerializedName("proxy")
+    var proxy: String = "",
+    @SerializedName("port")
+    var port: String = "",
+    @SerializedName("server")
+    var server: String = "",
+    @SerializedName("mmsc")
+    var mmsc: String = "",
+    @SerializedName("mmsproxy")
+    var mmsProxy: String = "",
+    @SerializedName("mmsport")
+    var mmsPort: String = "",
+    @SerializedName("authtype")
+    var authType: String = "",
+    @SerializedName("type")
+    var apnType: String = "",
+    @SerializedName("protocol")
+    var apnProtocol: String = "",
+    @SerializedName("roaming_protocol")
+    var apnRoamingProtocol: String = "",
+    @SerializedName("bearer")
+    var bearer: String = "",
+    @SerializedName("mvno_type")
+    var mvnoType: String = "",
+    @SerializedName("mvno_match_data")
+    var mvnoValue: String = ""
+) : BaseDbEntity() {
+    fun toApnData(list: List<String>): ApnData {
+        return ApnData().apply {
+            name = list[0]
+            mcc = list[1]
+            mnc = list[2]
+            apn = list[3]
+            username = list[4]
+            password = list[5]
+            proxy = list[6]
+            port = list[7]
+            server = list[8]
+            mmsc = list[9]
+            mmsProxy = list[10]
+            mmsPort = list[11]
+            authType = list[12]
+            apnType = list[13]
+            apnProtocol = list[14]
+            apnRoamingProtocol = list[15]
+            bearer = list[16]
+        }
+    }
+}

+ 405 - 0
app/src/main/java/com/sikey/commonservice/model/Const.kt

@@ -0,0 +1,405 @@
+package com.sikey.commonservice.model
+
+import android.os.SystemProperties
+import com.sikey.commonservice.model.Config.PROTOCOL_VERSION
+import com.sikey.commonservice.model.Config.SK_PROTOCOL_VERSION
+
+object Config {
+    const val LOCAL_RECEIVER_PERMISSION = "com.xplora.receiver"
+
+    /**
+     * test server: "https://htk-start-dev.myxplora.com"
+     * mp   server: "https://htk.myxplora.com"
+     **/
+    const val INIT_URL = "https://htk.myxplora.com"
+    const val INIT_URL_TEST = "https://htk.staging.myxplora.com"
+    const val BASE_DOWNLOAD_URL = "https://xplora-images.s3.eu-central-1.amazonaws.com/"
+    const val INIT_PORT = 443
+    const val PROTOCOL_VERSION = "/v2"
+
+    // Sikey Urls
+    const val SK_URL = "http://api.sikey.com.cn"//"https://sgp.tecanswer.com/"
+    const val SK_PROTOCOL_VERSION = "/api/v2"//"/w/api/v2"
+    const val SK_TOOL_URL = "http://api.tools.sikey.com.cn"
+    const val WS_URL = "ws://api.sikey.com.cn/api/v2/gatewayctx/connect/websocket"//"wss://sgp.tecanswer.com/w/api/v2/gatewayctx/connect/websocket"
+
+    //test keys
+    const val DEFAULT_SN = "112GX110e100000"
+    const val BACK_DOOR = "62a58828255d54c190bf92b2b3542e0ef9285fa479d0595c92c357d53513d0bb"
+    const val TEST_IMEI = "867245070123388"
+    const val TEST_SECRET_KEY_IMEI = "241d017f9d835a9db3ae8a46311bee17"
+    const val TEST_HC = "HC_dT7ezBQWZ2yQIfQgmU2dziROyK"
+    const val TEST_AES_KEY = "SOlpotPE2Dtef1Uf"
+    const val TEST_TICKET = "TK_dRnWFal0bf"
+    //test keys end
+
+    val INIT_SECRET = if (SystemProperties.getBoolean(
+            "ro.product.support.esim",
+            false
+        )
+    ) "91a837b21efe5aedadbd9b2b55d0d41b" else "3472ee0e78e85a9ab0075e2ca61b6d38"
+    val INIT_KEY = if (SystemProperties.getBoolean(
+            "ro.product.support.esim",
+            false
+        )
+    ) "ad4267b6f85655eca414672cc7a82ef3" else "b05a400d116b582c9b4742a50dcc5f48"
+    const val VENDOR = "sikey"
+    const val DEFAULT_CONTENT_TYPE = "application/json; charset=utf-8"
+    const val TYPE = "1"
+    const val REQUEST_QUERY = "tid"
+    val MODEL =
+        if (SystemProperties.getBoolean("ro.product.support.esim", false)) "X6E" else "X6"
+    val DEVICE_ATTRIBUTE =
+        if (SystemProperties.getBoolean("ro.product.support.esim", false)) "S200" else "S100"
+    val DEVICE_TYPE =
+        if (SystemProperties.getBoolean("ro.product.support.esim", false)) "122" else "102"
+    val IMEI: String = SystemProperties.get("persist.zs.imei.number", "")
+    val HC: String = SystemProperties.get("persist.sikey.hardcode", "")
+
+    //THRESHOLD
+    const val POSITIONING_DURATION: Long = 60 * 1000
+    const val POSITION_FREQ = 5 //Minute
+    const val LIVE_TRACKING_FREQ = 24 //Second
+    const val POSITIONING_STEP_THRESHOLD = 180
+    const val POSITIONING_TIME_THRESHOLD = 2 * 60 * 60 * 1000
+    const val STEP_REPORT_TIME_THRESHOLD = 1 * 60 * 60 * 1000
+    const val FORECAST_WEATHER_UPDATE_THRESHOLD = 6 * 60 * 60 * 1000
+    const val CURRENT_WEATHER_UPDATE_THRESHOLD = 60 * 60 * 1000
+
+    val LOW_BATTERY_NOTIFY_NODE = listOf(0, 5, 10, 15, 20)
+
+    //THRESHOLD end
+
+    // sms decrypt key
+    const val SMS_DECRYPT_KEY = "20b36f8b"
+}
+
+object CkError {
+    const val SUCCESS = "S000001"
+    const val ERROR_UNKNOWN = "E000001"
+    const val ERROR_NEED_RESET = "E100015"
+}
+
+object CkMessage {
+    const val SUCCESS = "SUCCESS"
+    const val ERROR_UNKNOWN = "Failure. Failure not specifically defined."
+}
+
+object SKHttpApi {
+    const val ADD_FRIEND = "$SK_PROTOCOL_VERSION/userctx/user/child/contacts/wristwatch/friend/add"
+    const val GENERATE_FRIEND_CODE = "$SK_PROTOCOL_VERSION/userctx/user/child/contacts/wristwatch/friend/generate-code"
+    const val GET_WRIST_WATCH_CONTACT_PERSON = "$SK_PROTOCOL_VERSION/userctx/user/child/contacts/wristwatch/get"
+    const val DEVICE_WRIST_WATCH_EXCHANGE = "$SK_PROTOCOL_VERSION/userctx/user/child/device/wristwatch/exchange"
+    const val DEVICE_WRIST_WATCH_BINDING = "$SK_PROTOCOL_VERSION/userctx/user/child/device/wristwatch/binding"
+    const val GET_ALL_WRISTWATCH_ALARM_CLOCK = "$SK_PROTOCOL_VERSION/userctx/user/alarm-clock/wristwatch/getall"
+    const val GET_ALL_WRISTWATCH_SCHOOL_DISABLE = "$SK_PROTOCOL_VERSION/userctx/user/child/school-disable/wristwatch/getall"
+    const val GET_BLOCK_UNKNOWN_CALL = "$SK_PROTOCOL_VERSION/userctx/user/child/block-unknown-call/get"
+    const val UPLOAD_FILE = "$SK_PROTOCOL_VERSION/userctx/file/upload"
+
+    const val CHAT_TEXT = "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/chat/text"
+    const val CHAT_VIDEO = "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/chat/video"
+    const val CHAT_VOICE = "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/chat/voice"
+    const val CHAT_EMOJI = "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/chat/emoji"
+    const val CHAT_IMAGE = "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/chat/image"
+
+    const val VIDEO_CALL_DIAL = "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/video-call/dial"
+    const val VIDEO_CALL_HANGUP= "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/video-call/hangup"
+
+    const val PUSH_ACK= "$SK_PROTOCOL_VERSION/messagectx/messaging/publish/ack"
+
+    const val WRISTWATCH_SESSION= "$SK_PROTOCOL_VERSION/messagectx/history/wristwatch/session"
+
+    const val POSITION_IOT = "$SK_PROTOCOL_VERSION/locatectx/location/iot"
+
+    const val VIDEO_GENERATE_TOKEN = "/token/generate"
+
+}
+
+object HttpApi {
+    const val INIT = "$PROTOCOL_VERSION/init"
+
+    const val PUSH_RESULT = "$PROTOCOL_VERSION/fcm/result"
+
+    object Location {
+        private const val PREFIX = "$PROTOCOL_VERSION/location"
+        const val GPS = "$PREFIX/gps"
+        const val CELL = "$PREFIX/cell"
+        const val MULTI = "$PREFIX/multi"
+        const val TRACKING_STATUS = "$PREFIX/tracking/status"
+        const val COMBAIN = PREFIX
+    }
+
+    object Battery {
+        const val PERCENT = "$PROTOCOL_VERSION/battery/percent"
+    }
+
+    object Call {
+        const val LOG = "$PROTOCOL_VERSION/call/log"
+    }
+
+    object Step {
+        const val COUNT = "$PROTOCOL_VERSION/step/count"
+        const val COUNT_TOTAL = "$COUNT/total"
+        const val COUNT_HISTORY = "$COUNT/history"
+    }
+
+    object Watch {
+        private const val PREFIX = "$PROTOCOL_VERSION/watch"
+
+        object Status {
+            private const val STATUS_PREFIX = "$PREFIX/status"
+            const val GET = "$STATUS_PREFIX/get"
+            const val SET = "$STATUS_PREFIX/set"
+            const val INFO = "$STATUS_PREFIX/info"
+        }
+
+        object Factory {
+            const val RESET = "$PREFIX/factory/reset"
+        }
+
+        object Power {
+            const val SET = "$PREFIX/power/set"
+        }
+
+        object Network {
+            private const val NETWORK_STATUS_PREFIX = "$PREFIX/network/status"
+            const val SET = "$NETWORK_STATUS_PREFIX/set"
+        }
+
+        object Log {
+            private const val LOG_PREFIX = "$PREFIX/log"
+            const val SAVE = "$LOG_PREFIX/save"
+        }
+
+        const val SIM = "$PREFIX/updateSIM"
+
+        const val WIFI = "$PREFIX/wifi/get"
+    }
+
+    object Etc {
+        private const val PREFIX = "$PROTOCOL_VERSION/etc"
+        const val GUARDIANS = "$PREFIX/guardians"
+        const val SOS = "$PREFIX/sos"
+        const val FirmwareVersion = "$PREFIX/watch/firmware/version"
+        const val XCoin = "$PREFIX/coin/count"
+
+        object Model {
+            const val GET = "${PREFIX}/watch/model/get"
+            const val SET = "${PREFIX}/watch/model/set"
+        }
+    }
+
+    object Alarm {
+        const val LIST = "$PROTOCOL_VERSION/alarm/list"
+    }
+
+    object Silent {
+        const val LIST = "$PROTOCOL_VERSION/silent/list"
+    }
+
+    object Contact {
+        const val LIST = "$PROTOCOL_VERSION/contact/list"
+    }
+
+    object Friend {
+        private const val PREFIX = "$PROTOCOL_VERSION/friend"
+        const val CODE = "$PREFIX/code"
+        const val ADD = "$PREFIX/add"
+    }
+
+    object Emoji {
+        const val LIST = "$PROTOCOL_VERSION/emoji/list"
+    }
+
+    object Weather {
+        private const val PREFIX = "$PROTOCOL_VERSION/weather"
+        const val CURRENT = "$PREFIX/current"
+        const val FORECAST = "$PREFIX/forecast"
+        const val CITYID = "$PREFIX/cityid"
+
+        object CityId {
+            const val ALL = "$CITYID/all"
+        }
+    }
+
+    object File {
+        private const val PREFIX = "$PROTOCOL_VERSION/file"
+        const val UPLOAD = "$PREFIX/upload"
+
+        object Separate {
+            private const val SEPARATE_PREFIX = "$PREFIX/separate"
+            const val SEPARATE_UPLOAD = "$SEPARATE_PREFIX/upload"
+            const val SEPARATE_START = "$UPLOAD/start"
+            const val SEPARATE_END = "$UPLOAD/end"
+        }
+    }
+
+    object Chat {
+        private const val PREFIX = "$PROTOCOL_VERSION/chat"
+        const val VOICE = "$PREFIX/voice"
+        const val TEXT = "$PREFIX/text"
+        const val EMOJI = "$PREFIX/emoji"
+        const val PHOTO = "$PREFIX/photo"
+        const val VIDEO = "$PREFIX/video"
+        const val MUSIC = "$PREFIX/music"
+        const val SMS = "$PREFIX/sms"
+        const val MSG = "$PREFIX/msg"
+
+        object Msg {
+            const val STATE = "$MSG/state"
+            const val LIST = "$MSG/list"
+
+            const val UNREAD = "$MSG/count/unread"
+            const val UNREAD_ALL = "$UNREAD/all"
+
+            const val READ = "$MSG/read"
+            const val READ_ALL = "$READ/all"
+
+            const val REMOVE = "$MSG/remove"
+        }
+    }
+
+    object PowerSaving {
+        private const val PREFIX = "$PROTOCOL_VERSION/mode/power/saving"
+        const val GET = "$PREFIX/get"
+        const val SET = "$PREFIX/set"
+        const val INFO = "$PREFIX/info"
+    }
+
+    object APN {
+        const val DATA = "$PROTOCOL_VERSION/apn/data"
+    }
+
+    object Content {
+        private const val PREFIX = "$PROTOCOL_VERSION/content"
+        const val GET = "${PREFIX}/get"
+        const val RESULT = "${PREFIX}/download/result"
+    }
+
+    object MqttCode {
+        const val REQUEST_UPLOAD_LOCATION = 1000
+        const val REQUEST_UPLOAD_LOCATION_CONTINUOUS = 1010
+        const val REQUEST_UPLOAD_BATTERY = 1020
+        const val REQUEST_CURRENT_TOTAL_STEP = 1030
+        const val NOTIFY_STATUS_UPDATED = 1040
+        const val REQUEST_STATUS = 1050
+        const val NOTIFY_FACTORY_RESET = 1060
+        const val REQUEST_POWER_STATUS = 1070
+        const val NOTIFY_TURN_OFF = 1080
+        const val NOTIFY_REBOOT = 1090
+        const val NOTIFY_ALARM_UPDATED = 1100
+        const val NOTIFY_SILENT_MODE_UPDATED = 1110
+        const val NOTIFY_CONTACT_UPDATED = 1120
+        const val NOTIFY_EMOJI_UPDATED = 1130
+        const val NOTIFY_NEW_MSG = 1150
+        const val NOTIFY_SENT_MSG_STATUS = 1160
+        const val NOTIFY_DELETE_MSG = 1170
+        const val NOTIFY_GROUP_CHAT_UPDATED = 1180
+        const val NOTIFY_NEW_GROUP_MSG = 1190
+        const val NOTIFY_RECEIVED_GROUP_MSG_STATUS = 1200
+        const val NOTIFY_GROUP_MSG_DELETE = 1210
+        const val NOTIFY_POWER_SAVING_MODE = 1220
+        const val REQUEST_UPLOAD_POWER_SAVING_MODE = 1230
+        const val NOTIFY_APN_UPDATE = 1240
+        const val NOTIFY_SERVER_INFO_UPDATE = 1250
+        const val REQUEST_WATCH_MODEL = 1260
+        const val REQUEST_UPLOAD_DAILY_STEP = 1270
+        const val REQUEST_UPLOAD_VERSION = 1280
+        const val REQUEST_START_LOCATION_TRACKING = 1290
+        const val REQUEST_STOP_LOCATION_TRACKING = 1300
+        const val REQUEST_UPLOAD_LOCATION_TRACKING_STATUS = 1310
+        const val NOTIFY_PRE_DEFINED_PHRASE_UPDATE = 1320
+        const val REQUEST_NET_STATUS = 1330
+        const val NOTIFY_WIFI_UPDATE = 1360
+        const val NOTIFY_CONTENT_DOWNLOAD = 1500
+        const val NOTIFY_XCOIN_COST = 1510
+    }
+}
+
+object ChatMsgState {
+    const val MESSAGE_STATE_UNREAD = 0
+    const val MESSAGE_STATE_READ = 1
+    const val MESSAGE_STATE_SEND_ING = 2
+    const val MESSAGE_STATE_SEND_SUCCESS = 3
+    const val MESSAGE_STATE_SEND_FAIL = 4
+    const val MESSAGE_STATE_DELETE = 5
+    const val MESSAGE_STATE_UNKNOWN = 99
+}
+
+object ChatMsgType {
+    const val TEXT = 20
+    const val VIDEO = 21
+    const val VOICE = 22
+    const val EMOJI = 23
+    const val PHOTO = 24
+
+    const val MP3 = 104
+    const val SMS = 106
+}
+
+enum class ChatFileType(private val desc: String) {
+    UNKNOWN("UNKNOWN"),
+    PHOTO("PHOTO"),
+    VOICE("VOICE"),
+    COVER("COVER"),
+    VIDEO("VIDEO"),
+    MUSIC("MUSIC"),
+    LOG("LOG");
+
+    override fun toString(): String {
+        return desc
+    }
+}
+
+enum class NetworkType(private val desc: String) {
+    NETWORK_WIFI("WiFi"),
+    NETWORK_4G("4G"),
+    NETWORK_2G("2G"),
+    NETWORK_3G("3G"),
+    NETWORK_UNKNOWN("Unknown"),
+    NETWORK_NO("No network");
+
+    override fun toString(): String {
+        return desc
+    }
+}
+
+enum class HighTempStatus {
+    OFF, DISABLE, SHUTDOWN
+}
+
+enum class MusicDownloadStatus {
+    NEW, DOWNLOADING, DONE, Failed
+}
+
+enum class REASON {
+    FAILED, LOW_MEMORY, NO_NETWORK, SUCCESS, DELETE
+}
+
+object LocalActions {
+    const val ACTION_ADD_FRIEND = "com.xplora.action.ADD_FRIEND"
+    const val ACTION_POWER_STATUS = "com.xplora.action.POWER_STATUS"
+    const val ACTION_REFRESH_CHAT_LIST = "com.xplora.action.REFRESH_CHAT_LIST"
+    const val ACTION_SILENT_BEGIN = "com.xplora.action.SILENT_BEGIN"
+    const val ACTION_SILENT_END = "com.xplora.action.SILENT_END"
+    const val ACTION_RESET_STEP = "com.xplora.action.RESET_STEP"
+    const val ACTION_POSITION = "com.xplora.action.POSITION"
+    const val ACTION_LIVE_TRACKING = "com.xplora.action.LIVE_TRACKING"
+    const val ACTION_ALARM = "com.xplora.action.ALARM"
+    const val ACTION_OTA = "com.xplora.action.OTA"
+    const val ACTION_OTA_CHECK = "com.xplora.action.OTA_CHECK"
+    const val ACTION_CALL_LOG = "com.xplora.call_log"
+    const val ACTION_SOS = "com.xplora.call.sos"
+    const val ACTION_DELETE_CONTENT = "com.xplora.action.DELETE_CONTENT"
+
+    const val NOTIFICATION_CHAT = "com.xplora.notification.Chat"
+    const val NOTIFICATION_MISSED_CALL = "com.xplora.notification.Missed_call"
+    const val NOTIFICATION_RINGTONE = "com.xplora.notification.Ringtone"
+    const val NOTIFICATION_WATCHFACE = "com.xplora.notification.Watchface"
+    const val NOTIFICATION_MUSIC_DOWNLOADING = "com.xplora.notification.Music_Downloading"
+    const val NOTIFICATION_MUSIC_DOWNLOADED = "com.xplora.notification.Music_Downloaded"
+    const val NOTIFICATION_DIAGNOSTIC = "com.xplora.notification.Diagnostic"
+    const val NOTIFICATION_CHAT_FAIL = "com.xplora.notification.ChatFail"
+
+    const val ACTION_SIM_STATE_CHANGED = "android.intent.action.SIM_STATE_CHANGED"
+}

+ 53 - 0
app/src/main/java/com/sikey/commonservice/model/MqttMessage.kt

@@ -0,0 +1,53 @@
+package com.sikey.commonservice.model.mqtt
+
+import com.google.gson.annotations.SerializedName
+
+open class BaseMessage<T>(
+    @SerializedName("data")
+    var data: PushData<T>? = null,
+    @SerializedName("background")
+    var background: Boolean = false,
+    @SerializedName("badge")
+    var badge: Int? = null,
+    @SerializedName("notification")
+    var notification: PushNotification? = null
+)
+
+open class PushData<T>(
+    @SerializedName("xpVersion")
+    var xpVersion: String,
+    @SerializedName("xpSrc")
+    var xpSrc: String,
+    @SerializedName("xpDest")
+    var xpDest: String,
+    @SerializedName("xpEt")
+    var xpEt: String,
+    @SerializedName("xpLang")
+    var xpLang: String? = null,
+    @SerializedName("xpTid")
+    var xpTid: String,
+    @SerializedName("xpTm")
+    var xpTm: String,
+    @SerializedName("xpCb")
+    var xpCb: String? = null,
+    @SerializedName("xpPushId")
+    var xpPushId: String,
+    @SerializedName("msgId")
+    var msgId: String? = null,
+    @SerializedName("msgIds")
+    var msgIds: ArrayList<String>? = null,
+    @SerializedName("cid")
+    var cid: String? = null,
+    var mData: T? = null
+)
+
+data class PushNotification(
+    @SerializedName("title")
+    var title: String? = null,
+    @SerializedName("body")
+    var body: String? = null,
+    @SerializedName("imageUrl")
+    var imageUrl: String? = null,
+    @SerializedName("sound")
+    var sound: String? = null
+)

+ 15 - 0
app/src/main/java/com/sikey/commonservice/model/NotificationDetails.kt

@@ -0,0 +1,15 @@
+package com.sikey.commonservice.model
+
+import android.app.PendingIntent
+import androidx.core.graphics.drawable.IconCompat
+
+data class NotificationDetails(
+    var id: Int = 0,
+    var channelId: String = "",
+    var packageName: String = "",
+    var color: Int? = null,
+    var notificationTitle: String = "",
+    var notificationText: String = "",
+    var icon: IconCompat,
+    var contentIntent: PendingIntent? = null
+)

+ 39 - 0
app/src/main/java/com/sikey/commonservice/model/database/AlarmDbEntity.kt

@@ -0,0 +1,39 @@
+package com.sikey.commonservice.model.database
+
+import androidx.room.Ignore
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.xplora.AlarmInfo
+
+data class AlarmDbEntity @Ignore constructor(
+    @SerializedName("alarmId")
+    var alarmId: Int = 0,
+    @SerializedName("serverId")
+    var serverId: String? = null,
+    @SerializedName("title")
+    var title: String? = null,
+    @SerializedName("hour")
+    var hour: String? = null,
+    @SerializedName("minute")
+    var minute: String? = null,
+    @SerializedName("enabled")
+    var enabled: String? = null,
+    @SerializedName("repeat")
+    var repeat: String? = null
+) :BaseDbEntity(){
+    constructor() : this(0, null, null, null, null, null, null)
+
+    override fun toString(): String {
+        return StringBuilder().append(hour).append(",").append(minute).append(",").append(enabled)
+            .append(",").append(repeat).toString()
+    }
+
+    fun form(info: AlarmInfo): AlarmDbEntity {
+        serverId = info.id
+        title = info.name
+        hour = (info.min / 60).toString()
+        minute = (info.min % 60).toString()
+        enabled = info.status.toString()
+        repeat = info.week
+        return this
+    }
+}

+ 3 - 0
app/src/main/java/com/sikey/commonservice/model/database/BaseDbEntity.kt

@@ -0,0 +1,3 @@
+package com.sikey.commonservice.model.database
+
+open class BaseDbEntity()

+ 134 - 0
app/src/main/java/com/sikey/commonservice/model/database/ChatDbDbEntity.kt

@@ -0,0 +1,134 @@
+package com.sikey.commonservice.model.database
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.xplora.chat.MsgListInfo
+import com.sikey.commonservice.modules.WatchStateChangeImpl
+
+/**
+ * Chat Message Type	Attributes
+ * Voice                msgId, type, fileUrl, dur, state, create, update
+ * Text	                msgId, type, text, state, create, update
+ * Emoji	            msgId, type, emojiId, state, create, update
+ * Photo	            msgId, type, fileUrl, state, create, update
+ * Short video	        msgId, type, dur, coverUrl, videoUrl, state, create, update
+ * Mp3	                msgId, type, fileUrl, dur, state, create, update
+ */
+data class ChatDbDbEntity(
+    @SerializedName("_id")
+    var _id: Long? = null,
+    @SerializedName("msgId")
+    var msgId: String? = null,
+    /**
+     * - 100 : Emoji
+     * - 101 : Text
+     * - 102 : Photo
+     * - 103 : Voice
+     * - 104 : Mp3
+     * - 105 : Short video
+     */
+    @SerializedName("type")
+    var type: String? = null,
+    @SerializedName("text")
+    var text: String? = null,
+    @SerializedName("emojiId")
+    var emojiId: String? = null,
+    /**
+     * -image
+     * -audio
+     * -cover
+     */
+    @SerializedName("fileUrl")
+    var fileUrl: String? = null,
+    /**
+     * file name of music file, empty string if no name or not a music
+     */
+    @SerializedName("fileName")
+    var fileName: String? = null,
+    /**
+     * -image
+     * -audio
+     * -cover
+     *
+     * MESSAGE_STATE_UNDOWNLOAD    = 0;
+     * MESSAGE_STATE_DOWNLOAD_ING  = 1;
+     * MESSAGE_STATE_NEED_DOWNLOAD  = 2
+     * MESSAGE_STATE_DOWNLOAD_DONE = uri;
+     */
+    @SerializedName("filePath")
+    var filePath: String? = null,
+    /**
+     * -audio
+     * -video
+     */
+    @SerializedName("dur")
+    var dur: String? = null,
+    /**
+     * -video
+     */
+    @SerializedName("videoUrl")
+    var videoUrl: String? = null,
+    /**
+     * MESSAGE_STATE_UNDOWNLOAD    = 0;
+     * MESSAGE_STATE_DOWNLOAD_ING  = 1;
+     * MESSAGE_STATE_NEED_DOWNLOAD  = 2
+     * MESSAGE_STATE_DOWNLOAD_DONE = uri;
+     */
+    @SerializedName("videoPath")
+    var videoPath: String? = null,
+    /**
+     * Message status
+     * - 0 : Unknown
+     * - 1 : Delivered
+     * - 2 : Read
+     * - 3 : Failed
+     */
+    @SerializedName("state")
+    var state: String? = null,
+    /**
+     * MESSAGE_STATE_UNREAD        = 0;
+     * MESSAGE_STATE_READ          = 1;
+     * MESSAGE_STATE_SEND_ING      = 2;
+     * MESSAGE_STATE_SEND_SUCCESS  = 3;e
+     * MESSAGE_STATE_SEND_FAIL     = 4;
+     * MESSAGE_STATE_DELETE        = 5;
+     * MESSAGE_STATE_UNKNOWN       = 99;
+     */
+    @SerializedName("localState")
+    var localState: String = "0",
+    @SerializedName("senderUserId")
+    var senderUserId: String? = null,
+    @SerializedName("receiverId")
+    var receiverId: String? = null,
+    @SerializedName("create")
+    var create: String? = null,
+    @SerializedName("update")
+    var update: String? = null,
+    @SerializedName("fid")
+    var fid: String? = null
+) : BaseDbEntity() {
+    fun from(info: com.sikey.commonservice.model.http.xplora.chat.BaseMsgInfo<*>): ChatDbDbEntity {
+        msgId = info.msgId
+        type = info.type
+        text = info.text
+        emojiId = info.emojiId
+        fileUrl = if (info.type == "105") info.coverUrl else info.fileUrl
+        dur = info.dur
+        videoUrl = info.videoUrl
+        state = info.state
+        create = info.create
+        update = info.update
+        when (info) {
+            is com.sikey.commonservice.model.http.xplora.chat.MsgInfo -> {
+                senderUserId = info.senderUserId
+                receiverId = WatchStateChangeImpl.watchBaseInfo.userId
+            }
+
+            is MsgListInfo -> {
+                if (!info.incomming) {
+                    senderUserId = WatchStateChangeImpl.watchBaseInfo.userId
+                }
+            }
+        }
+        return this
+    }
+}

+ 84 - 0
app/src/main/java/com/sikey/commonservice/model/database/ContactDbDbEntity.kt

@@ -0,0 +1,84 @@
+package com.sikey.commonservice.model.database
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.sk.Person
+import com.sikey.commonservice.model.http.xplora.ContactInfo
+
+data class ContactDbDbEntity(
+    @SerializedName("_id")
+    var _id: Long? = null,
+    /**
+     * Guardian's ID of contact. contact's resource ID
+     */
+    @SerializedName("id")
+    var id: String? = null,
+    @SerializedName("userId")
+    var userId: String? = null,
+    @SerializedName("name")
+    var name: String? = null,
+    /**
+     *  profile image url
+     */
+    @SerializedName("profile")
+    var profile: String? = null,
+    /**
+     *  phone number(without country phone number)
+     */
+    @SerializedName("phoneNumber")
+    var phoneNumber: String? = null,
+    /**
+     * Country phone number
+     */
+    @SerializedName("countryPN")
+    var countryPN: String? = null,
+    /**
+     * SIM type. Reserved column.
+     * - 1 : DATA SIM
+     * - 2 : DATA + Voice SIM
+     * - 100 : Unknown.
+     */
+    @SerializedName("sim")
+    var sim: String? = null,
+    /**
+     * - 1 : First guardian(SOS target)
+     * - 2 : Second guardian
+     * - 3 : General contact(Not member of XPLORA server)
+     * - 4 : Friend
+     */
+    @SerializedName("type")
+    var type: String? = null,
+    @SerializedName("rate")
+    var rate: String = "0",
+    @SerializedName("unRead")
+    var unRead: String = "0",
+    @SerializedName("profilePath")
+    var profilePath: String? = null
+):BaseDbEntity() {
+    fun from(info: ContactInfo): ContactDbDbEntity {
+        id = info.id
+        userId = info.userId
+        name = info.name
+        profile = info.profile
+        phoneNumber = info.phoneNumber
+        countryPN = info.countryPN
+        sim = info.sim
+        type = info.type
+        return this
+    }
+
+    fun from(info:Person):ContactDbDbEntity {
+        id = info.ctid.toString()
+        userId = info.refId
+        name = info.appellation
+        profile = info.avatar
+        phoneNumber = info.phoneNumber
+        countryPN = info.areaCode
+        sim = "100"
+        type = when(info.type) {
+            0 -> "1"
+            1 -> "2"
+            else -> "3"
+        }
+        return this
+    }
+}

+ 37 - 0
app/src/main/java/com/sikey/commonservice/model/database/GoplayContentDbDbEntity.kt

@@ -0,0 +1,37 @@
+package com.sikey.commonservice.model.database
+
+import androidx.room.Ignore
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.xplora.content.ContentData
+
+data class GoplayContentDbDbEntity @Ignore constructor(
+    @SerializedName("_id")
+    var _id: Long = 0,
+    @SerializedName("cid")
+    var cid: String? = null,
+    @SerializedName("title")
+    var title: String? = null,
+    @SerializedName("contentType")
+    var contentType: String? = null,
+    @SerializedName("size")
+    var size: String? = null,
+    @SerializedName("url")
+    var url: String? = null,
+    @SerializedName("status")
+    var status: String = "0",
+    @SerializedName("hint")
+    var hint: String = "0",
+    @SerializedName("reason")
+    var reason: String = "0"
+) : BaseDbEntity() {
+    constructor() : this(0, null, null, null, null, null, "0", "0", "0")
+
+    fun form(info: ContentData): GoplayContentDbDbEntity {
+        cid = info.cid
+        title = info.title
+        contentType = info.contentType
+        size = info.size.toString()
+        url = info.url
+        return this
+    }
+}

+ 15 - 0
app/src/main/java/com/sikey/commonservice/model/database/MusicDbDbEntity.kt

@@ -0,0 +1,15 @@
+package com.sikey.commonservice.model.database
+
+import com.google.gson.annotations.SerializedName
+
+
+data class MusicDbDbEntity(
+    @SerializedName("musicId")
+    var musicId: Int? = null,
+    @SerializedName("url")
+    var url: String? = null,
+    @SerializedName("path")
+    var path: String = "1",
+    @SerializedName("name")
+    var name: String? = null
+):BaseDbEntity()

+ 38 - 0
app/src/main/java/com/sikey/commonservice/model/database/SilentDbDbEntity.kt

@@ -0,0 +1,38 @@
+package com.sikey.commonservice.model.database
+
+import androidx.annotation.NonNull
+import androidx.room.Ignore
+import androidx.room.PrimaryKey
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.xplora.SilentInfo
+
+data class SilentDbDbEntity @Ignore constructor(
+    @PrimaryKey(autoGenerate = false)
+    @NonNull
+    @SerializedName("alarmId")
+    var alarmId: Int = 0,
+    @SerializedName("serverId")
+    var serverId: String? = null,
+    @SerializedName("startMin")
+    var startMin: String? = null,//start min
+    @SerializedName("endMin")
+    var endMin: String? = null,//end min
+    @SerializedName("repeat")
+    var repeat: String? = null
+):BaseDbEntity() {
+    constructor() : this(0, null, null, null)
+
+    override fun toString(): String {
+        return StringBuilder().append(startMin).append(",").append(endMin).append(",")
+            .append(repeat)
+            .toString()
+    }
+
+    fun form(info: SilentInfo): SilentDbDbEntity {
+        serverId = info.id
+        startMin = (info.startMin).toString()
+        endMin = (info.endMin).toString()
+        repeat = info.week
+        return this
+    }
+}

+ 16 - 0
app/src/main/java/com/sikey/commonservice/model/database/StepDbDbEntity.kt

@@ -0,0 +1,16 @@
+package com.sikey.commonservice.model.database
+
+import android.icu.util.Calendar
+import com.google.gson.annotations.SerializedName
+
+
+data class StepDbDbEntity(
+    @SerializedName("_id")
+    val _id: Long = 0,
+    @SerializedName("today")
+    var today: String = "0",
+    @SerializedName("history")
+    var history: String = "0,",
+    @SerializedName("day")
+    var day: String = Calendar.getInstance().get(Calendar.DAY_OF_YEAR).toString()
+):BaseDbEntity()

+ 31 - 0
app/src/main/java/com/sikey/commonservice/model/database/WeatherDbDbEntity.kt

@@ -0,0 +1,31 @@
+package com.sikey.commonservice.model.database
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.xplora.weather.WeatherData
+
+data class WeatherDbDbEntity(
+    @SerializedName("_id")
+    var _id: Long,
+    @SerializedName("city")
+    var city: String? = null,
+    @SerializedName("update_time")
+    var update_time: String? = null,
+    @SerializedName("weather_type")
+    var weather_type: String? = null,
+    @SerializedName("temperature_current")
+    var temperature_current: String? = null,
+    @SerializedName("temperature_low")
+    var temperature_low: String = "0",
+    @SerializedName("temperature_high")
+    var temperature_high: String = "0"
+) : BaseDbEntity() {
+    fun from(info: WeatherData): WeatherDbDbEntity {
+        city = info.cityName
+        update_time = info.obTime ?: info.datetime
+        weather_type = info.weather.code
+        temperature_current = info.temp
+        temperature_low = info.minTemp
+        temperature_high = info.maxTemp
+        return this
+    }
+}

+ 3 - 0
app/src/main/java/com/sikey/commonservice/model/http/BaseRequest.kt

@@ -0,0 +1,3 @@
+package com.sikey.commonservice.model.http
+
+open class BaseRequest()

+ 32 - 0
app/src/main/java/com/sikey/commonservice/model/http/BaseResponse.kt

@@ -0,0 +1,32 @@
+package com.sikey.commonservice.model.http
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.CkError
+import com.sikey.commonservice.model.CkMessage
+import com.sikey.commonservice.utils.Logger
+
+data class NormalResponse(val na: Any? = null) : BaseResponse<NormalResponse>()
+
+open class BaseResponse<T>(
+    @SerializedName("ckTid")
+    var ckTid: String? = "",
+    @SerializedName("ckError")
+    var ckError: String? = CkError.ERROR_UNKNOWN,
+    @SerializedName("ckMessage")
+    var ckMessage: String? = CkMessage.ERROR_UNKNOWN,
+    var mData: T? = null
+) {
+    companion object {
+        fun <T> unknownError(error: Throwable): BaseResponse<T> {
+            val baseModel: BaseResponse<T> = BaseResponse()
+            baseModel.ckMessage = error.message
+            Logger.e("BaseResponse", "unknownError: ${error.printStackTrace()}")
+            return baseModel
+        }
+    }
+
+    override fun toString(): String {
+        return "BaseModel(ckTid=$ckTid, ckError=$ckError, ckMessage='$ckMessage')"
+    }
+
+}

+ 17 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/AddFriend.kt

@@ -0,0 +1,17 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class AddFriendReq(
+    @SerializedName("code") val code: String
+) : BaseRequest()
+
+data class GenerateFriendCodeReq(
+    @SerializedName("ticket") val ticket: String
+) : BaseRequest()
+
+data class GenerateFriendCodeRepo(
+    @SerializedName("code") val code: String
+) : BaseResponse<GenerateFriendCodeRepo>()

+ 19 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/Alarm.kt

@@ -0,0 +1,19 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetAlarmRepo(
+    @SerializedName("alarmClocks") val alarmClocks: List<AlarmClock>
+) : BaseResponse<GetAlarmRepo>()
+
+data class AlarmClock(
+    @SerializedName("cid") val cid: String,
+    @SerializedName("label") val label: String,
+    @SerializedName("repeats") val repeats: String,
+    @SerializedName("time") val time: String,
+    @SerializedName("onceTime") val onceTime: String,
+    @SerializedName("id") val id: String,
+    @SerializedName("status") val status: String
+)

+ 10 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/DeviceWristwatchBinding.kt

@@ -0,0 +1,10 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class DeviceWristwatchBindingRepo(
+    @SerializedName("isBind") val isBind: Boolean,
+    @SerializedName("cid") val cid: String?,
+    @SerializedName("accessToken") val accessToken: String?
+) : BaseResponse<DeviceWristwatchBindingRepo>()

+ 11 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/DeviceWristwatchExchange.kt

@@ -0,0 +1,11 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class DeviceWristwatchExchangeRepo(
+    @SerializedName("ticket") val ticket: String,
+    @SerializedName("aseKey") val aseKey: String,
+    @SerializedName("hc") val hc: String,
+    @SerializedName("activationTime") val activationTime: Long
+) : BaseResponse<DeviceWristwatchExchangeRepo>()

+ 13 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/GetBlockUnknownCall.kt

@@ -0,0 +1,13 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetBlockUnknownCallReq(
+    @SerializedName("cid") val cid: String
+) : BaseRequest()
+
+data class GetBlockUnknownCallRepo(
+    @SerializedName("isEnable") val isEnable: Boolean
+) : BaseResponse<GetBlockUnknownCallRepo>()

+ 29 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/GetWristwatchContactPerson.kt

@@ -0,0 +1,29 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetWristwatchContactPersonRepo(
+    @SerializedName("persons") val persons: ArrayList<Person>
+) : BaseResponse<GetWristwatchContactPersonRepo>()
+
+data class Person(
+    @SerializedName("ctid") val ctid: Int,
+    @SerializedName("refId") val refId: String,
+    @SerializedName("type") val type: Int,
+    @SerializedName("phoneNumber") val phoneNumber: String,
+    @SerializedName("areaCode") val areaCode: String,
+    @SerializedName("avatar") val avatar: String,
+    @SerializedName("appellation") val appellation: String,
+    /**
+     * 联系人关系
+     *
+     * 0-超级管理员
+     * 1-管理员
+     * 2-家人
+     * 3-朋友
+     * 4-其他人
+     * 5-预留
+     */
+    @SerializedName("role") val role: Int
+)

+ 64 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/PositionIot.kt

@@ -0,0 +1,64 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class PositionIotReq(
+    var accesstype: String = "",
+    /**
+     * 设备 Ticket
+     */
+    var ticket: String = "",
+    val traceId:String = "1",
+    /**
+     * 手机卡是否为 CDMA 卡, accesstype=1时必填
+     */
+    var cdma: String = "0",
+    /**
+     * 无线网络类型 , accesstype=1时必填
+     */
+    var network: String? = null,
+    /**
+     * 接入基站信息, 非 CDMA 格式为:mcc,mnc,lac,cellid,signal,cage  CDMA 格式为:
+     * sid,nid,bid,lon,lat,signal,cage  lon,lat 为空时,格式为:sid,nid,bid,,,signal,cage
+     * 基站新鲜度字段(cage)说明:单位为秒,表示信号不变持续的时间。新鲜度值越大(数据越陈旧),偏离实际位置可能越大。默认为 0。, accesstype=1时必填
+     */
+    var bts: String? = null,
+    /**
+     * 周边基站信息(不含接入基站) , 基站信息1|基站信息2|基站信息3…..
+     */
+    var nearbts: String? = null,
+    /**
+     * 已连接 WiFi 信息, 格式为:mac,signal,ssid,fresh
+     *
+     * 如:
+     *
+     * mac:f0:7d:68:9e:7d:18
+     *
+     * signal:-41
+     *
+     * ssid:TPLink
+     *
+     * fresh:0
+     *
+     * WiFi 新鲜度字段(fresh)说明:单位为:秒,表示信号不变持续的时间。新鲜度值越大(数据越陈旧),偏离实际位置可能越大。默认为 0。
+     */
+    var mmac: String? = null,
+    /**
+     * WiFi 列表中的 WiFi 信息, 单 mac 信息同 mmac,mac 之间使用“|” 分隔。必须填写 2 个及 2 个以上,30 个以内的方可正常定位。请不要包含移动
+     * wifi 信息
+     */
+    var macs: String? = null,
+    /**
+     * 如果是GPS点位必传
+     */
+    var lat: String? = null,
+    /**
+     * 如果是GPS点位必传
+     */
+    var lon: String? = null,
+    /**
+     * 精度, 如果是GPS点位必传
+     */
+    var radius: Int? = null,
+) : BaseRequest()

+ 15 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/SKUpload.kt

@@ -0,0 +1,15 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+import okhttp3.MultipartBody
+
+data class SKUploadReq(
+    @SerializedName("fileType") val fileType: String,
+    @SerializedName("file") val file: MultipartBody.Part
+) : BaseRequest()
+
+data class SKUploadRepo(
+    @SerializedName("fid") val fid: String
+) : BaseResponse<SKUploadRepo>()

+ 19 - 0
app/src/main/java/com/sikey/commonservice/model/http/sk/SchoolMode.kt

@@ -0,0 +1,19 @@
+package com.sikey.commonservice.model.http.sk
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetSchoolModeRepo(
+    @SerializedName("schoolDisables") val alarmClocks: List<SchoolDisable>
+) : BaseResponse<GetSchoolModeRepo>()
+
+data class SchoolDisable(
+    @SerializedName("cid") val cid: String,
+    @SerializedName("label") val label: String,
+    @SerializedName("repeats") val repeats: String,
+    @SerializedName("time") val time: String,
+    @SerializedName("onceTime") val onceTime: String,
+    @SerializedName("id") val id: String,
+    @SerializedName("status") val status: String
+)

+ 21 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/AlarmList.kt

@@ -0,0 +1,21 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetAlarmListRepo(
+    @SerializedName("data") val data: List<AlarmInfo>
+) : BaseResponse<GetAlarmListRepo>()
+
+data class AlarmInfo(
+    @SerializedName("id")
+    val id: String,
+    @SerializedName("name")
+    val name: String,
+    @SerializedName("week")
+    val week: String,
+    @SerializedName("min")
+    val min: Int,
+    @SerializedName("status")
+    val status: Boolean
+)

+ 27 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/ContactList.kt

@@ -0,0 +1,27 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetContactListRepo(
+    @SerializedName("data") val data: List<ContactInfo>
+) : BaseResponse<GetContactListRepo>()
+
+data class ContactInfo(
+    @SerializedName("id")
+    val id: String,
+    @SerializedName("userId")
+    val userId: String,
+    @SerializedName("name")
+    val name: String,
+    @SerializedName("profile")
+    val profile: String,
+    @SerializedName("phoneNumber")
+    val phoneNumber: String,
+    @SerializedName("countryPN")
+    val countryPN: String,
+    @SerializedName("sim")
+    val sim: String,
+    @SerializedName("type")
+    val type: String
+)

+ 18 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/EmojiList.kt

@@ -0,0 +1,18 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetEmojiListRepo(
+    @SerializedName("data") val data: List<EmojiInfo>,
+    @SerializedName("updatedTm") val updatedTm: String
+) : BaseResponse<GetEmojiListRepo>()
+
+data class EmojiInfo(
+    @SerializedName("id")
+    val id: String,
+    @SerializedName("keyword")
+    val keyword: String,
+    @SerializedName("url")
+    val url: String
+)

+ 9 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/GetApnData.kt

@@ -0,0 +1,9 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetApnDataRepo(
+    @SerializedName("url") val url: String,
+    @SerializedName("updatedTm") val updatedTm: Long
+) : BaseResponse<GetApnDataRepo>()

+ 17 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/GetWifi.kt

@@ -0,0 +1,17 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+
+data class GetWifiRepo(
+   @SerializedName("data") val wifiList: List<WifiInfo>
+) : BaseResponse<GetWifiRepo>()
+
+
+data class WifiInfo(
+    @SerializedName("id") val id: String,
+    @SerializedName("ssid") val ssid: String,
+    @SerializedName("password") val password: String,
+    @SerializedName("security_type") val securityType: String
+)

+ 31 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/Init.kt

@@ -0,0 +1,31 @@
+package com.sikey.commonservice.model.http.xplora
+
+import androidx.annotation.Nullable
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class InitReq(
+    @SerializedName("secret") val secret: String,
+    @Nullable @SerializedName("firmwareVersion") var firmwareVersion: String? = null
+): BaseRequest()
+
+data class InitRepo(
+    @SerializedName("serverIP") val serverIP: String,
+    @SerializedName("serverPort") val serverPort: Int,
+    @SerializedName("apiKey") val apiKey: String,
+    @SerializedName("apiSecret") val apiSecret: String,
+    @SerializedName("secret") val secret: String,
+    @SerializedName("secretExpireTm") val secretExpireTm: Long,
+    @SerializedName("awsIotIP") val awsIotIP: String,
+    @SerializedName("awsIotPort") val awsIotPort: Int,
+    @SerializedName("awsIotTopic") val awsIotTopic: String,
+    @SerializedName("awsIotRegion") val awsIotRegion: String,
+    @SerializedName("awsIotClientId") val awsIotClientId: String,
+    @SerializedName("awsIotKeepAliveSec") val awsIotKeepAliveSec: Int,
+    @SerializedName("awsIotCaCert") val awsIotCaCert: String,
+    @SerializedName("awsIotCliCert") val awsIotCliCert: String,
+    @SerializedName("awsIotCliPriv") val awsIotCliPriv: String,
+    /** Server time. Unix timestamp **/
+    @SerializedName("tm") val tm: Long
+) : BaseResponse<InitRepo>()

+ 21 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/ReportPushResult.kt

@@ -0,0 +1,21 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.Config.REQUEST_QUERY
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class FcmResultReq(
+    @SerializedName("result")
+    var result: Int = 0,
+    @SerializedName("reason")
+    var reason: FcmResultReqReason? = null
+): BaseRequest()
+
+data class FcmResultReqReason(
+    @SerializedName("urlPath")
+    var urlPath: String = "",
+    @SerializedName("code")
+    var code: String = "",
+    @SerializedName(REQUEST_QUERY)
+    var tid: String = ""
+)

+ 19 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/SilentList.kt

@@ -0,0 +1,19 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetSilentListRepo(
+    @SerializedName("data") val data: List<SilentInfo>
+) : BaseResponse<GetSilentListRepo>()
+
+data class SilentInfo(
+    @SerializedName("id")
+    val id: String,
+    @SerializedName("week")
+    val week: String,
+    @SerializedName("startMin")
+    val startMin: Int,
+    @SerializedName("endMin")
+    val endMin: Int
+)

+ 17 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/UploadBatteryPercent.kt

@@ -0,0 +1,17 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class PercentReq(
+    @SerializedName("battery") val battery:String,
+    @SerializedName("isCharging") val isCharging:Boolean,
+    @SerializedName("temper") val temper:String? ,
+    /**
+     * Const.HighTempStatus
+     * 0-off
+     * 1-high-temp-disable
+     * 2-high-temp-shutdown
+     */
+    @SerializedName("protection") val protection:Int?
+): BaseRequest()

+ 14 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/UploadCallLog.kt

@@ -0,0 +1,14 @@
+package com.sikey.commonservice.model.http.xplora
+
+import androidx.annotation.Nullable
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class CallLogReq(
+    @SerializedName("caller") val caller: String,
+    @SerializedName("callee") val callee: String,
+    @SerializedName("start") val start: Long,
+    @SerializedName("end") val end: Long,
+    @SerializedName("type") val type: Int,
+    @SerializedName("voip") @Nullable var voip: Boolean? = null
+): BaseRequest()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/UploadIccid.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class UploadIccidReq(
+    @SerializedName("ICCID") val iccid: String
+): BaseRequest()

+ 17 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/WatchModelInfo.kt

@@ -0,0 +1,17 @@
+package com.sikey.commonservice.model.http.xplora
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class SetWatchModelInfoReq(
+    @SerializedName("model") val model: String,
+    @SerializedName("deviceAttribute") val deviceAttribute: String,
+    @SerializedName("deviceType") val deviceType: String
+) : BaseRequest()
+
+data class GetWatchModelInfoRepo(
+    @SerializedName("model") val model: String,
+    @SerializedName("deviceAttribute") val deviceAttribute: String,
+    @SerializedName("deviceType") val deviceType: String
+) : BaseResponse<GetWatchModelInfoRepo>()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/DeleteMsg.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora.chat
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class DeleteMsgReq(
+    @SerializedName("msgIds") val msgIds: ArrayList<String>
+): BaseRequest()

+ 32 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetMsg.kt

@@ -0,0 +1,32 @@
+package com.sikey.commonservice.model.http.xplora.chat
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class MsgReq(
+    @SerializedName("msgId") val msgId: String
+): BaseRequest()
+
+data class MsgRepo(
+    @SerializedName("data") val data: com.sikey.commonservice.model.http.xplora.chat.MsgInfo
+) : BaseResponse<com.sikey.commonservice.model.http.xplora.chat.MsgRepo>()
+
+data class MsgInfo(
+    @SerializedName("senderUserId") var senderUserId: String? = null
+) : com.sikey.commonservice.model.http.xplora.chat.BaseMsgInfo<com.sikey.commonservice.model.http.xplora.chat.MsgInfo>()
+
+open class BaseMsgInfo<T>(
+    @SerializedName("msgId") var msgId: String? = null,
+    @SerializedName("type") var type: String? = null,
+    @SerializedName("text") var text: String? = null,
+    @SerializedName("emojiId") var emojiId: String? = null,
+    @SerializedName("fileUrl") var fileUrl: String? = null,
+    @SerializedName("fileName") var fileName:String? = null,
+    @SerializedName("dur") var dur: String? = null,
+    @SerializedName("coverUrl") var coverUrl: String? = null,
+    @SerializedName("videoUrl") var videoUrl: String? = null,
+    @SerializedName("state") var state: String? = null,
+    @SerializedName("create") var create: String? = null,
+    @SerializedName("update") var update: String? = null
+)

+ 23 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetMsgList.kt

@@ -0,0 +1,23 @@
+package com.sikey.commonservice.model.http.xplora.chat
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class MsgListReq(
+    @SerializedName("userId") val userId: String? = null,
+    @SerializedName("offset") val offset: Int = 0,
+    @SerializedName("limit") var limit: Int = 10,
+    @SerializedName("msgId") var msgId: String? = null
+): BaseRequest()
+
+data class MsgListRepo(
+    @SerializedName("total") val total: Int,
+    @SerializedName("offset") val offset: Int,
+    @SerializedName("limit") val limit: Int,
+    @SerializedName("list") val list: ArrayList<MsgListInfo>
+) : BaseResponse<MsgListRepo>()
+
+data class MsgListInfo(
+    @SerializedName("incomming") val incomming: Boolean
+) : BaseMsgInfo<MsgListInfo>()

+ 20 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetMsgState.kt

@@ -0,0 +1,20 @@
+package com.sikey.commonservice.model.http.xplora.chat
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetMsgStateReq(
+    @SerializedName("msgIds") val msgIds: ArrayList<String>
+): BaseRequest()
+
+data class GetMsgStateRepo(
+    @SerializedName("data") val data: ArrayList<MsgState>
+) : BaseResponse<GetMsgStateRepo>()
+
+data class MsgState(
+    @SerializedName("msgId") val msgId: String,
+    @SerializedName("state") val state: Int,
+    @SerializedName("create") val create: Long,
+    @SerializedName("update") val update: Long
+)

+ 23 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/GetUnreadCount.kt

@@ -0,0 +1,23 @@
+package com.sikey.commonservice.model.http.xplora.chat
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetUnreadCountReq(
+    @SerializedName("userId") val userId: String
+): BaseRequest()
+
+data class GetUnreadCountRepo(
+    @SerializedName("count") val count: Int
+) : BaseResponse<GetUnreadCountRepo>()
+
+data class GetUnreadAllRepo(
+    @SerializedName("data") val data: ArrayList<UnreadInfo>
+) : BaseResponse<GetUnreadAllRepo>()
+
+data class UnreadInfo(
+    @SerializedName("userId") val userId: String,
+    @SerializedName("count") val count: Int,
+    @SerializedName("lastDate") val lastDate: Long
+)

+ 42 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/SendMsg.kt

@@ -0,0 +1,42 @@
+package com.sikey.commonservice.model.http.xplora.chat
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class SendVoiceReq(
+    @SerializedName("fid") val fid: String,
+    @SerializedName("dur") val dur: Int,
+    @SerializedName("userId") val receiverId: String
+): BaseRequest()
+
+data class SendTextReq(
+    @SerializedName("text") val text: String,
+    @SerializedName("userId") val receiverId: String
+): BaseRequest()
+
+data class SendEmojiReq(
+    @SerializedName("emojiId") val emojiId: String,
+    @SerializedName("userId") val receiverId: String
+): BaseRequest()
+
+data class SendPhotoReq(
+    @SerializedName("fid") val fid: String,
+    @SerializedName("userId") val receiverId: String
+): BaseRequest()
+
+data class SendVideoReq(
+    @SerializedName("coverId") val coverFid: String,
+    @SerializedName("videoId") val videoFid: String,
+    @SerializedName("dur") val dur: Int,
+    @SerializedName("userId") val receiverId: String
+): BaseRequest()
+
+data class SendSmsReq(
+    @SerializedName("text") val text: String,
+    @SerializedName("senderName") val senderName:String
+): BaseRequest()
+
+data class SendMsgRepo(
+    @SerializedName("msgId") val msgId: String
+) : BaseResponse<SendMsgRepo>()

+ 12 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/chat/SetMsgRead.kt

@@ -0,0 +1,12 @@
+package com.sikey.commonservice.model.http.xplora.chat
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class SetMsgReadReq(
+    @SerializedName("msgIds") val msgIds: ArrayList<String>
+): BaseRequest()
+
+data class SetMsgReadAllReq(
+    @SerializedName("userId") val userId: String
+): BaseRequest()

+ 26 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/content/GetContent.kt

@@ -0,0 +1,26 @@
+package com.sikey.commonservice.model.http.xplora.content
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetContentReq(
+    @SerializedName("cid") val cid: String
+): BaseRequest()
+
+data class GetContentRepo(
+    @SerializedName("data") val data: ContentData
+) : BaseResponse<GetContentRepo>()
+
+data class ContentData(
+    @SerializedName("cid") var cid: String,
+    @SerializedName("title") var title: String,
+    /**
+     * Content type
+     * - Ringtone: "Ringtone"
+     * - Watchface: "WatchFace"
+     **/
+    @SerializedName("contentType") var contentType: String,
+    @SerializedName("size") var size: Int,
+    @SerializedName("url") var url: String
+)

+ 9 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/content/ReportContentDownloadStatus.kt

@@ -0,0 +1,9 @@
+package com.sikey.commonservice.model.http.xplora.content
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class ReportContentDownloadStatusReq(
+    @SerializedName("cid") val cid: String,
+    @SerializedName("status") val status: String
+): BaseRequest()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/FirmwareVersion.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora.etc
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class FirmwareVersionReq(
+    @SerializedName("version") val version: String
+): BaseRequest()

+ 25 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/Guardians.kt

@@ -0,0 +1,25 @@
+package com.sikey.commonservice.model.http.xplora.etc
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetGuardiansRepo(
+    @SerializedName("data") val data: List<GuardianInfo>
+) : BaseResponse<GetGuardiansRepo>()
+
+data class GuardianInfo(
+    @SerializedName("id")
+    val id: String,
+    @SerializedName("userId")
+    val userId: String,
+    @SerializedName("name")
+    val name: String,
+    @SerializedName("profile")
+    val profile: String,
+    @SerializedName("phoneNumber")
+    val phoneNumber: String,
+    @SerializedName("countryPN")
+    val countryPN: String,
+    @SerializedName("sim")
+    val sim: String
+)

+ 15 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/SOS.kt

@@ -0,0 +1,15 @@
+package com.sikey.commonservice.model.http.xplora.etc
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class SOSReq(
+    /**
+     * SOS state
+     * - 1 : Start
+     * - 2 : End - Success
+     * - 3 : End - Fail
+     */
+    @SerializedName("state") val state: Int,
+    @SerializedName("guardianId") val guardianId: String
+): BaseRequest()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/etc/XCoin.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora.etc
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class GetXCoinRepo(
+    @SerializedName("coin") val coin: Int
+) : BaseResponse<GetXCoinRepo>()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/file/Upload.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora.file
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class UploadRepo(
+    @SerializedName("fid") val fid: String
+) : BaseResponse<UploadRepo>()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/friend/Add.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora.friend
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class FriendAddReq(
+    @SerializedName("code") val code: String
+): BaseRequest()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/friend/Code.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora.friend
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class FriendCodeReq(
+    @SerializedName("code") val code: String
+): BaseRequest()

+ 50 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/location/Cell.kt

@@ -0,0 +1,50 @@
+package com.sikey.commonservice.model.http.xplora.location
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class CellLocationReq(
+    @SerializedName("radioType") val radioType: String,
+    @SerializedName("cellTowers") val cellTowers: ArrayList<CellTowers>,
+    @SerializedName("wifiAPs") var wifiAPs: ArrayList<WifiAPs>? = null,
+    @SerializedName("tm") val tm: Long,
+    @SerializedName("countryCode") var countryCode: String? = null,
+    @SerializedName("province") var province: String? = null,
+    @SerializedName("city") var city: String? = null,
+    @SerializedName("addr1") var addr1: String? = null,
+    @SerializedName("addr2") var addr2: String? = null,
+    @SerializedName("poi") var poi: String? = null,
+    @SerializedName("battery") var battery: String? = null,
+    @SerializedName("isCharging") var isCharging: Boolean? = null,
+    @SerializedName("step") var step: Int? = null,
+    @SerializedName("distance") var distance: String? = null,
+    @SerializedName("cause") var cause: Int? = null
+): BaseRequest()
+
+data class CellTowers(
+    @SerializedName("id") val id: Int,
+    @SerializedName("areaCode") val areaCode: Int,
+    @SerializedName("strength") var strength: Int? = null,
+    @SerializedName("mcc") var mcc: Int? = null,
+    @SerializedName("mnc") val mnc: Int,
+    @SerializedName("connected") var connected: Boolean? = null
+) {
+    fun toBts():String {
+        return "$mcc,$mnc,$areaCode,$id,$strength"
+    }
+}
+
+data class WifiAPs(
+    @SerializedName("macAddr") val macAddr: String,
+    @SerializedName("age") val age: Long? = null,
+    @SerializedName("channel") val channel: Int? = null,
+    @SerializedName("noise") val noise: Int? = null,
+    @SerializedName("strength") val strength: Int? = null,
+    val ssid:String? = null
+) {
+    fun toMacs():String {
+        val ssid = ""
+        return "$macAddr,$strength,$ssid,$age"
+    }
+
+}

+ 22 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/location/Gps.kt

@@ -0,0 +1,22 @@
+package com.sikey.commonservice.model.http.xplora.location
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class GpsLocationReq(
+    @SerializedName("lat") val lat: String,
+    @SerializedName("lng") val lng: String,
+    @SerializedName("rad") val rad: String,
+    @SerializedName("tm") val tm: Long,
+    @SerializedName("countryCode") var countryCode: String? = null,
+    @SerializedName("province") var province: String? = null,
+    @SerializedName("city") var city: String? = null,
+    @SerializedName("addr1") var addr1: String? = null,
+    @SerializedName("addr2") var addr2: String? = null,
+    @SerializedName("poi") var poi: String? = null,
+    @SerializedName("battery") var battery: String? = null,
+    @SerializedName("isCharging") var isCharging: Boolean? = null,
+    @SerializedName("step") var step: Int? = null,
+    @SerializedName("distance") var distance: String? = null,
+    @SerializedName("cause") var cause: Int? = null
+): BaseRequest()

+ 35 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/location/Multi.kt

@@ -0,0 +1,35 @@
+package com.sikey.commonservice.model.http.xplora.location
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class MultiPositionReq(
+    @SerializedName("list") val list: ArrayList<CombainPositionReq>
+): BaseRequest()
+
+data class MultiPositionRepo(
+    @SerializedName("list") val list: ArrayList<String>
+) : BaseResponse<MultiPositionRepo>()
+
+data class CombainPositionReq(
+    @SerializedName("gps") var gps: Boolean = false,
+    @SerializedName("lat") var lat: String? = null,
+    @SerializedName("lng") var lng: String? = null,
+    @SerializedName("rad") var rad: String? = null,
+    @SerializedName("radioType") var radioType: String? = null,
+    @SerializedName("cellTowers") var cellTowers: ArrayList<CellTowers>? = null,
+    @SerializedName("wifiAPs") var wifiAPs: ArrayList<WifiAPs>? = null,
+    @SerializedName("tm") var tm: Long = System.currentTimeMillis() / 1000,
+    @SerializedName("countryCode") var countryCode: String? = null,
+    @SerializedName("province") var province: String? = null,
+    @SerializedName("city") var city: String? = null,
+    @SerializedName("addr1") var addr1: String? = null,
+    @SerializedName("addr2") var addr2: String? = null,
+    @SerializedName("poi") var poi: String? = null,
+    @SerializedName("battery") var battery: String? = null,
+    @SerializedName("isCharging") var isCharging: Boolean? = null,
+    @SerializedName("step") var step: Int? = null,
+    @SerializedName("distance") var distance: String? = null,
+    @SerializedName("cause") var cause: Int? = null
+):BaseRequest()

+ 8 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/location/TrackingStatus.kt

@@ -0,0 +1,8 @@
+package com.sikey.commonservice.model.http.xplora.location
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class LocationTrackingStatusReq(
+    @SerializedName("status") val status: Int
+): BaseRequest()

+ 14 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/log/Save.kt

@@ -0,0 +1,14 @@
+package com.sikey.commonservice.model.http.xplora.log
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class SaveLogReq(
+    @SerializedName("fid") val fid: String,
+    @SerializedName("tm") val tm: Long
+): BaseRequest()
+
+data class SaveLogRepo(
+    @SerializedName("logId") val logId: String
+) : BaseResponse<SaveLogRepo>()

+ 25 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/power/SavingMode.kt

@@ -0,0 +1,25 @@
+package com.sikey.commonservice.model.http.xplora.power
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class SetSavingModeReq(
+    /**
+     * Power saving mode.
+     * - 1 : normal mode(Not power saving mode)
+     * - 2 : super-standby time mode
+     * - 3 : sleep mode
+     */
+    @SerializedName("mode") val mode: Int
+): BaseRequest()
+
+data class GetSavingModeRepo(
+    /**
+     * Power saving mode.
+     * - 1 : normal mode(Not power saving mode)
+     * - 2 : super-standby time mode
+     * - 3 : sleep mode
+     */
+    @SerializedName("mode") val mode: Int
+) : BaseResponse<GetSavingModeRepo>()

+ 13 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/power/Set.kt

@@ -0,0 +1,13 @@
+package com.sikey.commonservice.model.http.xplora.power
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseRequest
+
+data class PowerSetReq(
+    /**
+     * Kids watch power status
+     * - true : On
+     * - false : Off
+     */
+    @SerializedName("power") val power: Boolean,
+): BaseRequest()

+ 14 - 0
app/src/main/java/com/sikey/commonservice/model/http/xplora/status/Get.kt

@@ -0,0 +1,14 @@
+package com.sikey.commonservice.model.http.xplora.status
+
+import com.google.gson.annotations.SerializedName
+import com.sikey.commonservice.model.http.BaseResponse
+
+data class StatusGetRepo(
+    @SerializedName("data") val data: StatusData
+) : BaseResponse<StatusGetRepo>()
+
+data class StatusData(
+    @SerializedName("id") val id: String,
+    @SerializedName("status") val status: Boolean,
+    @SerializedName("sim") val sim: Int
+)

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff