From 8ca49856c218dbce01e95ffa823fdd770e10013f Mon Sep 17 00:00:00 2001 From: Y7000p Date: Sat, 26 Mar 2022 23:24:22 +0800 Subject: [PATCH] add v1.0.0 --- DaKa/.gitignore | 16 + DaKa/.idea/.gitignore | 3 + DaKa/.idea/compiler.xml | 6 + DaKa/.idea/gradle.xml | 24 + .../inspectionProfiles/Project_Default.xml | 36 + DaKa/.idea/intellij-javadocs-4.0.1.xml | 141 +++ DaKa/.idea/jarRepositories.xml | 35 + DaKa/.idea/misc.xml | 4 + .../phone/phoneSettingConfig_MateX2.json | 25 + .../phone/phoneSettingConfig_P40.json | 25 + DaKa/.idea/previewer/previewConfigV2.json | 61 ++ .../tabletSettingConfig_MatePadPro.json | 25 + .../wearableSettingConfig_Watch3.json | 25 + .../0fc04922cd9a34622b859cd4d1a67a89f33da940 | 0 .../10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2 | 0 .../15d8bcbfc11a5f476138f9bcb53e2052e1a9dfbf | 2 + .../1a0bfe7a027837ed647b6bd5b6e2500c8555362e | 0 .../1fca71afd5c1d5be301d96e6944f0f72e7cfe336 | 5 + .../25dacbaab99cc1fe7e73d185785207a3337590fb | 14 + .../3fb907f4e71bcffa5291e02efe576a814a42762e | 11 + .../4658bbfeed30bc3c16d89bdde88d0ce1bb94d3a7 | 8 + .../7030d0b2f71b999ff89a343de08c414af32fc93a | 0 .../9c0629d9ee39e937c45ba4e3206cabded9f4c3be | 0 .../a49d04c34d269757f710cdd66ee499b30ca4d012 | 12 + .../a4eac0e11cd512bf75961f45bc949d4f8033203e | 30 + .../ad38b2dea33752cac233aa09d7dfbe582e9dded6 | 0 .../b21eebb6b040e2b10cd428205c5acd1f68cc6d50 | 4 + .../cea9463d59754ba3cdc565e6279149e7440edadf | 4 + .../e0da17fc7f5e236564b670ddce19a468201781e3 | 47 + .../f07866736216be0ee2aba49e392191aeae700a35 | 0 .../fbe448ebfc3eb2d4e308f6b8b043666f5b57235e | 0 DaKa/.idea/sonarlint/issuestore/index.pb | 37 + DaKa/.idea/vcs.xml | 6 + DaKa/build.gradle | 45 + DaKa/entry/.gitignore | 2 + DaKa/entry/agconnect-services.json | 1 + DaKa/entry/build.gradle | 45 + DaKa/entry/proguard-rules.pro | 130 +++ DaKa/entry/src/main/config.json | 87 ++ .../java/com/xcl/location/MainAbility.java | 103 ++ .../java/com/xcl/location/MyApplication.java | 76 ++ .../main/java/com/xcl/location/Net/DXJX.java | 49 + .../main/java/com/xcl/location/Net/TJXX.java | 15 + .../main/java/com/xcl/location/Net/Wan.java | 36 + .../java/com/xcl/location/Preference_RW.java | 187 ++++ .../com/xcl/location/Util/MyToastDialog.java | 93 ++ .../src/main/java/com/xcl/location/XLog.java | 68 ++ .../xcl/location/slice/MainAbilitySlice.java | 369 +++++++ .../main/resources/base/element/string.json | 16 + .../graphic/background_checkbox_checkedm.xml | 11 + .../graphic/background_checkbox_emptym.xml | 12 + .../base/graphic/checkbox_check_elementm.xml | 12 + .../resources/base/graphic/xtoast_framem.xml | 11 + .../base/layout/main_ability_slice.xml | 345 +++++++ .../src/main/resources/base/media/icon.png | Bin 0 -> 21118 bytes .../resources/rawfile/agconnect-services.json | 1 + .../com/xcl/location/ExampleOhosTest.java | 14 + .../java/com/xcl/location/ExampleTest.java | 9 + DaKa/gradle.properties | 13 + DaKa/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 58694 bytes DaKa/gradle/wrapper/gradle-wrapper.properties | 5 + DaKa/gradlew | 183 ++++ DaKa/gradlew.bat | 103 ++ DaKa/jianjia/.gitignore | 2 + DaKa/jianjia/build.gradle | 29 + DaKa/jianjia/consumer-rules.pro | 1 + DaKa/jianjia/proguard-rules.pro | 133 +++ DaKa/jianjia/src/main/config.json | 24 + .../com/net/jianjia/BuiltInConverters.java | 175 ++++ .../src/main/java/com/net/jianjia/Call.java | 67 ++ .../java/com/net/jianjia/CallAdapter.java | 49 + .../main/java/com/net/jianjia/Callback.java | 27 + .../main/java/com/net/jianjia/Converter.java | 76 ++ .../jianjia/DefaultCallAdapterFactory.java | 186 ++++ .../com/net/jianjia/HttpServiceMethod.java | 183 ++++ .../main/java/com/net/jianjia/Invocation.java | 76 ++ .../main/java/com/net/jianjia/JianJia.java | 484 +++++++++ .../main/java/com/net/jianjia/OkHttpCall.java | 464 +++++++++ .../com/net/jianjia/ParameterHandler.java | 753 ++++++++++++++ .../main/java/com/net/jianjia/Platform.java | 168 ++++ .../java/com/net/jianjia/RequestBuilder.java | 395 ++++++++ .../java/com/net/jianjia/RequestFactory.java | 919 ++++++++++++++++++ .../main/java/com/net/jianjia/Response.java | 210 ++++ .../java/com/net/jianjia/ServiceMethod.java | 43 + .../src/main/java/com/net/jianjia/Utils.java | 708 ++++++++++++++ .../conventer/ScalarRequestBodyConverter.java | 42 + .../ScalarResponseBodyConverters.java | 220 +++++ .../conventer/ScalarsConverterFactory.java | 105 ++ .../jianjia/gson/GsonConverterFactory.java | 84 ++ .../gson/GsonRequestBodyConverter.java | 71 ++ .../gson/GsonResponseBodyConverter.java | 62 ++ .../java/com/net/jianjia/http/BaseUrl.java | 25 + .../main/java/com/net/jianjia/http/Body.java | 17 + .../java/com/net/jianjia/http/DELETE.java | 23 + .../main/java/com/net/jianjia/http/Field.java | 34 + .../java/com/net/jianjia/http/FieldMap.java | 22 + .../com/net/jianjia/http/FormUrlEncoded.java | 20 + .../main/java/com/net/jianjia/http/GET.java | 23 + .../main/java/com/net/jianjia/http/HEAD.java | 23 + .../main/java/com/net/jianjia/http/HTTP.java | 50 + .../java/com/net/jianjia/http/Header.java | 22 + .../java/com/net/jianjia/http/HeaderMap.java | 15 + .../java/com/net/jianjia/http/Headers.java | 30 + .../java/com/net/jianjia/http/Multipart.java | 23 + .../java/com/net/jianjia/http/OPTIONS.java | 23 + .../main/java/com/net/jianjia/http/PATCH.java | 23 + .../main/java/com/net/jianjia/http/POST.java | 23 + .../main/java/com/net/jianjia/http/PUT.java | 23 + .../main/java/com/net/jianjia/http/Part.java | 56 ++ .../java/com/net/jianjia/http/PartMap.java | 17 + .../main/java/com/net/jianjia/http/Path.java | 31 + .../main/java/com/net/jianjia/http/Query.java | 31 + .../java/com/net/jianjia/http/QueryMap.java | 22 + .../jianjia/http/SkipCallbackExecutor.java | 19 + .../java/com/net/jianjia/http/Streaming.java | 17 + .../main/java/com/net/jianjia/http/Url.java | 20 + .../main/resources/base/element/string.json | 8 + .../java/com/net/jianjia/ExampleTest.java | 15 + DaKa/package.json | 1 + DaKa/settings.gradle | 2 + README.md | 47 + 121 files changed, 9108 insertions(+) create mode 100644 DaKa/.gitignore create mode 100644 DaKa/.idea/.gitignore create mode 100644 DaKa/.idea/compiler.xml create mode 100644 DaKa/.idea/gradle.xml create mode 100644 DaKa/.idea/inspectionProfiles/Project_Default.xml create mode 100644 DaKa/.idea/intellij-javadocs-4.0.1.xml create mode 100644 DaKa/.idea/jarRepositories.xml create mode 100644 DaKa/.idea/misc.xml create mode 100644 DaKa/.idea/previewer/phone/phoneSettingConfig_MateX2.json create mode 100644 DaKa/.idea/previewer/phone/phoneSettingConfig_P40.json create mode 100644 DaKa/.idea/previewer/previewConfigV2.json create mode 100644 DaKa/.idea/previewer/tablet/tabletSettingConfig_MatePadPro.json create mode 100644 DaKa/.idea/previewer/wearable/wearableSettingConfig_Watch3.json create mode 100644 DaKa/.idea/sonarlint/issuestore/0/f/0fc04922cd9a34622b859cd4d1a67a89f33da940 create mode 100644 DaKa/.idea/sonarlint/issuestore/1/0/10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2 create mode 100644 DaKa/.idea/sonarlint/issuestore/1/5/15d8bcbfc11a5f476138f9bcb53e2052e1a9dfbf create mode 100644 DaKa/.idea/sonarlint/issuestore/1/a/1a0bfe7a027837ed647b6bd5b6e2500c8555362e create mode 100644 DaKa/.idea/sonarlint/issuestore/1/f/1fca71afd5c1d5be301d96e6944f0f72e7cfe336 create mode 100644 DaKa/.idea/sonarlint/issuestore/2/5/25dacbaab99cc1fe7e73d185785207a3337590fb create mode 100644 DaKa/.idea/sonarlint/issuestore/3/f/3fb907f4e71bcffa5291e02efe576a814a42762e create mode 100644 DaKa/.idea/sonarlint/issuestore/4/6/4658bbfeed30bc3c16d89bdde88d0ce1bb94d3a7 create mode 100644 DaKa/.idea/sonarlint/issuestore/7/0/7030d0b2f71b999ff89a343de08c414af32fc93a create mode 100644 DaKa/.idea/sonarlint/issuestore/9/c/9c0629d9ee39e937c45ba4e3206cabded9f4c3be create mode 100644 DaKa/.idea/sonarlint/issuestore/a/4/a49d04c34d269757f710cdd66ee499b30ca4d012 create mode 100644 DaKa/.idea/sonarlint/issuestore/a/4/a4eac0e11cd512bf75961f45bc949d4f8033203e create mode 100644 DaKa/.idea/sonarlint/issuestore/a/d/ad38b2dea33752cac233aa09d7dfbe582e9dded6 create mode 100644 DaKa/.idea/sonarlint/issuestore/b/2/b21eebb6b040e2b10cd428205c5acd1f68cc6d50 create mode 100644 DaKa/.idea/sonarlint/issuestore/c/e/cea9463d59754ba3cdc565e6279149e7440edadf create mode 100644 DaKa/.idea/sonarlint/issuestore/e/0/e0da17fc7f5e236564b670ddce19a468201781e3 create mode 100644 DaKa/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 create mode 100644 DaKa/.idea/sonarlint/issuestore/f/b/fbe448ebfc3eb2d4e308f6b8b043666f5b57235e create mode 100644 DaKa/.idea/sonarlint/issuestore/index.pb create mode 100644 DaKa/.idea/vcs.xml create mode 100644 DaKa/build.gradle create mode 100644 DaKa/entry/.gitignore create mode 100644 DaKa/entry/agconnect-services.json create mode 100644 DaKa/entry/build.gradle create mode 100644 DaKa/entry/proguard-rules.pro create mode 100644 DaKa/entry/src/main/config.json create mode 100644 DaKa/entry/src/main/java/com/xcl/location/MainAbility.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/MyApplication.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/Net/DXJX.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/Net/TJXX.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/Net/Wan.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/Preference_RW.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/Util/MyToastDialog.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/XLog.java create mode 100644 DaKa/entry/src/main/java/com/xcl/location/slice/MainAbilitySlice.java create mode 100644 DaKa/entry/src/main/resources/base/element/string.json create mode 100644 DaKa/entry/src/main/resources/base/graphic/background_checkbox_checkedm.xml create mode 100644 DaKa/entry/src/main/resources/base/graphic/background_checkbox_emptym.xml create mode 100644 DaKa/entry/src/main/resources/base/graphic/checkbox_check_elementm.xml create mode 100644 DaKa/entry/src/main/resources/base/graphic/xtoast_framem.xml create mode 100644 DaKa/entry/src/main/resources/base/layout/main_ability_slice.xml create mode 100644 DaKa/entry/src/main/resources/base/media/icon.png create mode 100644 DaKa/entry/src/main/resources/rawfile/agconnect-services.json create mode 100644 DaKa/entry/src/ohosTest/java/com/xcl/location/ExampleOhosTest.java create mode 100644 DaKa/entry/src/test/java/com/xcl/location/ExampleTest.java create mode 100644 DaKa/gradle.properties create mode 100644 DaKa/gradle/wrapper/gradle-wrapper.jar create mode 100644 DaKa/gradle/wrapper/gradle-wrapper.properties create mode 100644 DaKa/gradlew create mode 100644 DaKa/gradlew.bat create mode 100644 DaKa/jianjia/.gitignore create mode 100644 DaKa/jianjia/build.gradle create mode 100644 DaKa/jianjia/consumer-rules.pro create mode 100644 DaKa/jianjia/proguard-rules.pro create mode 100644 DaKa/jianjia/src/main/config.json create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/BuiltInConverters.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/Call.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/CallAdapter.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/Callback.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/Converter.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/DefaultCallAdapterFactory.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/HttpServiceMethod.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/Invocation.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/JianJia.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/OkHttpCall.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/ParameterHandler.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/Platform.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/RequestBuilder.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/RequestFactory.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/Response.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/ServiceMethod.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/Utils.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/conventer/ScalarRequestBodyConverter.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/conventer/ScalarResponseBodyConverters.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/conventer/ScalarsConverterFactory.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/gson/GsonConverterFactory.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/gson/GsonRequestBodyConverter.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/gson/GsonResponseBodyConverter.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/BaseUrl.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Body.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/DELETE.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Field.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/FieldMap.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/FormUrlEncoded.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/GET.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/HEAD.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/HTTP.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Header.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/HeaderMap.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Headers.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Multipart.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/OPTIONS.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/PATCH.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/POST.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/PUT.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Part.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/PartMap.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Path.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Query.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/QueryMap.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/SkipCallbackExecutor.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Streaming.java create mode 100644 DaKa/jianjia/src/main/java/com/net/jianjia/http/Url.java create mode 100644 DaKa/jianjia/src/main/resources/base/element/string.json create mode 100644 DaKa/jianjia/src/test/java/com/net/jianjia/ExampleTest.java create mode 100644 DaKa/package.json create mode 100644 DaKa/settings.gradle create mode 100644 README.md diff --git a/DaKa/.gitignore b/DaKa/.gitignore new file mode 100644 index 0000000..fdc0c4a --- /dev/null +++ b/DaKa/.gitignore @@ -0,0 +1,16 @@ +*.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 +/entry/.preview +.cxx +/node_modules diff --git a/DaKa/.idea/.gitignore b/DaKa/.idea/.gitignore new file mode 100644 index 0000000..359bb53 --- /dev/null +++ b/DaKa/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/DaKa/.idea/compiler.xml b/DaKa/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/DaKa/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DaKa/.idea/gradle.xml b/DaKa/.idea/gradle.xml new file mode 100644 index 0000000..5cd4f7d --- /dev/null +++ b/DaKa/.idea/gradle.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/DaKa/.idea/inspectionProfiles/Project_Default.xml b/DaKa/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6560a98 --- /dev/null +++ b/DaKa/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git a/DaKa/.idea/intellij-javadocs-4.0.1.xml b/DaKa/.idea/intellij-javadocs-4.0.1.xml new file mode 100644 index 0000000..cb1ff21 --- /dev/null +++ b/DaKa/.idea/intellij-javadocs-4.0.1.xml @@ -0,0 +1,141 @@ + + + + + UPDATE + false + true + + TYPE + FIELD + METHOD + + + DEFAULT + PUBLIC + PROTECTED + + + + + + ^.*(public|protected|private)*.+interface\s+\w+.* + /**\n + * The interface ${name}.\n +<#if element.typeParameters?has_content> * \n +</#if><#list element.typeParameters as typeParameter> * @param <${typeParameter.name}> the type parameter\n +</#list> */ + + + ^.*(public|protected|private)*.+enum\s+\w+.* + /**\n + * The enum ${name}.\n + */ + + + ^.*(public|protected|private)*.+class\s+\w+.* + /**\n + * The type ${name}.\n +<#if element.typeParameters?has_content> * \n +</#if><#list element.typeParameters as typeParameter> * @param <${typeParameter.name}> the type parameter\n +</#list> */ + + + .+ + /**\n + * The type ${name}.\n + */ + + + + + .+ + /**\n + * Instantiates a new ${name}.\n +<#if element.parameterList.parameters?has_content> *\n +</#if><#list element.parameterList.parameters as parameter> * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list><#if element.throwsList.referenceElements?has_content> *\n +</#if><#list element.throwsList.referenceElements as exception> * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> */ + + + + + ^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+ + /**\n + * Gets ${partName}.\n +<#if element.typeParameters?has_content> * \n +</#if><#list element.typeParameters as typeParameter> * @param <${typeParameter.name}> the type parameter\n +</#list><#if element.parameterList.parameters?has_content> *\n +</#if><#list element.parameterList.parameters as parameter> * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list><#if isNotVoid> *\n + * @return the ${partName}\n +</#if><#if element.throwsList.referenceElements?has_content> *\n +</#if><#list element.throwsList.referenceElements as exception> * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> */ + + + ^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+ + /**\n + * Sets ${partName}.\n +<#if element.typeParameters?has_content> * \n +</#if><#list element.typeParameters as typeParameter> * @param <${typeParameter.name}> the type parameter\n +</#list><#if element.parameterList.parameters?has_content> *\n +</#if><#list element.parameterList.parameters as parameter> * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list><#if isNotVoid> *\n + * @return the ${partName}\n +</#if><#if element.throwsList.referenceElements?has_content> *\n +</#if><#list element.throwsList.referenceElements as exception> * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> */ + + + ^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+ + /**\n + * The entry point of application.\n + + <#if element.parameterList.parameters?has_content> *\n +</#if> * @param ${element.parameterList.parameters[0].name} the input arguments\n +<#if element.throwsList.referenceElements?has_content> *\n +</#if><#list element.throwsList.referenceElements as exception> * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> */ + + + .+ + /**\n + * ${name}<#if isNotVoid> ${return}</#if>.\n +<#if element.typeParameters?has_content> * \n +</#if><#list element.typeParameters as typeParameter> * @param <${typeParameter.name}> the type parameter\n +</#list><#if element.parameterList.parameters?has_content> *\n +</#if><#list element.parameterList.parameters as parameter> * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list><#if isNotVoid> *\n + * @return the ${return}\n +</#if><#if element.throwsList.referenceElements?has_content> *\n +</#if><#list element.throwsList.referenceElements as exception> * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> */ + + + + + ^.*(public|protected|private)*.+static.*(\w\s\w)+.+ + /**\n + * The constant ${element.getName()}.\n + */ + + + ^.*(public|protected|private)*.*(\w\s\w)+.+ + /**\n + <#if element.parent.isInterface()> * The constant ${element.getName()}.\n +<#else> * The ${name}.\n +</#if> */ + + + .+ + /**\n + <#if element.parent.isEnum()> *${name} ${typeName}.\n +<#else> * The ${name}.\n +</#if>*/ + + + + + \ No newline at end of file diff --git a/DaKa/.idea/jarRepositories.xml b/DaKa/.idea/jarRepositories.xml new file mode 100644 index 0000000..3298e79 --- /dev/null +++ b/DaKa/.idea/jarRepositories.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DaKa/.idea/misc.xml b/DaKa/.idea/misc.xml new file mode 100644 index 0000000..58918f5 --- /dev/null +++ b/DaKa/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DaKa/.idea/previewer/phone/phoneSettingConfig_MateX2.json b/DaKa/.idea/previewer/phone/phoneSettingConfig_MateX2.json new file mode 100644 index 0000000..f505e6b --- /dev/null +++ b/DaKa/.idea/previewer/phone/phoneSettingConfig_MateX2.json @@ -0,0 +1,25 @@ +{ + "setting": { + "1.0.1": { + "Language": { + "args": { + "Language": "zh-CN" + } + } + } + }, + "frontend": { + "1.0.0": { + "Resolution": { + "args": { + "Resolution": "360*780" + } + }, + "DeviceType": { + "args": { + "DeviceType": "phone" + } + } + } + } +} \ No newline at end of file diff --git a/DaKa/.idea/previewer/phone/phoneSettingConfig_P40.json b/DaKa/.idea/previewer/phone/phoneSettingConfig_P40.json new file mode 100644 index 0000000..69beee7 --- /dev/null +++ b/DaKa/.idea/previewer/phone/phoneSettingConfig_P40.json @@ -0,0 +1,25 @@ +{ + "setting": { + "1.0.1": { + "Language": { + "args": { + "Language": "zh_CN" + } + } + } + }, + "frontend": { + "1.0.0": { + "Resolution": { + "args": { + "Resolution": "360*780" + } + }, + "DeviceType": { + "args": { + "DeviceType": "phone" + } + } + } + } +} \ No newline at end of file diff --git a/DaKa/.idea/previewer/previewConfigV2.json b/DaKa/.idea/previewer/previewConfigV2.json new file mode 100644 index 0000000..d8b271e --- /dev/null +++ b/DaKa/.idea/previewer/previewConfigV2.json @@ -0,0 +1,61 @@ +{ + "1.0.0": { + "LastPreviewDevice": {} + }, + "1.0.1": { + "profileList": [ + { + "id": "P40", + "deviceType": "phone", + "width": 1080, + "height": 2340, + "shape": "rect", + "dpi": 480, + "orientation": "portrait", + "language": "zh_CN", + "colorMode": "light" + }, + { + "id": "MateX2", + "deviceType": "phone", + "width": 2200, + "height": 2480, + "shape": "rect", + "dpi": 520, + "orientation": "portrait", + "language": "zh_CN", + "colorMode": "light" + }, + { + "id": "MatePadPro", + "deviceType": "tablet", + "width": 2560, + "height": 1600, + "shape": "rect", + "dpi": 400, + "orientation": "landscape", + "language": "zh_CN", + "colorMode": "light" + }, + { + "id": "Watch3", + "deviceType": "wearable", + "width": 466, + "height": 466, + "shape": "circle", + "dpi": 320, + "orientation": "landscape", + "language": "zh_CN", + "colorMode": "light" + } + ], + "runningProfileList": [ + "P40" + ], + "availableProfileList": [ + "MateX2", + "MatePadPro", + "Watch3" + ] + } +} \ No newline at end of file diff --git a/DaKa/.idea/previewer/tablet/tabletSettingConfig_MatePadPro.json b/DaKa/.idea/previewer/tablet/tabletSettingConfig_MatePadPro.json new file mode 100644 index 0000000..e241bd4 --- /dev/null +++ b/DaKa/.idea/previewer/tablet/tabletSettingConfig_MatePadPro.json @@ -0,0 +1,25 @@ +{ + "setting": { + "1.0.1": { + "Language": { + "args": { + "Language": "zh-CN" + } + } + } + }, + "frontend": { + "1.0.0": { + "Resolution": { + "args": { + "Resolution": "1024*640" + } + }, + "DeviceType": { + "args": { + "DeviceType": "tablet" + } + } + } + } +} \ No newline at end of file diff --git a/DaKa/.idea/previewer/wearable/wearableSettingConfig_Watch3.json b/DaKa/.idea/previewer/wearable/wearableSettingConfig_Watch3.json new file mode 100644 index 0000000..61046c5 --- /dev/null +++ b/DaKa/.idea/previewer/wearable/wearableSettingConfig_Watch3.json @@ -0,0 +1,25 @@ +{ + "setting": { + "1.0.1": { + "Language": { + "args": { + "Language": "zh-CN" + } + } + } + }, + "frontend": { + "1.0.0": { + "Resolution": { + "args": { + "Resolution": "466*466" + } + }, + "DeviceType": { + "args": { + "DeviceType": "wearable" + } + } + } + } +} \ No newline at end of file diff --git a/DaKa/.idea/sonarlint/issuestore/0/f/0fc04922cd9a34622b859cd4d1a67a89f33da940 b/DaKa/.idea/sonarlint/issuestore/0/f/0fc04922cd9a34622b859cd4d1a67a89f33da940 new file mode 100644 index 0000000..e69de29 diff --git a/DaKa/.idea/sonarlint/issuestore/1/0/10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2 b/DaKa/.idea/sonarlint/issuestore/1/0/10f965cf51fe14a5ef0ca2ebefb1bd7e4607eeb2 new file mode 100644 index 0000000..e69de29 diff --git a/DaKa/.idea/sonarlint/issuestore/1/5/15d8bcbfc11a5f476138f9bcb53e2052e1a9dfbf b/DaKa/.idea/sonarlint/issuestore/1/5/15d8bcbfc11a5f476138f9bcb53e2052e1a9dfbf new file mode 100644 index 0000000..ae2bda1 --- /dev/null +++ b/DaKa/.idea/sonarlint/issuestore/1/5/15d8bcbfc11a5f476138f9bcb53e2052e1a9dfbf @@ -0,0 +1,2 @@ + +{ java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(ޅ8ﱶ/ \ No newline at end of file diff --git a/DaKa/.idea/sonarlint/issuestore/1/a/1a0bfe7a027837ed647b6bd5b6e2500c8555362e b/DaKa/.idea/sonarlint/issuestore/1/a/1a0bfe7a027837ed647b6bd5b6e2500c8555362e new file mode 100644 index 0000000..e69de29 diff --git a/DaKa/.idea/sonarlint/issuestore/1/f/1fca71afd5c1d5be301d96e6944f0f72e7cfe336 b/DaKa/.idea/sonarlint/issuestore/1/f/1fca71afd5c1d5be301d96e6944f0f72e7cfe336 new file mode 100644 index 0000000..ff6519f --- /dev/null +++ b/DaKa/.idea/sonarlint/issuestore/1/f/1fca71afd5c1d5be301d96e6944f0f72e7cfe336 @@ -0,0 +1,5 @@ + +u +java:S3008"SRename this field "Instance" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(⋈8؎/ +S +java:S26964"6Make the enclosing method "static" or remove this set.(ē8؎/ \ No newline at end of file diff --git a/DaKa/.idea/sonarlint/issuestore/2/5/25dacbaab99cc1fe7e73d185785207a3337590fb b/DaKa/.idea/sonarlint/issuestore/2/5/25dacbaab99cc1fe7e73d185785207a3337590fb new file mode 100644 index 0000000..05bfbb4 --- /dev/null +++ b/DaKa/.idea/sonarlint/issuestore/2/5/25dacbaab99cc1fe7e73d185785207a3337590fb @@ -0,0 +1,14 @@ + +t +java:S1104"RMake result a static final constant or non-public and provide accessors if needed.(8ܱ/ +y +java:S1104"\Make addressComponent a static final constant or non-public and provide accessors if needed.(̝8ܱ/ +v +java:S1104""TMake province a static final constant or non-public and provide accessors if needed.(8ܱ/ +r +java:S1104&"PMake city a static final constant or non-public and provide accessors if needed.(8ܱ/ +q +java:S1104*"TMake district a static final constant or non-public and provide accessors if needed.(8ܱ/ +t +java:S1104."RMake street a static final constant or non-public and provide accessors if needed.(ک8ܱ/ +{ java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(ޅ8ܱ/ \ No newline at end of file diff --git a/DaKa/.idea/sonarlint/issuestore/3/f/3fb907f4e71bcffa5291e02efe576a814a42762e b/DaKa/.idea/sonarlint/issuestore/3/f/3fb907f4e71bcffa5291e02efe576a814a42762e new file mode 100644 index 0000000..f8a3553 --- /dev/null +++ b/DaKa/.idea/sonarlint/issuestore/3/f/3fb907f4e71bcffa5291e02efe576a814a42762e @@ -0,0 +1,11 @@ + +C java:S108/")Either remove or fill this block of code.( +C java:S1084")Either remove or fill this block of code.( +A +java:S1452H"&Remove usage of generic wildcard type.(ݥ +O +java:S3400R"9Remove this method and declare a constant for this value.(ȸ +< +java:S1452Z"&Remove usage of generic wildcard type.(ώ +B +java:S3011u",This accessibility update should be removed.(ٮ \ No newline at end of file diff --git a/DaKa/.idea/sonarlint/issuestore/4/6/4658bbfeed30bc3c16d89bdde88d0ce1bb94d3a7 b/DaKa/.idea/sonarlint/issuestore/4/6/4658bbfeed30bc3c16d89bdde88d0ce1bb94d3a7 new file mode 100644 index 0000000..50ba40b --- /dev/null +++ b/DaKa/.idea/sonarlint/issuestore/4/6/4658bbfeed30bc3c16d89bdde88d0ce1bb94d3a7 @@ -0,0 +1,8 @@ + +| java:S116"[Rename this field "MainAbilitySlice" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Џ8ޞ/ +h java:S100!"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ڜ +1 +java:S3626J"Remove this redundant jump.(݅ +< java:S1316""Add a default case to this switch.( +f +java:S13016"KReplace this "switch" statement by "if" statements to increase readability.( \ No newline at end of file diff --git a/DaKa/.idea/sonarlint/issuestore/7/0/7030d0b2f71b999ff89a343de08c414af32fc93a b/DaKa/.idea/sonarlint/issuestore/7/0/7030d0b2f71b999ff89a343de08c414af32fc93a new file mode 100644 index 0000000..e69de29 diff --git a/DaKa/.idea/sonarlint/issuestore/9/c/9c0629d9ee39e937c45ba4e3206cabded9f4c3be b/DaKa/.idea/sonarlint/issuestore/9/c/9c0629d9ee39e937c45ba4e3206cabded9f4c3be new file mode 100644 index 0000000..e69de29 diff --git a/DaKa/.idea/sonarlint/issuestore/a/4/a49d04c34d269757f710cdd66ee499b30ca4d012 b/DaKa/.idea/sonarlint/issuestore/a/4/a49d04c34d269757f710cdd66ee499b30ca4d012 new file mode 100644 index 0000000..8214eab --- /dev/null +++ b/DaKa/.idea/sonarlint/issuestore/a/4/a49d04c34d269757f710cdd66ee499b30ca4d012 @@ -0,0 +1,12 @@ + +r +java:S3008"PRename this field "pd_pd" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/ +T +java:S1135"2Complete the task associated to this TODO comment.(锠8/ +X java:S125!"").( +u +java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").( +> +java:S1604"(Make this anonymous inner class a lambda( +D +java:S1604"(Make this anonymous inner class a lambda( +? +java:S1604"(Make this anonymous inner class a lambda( +D +java:S1604"(Make this anonymous inner class a lambda( +? +java:S1604"(Make this anonymous inner class a lambda(河 +D +java:S1604"(Make this anonymous inner class a lambda(Ϫ +? +java:S1604"(Make this anonymous inner class a lambda( +z +java:S1104&"_Make fusedLocationClient a static final constant or non-public and provide accessors if needed.( \ No newline at end of file diff --git a/DaKa/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 b/DaKa/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 new file mode 100644 index 0000000..e69de29 diff --git a/DaKa/.idea/sonarlint/issuestore/f/b/fbe448ebfc3eb2d4e308f6b8b043666f5b57235e b/DaKa/.idea/sonarlint/issuestore/f/b/fbe448ebfc3eb2d4e308f6b8b043666f5b57235e new file mode 100644 index 0000000..e69de29 diff --git a/DaKa/.idea/sonarlint/issuestore/index.pb b/DaKa/.idea/sonarlint/issuestore/index.pb new file mode 100644 index 0000000..ee1bb38 --- /dev/null +++ b/DaKa/.idea/sonarlint/issuestore/index.pb @@ -0,0 +1,37 @@ + +X +(gradle/wrapper/gradle-wrapper.properties,f\b\fbe448ebfc3eb2d4e308f6b8b043666f5b57235e +c +3jianjia/src/main/java/com/net/jianjia/Platform.java,3\f\3fb907f4e71bcffa5291e02efe576a814a42762e +g +7entry/src/main/java/com/xcl/location/MyApplication.java,1\f\1fca71afd5c1d5be301d96e6944f0f72e7cfe336 +g +7entry/src/main/java/com/xcl/location/Preference_RW.java,a\4\a4eac0e11cd512bf75961f45bc949d4f8033203e +^ +.entry/src/main/java/com/xcl/location/XLog.java,a\4\a49d04c34d269757f710cdd66ee499b30ca4d012 +e +5entry/src/main/java/com/xcl/location/MainAbility.java,4\6\4658bbfeed30bc3c16d89bdde88d0ce1bb94d3a7 +H +entry/proguard-rules.pro,1\a\1a0bfe7a027837ed647b6bd5b6e2500c8555362e +< + build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35 +B +entry/build.gradle,a\d\ad38b2dea33752cac233aa09d7dfbe582e9dded6 +l + + + + + + \ No newline at end of file diff --git a/DaKa/build.gradle b/DaKa/build.gradle new file mode 100644 index 0000000..365ef2f --- /dev/null +++ b/DaKa/build.gradle @@ -0,0 +1,45 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } +} + +buildscript { + repositories { + maven { + url 'https://mirrors.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + mavenCentral() + } + dependencies { + classpath 'com.huawei.ohos:hap:3.0.5.2' + classpath 'com.huawei.ohos:decctest:1.2.7.2' + classpath 'com.huawei.agconnect:agcp-harmony:1.3.0.300' + } +} + +allprojects { + repositories { + maven { + url 'https://mirrors.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + mavenCentral() + } +} diff --git a/DaKa/entry/.gitignore b/DaKa/entry/.gitignore new file mode 100644 index 0000000..7d5b7a9 --- /dev/null +++ b/DaKa/entry/.gitignore @@ -0,0 +1,2 @@ +/build +/node_modules diff --git a/DaKa/entry/agconnect-services.json b/DaKa/entry/agconnect-services.json new file mode 100644 index 0000000..fae96c7 --- /dev/null +++ b/DaKa/entry/agconnect-services.json @@ -0,0 +1 @@ +你自己的agconnect-services.json文件 \ No newline at end of file diff --git a/DaKa/entry/build.gradle b/DaKa/entry/build.gradle new file mode 100644 index 0000000..fdd4f84 --- /dev/null +++ b/DaKa/entry/build.gradle @@ -0,0 +1,45 @@ +apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' +apply plugin: 'com.huawei.agconnect' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 6 + defaultConfig { + compatibleSdkVersion 6 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildTypes { + release { + proguardOpt { + proguardEnabled true + rulesFiles 'proguard-rules.pro' + } + } + debug { + proguardOpt { + proguardEnabled true + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:2.0.0.200' + implementation 'org.json:json:20211205' + implementation 'org.conscrypt:conscrypt-openjdk:2.5.2' + implementation project(':jianjia') + implementation "com.google.code.gson:gson:2.9.0"//网络Json数据解析 + implementation 'com.squareup.okhttp3:logging-interceptor:3.14.9'//网络框架依赖 + implementation 'com.huawei.agconnect:agconnect-core-harmony:1.3.0.300'//agc核心依赖 + implementation 'com.huawei.hms:hianalytics-harmony:6.3.2.301'//HMS服务 + implementation 'com.huawei.hms:location-harmony:6.3.0.300'//HMS定位 +} +decc { + supportType = ['html', 'xml'] +} diff --git a/DaKa/entry/proguard-rules.pro b/DaKa/entry/proguard-rules.pro new file mode 100644 index 0000000..f0eb146 --- /dev/null +++ b/DaKa/entry/proguard-rules.pro @@ -0,0 +1,130 @@ +-dontwarn +# 代码混淆压缩比,在0~7之间 +-optimizationpasses 5 +# 混合时不使用大小写混合,混合后的类名为小写 +-dontusemixedcaseclassnames +# 在读取依赖的库文件时,不要略过那些非public类成员 +-dontskipnonpubliclibraryclassmembers +# 指定不去忽略非公共库的类 +-dontskipnonpubliclibraryclasses +# 不做预校验,preverify是proguard的四个步骤之一,去掉这一步能够加快混淆速度。 +-dontpreverify +-verbose +# google推荐算法 +#-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* +-dontoptimize#注意在上传时配置,本地无需配置 +# 保留注解、内部类、泛型、匿名类 +-keepattributes *Annotation*,Exceptions,InnerClasses,Signature,EnclosingMethod +# 重命名抛出异常时的文件名称 +-renamesourcefileattribute SourceFile +# 抛出异常时保留代码行号 +-keepattributes SourceFile,LineNumberTable +-dontwarn javax.annotation.** +# 保留本地native方法不被混淆 +-keepclasseswithmembernames,allowshrinking class * { +native ; +} +# 保留枚举类不被混淆 +-keepclassmembers enum * { +public static **[] values(); +public static ** valueOf(java.lang.String); +} +# 保留自定义类 +-keep class com.xcl.location.MyApplication +-keep class com.xcl.location.Net.**{*;} + +# 忽略数据库有关 +-keep class com.litesuits.orm.** +-keepclassmembers class com.litesuits.orm.**{*;} +-keep enum com.litesuits.orm.** +-keepclassmembers enum com.litesuits.orm.**{*;} +-keep interface com.litesuits.orm.** +-keepclassmembers interface com.litesuits.orm.**{*;} +-keep class com.xcl.study.DataANet.**{*;} +# 忽略继承 +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private static final java.io.ObjectStreamField[] serialPersistentFields; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} +# 保留HMS相关接入[AnalyticsKit SDK和依赖SDK的混淆配置] +-ignorewarnings +-repackageclasses +-keep class com.huawei.agconnect.**{*;} +-keep class com.huawei.hms.analytics.**{*;} +-keep class com.huawei.hms.push.**{*;} +-keep class com.huawei.hms.**{*;} +# 保留fastjson +#-dontwarn com.alibaba.fastjson.** +#-keep class com.alibaba.fastjson.**{*; } +# 保留okhttp +-keep class com.squareup.okhttp.** { *;} +-dontwarn com.squareup.okhttp.** +-dontwarn org.apache.http.** +-keep class okio.**{*;} +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okhttp3.** +# HMS接口服务 +-keepattributes Exceptions +-keep interface com.huawei.hms.analytics.type.HAEventType{*;} +-keep interface com.huawei.hms.analytics.type.HAParamType{*;} +-keep class com.huawei.hms.analytics.HiAnalyticsInstance{*;} +-keep class com.huawei.hms.analytics.HiAnalytics{*;} +-keep class com.huawei.hianalytics.**{*;} +-keep class com.huawei.updatesdk.**{*;} +-keep class com.huawei.harmony.**{*;} +-keep class com.huawei.mylibrary.**{*;} +# 保留HarmonyOS应用/服务入口类 +-keep public class * extends *.aafwk.ability.Ability +-keep public class * extends *.ace.ability.AceAbility +-keep public class * extends *.aafwk.ability.AbilitySlice +-keep public class * extends *.aafwk.ability.AbilityPackage +-dontwarn java.lang.invoke.** +-dontwarn javax.naming.** +# 保留HarmonyOS定位服务 +-keep public class com.huawei.hms.location.harmony.* {*;} +-keep public class com.huawei.hms.location.harmony.base.* {*;} +-keep class com.huawei.hmf.tasks.* {*;} +#网络有关 +#okgo +-dontwarn com.lzy.okgo.** +-keep class com.lzy.okgo.**{*;} + +#okrx +-dontwarn com.lzy.okrx.** +-keep class com.lzy.okrx.**{*;} + +#okrx2 +-dontwarn com.lzy.okrx2.** +-keep class com.lzy.okrx2.**{*;} + +#okserver +-dontwarn com.lzy.okserver.** +-keep class com.lzy.okserver.**{*;} + +-keepattributes Signature, InnerClasses, EnclosingMethod, Exceptions +# 蒹葭 +-dontwarn com.net.jianjia.** +-keep class com.net.jianjia.** { *; } +-keep class com.net.jianjia.gson.** { *; } +-keep class com.net.jianjia.conventer.** { *; } +-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations +-keepclassmembers,allowshrinking,allowobfuscation interface * { + @com.net.jianjia.http.* ; +} + +# OkHttp3 +-dontwarn okhttp3.logging.** +-keep class okhttp3.internal.**{*;} +-dontwarn okio.** + +# gson +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } + +# 保留配置文件 +-printmapping mapping.txt \ No newline at end of file diff --git a/DaKa/entry/src/main/config.json b/DaKa/entry/src/main/config.json new file mode 100644 index 0000000..79eec0c --- /dev/null +++ b/DaKa/entry/src/main/config.json @@ -0,0 +1,87 @@ +{ + "app": { + "bundleName": "com.xcl.location", + "vendor": "xcl", + "version": { + "code": 326, + "name": "1.0.1.220326" + } + }, + "deviceConfig": { + "default": { + "supportBackup": true + } + }, + "module": { + "package": "com.xcl.location", + "name": ".MyApplication", + "mainAbility": "com.xcl.location.MainAbility", + "deviceType": [ + "phone", + "tablet" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "name": "com.xcl.location.MainAbility", + "icon": "$media:icon", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "permissions": [ + "com.huawei.agconnect.core.DataAbilityShellProvider.PROVIDER" + ], + "name": "com.huawei.agconnect.core.provider.AGConnectInitializeAbility", + "type": "data", + "uri": "dataability://com.xcl.location.location.AGConnectInitializeAbility" + } + ], + "metaData": { + "customizeData": [ + { + "name": "hwc-theme", + "extra": "", + "value": "androidhwext:style/Theme.Emui.Wallpaper.NoTitleBar" + } + ] + }, + "reqPermissions": [ + { + "name": "ohos.permission.LOCATION", + "reason": "定位", + "usedScene": { + "ability": [ + "com.xcl.location.MainAbility" + ], + "when": "always" + } + }, + { + "name": "ohos.permission.GET_NETWORK_INFO", + "reason": "Allows programs to obtain network information status" + }, + { + "name": "ohos.permission.LOCATION_IN_BACKGROUND" + } + ] + } +} \ No newline at end of file diff --git a/DaKa/entry/src/main/java/com/xcl/location/MainAbility.java b/DaKa/entry/src/main/java/com/xcl/location/MainAbility.java new file mode 100644 index 0000000..9cd943f --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/MainAbility.java @@ -0,0 +1,103 @@ +package com.xcl.location; + +import com.xcl.location.Util.MyToastDialog; +import com.xcl.location.slice.MainAbilitySlice; +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.Operation; +import ohos.agp.utils.LayoutAlignment; +import ohos.agp.window.service.WindowManager; +import ohos.bundle.IBundleManager; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import ohos.utils.IntentConstants; +import ohos.utils.net.Uri; + +/** + * The type Main ability. + */ +public class MainAbility extends Ability { + private static final HiLogLabel label = new HiLogLabel(HiLog.LOG_APP, 0x00234, "MainAbility"); + + /** + * The Main ability slice. + */ + MainAbilitySlice MainAbilitySlice; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + + super.setAbilitySliceAnimator(null); + super.setTransitionAnimation(0, 0); + this.getWindow().addFlags(WindowManager.LayoutConfig.MARK_ALLOW_EXTEND_LAYOUT); + super.setMainRoute(MainAbilitySlice.class.getName()); + super.setAbilitySliceAnimator(null); + super.setTransitionAnimation(0, 0); + } + + private void ShowDialog(String text1) { + try { + new MyToastDialog(this.getContext(), text1, ResourceTable.Graphic_xtoast_framem, 36, 25) + .setDuration(120) + .setAlignment(LayoutAlignment.BOTTOM) + .setOffset(0, 100) + .show(); + } catch (Exception e) { + XLog.error(label, e.getMessage()); + } + } + + /** + * 权限 + * + * @param requestCode the request code + * @param permissions the permissions + * @param grantResults the grant results + */ + @Override + public void onRequestPermissionsFromUserResult(int requestCode, String[] permissions, int[] grantResults) { + super.onRequestPermissionsFromUserResult(requestCode, permissions, grantResults); + switch (requestCode) { + case 20220109: { + // 匹配requestPermissions的requestCode + if (grantResults.length > 0 + && grantResults[0] == IBundleManager.PERMISSION_GRANTED) { + // 权限被授予之后做相应业务逻辑的处理 + } else { + // 权限被拒绝 + this.ShowDialog("权限被拒绝"); + this.ShowDialog("请在设置中开启定位权限"); + /*无参--页面跳转开始*/ + Intent intent1 = new Intent(); + Operation operation = new Intent.OperationBuilder() + .withAction(IntentConstants.ACTION_APPLICATION_DETAILS_SETTINGS) + .withUri(Uri.getUriFromParts("package", getBundleName(), null)) + .build(); + intent1.setOperation(operation); + startAbility(intent1); + this.onBackPressed(); + } + return; + } + } + } + + /** + * Gets main ability slice. + * + * @return the main ability slice + */ + public MainAbilitySlice getMainAbilitySlice() { + return this.MainAbilitySlice; + } + + /** + * Sets main ability slice. + * + * @param bianQianShareAbilitySlice the bian qian share ability slice + */ + public void setMainAbilitySlice(MainAbilitySlice bianQianShareAbilitySlice) { + this.MainAbilitySlice = bianQianShareAbilitySlice; + } +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/MyApplication.java b/DaKa/entry/src/main/java/com/xcl/location/MyApplication.java new file mode 100644 index 0000000..8155ca2 --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/MyApplication.java @@ -0,0 +1,76 @@ +package com.xcl.location; + +import com.huawei.hms.analytics.HiAnalyticsTools; +import com.net.jianjia.JianJia; +import com.net.jianjia.gson.GsonConverterFactory; +import com.xcl.location.Net.Wan; +import ohos.aafwk.ability.AbilityPackage; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * The type My application. + */ +public class MyApplication extends AbilityPackage { + private static final HiLogLabel label = new HiLogLabel(HiLog.LOG_APP, 0x00234, "MyApplication"); + private static MyApplication Instance; + private JianJia mJianJia; + private Wan mWan; + + /** + * Gets instance. + * + * @return the instance + */ + public static MyApplication getInstance() { + return Instance; + } + + /** + * Gets jian jia. + * + * @return the jian jia + */ + public JianJia getJianJia() { + return this.mJianJia; + } + + /** + * Gets wan. + * + * @return the wan + */ + public Wan getWan() { + return this.mWan; + } + + @Override + public void onInitialize() { + super.onInitialize(); + try { + Preference_RW.context = this.getContext(); + XLog.pd_pd = Preference_RW.ff7_r(); + XLog.pd_pd = 555; + HiAnalyticsTools.enableLog(); + //创建日志拦截器 + HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); + logging.setLevel(HttpLoggingInterceptor.Level.BODY); + //为OKHTTP添加日志拦截器 + OkHttpClient okHttpClient = new OkHttpClient.Builder() + .addInterceptor(logging) + .build(); + this.mJianJia = new JianJia.Builder() + // 使用自定义的okHttpClient对象 + .callFactory(okHttpClient) + .baseUrl("https://api.xuegao-xcl.tech") + .addConverterFactory(GsonConverterFactory.create()) + .build(); + Instance = this; + this.mWan = this.mJianJia.create(Wan.class); + } catch (Exception e) { + XLog.error(label, e.getMessage()); + } + } +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/Net/DXJX.java b/DaKa/entry/src/main/java/com/xcl/location/Net/DXJX.java new file mode 100644 index 0000000..478c3e3 --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/Net/DXJX.java @@ -0,0 +1,49 @@ +package com.xcl.location.Net; + +import java.io.Serializable; + +/** + * The type Dxjx. + * + * @author Xcl + * @date 2022 /3/25 + * @package com.xcl.location.Net + */ +public class DXJX { + /** + * The Result. + */ + public Result result; + + /** + * The type Result. + */ + public static class Result implements Serializable { + /** + * The Address component. + */ + public AddressComponent addressComponent; + + /** + * The type Address component. + */ + public static class AddressComponent implements Serializable { + /** + * The Province. + */ + public String province; + /** + * The City. + */ + public String city; + /** + * The District. + */ + public String district; + /** + * The Street. + */ + public String street; + } + } +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/Net/TJXX.java b/DaKa/entry/src/main/java/com/xcl/location/Net/TJXX.java new file mode 100644 index 0000000..f4b0642 --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/Net/TJXX.java @@ -0,0 +1,15 @@ +package com.xcl.location.Net; + +/** + * The type Tjxx. + * + * @author Xcl + * @date 2022 /3/25 + * @package com.xcl.location.Net + */ +public class TJXX { + /** + * The Msg. + */ + public String msg; +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/Net/Wan.java b/DaKa/entry/src/main/java/com/xcl/location/Net/Wan.java new file mode 100644 index 0000000..b435fb6 --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/Net/Wan.java @@ -0,0 +1,36 @@ +package com.xcl.location.Net; + +import com.net.jianjia.Call; +import com.net.jianjia.http.*; + +import java.util.Map; + +/** + * The interface Wan. + * + * @author Xcl + * @date 2022 /2/18 + * @package com.xcl.study.DataANet + */ +public interface Wan { + /** + * Gets dkxx. + * + * @param param the param + * @return the dkxx + */ + @BaseUrl("https://api.map.baidu.com/") + @GET("/reverse_geocoding/v3") + Call getDKXX(@QueryMap Map param); + + /** + * Post dkxx call. + * + * @param param the param + * @return the call + */ + @BaseUrl("https://yx.ty-ke.com/") + @POST("/Home/Monitor/monitor_add") + @FormUrlEncoded + Call postDKXX(@FieldMap Map param); +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/Preference_RW.java b/DaKa/entry/src/main/java/com/xcl/location/Preference_RW.java new file mode 100644 index 0000000..d375f1a --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/Preference_RW.java @@ -0,0 +1,187 @@ +package com.xcl.location; + +import ohos.aafwk.ability.Ability; +import ohos.app.Context; +import ohos.data.DatabaseHelper; +import ohos.data.preferences.Preferences; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +/** + * The type Preference rw. + * + * @author Xcl + * @date 2022 /3/25 + * @package com.xcl.location + */ +public class Preference_RW extends Ability { + private static final HiLogLabel label = new HiLogLabel(HiLog.LOG_APP, 0x00234, "Preference_RW"); + private static final String preferenceFile = "messages_tzx_xcl_dx"; + private static final String counterKey7 = "DeBug"; + private static final String counterKey1 = "dszh"; + private static final String counterKey2 = "dxtempd"; + private static final String counterKey3 = "dxtem"; + private static final String counterKey4 = "autodxpd"; + /** + * The constant context. + */ + public static Context context; + + private static void writeCounter(String key, int message) { + try { + DatabaseHelper databaseHelper = new DatabaseHelper(context); + Preferences preferences = databaseHelper.getPreferences(preferenceFile); + preferences.putInt(key, message); + preferences.flush(); + } catch (Exception e) { + HiLog.error(label, "写发生错误[" + e.getMessage() + "],key=[" + key + "],message=[" + message + "]"); + } + } + + private static void writeCounter(String key, long message) { + try { + DatabaseHelper databaseHelper = new DatabaseHelper(context); + Preferences preferences = databaseHelper.getPreferences(preferenceFile); + preferences.putLong(key, message); + preferences.flush(); + } catch (Exception e) { + HiLog.error(label, "写发生错误[" + e.getMessage() + "],key=[" + key + "],message=[" + message + "]"); + } + } + + private static void writeCounter(String key, String message) { + try { + DatabaseHelper databaseHelper = new DatabaseHelper(context); + Preferences preferences = databaseHelper.getPreferences(preferenceFile); + preferences.putString(key, message); + preferences.flush(); + } catch (Exception e) { + HiLog.warn(label, "xcl写发生错误[" + e.getMessage() + "],key=[" + key + "],message=[" + message + "]"); + } + } + + private static int readCounter(String key) { + try { + DatabaseHelper databaseHelper = new DatabaseHelper(context); + Preferences preferences = databaseHelper.getPreferences(preferenceFile); + return preferences.getInt(key, 0); + } catch (Exception e) { + HiLog.error(label, "读发生错误" + e.getMessage()); + return 0; + } + } + + private static long readCounter(String key, int a) { + try { + XLog.info(label, "没必要的数据:" + a); + DatabaseHelper databaseHelper = new DatabaseHelper(context); + Preferences preferences = databaseHelper.getPreferences(preferenceFile); + return preferences.getLong(key, 0); + } catch (Exception e) { + HiLog.error(label, "读发生错误" + e.getMessage()); + return 0; + } + } + + private static String readCounter(String key, String a) { + try { + XLog.info(label, "没必要的数据:" + a); + DatabaseHelper databaseHelper = new DatabaseHelper(context); + Preferences preferences = databaseHelper.getPreferences(preferenceFile); + return preferences.getString(key, String.valueOf(0)); + } catch (Exception e) { + HiLog.warn(label, "xcl读发生错误" + e.getMessage()); + return "0"; + } + } + + /** + * Ff 7 r int. + * + * @return the int + */ + public static int ff7_r() { + return readCounter(counterKey7); + } + + /** + * Ff 7 w. + * + * @param a1 the a 1 + */ + public static void ff7_w(int a1) { + Preference_RW.writeCounter(counterKey7, a1); + } + + /** + * Ff 2 r int. + * + * @return the int + */ + public static int ff2_r() { + return readCounter(counterKey2); + } + + /** + * Ff 2 w. + * + * @param a1 the a 1 + */ + public static void ff2_w(int a1) { + Preference_RW.writeCounter(counterKey2, a1); + } + + /** + * Ff 4 r int. + * + * @return the int + */ + public static int ff4_r() { + return readCounter(counterKey4); + } + + /** + * Ff 4 w. + * + * @param a1 the a 1 + */ + public static void ff4_w(int a1) { + Preference_RW.writeCounter(counterKey4, a1); + } + + /** + * Ff 1 r string. + * + * @return the string + */ + public static String ff1_r() { + return readCounter(counterKey1, "0"); + } + + /** + * Ff 1 w. + * + * @param a1 the a 1 + */ + public static void ff1_w(String a1) { + Preference_RW.writeCounter(counterKey1, a1); + } + + /** + * Ff 3 r string. + * + * @return the string + */ + public static String ff3_r() { + return readCounter(counterKey3, "0"); + } + + /** + * Ff 3 w. + * + * @param a1 the a 1 + */ + public static void ff3_w(String a1) { + Preference_RW.writeCounter(counterKey3, a1); + } +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/Util/MyToastDialog.java b/DaKa/entry/src/main/java/com/xcl/location/Util/MyToastDialog.java new file mode 100644 index 0000000..7e20304 --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/Util/MyToastDialog.java @@ -0,0 +1,93 @@ +package com.xcl.location.Util; + +import com.xcl.location.Preference_RW; +import com.xcl.location.XLog; +import ohos.agp.components.AttrHelper; +import ohos.agp.components.ComponentContainer; +import ohos.agp.components.DirectionalLayout; +import ohos.agp.components.Text; +import ohos.agp.components.element.ShapeElement; +import ohos.agp.utils.Color; +import ohos.agp.utils.LayoutAlignment; +import ohos.agp.utils.TextAlignment; +import ohos.agp.window.dialog.ToastDialog; +import ohos.app.Context; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +/** + * The type My toast dialog. + * + * @author Xcl + * @date 2021 /12/31 + * @package com.xcl.study.slice.Dialog + */ +public class MyToastDialog extends ToastDialog { + /** + * The constant label. + */ + private static final HiLogLabel label = new HiLogLabel(HiLog.LOG_APP, 0x00234, "MyToastDialog"); + /** + * The Text component. + */ + private Text textComponent; + + /** + * Instantiates a new My toast dialog. + * + * @param context the context + * @param text the text + * @param style the style + * @param size the size + * @param pad the pad + */ + public MyToastDialog(Context context, String text, int style, int size, int pad) { + super(context); + this.init(context, style, size, pad); + this.setText(text); + } + + /** + * Init. + * + * @param context the context + * @param style the style + * @param size the size + * @param pad the pad + */ + private void init(Context context, int style, int size, int pad) { + try { + this.textComponent = new Text(context); + this.textComponent.setPadding(pad, pad, pad, pad); + this.textComponent.setTextColor(Color.BLACK); + this.textComponent.setTextAlignment(TextAlignment.CENTER); + this.textComponent.setTextSize(size); + ShapeElement shapeElement = new ShapeElement(context, style); + this.textComponent.setBackground(shapeElement); + this.textComponent.setMultipleLine(true); + DirectionalLayout.LayoutConfig layoutConfig = new DirectionalLayout.LayoutConfig(); + layoutConfig.width = ComponentContainer.LayoutConfig.MATCH_CONTENT; + layoutConfig.height = ComponentContainer.LayoutConfig.MATCH_CONTENT; + layoutConfig.alignment = LayoutAlignment.CENTER; + this.textComponent.setLayoutConfig(layoutConfig); + this.setTransparent(true); + this.setComponent(this.textComponent); + this.setCornerRadius(AttrHelper.vp2px(25, context)); + } catch (Exception e) { + XLog.pd_pd = Preference_RW.ff7_r(); + XLog.error(label, e.getMessage()); + } + } + + /** + * Sets text. + * + * @param text the text + * @return the text + */ + @Override + public MyToastDialog setText(String text) { + this.textComponent.setText(text); + return this; + } +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/XLog.java b/DaKa/entry/src/main/java/com/xcl/location/XLog.java new file mode 100644 index 0000000..eb49f35 --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/XLog.java @@ -0,0 +1,68 @@ +package com.xcl.location; + +import ohos.aafwk.ability.Ability; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; + +/** + * The type X log. + * + * @author Xcl + * @date 2022 /1/24 + * @package com.xcl.study.Log + */ +public class XLog extends Ability { + /** + * The constant pd_pd. + */ + public static int pd_pd; + /** + * The . + */ + static int i = 0;//TODO:其实这个值P用没有,只是因为有些情况下不输出日志就会卡死≥▂≤ + + /** + * Info. + * + * @param label the label + * @param message the message + */ + public static void info(HiLogLabel label, String message) { + if (pd_pd == 555) { + HiLog.info(label, "信息:[" + message + "]"); + } else { + i++; + } + //HiLog.info(label, "信息:[" + message + "]"); + } + + /** + * Warn. + * + * @param label the label + * @param message the message + */ + public static void warn(HiLogLabel label, String message) { + if (pd_pd == 555) { + HiLog.warn(label, "警告:[" + message + "]"); + } else { + i++; + } + //HiLog.warn(label, "警告:[" + message + "]"); + } + + /** + * Error. + * + * @param label the label + * @param message the message + */ + public static void error(HiLogLabel label, String message) { + if (pd_pd == 555) { + HiLog.error(label, "错误:[" + message + "]"); + } else { + i++; + } + //HiLog.error(label, "错误:[" + message + "]"); + } +} diff --git a/DaKa/entry/src/main/java/com/xcl/location/slice/MainAbilitySlice.java b/DaKa/entry/src/main/java/com/xcl/location/slice/MainAbilitySlice.java new file mode 100644 index 0000000..4516dab --- /dev/null +++ b/DaKa/entry/src/main/java/com/xcl/location/slice/MainAbilitySlice.java @@ -0,0 +1,369 @@ +package com.xcl.location.slice; + +import com.huawei.hmf.tasks.OnFailureListener; +import com.huawei.hmf.tasks.OnSuccessListener; +import com.huawei.hms.location.harmony.*; +import com.net.jianjia.Call; +import com.net.jianjia.Callback; +import com.net.jianjia.Response; +import com.xcl.location.*; +import com.xcl.location.Net.DXJX; +import com.xcl.location.Net.TJXX; +import com.xcl.location.Util.MyToastDialog; +import ohos.aafwk.ability.AbilitySlice; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.Operation; +import ohos.agp.components.*; +import ohos.agp.utils.LayoutAlignment; +import ohos.app.Context; +import ohos.bundle.IBundleManager; +import ohos.hiviewdfx.HiLog; +import ohos.hiviewdfx.HiLogLabel; +import ohos.utils.IntentConstants; +import ohos.utils.net.Uri; + +import java.text.DecimalFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +/** + * The type Main ability slice. + */ +public class MainAbilitySlice extends AbilitySlice { + private static final HiLogLabel label = new HiLogLabel(HiLog.LOG_APP, 0x00111, "MainAbilitySlice"); + /** + * The Fused location client. + */ + public FusedLocationClient fusedLocationClient; + /** + * The Settings provider client. + */ + SettingsProviderClient settingsProviderClient; + /** + * The Location callback. + */ + LocationCallback locationCallback; + /** + * The Location request. + */ + LocationRequest locationRequest = new LocationRequest(); + /** + * The Input. + */ + TextField input; + /** + * The Inputtem. + */ + TextField inputtem; + /** + * The Result. + */ + Text result; + /** + * The Latitude. + */ + Double latitude; + /** + * The Longitude. + */ + Double Longitude; + /** + * The Province. + */ + String province; + /** + * The City. + */ + String city; + /** + * The District. + */ + String district; + /** + * The Street. + */ + String street; + private Context context; + private Text geoAddressInfoText; + private Text locationInfoText; + + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_main_ability_slice); + MainAbility bianQianShareAbility = (MainAbility) this.getAbility(); + bianQianShareAbility.setMainAbilitySlice(this); + if (this.verifySelfPermission(ohos.security.SystemPermission.DISTRIBUTED_DATASYNC) != IBundleManager.PERMISSION_GRANTED) { + if (this.canRequestPermission(ohos.security.SystemPermission.DISTRIBUTED_DATASYNC)) { + this.requestPermissionsFromUser( + new String[]{ohos.security.SystemPermission.LOCATION}, 20220109); + } else { + // 显示应用需要权限的理由,提示用户进入设置授权 + this.ShowDialog("请在设置中开启定位权限"); + /*无参--页面跳转开始*/ + Intent intent1 = new Intent(); + Operation operation = new Intent.OperationBuilder() + .withAction(IntentConstants.ACTION_APPLICATION_DETAILS_SETTINGS) + .withUri(Uri.getUriFromParts("package", getBundleName(), null)) + .build(); + intent1.setOperation(operation); + startAbility(intent1); + this.onBackPressed(); + } + } + locationInfoText = (Text) findComponentById(ResourceTable.Id_location_info); + geoAddressInfoText = (Text) findComponentById(ResourceTable.Id_geo_address_info); + input = (TextField) findComponentById(ResourceTable.Id_dxzh); + inputtem = (TextField) findComponentById(ResourceTable.Id_dxtem); + result = (Text) findComponentById(ResourceTable.Id_dkjg); + inputtem.setEnabled(false); + if (Preference_RW.ff1_r() == null || Preference_RW.ff1_r().equals("") || Preference_RW.ff1_r().equals("0")) { + input.setText(""); + } else { + input.setText(Preference_RW.ff1_r()); + } + if (Preference_RW.ff2_r() == 2) { + if (Preference_RW.ff3_r() == null || Preference_RW.ff3_r().equals("") || Preference_RW.ff3_r().equals("0")) { + inputtem.setText(""); + } else { + inputtem.setText(Preference_RW.ff3_r()); + } + } + XLog.info(label, "onStart start"); + fusedLocationClient = new FusedLocationClient(this); + settingsProviderClient = new SettingsProviderClient(this); +// 设置位置更新的间隔(毫秒:单位) + locationRequest.setInterval(5000); +// 设置权重 + locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); +// (可选)设置是否需要返回地址信息 + locationRequest.setNeedAddress(true); +// (可选)设置返回地址信息的语言 + locationRequest.setLanguage("zh"); + locationCallback = new LocationCallback() { + @Override + public void onLocationResult(LocationResult locationResult) { + if (locationResult != null) { + // 处理位置回调结果 + XLog.info(label, "onLocationResult"); + latitude = locationResult.getLastHWLocation().getLatitude(); + Longitude = locationResult.getLastHWLocation().getLongitude(); + } + } + + @Override + public void onLocationAvailability(LocationAvailability locationAvailability) { + super.onLocationAvailability(locationAvailability); + if (locationAvailability != null) { + // 处理位置状态 + XLog.info(label, "onLocationAvailability"); + + } + } + }; + fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback) + .addOnSuccessListener(new OnSuccessListener() { + @Override + public void onSuccess(Object v) { + // 接口调用成功的处理 + XLog.info(label, "requestLocationUpdates success"); + } + }) + .addOnFailureListener(new OnFailureListener() { + @Override + public void onFailure(Exception e) { + // 接口调用失败的处理 + XLog.error(label, "requestLocationUpdates failure"); + } + }); + context = this; + Button stopLocatingButton = (Button) findComponentById(ResourceTable.Id_stop_locating); + Map url = new HashMap(); + Map url1 = new HashMap(); + url.put("ak", "此处填写你的百度地图ak");//TODO:百度地图ak + url.put("output", "json"); + url.put("coordtype", "wgs84ll"); + stopLocatingButton.setClickedListener(new Component.ClickedListener() { + @Override + public void onClick(Component component) { + // 注意:停止位置更新时,mLocationCallback与requestLocationUpdates()中的LocationCallback参数为同一对象。 + fusedLocationClient.removeLocationUpdates(locationCallback) + .addOnSuccessListener(v -> { + // 接口调用成功的处理 + XLog.info(label, "removeLocationUpdates success"); + }) + .addOnFailureListener(e -> { + // 接口调用失败的处理 + XLog.error(label, "removeLocationUpdates failure"); + }); + locationInfoText.setText(latitude + "," + Longitude); + XLog.error(label, latitude + "," + Longitude); + url.put("location", latitude + "," + Longitude); + MyApplication.getInstance().getWan().getDKXX(url).enqueue(new Callback() { + + @Override + public void onResponse(Call call, Response response) { + province = response.body().result.addressComponent.province; + city = response.body().result.addressComponent.city; + district = response.body().result.addressComponent.district; + street = response.body().result.addressComponent.street; + geoAddressInfoText.setText(response.body().result.addressComponent.province + + response.body().result.addressComponent.city + + response.body().result.addressComponent.district + + response.body().result.addressComponent.street); + XLog.error(label, response.body().result.addressComponent.province + + response.body().result.addressComponent.city + + response.body().result.addressComponent.district + + response.body().result.addressComponent.street); + } + + @Override + public void onFailure(Call call, Throwable t) { + XLog.error(label, t.getMessage()); + } + }); + } + }); + Button save = (Button) findComponentById(ResourceTable.Id_save_button); + save.setClickedListener(new Component.ClickedListener() { + @Override + public void onClick(Component component) { + Preference_RW.ff1_w(input.getText()); + if (Preference_RW.ff2_r() == 2) { + Preference_RW.ff3_w(inputtem.getText()); + } + ShowDialog("保存成功!"); + } + }); + RadioContainer radioContainer = (RadioContainer) findComponentById(ResourceTable.Id_radio_container0); + radioContainer.cancelMarks(); + if (Preference_RW.ff2_r() == 1) { + radioContainer.mark(0); + Random rand = new Random();//36.0-36.9 + DecimalFormat df = new DecimalFormat("0.0"); + inputtem.setText(df.format((float) (rand.nextInt(10) + 360) / 10)); + } else if (Preference_RW.ff2_r() == 2) { + radioContainer.mark(1); + inputtem.setText(""); + inputtem.setEnabled(true); + } else { + radioContainer.mark(0); + Preference_RW.ff2_w(1); + Random rand = new Random();//36.0-36.9 + DecimalFormat df = new DecimalFormat("0.0"); + inputtem.setText(df.format((float) (rand.nextInt(10) + 360) / 10)); + } + radioContainer.setMarkChangedListener(new RadioContainer.CheckedStateChangedListener() { + @Override + public void onCheckedChanged(RadioContainer radioContainer, int i) { + XLog.info(label, "用户选择的是:" + i); + if (i == 0) { + XLog.info(label, "用户选择的是:是"); + Preference_RW.ff2_w(1); + Random rand = new Random();//36.0-36.9 + DecimalFormat df = new DecimalFormat("0.0"); + inputtem.setText(df.format((float) (rand.nextInt(10) + 360) / 10)); + inputtem.setEnabled(false); + } else if (i == 1) { + XLog.info(label, "用户选择的是:否"); + Preference_RW.ff2_w(2); + inputtem.setText(""); + inputtem.setEnabled(true); + } else { + XLog.error(label, "这tm不可能!"); + } + } + }); + RadioContainer radioContainer1 = (RadioContainer) findComponentById(ResourceTable.Id_radio_container1); + radioContainer1.cancelMarks(); + if (Preference_RW.ff4_r() == 1) { + radioContainer1.mark(0); + } else if (Preference_RW.ff4_r() == 2) { + radioContainer1.mark(1); + } else { + radioContainer1.mark(0); + Preference_RW.ff4_w(1); + } + radioContainer1.setMarkChangedListener(new RadioContainer.CheckedStateChangedListener() { + @Override + public void onCheckedChanged(RadioContainer radioContainer, int i) { + XLog.info(label, "用户选择的是:" + i); + if (i == 0) { + XLog.info(label, "用户选择的是:是"); + Preference_RW.ff4_w(1); + } else if (i == 1) { + XLog.info(label, "用户选择的是:否"); + Preference_RW.ff4_w(2); + } else { + XLog.error(label, "这tm不可能!"); + } + } + }); + Button daka = (Button) findComponentById(ResourceTable.Id_sddk_button); + daka.setClickedListener(new Component.ClickedListener() { + @Override + public void onClick(Component component) { + url1.put("mobile", Preference_RW.ff1_r()); + url1.put("city", city); + url1.put("jk_type", "健康"); + url1.put("district", district); + url1.put("address", province + city + district + street); + url1.put("title", inputtem.getText()); + url1.put("jc_type", "否"); + url1.put("wc_type", "否"); + url1.put("is_verify", "0"); + url1.put("province", province); + MyApplication.getInstance().getWan().postDKXX(url1).enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + ShowDialog("打卡成功!"); + XLog.info(label, response.body().msg); + result.setText(response.body().msg); + } + + @Override + public void onFailure(Call call, Throwable t) { + XLog.error(label, t.getMessage()); + ShowDialog("打卡失败!错误原因:" + t.getMessage()); + } + }); + } + }); + } + + private void ShowDialog(String text1) { + try { + new MyToastDialog(this.getContext(), text1, ResourceTable.Graphic_xtoast_framem, 36, 25) + .setDuration(120) + .setAlignment(LayoutAlignment.BOTTOM) + .setOffset(0, 100) + .show(); + } catch (Exception e) { + + XLog.error(label, e.getMessage()); + } + } + + @Override + protected void onStop() { + XLog.info(label, "onStop start"); + super.onStop(); + try { + fusedLocationClient.removeLocationUpdates(locationCallback) + .addOnSuccessListener(v -> { + // 接口调用成功的处理 + XLog.info(label, "removeLocationUpdates success"); + }) + .addOnFailureListener(e -> { + // 接口调用失败的处理 + XLog.error(label, "removeLocationUpdates failure"); + }); + } catch (Exception e) { + + XLog.error(label, e.getMessage()); + } + XLog.info(label, "onStop end"); + } +} + diff --git a/DaKa/entry/src/main/resources/base/element/string.json b/DaKa/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000..726db10 --- /dev/null +++ b/DaKa/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "校企通[魔改版]" + }, + { + "name": "mainability_description", + "value": "Java_Empty Ability" + }, + { + "name": "mainability_HelloWorld", + "value": "Hello World" + } + ] +} \ No newline at end of file diff --git a/DaKa/entry/src/main/resources/base/graphic/background_checkbox_checkedm.xml b/DaKa/entry/src/main/resources/base/graphic/background_checkbox_checkedm.xml new file mode 100644 index 0000000..8eb3fce --- /dev/null +++ b/DaKa/entry/src/main/resources/base/graphic/background_checkbox_checkedm.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/DaKa/entry/src/main/resources/base/graphic/background_checkbox_emptym.xml b/DaKa/entry/src/main/resources/base/graphic/background_checkbox_emptym.xml new file mode 100644 index 0000000..7126c26 --- /dev/null +++ b/DaKa/entry/src/main/resources/base/graphic/background_checkbox_emptym.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/DaKa/entry/src/main/resources/base/graphic/checkbox_check_elementm.xml b/DaKa/entry/src/main/resources/base/graphic/checkbox_check_elementm.xml new file mode 100644 index 0000000..b8da385 --- /dev/null +++ b/DaKa/entry/src/main/resources/base/graphic/checkbox_check_elementm.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/DaKa/entry/src/main/resources/base/graphic/xtoast_framem.xml b/DaKa/entry/src/main/resources/base/graphic/xtoast_framem.xml new file mode 100644 index 0000000..3496646 --- /dev/null +++ b/DaKa/entry/src/main/resources/base/graphic/xtoast_framem.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/DaKa/entry/src/main/resources/base/layout/main_ability_slice.xml b/DaKa/entry/src/main/resources/base/layout/main_ability_slice.xml new file mode 100644 index 0000000..bca7ca5 --- /dev/null +++ b/DaKa/entry/src/main/resources/base/layout/main_ability_slice.xml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +